diff --git a/.editorconfig b/.editorconfig index d394d9db..10b38431 100644 --- a/.editorconfig +++ b/.editorconfig @@ -17,3 +17,8 @@ insert_final_newline = true # Some Mermaid diagram commands need to end with a trailing whitespace in Markdown files [*.md] trim_trailing_whitespace = false + +# Use two spaces for YAML files +[{*.yml,*.yaml}] +indent_style = space +indent_size = 2 diff --git a/.github/workflows/upload_component.yml b/.github/workflows/upload_component.yml index dae3a3d1..269ef361 100644 --- a/.github/workflows/upload_component.yml +++ b/.github/workflows/upload_component.yml @@ -15,13 +15,9 @@ jobs: - name : Copy common dir into slave run: cp -r common slave/main/ - - name : Extract and save version info - run: | - sed -n 's/^version: "\(.*\)"/\1/p' idf_component.yml > slave/main/coprocessor_fw_version.txt - - name: Upload component to the component registry - uses: espressif/upload-components-ci-action@v1 + uses: espressif/upload-components-ci-action@v2 with: - name: "esp_hosted" + components: "esp_hosted:." namespace: "espressif" api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }} diff --git a/.gitignore b/.gitignore index 6edbbdf3..030c24ef 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,3 @@ dependencies.lock managed_components sdkconfig sdkconfig.old -slave/main/coprocessor_fw_version.h -slave/main/coprocessor_fw_version.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d46807a3..fac1305a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,57 +1,15 @@ stages: + - pre - build + - build_coprocessor + - build_example + - deploy before_script: - git submodule update --init --recursive -.build_template: - stage: build - tags: - - build - artifacts: - paths: - - "${IDF_PATH}/${IDF_EXAMPLE_PATH}/build*/build_log.txt" - when: always - expire_in: 4 days - script: - - source ${IDF_PATH}/export.sh - - pip install idf-component-manager idf-build-apps --upgrade - # Need to rename the cloned "esp_hosted_mcu" directory since the injected component name is "esp_hosted" - - cd .. && rm -rf esp_hosted && mv esp_hosted_mcu esp_hosted && cd esp_hosted - # Replaces esp_hosted component in example's deps with the one from the current repository - - export OVERRIDE_PATH=`pwd` - - cd ${IDF_PATH}/${IDF_EXAMPLE_PATH} - - cat ${OVERRIDE_PATH}/.gitlab-ci-override-idf-component.yml >> main/idf_component.yml - # Build with IDF pedantic flags and IDF build apps script - - export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function" - - export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes" - - export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}" - - idf-build-apps find --config sdkconfig.ci* -vv --target ${IDF_TARGET} - - idf-build-apps build --config sdkconfig.ci* -vv --target ${IDF_TARGET} - # Rename back, since post scripts expect the original name - - cd ${OVERRIDE_PATH} && cd .. && mv esp_hosted esp_hosted_mcu - - -build_idf_v5.3: - extends: .build_template - image: espressif/idf:release-v5.3 - parallel: - matrix: - - IDF_TARGET: ["esp32p4", "esp32h2", "esp32s3"] - IDF_EXAMPLE_PATH: examples/protocols/mqtt/tcp - -build_idf_v5.4: - extends: .build_template - image: espressif/idf:release-v5.4 - parallel: - matrix: - - IDF_TARGET: ["esp32p4", "esp32h2", "esp32s3"] - IDF_EXAMPLE_PATH: examples/protocols/mqtt/tcp - -build_idf_v5.5: - extends: .build_template - image: espressif/idf:latest - parallel: - matrix: - - IDF_TARGET: ["esp32p4", "esp32h2", "esp32s3"] - IDF_EXAMPLE_PATH: [examples/protocols/mqtt/tcp, examples/wifi/iperf] +include: + - '.gitlab/ci/templates.yml' + - '.gitlab/ci/rules.yml' + - '.gitlab/ci/regression_pipeline_jobs.yml' + - '.gitlab/ci/sanity_pipeline_jobs.yml' diff --git a/.gitlab/ci/regression_pipeline_jobs.yml b/.gitlab/ci/regression_pipeline_jobs.yml new file mode 100644 index 00000000..1c041cf9 --- /dev/null +++ b/.gitlab/ci/regression_pipeline_jobs.yml @@ -0,0 +1,347 @@ +# Holds jobs that run before promoting to main branch + +### Notes: +# IDF v5.3 and v5.3.1 do not build for P4 +# - fix only merged for v5.3.2 and above +# - https://github.com/espressif/esp-idf/commit/1aec9e7df38bb7ccc9ec2fb846288910c329d77a + +regression_build_idf_v5.3_mqtt_tcp_h2: + variables: + EXAMPLE_CI_FILE: "sdkconfig.ci.p4_wifi" + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_VER: ["v5.3", "v5.3.1", "v5.3.2", "v5.3.3", "v5.3.4", "release-v5.3"] + IDF_TARGET: ["esp32h2"] + IDF_SLAVE_TARGET: ["esp32c6"] + IDF_EXAMPLE_PATH: ["examples/protocols/mqtt/tcp"] + +regression_build_idf_v5.3_mqtt_tcp_p4: + variables: + EXAMPLE_CI_FILE: "sdkconfig.ci.p4_wifi" + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_VER: ["v5.3.2", "v5.3.3", "v5.3.4", "release-v5.3"] + IDF_TARGET: ["esp32p4"] + IDF_SLAVE_TARGET: ["esp32c6"] + IDF_EXAMPLE_PATH: ["examples/protocols/mqtt/tcp"] + +regression_build_idf_v5.4_mqtt_tcp: + variables: + EXAMPLE_CI_FILE: "sdkconfig.ci.p4_wifi" + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_VER: ["v5.4", "v5.4.1", "v5.4.2", "release-v5.4"] + IDF_TARGET: ["esp32p4", "esp32h2"] + IDF_SLAVE_TARGET: ["esp32c6"] + IDF_EXAMPLE_PATH: ["examples/protocols/mqtt/tcp"] + +regression_build_idf_v5.5_iperf: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_VER: ["v5.5", "release-v5.5"] + IDF_TARGET: ["esp32p4", "esp32h2"] + IDF_SLAVE_TARGET: ["esp32", "esp32c2", "esp32c3", "esp32s3" ] + IDF_EXAMPLE_PATH: ["examples/wifi/iperf"] + +regression_build_idf_master_mqtt_tcp: + variables: + EXAMPLE_CI_FILE: "sdkconfig.ci.p4_wifi" + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template + image: espressif/idf:latest + parallel: + matrix: + - IDF_TARGET: ["esp32p4", "esp32h2"] + IDF_SLAVE_TARGET: ["esp32", "esp32c2", "esp32c3", "esp32s3" ] + IDF_EXAMPLE_PATH: ["examples/protocols/mqtt/tcp"] + +regression_build_idf_master_iperf: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template + image: espressif/idf:latest + parallel: + matrix: + - IDF_TARGET: ["esp32p4", "esp32h2"] + IDF_SLAVE_TARGET: ["esp32", "esp32c2", "esp32c3", "esp32s3" ] + IDF_EXAMPLE_PATH: ["examples/wifi/iperf"] + +regression_build_coprocessor_idf_v5.3_pt1: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_coprocessor + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32c6"] + IDF_VER: ["v5.3", "v5.3.1", "v5.3.2", "v5.3.3", "v5.3.4", "release-v5.3"] + SLAVE_CI_FILE: ["sdio", "spi", "spi_hd", "uart", "dpp"] + +regression_build_coprocessor_idf_v5.3_pt2: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_coprocessor + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32c2", "esp32c3", "esp32s3"] + IDF_VER: ["v5.3", "v5.3.1", "v5.3.2", "v5.3.3", "v5.3.4", "release-v5.3"] + SLAVE_CI_FILE: ["spi", "spi_hd", "uart"] + +regression_build_coprocessor_idf_v5.3_esp32: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_coprocessor + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32"] + IDF_VER: ["v5.3", "v5.3.1", "v5.3.2", "v5.3.3", "v5.3.4", "release-v5.3"] + SLAVE_CI_FILE: ["sdio", "spi", "uart"] + +regression_build_coprocessor_idf_v5.4_pt1: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_coprocessor + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32c6"] + IDF_VER: ["v5.4", "v5.4.1", "v5.4.2", "release-v5.4"] + SLAVE_CI_FILE: ["sdio", "spi", "spi_hd", "uart", "dpp"] + +regression_build_coprocessor_idf_v5.4_pt2: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_coprocessor + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32c2", "esp32c3", "esp32s3"] + IDF_VER: ["v5.4", "v5.4.1", "v5.4.2", "release-v5.4"] + SLAVE_CI_FILE: ["spi", "spi_hd", "uart"] + +regression_build_coprocessor_idf_v5.4_esp32: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_coprocessor + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32"] + IDF_VER: ["v5.4", "v5.4.1", "v5.4.2", "release-v5.4"] + SLAVE_CI_FILE: ["sdio", "spi", "uart"] + +regression_build_coprocessor_idf_v5.5: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_coprocessor + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32c2", "esp32c3", "esp32s3"] + IDF_VER: ["v5.5", "v5.5.1", "release-v5.5"] + SLAVE_CI_FILE: ["spi", "spi_hd", "uart"] + +regression_build_coprocessor_idf_v5.5_esp32: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_coprocessor + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32"] + IDF_VER: ["v5.5", "v5.5.1", "release-v5.5"] + SLAVE_CI_FILE: ["sdio", "spi", "uart"] + +regression_build_coprocessor_idf_master_all_features_enabled: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_coprocessor + image: espressif/idf:latest + parallel: + matrix: + - IDF_TARGET: ["esp32c6"] + SLAVE_CI_FILE: ["all_features"] + +regression_build_nimble_examples_h2: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_example + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32h2"] + IDF_VER: ["v5.4", "v5.4.1", "v5.4.2", "release-v5.4", + "v5.3", "v5.3.1", "v5.3.2", "v5.3.3", "v5.3.4", "release-v5.3"] + IDF_SLAVE_TARGET: ["esp32c6"] + EXAMPLE_TO_BUILD: ["host_nimble_bleprph_host_only_vhci", + "host_nimble_bleprph_host_only_uart_hci"] + +regression_build_nimble_examples_p4: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_example + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32p4"] + IDF_VER: ["v5.4", "v5.4.1", "v5.4.2", "release-v5.4", + "v5.3.2", "v5.3.3", "v5.3.4", "release-v5.3"] + IDF_SLAVE_TARGET: ["esp32c6"] + EXAMPLE_TO_BUILD: ["host_nimble_bleprph_host_only_vhci", + "host_nimble_bleprph_host_only_uart_hci"] + +regression_build_bluedroid_examples_h2: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_example + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32h2"] + IDF_VER: ["v5.4", "v5.4.1", "v5.4.2", "release-v5.4", + "v5.3", "v5.3.1", "v5.3.2", "v5.3.3", "v5.3.4", "release-v5.3"] + IDF_SLAVE_TARGET: ["esp32"] + EXAMPLE_TO_BUILD: ["host_bluedroid_ble_compatibility_test", + "host_bluedroid_bt_hid_mouse_device", + "host_bluedroid_host_only", + "host_bt_controller_mac_addr"] + +regression_build_bluedroid_examples_p4: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_example + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32p4"] + IDF_VER: ["v5.4", "v5.4.1", "v5.4.2", "release-v5.4", + "v5.3.2", "v5.3.3", "v5.3.4", "release-v5.3"] + IDF_SLAVE_TARGET: ["esp32"] + EXAMPLE_TO_BUILD: ["host_bluedroid_ble_compatibility_test", + "host_bluedroid_bt_hid_mouse_device", + "host_bluedroid_host_only", + "host_bt_controller_mac_addr"] + +regression_build_wifi_examples_h2: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_example + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32h2"] + IDF_VER: ["v5.4", "v5.4.1", "v5.4.2", "release-v5.4", + "v5.3", "v5.3.1", "v5.3.2", "v5.3.3", "v5.3.4", "release-v5.3"] + IDF_SLAVE_TARGET: ["esp32c6"] + EXAMPLE_TO_BUILD: ["host_wifi_easy_connect_dpp_enrollee", + "host_wifi_itwt", + "host_transport_config", + "host_network_split__power_save"] + +regression_build_wifi_examples_p4: + tags: + - build + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_example + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32p4"] + IDF_VER: ["v5.4", "v5.4.1", "v5.4.2", "release-v5.4", + "v5.3.2", "v5.3.3", "v5.3.4", "release-v5.3"] + IDF_SLAVE_TARGET: ["esp32c6"] + EXAMPLE_TO_BUILD: ["host_wifi_easy_connect_dpp_enrollee", + "host_wifi_itwt", + "host_transport_config", + "host_network_split__power_save"] + +# build an example using the various transports +# this is to verify transport builds as expected on the host +# for h2, build only for ESP-IDF v5.3 and v5.3.1 +# for p4, build for other ESP-IDFs +regression_build_transport_examples_h2: + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_example + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32h2"] + IDF_VER: ["v5.3", "v5.3.1"] + IDF_SLAVE_TARGET: ["esp32c6"] + EXAMPLE_TO_BUILD: ["host_network_split__power_save"] + EXAMPLE_CI_FILE: ["spi", "spi_hd", "uart"] + +regression_build_transport_examples_p4: + rules: + - !reference [.staging_branch_rules, rules] + extends: .build_template_example + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32p4"] + IDF_VER: ["v5.4", "v5.4.1", "v5.4.2", "release-v5.4", + "v5.3.2", "v5.3.3", "v5.3.4", "release-v5.3"] + IDF_SLAVE_TARGET: ["esp32c6"] + EXAMPLE_TO_BUILD: ["host_network_split__power_save"] + EXAMPLE_CI_FILE: ["sdio", "spi", "spi_hd", "uart"] diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml new file mode 100644 index 00000000..ea0bd3df --- /dev/null +++ b/.gitlab/ci/rules.yml @@ -0,0 +1,26 @@ +# Holds rules for running jobs + +# default rule +# used for running jobs on a merge request to staging +.default_rules: + rules: + - if: $CI_COMMIT_BRANCH == "staging" && $CI_PIPELINE_SOURCE == "push" + when: never + - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "staging" + +# staging branch rule +# used for running regression jobs on staging branch +.staging_branch_rules: + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + when: never + - if: $CI_COMMIT_BRANCH == "staging" && $CI_PIPELINE_SOURCE == "push" + +# no build rule to disable jobs temporarily +# while testing new build rules +.no_build_rules: + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + when: never + - if: $CI_COMMIT_BRANCH == "staging" && $CI_PIPELINE_SOURCE == "push" + when: never diff --git a/.gitlab/ci/sanity_pipeline_jobs.yml b/.gitlab/ci/sanity_pipeline_jobs.yml new file mode 100644 index 00000000..2b91c8b7 --- /dev/null +++ b/.gitlab/ci/sanity_pipeline_jobs.yml @@ -0,0 +1,159 @@ +# Holds jobs that run from a merge request + +### +### Check project pre-requisites have been fulfilled +### + +premerge_check: + rules: + - !reference [.default_rules, rules] + extends: .premerge_check_template + image: espressif/idf:latest + +### +### Build host using ESP-IDF examples +### + +### protocols/mqtt/tcp example +sanity_build_idf_master_mqtt_tcp: + variables: + EXAMPLE_CI_FILE: "sdkconfig.ci.p4_wifi" + rules: + - !reference [.default_rules, rules] + extends: .build_template + image: espressif/idf:latest + parallel: + matrix: + - IDF_TARGET: ["esp32p4"] + IDF_SLAVE_TARGET: ["esp32c6", "esp32c5"] + IDF_EXAMPLE_PATH: ["examples/protocols/mqtt/tcp"] + +### wifi/iperf example +sanity_build_idf_v5.5_iperf: + rules: + - !reference [.default_rules, rules] + extends: .build_template + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_VER: ["v5.5", "v5.5.1", "release-v5.5"] + IDF_TARGET: ["esp32p4"] + IDF_SLAVE_TARGET: ["esp32c6", "esp32c5"] + IDF_EXAMPLE_PATH: ["examples/wifi/iperf"] + +sanity_build_idf_master_iperf: + rules: + - !reference [.default_rules, rules] + extends: .build_template + image: espressif/idf:latest + parallel: + matrix: + - IDF_TARGET: ["esp32p4"] + IDF_SLAVE_TARGET: ["esp32c6", "esp32c5", "esp32c61"] + IDF_EXAMPLE_PATH: ["examples/wifi/iperf"] + +### +### Build coprocessor +### + +sanity_build_coprocessor_idf_v5.5: + rules: + - !reference [.default_rules, rules] + extends: .build_template_coprocessor + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32c6", "esp32c5"] + IDF_VER: ["v5.5", "v5.5.1", "release-v5.5"] + SLAVE_CI_FILE: ["sdio", "spi", "spi_hd", "uart", "dpp"] + +sanity_build_coprocessor_idf_master: + rules: + - !reference [.default_rules, rules] + extends: .build_template_coprocessor + image: espressif/idf:latest + parallel: + matrix: + - IDF_TARGET: ["esp32c6", "esp32c5", "esp32c61"] + SLAVE_CI_FILE: ["sdio", "spi", "spi_hd", "uart", "dpp"] + +### +### build ESP-Hosted examples +### + +sanity_build_nimble_examples: + rules: + - !reference [.default_rules, rules] + extends: .build_template_example + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32p4"] + IDF_VER: ["latest", + "v5.5", "v5.5.1", "release-v5.5"] + IDF_SLAVE_TARGET: ["esp32c6"] + EXAMPLE_TO_BUILD: ["host_nimble_bleprph_host_only_vhci", + "host_nimble_bleprph_host_only_uart_hci"] + +sanity_build_bluedroid_examples: + rules: + - !reference [.default_rules, rules] + extends: .build_template_example + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32p4"] + IDF_VER: ["latest", + "v5.5", "v5.5.1", "release-v5.5"] + IDF_SLAVE_TARGET: ["esp32"] + EXAMPLE_TO_BUILD: ["host_bluedroid_ble_compatibility_test", + "host_bluedroid_bt_hid_mouse_device", + "host_bluedroid_host_only", + "host_bt_controller_mac_addr"] + +sanity_build_wifi_examples: + rules: + - !reference [.default_rules, rules] + extends: .build_template_example + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32p4"] + IDF_VER: ["latest", + "v5.5", "v5.5.1", "release-v5.5"] + IDF_SLAVE_TARGET: ["esp32c6", "esp32c5"] + EXAMPLE_TO_BUILD: ["host_wifi_easy_connect_dpp_enrollee", + "host_wifi_itwt", + "host_transport_config", + "host_network_split__power_save", + "host_performs_slave_ota"] + +# build an example using the various transports +# this is to verify transport builds as expected on the host +sanity_build_transport_examples: + rules: + - !reference [.default_rules, rules] + extends: .build_template_example + image: espressif/idf:${IDF_VER} + parallel: + matrix: + - IDF_TARGET: ["esp32p4"] + IDF_VER: ["latest", + "v5.5", "v5.5.1", "release-v5.5"] + IDF_SLAVE_TARGET: ["esp32c6"] + EXAMPLE_TO_BUILD: ["host_network_split__power_save"] + EXAMPLE_CI_FILE: ["sdio", "spi", "spi_hd", "uart"] + +### +### Promote staging to main after successful regression testing +### + +promote_staging_to_main: + stage: deploy + rules: + - if: $CI_COMMIT_BRANCH == "staging" && $CI_PIPELINE_SOURCE == "push" + script: + - git remote set-url origin https://oauth2:${GITLAB_TOKEN_STAGING_TO_MAIN}@gitlab.espressif.cn:6688/app-frameworks/esp_hosted_mcu.git + - git push origin $CI_COMMIT_SHA:main + tags: + - build diff --git a/.gitlab/ci/templates.yml b/.gitlab/ci/templates.yml new file mode 100644 index 00000000..ef963849 --- /dev/null +++ b/.gitlab/ci/templates.yml @@ -0,0 +1,154 @@ +# Holds templates used for jobs + +.premerge_check_template: + stage: pre + tags: + - build + script: + - source ${IDF_PATH}/export.sh + # check the exported fw versions + - python tools/check_fw_versions.py + # check the changelog + - python tools/check_changelog.py + +.build_template_coprocessor: + stage: build_coprocessor + tags: + - build + artifacts: + when: always + expire_in: 4 days + script: + - export IDF_PYTHON_CHECK_CONSTRAINTS=yes + - ${IDF_PATH}/install.sh --enable-ci + - source ${IDF_PATH}/export.sh + - SDKCONFIG_PATTERN="sdkconfig.ci.${SLAVE_CI_FILE}" + # Build with IDF pedantic flags and IDF build apps script + - export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function" + - export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes" + - export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}" + - cd slave + # use --enable-preview-targets to build for all targets + - idf-build-apps find -p . --enable-preview-targets --config ${SDKCONFIG_PATTERN} -vv --target ${IDF_TARGET} + - idf-build-apps build -p . --enable-preview-targets --config ${SDKCONFIG_PATTERN} -vv --target ${IDF_TARGET} + +.build_template_example: + stage: build_example + tags: + - build + artifacts: + when: always + expire_in: 4 days + script: + - export IDF_PYTHON_CHECK_CONSTRAINTS=yes + - ${IDF_PATH}/install.sh --enable-ci + - source ${IDF_PATH}/export.sh + # Need to rename the cloned "esp_hosted_mcu" directory since the injected component name is "esp_hosted" + - cd .. && rm -rf esp_hosted && mv esp_hosted_mcu esp_hosted && cd esp_hosted + # Create components directory and link esp_hosted component + - export OVERRIDE_PATH=`pwd` + - cd examples/${EXAMPLE_TO_BUILD} + # Create components directory and link esp_hosted component + - mkdir -p components + - ln -sf ${OVERRIDE_PATH} components/esp_hosted + # Override component dependency as backup only if not already present + - | + if ! grep -q "esp_hosted" main/idf_component.yml 2>/dev/null; then + cat ${OVERRIDE_PATH}/.gitlab-ci-override-idf-component.yml >> main/idf_component.yml + echo "Added esp_hosted override to idf_component.yml" + fi + # Add slave target configuration if specified + - | + if [ ! -z "${IDF_SLAVE_TARGET}" ]; then + echo "CONFIG_SLAVE_IDF_TARGET_${IDF_SLAVE_TARGET^^}=y" >> sdkconfig.defaults + echo "Added slave target CONFIG_SLAVE_IDF_TARGET_${IDF_SLAVE_TARGET^^}=y to sdkconfig.defaults" + fi + # Build with IDF pedantic flags and IDF build apps script + - export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function" + - export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes" + - export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}" + # Build with extra ci config file if specified + - | + if [ ! -z "${EXAMPLE_CI_FILE}" ]; then + idf-build-apps find -p . -vv --config sdkconfig.ci.${EXAMPLE_CI_FILE} --target ${IDF_TARGET} + idf-build-apps build -p . -vv --config sdkconfig.ci.${EXAMPLE_CI_FILE} --target ${IDF_TARGET} + else + idf-build-apps find -p . -vv --target ${IDF_TARGET} + idf-build-apps build -p . -vv --target ${IDF_TARGET} + fi + +.build_template: + stage: build + tags: + - build + artifacts: + paths: + - "artifacts_*/" + when: always + expire_in: 4 days + script: + - export IDF_PYTHON_CHECK_CONSTRAINTS=yes + - ${IDF_PATH}/install.sh --enable-ci + - source ${IDF_PATH}/export.sh + # Need to rename the cloned "esp_hosted_mcu" directory since the injected component name is "esp_hosted" + - cd .. && rm -rf esp_hosted && mv esp_hosted_mcu esp_hosted && cd esp_hosted + # Replaces esp_hosted component in example's deps with the one from the current repository + - export OVERRIDE_PATH=`pwd` + - cd ${IDF_PATH}/${IDF_EXAMPLE_PATH} + # Create components directory and link esp_hosted component + - mkdir -p components + - ln -sf ${OVERRIDE_PATH} components/esp_hosted + - echo "Created components directory with esp_hosted link:" + - ls -la components/ + # Override component dependency as backup only if not already present + - | + if ! grep -q "esp_hosted" main/idf_component.yml 2>/dev/null; then + cat ${OVERRIDE_PATH}/.gitlab-ci-override-idf-component.yml >> main/idf_component.yml + echo "Added esp_hosted override to idf_component.yml" + fi + # Add slave target configuration if specified + - | + if [ ! -z "${IDF_SLAVE_TARGET}" ]; then + echo "CONFIG_SLAVE_IDF_TARGET_${IDF_SLAVE_TARGET^^}=y" >> sdkconfig.defaults + echo "Added slave target CONFIG_SLAVE_IDF_TARGET_${IDF_SLAVE_TARGET^^}=y to sdkconfig.defaults" + fi + # HOSTED_CI_FILE: use custom sdkconfig CI file from esp_hosted directory, or + # EXAMPLE_CI_FILE: use sdkconfig CI file in example directory + - | + if [ ! -z "${SDKCONFIG_CI_FILE}" ]; then + cp ${OVERRIDE_PATH}/${SDKCONFIG_CI_FILE} ./sdkconfig.ci.custom + echo "Using custom sdkconfig: ${SDKCONFIG_CI_FILE}" + SDKCONFIG_PATTERN="sdkconfig.ci.custom" + elif [ ! -z "${EXAMPLE_CI_FILE}" ]; then + echo "Using CI sdkconfig file in example: ${EXAMPLE_CI_FILE}" + SDKCONFIG_PATTERN="./${EXAMPLE_CI_FILE}" + else + SDKCONFIG_PATTERN="sdkconfig.ci*" + fi + - echo "SDKCONFIG_PATTERN is ${SDKCONFIG_PATTERN}" + # Build with IDF pedantic flags and IDF build apps script + - export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function" + - export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes" + - export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}" + # Remove the conflicting extconn config that disables hosted + - rm -f sdkconfig.ci.*extconn* + # use --config-file to override default IDF config file + # use --enable-preview-targets to build for all targets + # use --override-sdkconfig-items to override (possibly incorrect) build target that may be in provided config file + - idf-build-apps find -p . --enable-preview-targets --config-file "${OVERRIDE_PATH}/.idf_build_apps.toml" --config ${SDKCONFIG_PATTERN} --override-sdkconfig-items=CONFIG_IDF_TARGET=${IDF_TARGET} -vv --target ${IDF_TARGET} + - idf-build-apps build -p . --enable-preview-targets --config-file "${OVERRIDE_PATH}/.idf_build_apps.toml" --config ${SDKCONFIG_PATTERN} --override-sdkconfig-items=CONFIG_IDF_TARGET=${IDF_TARGET} -vv --target ${IDF_TARGET} +# - echo "----------- last sdkconfig.defaults,ci* used (${IDF_TARGET}-${IDF_SLAVE_TARGET}) --------------" +# - cat sdkconfig.defaults +# - cat sdkconfig.ci* +# - echo "----------- last (generated) sdkconfig used (${IDF_TARGET}-${IDF_SLAVE_TARGET}) --------------" +# - cat sdkconfig +# - echo "----------------------------------------------" + # Copy config files back to project directory for artifacts + - mkdir -p ${OVERRIDE_PATH}/artifacts_${IDF_TARGET}_${IDF_SLAVE_TARGET} + - cp sdkconfig* ${OVERRIDE_PATH}/artifacts_${IDF_TARGET}_${IDF_SLAVE_TARGET}/ 2>/dev/null || echo "No sdkconfig files found" + - cp main/idf_component.yml ${OVERRIDE_PATH}/artifacts_${IDF_TARGET}_${IDF_SLAVE_TARGET}/ 2>/dev/null || echo "No component file found" + # Clean up the component symlink + - unlink components/esp_hosted + - echo "Cleaned up esp_hosted component symlink" + # Rename back, since post scripts expect the original name + - cd ${OVERRIDE_PATH} && cd .. && mv esp_hosted esp_hosted_mcu diff --git a/.idf_build_apps.toml b/.idf_build_apps.toml new file mode 100644 index 00000000..e761d02b --- /dev/null +++ b/.idf_build_apps.toml @@ -0,0 +1 @@ +build_log_filename = "" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..3300e4dc --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,26 @@ +repos: + - repo: local + hooks: + - id: version-checker + name: ESP-Hosted Version Checker + entry: tools/check_fw_versions.py + language: python + args: [ "--update" ] + always_run: true + pass_filenames: false + - id: rpc-checker + name: ESP-Hosted RPC Checker + entry: tools/check_rpc_calls.py + language: python + always_run: true + pass_filenames: false + - id: changelog-checker + name: ESP-Hosted Changelog Checker + entry: tools/check_changelog.py + language: python + files: ^idf_component.yml$ + - repo: https://github.com/espressif/check-copyright/ + rev: v1.1.1 + hooks: + - id: check-copyright + args: ['--config', 'tools/check_copyright_config.yaml'] diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..47d1b44b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,206 @@ +# Changelog + +## 2.6.1 +Minor fixes in Slave OTA example + +## 2.6.0 +- Added public OTA APIs for slave firmware updates +- Added host-triggered slave OTA example with support for HTTP, partition, and filesystem sources +- Support for LittleFS filesystem-based OTA updates +- Migration guide updated for 2.6.0 + +### APIs added + +- `esp_hosted_ota_begin` +- `esp_hosted_ota_write` +- `esp_hosted_ota_end` +- `esp_hosted_ota_activate` + +### APIs deprecated + +- `esp_hosted_slave_ota` - Use the new [Host Performs Slave OTA Example](examples/host_performs_slave_ota/README.md) instead for more flexible OTA implementations with comprehensive documentation and multiple deployment methods + +### Examples added + +- `host_performs_slave_ota` - Host-triggered slave OTA example supporting HTTP URLs, partition sources and LittleFS filesystem sources + +## 2.5.12 + +### Features + +- Add SPI (full and half duplex) and UART support for ESP32-C61 +- Updated documentation on applying optimised Wi-Fi settings to sdkconfigs + +### Bug Fixes + +- Fixed build issues when raw throughput testing is enabled +- Fixed bug in co-processor causing SDIO to operate only in packet mode + +## 2.5.11 + +### Bug Fixes + +- Fixes to use compatible version of `idf-build-apps` and constraints during CI pipeline builds +- Renamed CI pipelines to "sanity" and "regression" +- Prefix jobs with `sanity_` or `regression_` to make their names unique +- Enabled building of ESP-Hosted examples in regression pipeline +- Various bug fixes found in the process of fixing the CI pipelines + +## 2.5.10 + +### Features + +- Version, 2.5.8 - 2.5.10: + - Add staging branch workflow for safer component releases + +## 2.5.7 + +### Bug Fixes + +- Fixed build break when Network Split and CLI Commands are enabled on coprocessor + +## 2.5.6 + +### Bug Fixes + +- Updated co-processor and some example `idf_component.yml` files to set component dependencies based on the ESP-IDF version in use + +## 2.5.5 + +### Bug Fixes + +- Fixed build errors when using latest version of ESP-IDF +- Updated Wi-Fi Easy Connect (DPP) code to match current ESP-IDF master +- Adjusted CI pipeline + +## 2.5.4 + +### Features + +- Added building with ESP-IDF v5.3 in CI +- Added building ESP-Hosted examples in CI + +### Bug Fixes + +- Fixed building with ESP32-H2 as host in CI (was skipping build) + +## 2.5.3 + +### Bug Fixes + +- Fix the ESP-IDF CI + +## 2.5.2 + +### Features + +- Add support to get and set the BT Controller Mac Address + - To support set BT Controller Mac Address, BT Controller is now disabled by default on the co-processor, and host must enable the BT Controller. See [Initializing the Bluetooth Controller](https://github.com/espressif/esp-hosted-mcu/blob/main/docs/bluetooth_design.md#31-initializing-the-bluetooth-controller) for details +- Updated all ESP-Hosted BT related examples to account for new BT Controller behaviour + +### APIs added + +- `esp_hosted_bt_controller_init` +- `esp_hosted_bt_controller_deinit` +- `esp_hosted_bt_controller_enable` +- `esp_hosted_bt_controller_disable` +- `esp_hosted_iface_mac_addr_set` +- `esp_hosted_iface_mac_addr_get` +- `esp_hosted_iface_mac_addr_len_get` + +## 2.5.1 + +### Bug Fixes + +- Added dependency on `esp_driver_gpio` + +## 2.5.0 + +### Bug Fixes + +- Remove dependency on deprecated `driver` component and added necessary dependencies instead + +## 2.4.3 + +### Features + +- Add support for Wi-Fi Easy Connect (DPP) + - [Espressif documentation](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/network/esp_dpp.html) on Wi-Fi Easy Connect (DPP) + - [ESP-Hosted Enrollee Example](https://github.com/espressif/esp-hosted-mcu/tree/main/examples/host_wifi_easy_connect_dpp_enrollee) using DPP to securely onboard a ESP32P4 with C6 board to a network with the help of a QR code and an Android 10+ device + +### APIs added + +- `esp_supp_dpp_init` +- `esp_supp_dpp_deinit` +- `esp_supp_dpp_bootstrap_gen` +- `esp_supp_dpp_start_listen` +- `esp_supp_dpp_stop_listen` + +## 2.4.2 + +### Bug Fixes + +- Fix ignored lwip hook header in slave example + +## 2.4.1 + +### Bug Fixes + +- Reduced ESP32 bootloader size + +## 2.4.0 + +### Features + +- Added support for Wi-Fi Enterprise + +### APIs added + +- `esp_wifi_sta_enterprise_enable` +- `esp_wifi_sta_enterprise_disable` +- `esp_eap_client_set_identity` +- `esp_eap_client_clear_identity` +- `esp_eap_client_set_username` +- `esp_eap_client_clear_username` +- `esp_eap_client_set_password` +- `esp_eap_client_clear_password` +- `esp_eap_client_set_new_password` +- `esp_eap_client_clear_new_password` +- `esp_eap_client_set_ca_cert` +- `esp_eap_client_clear_ca_cert` +- `esp_eap_client_set_certificate_and_key` +- `esp_eap_client_clear_certificate_and_key` +- `esp_eap_client_set_disable_time_check` +- `esp_eap_client_get_disable_time_check` +- `esp_eap_client_set_ttls_phase2_method` +- `esp_eap_client_set_suiteb_192bit_certification` +- `esp_eap_client_set_pac_file` +- `esp_eap_client_set_fast_params` +- `esp_eap_client_use_default_cert_bundle` +- `esp_wifi_set_okc_support` +- `esp_eap_client_set_domain_name` +- `esp_eap_client_set_eap_methods` + +## 2.3.3 + +### Features + +- Added SDIO support for ESP32-C61 + +## 2.3.2 + +### Features + +- Add host example to showcase transport config before `esp_hosted_init()` + +## 2.3.1 + +### Bug Fixes + +- Fixed a build break caused by refactoring + +## 2.3.0 + +### Features + +- Refactored common and port specific code diff --git a/CMakeLists.txt b/CMakeLists.txt index 7054dfc3..36447414 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,80 +3,133 @@ if(CONFIG_ESP_HOSTED_ENABLED) set(FG_root_dir ".") set(host_dir "${FG_root_dir}/host") - set(COMPONENT_SRCS "${host_dir}/esp_hosted_host_init.c" "${host_dir}/api/src/esp_wifi_weak.c" "${host_dir}/api/src/esp_hosted_api.c" "${host_dir}/drivers/transport/transport_drv.c" "${host_dir}/drivers/serial/serial_ll_if.c" "${host_dir}/utils/common.c" "${host_dir}/utils/util.c" "${host_dir}/utils/stats.c" "${host_dir}/drivers/serial/serial_drv.c") + set(srcs + "${host_dir}/api/src/esp_wifi_weak.c" + "${host_dir}/api/src/esp_hosted_api.c" + "${host_dir}/api/src/esp_hosted_transport_config.c" + "${host_dir}/api/src/esp_hosted_ota_api.c" + "${host_dir}/drivers/transport/transport_drv.c" + "${host_dir}/drivers/serial/serial_ll_if.c" + "${host_dir}/utils/stats.c" + "${host_dir}/drivers/serial/serial_drv.c") # only these directories are public. Others are private - set(COMPONENT_ADD_PUBLIC_INCLUDEDIRS "${host_dir}" "${host_dir}/api/include") - - set(COMPONENT_ADD_INCLUDEDIRS "${host_dir}/drivers/transport" "${host_dir}/drivers/transport/spi" "${host_dir}/drivers/transport/sdio" "${host_dir}/drivers/serial" "${host_dir}/utils") + set(pub_include + "${host_dir}" + "${host_dir}/api/include") + + set(priv_include + "${host_dir}/drivers/transport" + "${host_dir}/drivers/transport/spi" + "${host_dir}/drivers/transport/sdio" + "${host_dir}/drivers/serial" + "${host_dir}/utils" + "${host_dir}/api/priv") # rpc files - wrap -> slaveif -> core set(rpc_dir "${host_dir}/drivers/rpc") set(rpc_core_dir "${rpc_dir}/core") set(rpc_slaveif_dir "${rpc_dir}/slaveif") set(rpc_wrap_dir "${rpc_dir}/wrap") - list(APPEND COMPONENT_SRCS "${rpc_core_dir}/rpc_core.c" "${rpc_core_dir}/rpc_req.c" "${rpc_core_dir}/rpc_rsp.c" "${rpc_core_dir}/rpc_evt.c" + + list(APPEND srcs + "${rpc_core_dir}/rpc_core.c" + "${rpc_core_dir}/rpc_req.c" + "${rpc_core_dir}/rpc_rsp.c" + "${rpc_core_dir}/rpc_evt.c" + "${rpc_core_dir}/rpc_utils.c" "${rpc_slaveif_dir}/rpc_slave_if.c" "${rpc_wrap_dir}/rpc_wrap.c") - list(APPEND COMPONENT_ADD_INCLUDEDIRS "${rpc_core_dir}" "${rpc_slaveif_dir}" "${rpc_wrap_dir}") + + list(APPEND priv_include + "${rpc_core_dir}" + "${rpc_slaveif_dir}" + "${rpc_wrap_dir}") # virtual serial set(virt_serial_dir "${host_dir}/drivers/virtual_serial_if") - list(APPEND COMPONENT_SRCS "${virt_serial_dir}/serial_if.c") - list(APPEND COMPONENT_ADD_INCLUDEDIRS "${virt_serial_dir}") + list(APPEND srcs "${virt_serial_dir}/serial_if.c") + list(APPEND priv_include "${virt_serial_dir}") # mempool - list(APPEND COMPONENT_SRCS "${host_dir}/drivers/mempool/mempool.c") - list(APPEND COMPONENT_ADD_INCLUDEDIRS "${host_dir}/drivers/mempool" ) + list(APPEND srcs "${host_dir}/drivers/mempool/mempool.c") + list(APPEND priv_include "${host_dir}/drivers/mempool" ) # slave and host common files set(common_dir "${FG_root_dir}/common") - list(APPEND COMPONENT_SRCS "${common_dir}/protobuf-c/protobuf-c/protobuf-c.c" "${common_dir}/proto/esp_hosted_rpc.pb-c.c" ) - list(APPEND COMPONENT_ADD_INCLUDEDIRS "${common_dir}" "${common_dir}/log" "${common_dir}/rpc" "${common_dir}/transport" "${common_dir}/protobuf-c" "${common_dir}/proto" ) + + list(APPEND srcs + "${common_dir}/protobuf-c/protobuf-c/protobuf-c.c" + "${common_dir}/proto/esp_hosted_rpc.pb-c.c" ) + + list(APPEND priv_include + "${common_dir}" + "${common_dir}/log" + "${common_dir}/rpc" + "${common_dir}/transport" + "${common_dir}/protobuf-c" + "${common_dir}/proto" ) + + if(CONFIG_ESP_HOSTED_ENABLE_GPIO_CONTROL) + list(APPEND srcs "${host_dir}/port/esp/freertos/src/port_esp_hosted_host_gpio.c") + endif() + + # cli + list(APPEND srcs "${common_dir}/utils/esp_hosted_cli.c") + list(APPEND priv_include "${common_dir}/utils") # bt (NimBLE) ### TODO config for HCI over UART - list(APPEND COMPONENT_ADD_INCLUDEDIRS "${host_dir}/drivers/bt") + list(APPEND priv_include "${host_dir}/drivers/bt") + if(CONFIG_ESP_HOSTED_NIMBLE_HCI_VHCI OR CONFIG_ESP_HOSTED_BLUEDROID_HCI_VHCI) - list(APPEND COMPONENT_SRCS "${host_dir}/drivers/bt/vhci_drv.c") + list(APPEND srcs "${host_dir}/drivers/bt/vhci_drv.c") else() - list(APPEND COMPONENT_SRCS "${host_dir}/drivers/bt/hci_stub_drv.c") + list(APPEND srcs "${host_dir}/drivers/bt/hci_stub_drv.c") endif() + # power save + list(APPEND priv_include "${host_dir}/drivers/power_save") + list(APPEND srcs "${host_dir}/drivers/power_save/power_save_drv.c") + # transport files if(CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE) - list(APPEND COMPONENT_SRCS "${host_dir}/drivers/transport/sdio/sdio_drv.c") + list(APPEND srcs "${host_dir}/drivers/transport/sdio/sdio_drv.c") elseif(CONFIG_ESP_HOSTED_SPI_HD_HOST_INTERFACE) - list(APPEND COMPONENT_SRCS "${host_dir}/drivers/transport/spi_hd/spi_hd_drv.c") + list(APPEND srcs "${host_dir}/drivers/transport/spi_hd/spi_hd_drv.c") elseif(CONFIG_ESP_HOSTED_SPI_HOST_INTERFACE) - list(APPEND COMPONENT_SRCS "${host_dir}/drivers/transport/spi/spi_drv.c") + list(APPEND srcs "${host_dir}/drivers/transport/spi/spi_drv.c") elseif(CONFIG_ESP_HOSTED_UART_HOST_INTERFACE) - list(APPEND COMPONENT_SRCS "${host_dir}/drivers/transport/uart/uart_drv.c") + list(APPEND srcs "${host_dir}/drivers/transport/uart/uart_drv.c") endif() - # config files - list(APPEND COMPONENT_ADD_INCLUDEDIRS "${host_dir}/port/include") - list(APPEND COMPONENT_SRCS "${host_dir}/port/src/esp_hosted_config.c" "${host_dir}/port/src/esp_hosted_transport_config.c") + # port files + list(APPEND priv_include "${host_dir}/port/esp/freertos/include") + + list(APPEND srcs + "${host_dir}/port/esp/freertos/src/port_esp_hosted_host_init.c" + "${host_dir}/port/esp/freertos/src/port_esp_hosted_host_os.c" + #"${host_dir}/port/esp/freertos/src/port_esp_hosted_host_ota.c" + "${host_dir}/port/esp/freertos/src/port_esp_hosted_host_transport_defaults.c" + ) - # transport port files - list(APPEND COMPONENT_SRCS "${host_dir}/port/src/os_wrapper.c") if(CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE) - list(APPEND COMPONENT_SRCS "${host_dir}/port/src/sdio_wrapper.c") + list(APPEND srcs "${host_dir}/port/esp/freertos/src/port_esp_hosted_host_sdio.c") elseif(CONFIG_ESP_HOSTED_SPI_HD_HOST_INTERFACE) - list(APPEND COMPONENT_SRCS "${host_dir}/port/src/spi_hd_wrapper.c") + list(APPEND srcs "${host_dir}/port/esp/freertos/src/port_esp_hosted_host_spi_hd.c") elseif(CONFIG_ESP_HOSTED_SPI_HOST_INTERFACE) - list(APPEND COMPONENT_SRCS "${host_dir}/port/src/spi_wrapper.c") + list(APPEND srcs "${host_dir}/port/esp/freertos/src/port_esp_hosted_host_spi.c") elseif(CONFIG_ESP_HOSTED_UART_HOST_INTERFACE) - list(APPEND COMPONENT_SRCS "${host_dir}/port/src/uart_wrapper.c") + list(APPEND srcs "${host_dir}/port/esp/freertos/src/port_esp_hosted_host_uart.c") endif() endif() -idf_component_register(SRCS ${COMPONENT_SRCS} - PRIV_REQUIRES soc esp_event esp_netif esp_timer driver esp_wifi bt esp_http_client - EXCLUDE_SRCS ${EXCLUDE_COMPONENT_SRCS} - INCLUDE_DIRS ${COMPONENT_ADD_PUBLIC_INCLUDEDIRS} - PRIV_INCLUDE_DIRS ${COMPONENT_ADD_INCLUDEDIRS}) +idf_component_register(SRCS ${srcs} + PRIV_REQUIRES soc esp_event esp_netif esp_timer esp_wifi bt esp_http_client console wpa_supplicant esp_driver_spi esp_driver_gpio + REQUIRES esp_driver_sdmmc esp_driver_uart + INCLUDE_DIRS ${pub_include} + PRIV_INCLUDE_DIRS ${priv_include}) idf_component_set_property(${COMPONENT_NAME} WHOLE_ARCHIVE TRUE) @@ -90,3 +143,15 @@ endif() # # used to workaround SPI transfer issue # idf_component_optional_requires(PRIVATE esp_mm) # endif() + + +idf_component_get_property(lwip lwip COMPONENT_LIB) +if(TARGET ${lwip}) + # Use generator expressions to only apply to non-INTERFACE targets + get_target_property(lwip_type ${lwip} TYPE) + if(NOT lwip_type STREQUAL "INTERFACE_LIBRARY") + message(STATUS "********** Configuring LWIP for network split mode with custom hook **********") + target_include_directories(${lwip} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/common") + target_compile_definitions(${lwip} PRIVATE "-DESP_IDF_LWIP_HOOK_FILENAME=\"${CMAKE_CURRENT_SOURCE_DIR}/common/esp_hosted_lwip_src_port_hook.h\"") + endif() +endif() diff --git a/Kconfig b/Kconfig index 005c49e7..949c41cb 100644 --- a/Kconfig +++ b/Kconfig @@ -24,10 +24,35 @@ menu "ESP-Hosted config" comment "ESP32-C61 is Slave Target from Wi-Fi Remote Component" depends on SLAVE_IDF_TARGET_ESP32C61 + choice ESP_HOSTED_P4_DEV_BOARD + bool "Configure GPIOs for Development Board" + depends on IDF_TARGET_ESP32P4 + default ESP_HOSTED_P4_DEV_BOARD_NONE + help + Sets GPIOs used for transport on these ESP32-P4 Development Boards + - ESP32-P4 Function_EV_Board with on-board ESP32-C6 + - ESP32-P4 Function_EV_Board with ESP32-C5 on a EV board + - ESP32-P4 Function_EV_Board with ESP32-C2 on a EV board + - ESP32-P4-C5 Code Board with on-board ESP32-C5 + Select "No development board" if you want to modify GPIOs used + + config ESP_HOSTED_P4_DEV_BOARD_NONE + bool "No development board" + + config ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD + depends on SLAVE_IDF_TARGET_ESP32C6 || SLAVE_IDF_TARGET_ESP32C5 || SLAVE_IDF_TARGET_ESP32C2 + bool "ESP32-P4-Function-EV-Board with on-board C6 or C5/C2 on EV board" + + config ESP_HOSTED_P4_C5_CORE_BOARD + depends on SLAVE_IDF_TARGET_ESP32C5 + bool "ESP32-P4-C5 Core Board with on-board C5" + + endchoice + # y if SDIO Transport is available, based on host and slave selection config ESP_HOSTED_PRIV_SDIO_OPTION bool - default y if (IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4) && (SLAVE_IDF_TARGET_ESP32 || SLAVE_IDF_TARGET_ESP32C6) + default y if (IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4) && (SLAVE_IDF_TARGET_ESP32 || SLAVE_IDF_TARGET_ESP32C6 || SLAVE_IDF_TARGET_ESP32C5 || SLAVE_IDF_TARGET_ESP32C61) default n # y if SPI HD Transport is available, based on host and slave selection @@ -76,6 +101,7 @@ menu "ESP-Hosted config" default "esp32c3" if SLAVE_IDF_TARGET_ESP32C3 default "esp32c6" if SLAVE_IDF_TARGET_ESP32C6 default "esp32c5" if SLAVE_IDF_TARGET_ESP32C5 + default "esp32c61" if SLAVE_IDF_TARGET_ESP32C61 default "invalid" menu "SPI Configuration" @@ -185,43 +211,107 @@ menu "ESP-Hosted config" bool "RESET: Active Low" endchoice + config ESP_HOSTED_SPI_MOSI_RANGE_MIN + int + default 14 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 23 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 23 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 0 + + config ESP_HOSTED_SPI_MOSI_RANGE_MAX + int + default 14 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 23 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 23 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 100 + config ESP_HOSTED_SPI_HSPI_GPIO_MOSI depends on ESP_HOSTED_SPI_HSPI int "GPIO pin for Host MOSI" - default 14 if IDF_TARGET_ESP32P4 && SLAVE_IDF_TARGET_ESP32C6 + default 8 if IDF_TARGET_ESP32P4 default 13 if IDF_TARGET_ESP32 default 11 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 + default 5 if IDF_TARGET_ESP32H2 default 7 + range ESP_HOSTED_SPI_MOSI_RANGE_MIN ESP_HOSTED_SPI_MOSI_RANGE_MAX help SPI controller Host MOSI + config ESP_HOSTED_SPI_MISO_RANGE_MIN + int + default 15 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 22 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 22 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 0 + + config ESP_HOSTED_SPI_MISO_RANGE_MAX + int + default 15 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 22 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 22 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 100 + config ESP_HOSTED_SPI_HSPI_GPIO_MISO depends on ESP_HOSTED_SPI_HSPI int "GPIO pin for Host MISO" - default 15 if IDF_TARGET_ESP32P4 && SLAVE_IDF_TARGET_ESP32C6 + default 10 if IDF_TARGET_ESP32P4 default 12 if IDF_TARGET_ESP32 default 13 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 + default 0 if IDF_TARGET_ESP32H2 default 2 + range ESP_HOSTED_SPI_MISO_RANGE_MIN ESP_HOSTED_SPI_MISO_RANGE_MAX help SPI controller Host MISO + config ESP_HOSTED_SPI_CLK_RANGE_MIN + int + default 18 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 33 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 33 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 0 + + config ESP_HOSTED_SPI_CLK_RANGE_MAX + int + default 18 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 33 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 33 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 100 + config ESP_HOSTED_SPI_HSPI_GPIO_CLK depends on ESP_HOSTED_SPI_HSPI int "GPIO pin for Host CLK" - default 18 if IDF_TARGET_ESP32P4 && SLAVE_IDF_TARGET_ESP32C6 + default 9 if IDF_TARGET_ESP32P4 default 14 if IDF_TARGET_ESP32 default 12 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 + default 4 if IDF_TARGET_ESP32H2 default 6 + range ESP_HOSTED_SPI_CLK_RANGE_MIN ESP_HOSTED_SPI_CLK_RANGE_MAX help SPI controller Host CLK + config ESP_HOSTED_SPI_CS_RANGE_MIN + int + default 19 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 4 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 4 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 0 + + config ESP_HOSTED_SPI_CS_RANGE_MAX + int + default 19 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 4 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 4 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 100 + config ESP_HOSTED_SPI_HSPI_GPIO_CS depends on ESP_HOSTED_SPI_HSPI int "GPIO pin for Host CS" - default 19 if IDF_TARGET_ESP32P4 && SLAVE_IDF_TARGET_ESP32C6 + default 7 if IDF_TARGET_ESP32P4 default 15 if IDF_TARGET_ESP32 default 10 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 + default 1 if IDF_TARGET_ESP32H2 default 10 + range ESP_HOSTED_SPI_CS_RANGE_MIN ESP_HOSTED_SPI_CS_RANGE_MAX help SPI controller Host CS @@ -273,26 +363,74 @@ menu "ESP-Hosted config" default ESP_HOSTED_SPI_VSPI_GPIO_CS if ESP_HOSTED_SPI_VSPI default ESP_HOSTED_SPI_HSPI_GPIO_CS + config ESP_HOSTED_SPI_HANDSHAKE_RANGE_MIN + int + default 16 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 21 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 21 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 0 + + config ESP_HOSTED_SPI_HANDSHAKE_RANGE_MAX + int + default 16 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 21 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 21 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 100 + config ESP_HOSTED_SPI_GPIO_HANDSHAKE int "GPIO pin for handshake" - default 16 if IDF_TARGET_ESP32P4 && SLAVE_IDF_TARGET_ESP32C6 + default 6 if IDF_TARGET_ESP32P4 default 3 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C6 default 17 if IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32S2 + default 22 if IDF_TARGET_ESP32H2 default 26 + range ESP_HOSTED_SPI_HANDSHAKE_RANGE_MIN ESP_HOSTED_SPI_HANDSHAKE_RANGE_MAX help GPIO pin to use for handshake with other spi controller + config ESP_HOSTED_SPI_DATA_READY_RANGE_MIN + int + default 17 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 32 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 32 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 0 + + config ESP_HOSTED_SPI_DATA_READY_RANGE_MAX + int + default 17 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 32 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 32 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 100 + config ESP_HOSTED_SPI_GPIO_DATA_READY int "GPIO pin for data ready interrupt" - default 17 if IDF_TARGET_ESP32P4 && SLAVE_IDF_TARGET_ESP32C6 + default 11 if IDF_TARGET_ESP32P4 + default 12 if IDF_TARGET_ESP32H2 default 4 + range ESP_HOSTED_SPI_DATA_READY_RANGE_MIN ESP_HOSTED_SPI_DATA_READY_RANGE_MAX help GPIO pin for indicating host that SPI slave has data to be read by host + config ESP_HOSTED_SPI_RESET_RANGE_MIN + int + default 54 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 53 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 53 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 0 + + config ESP_HOSTED_SPI_RESET_RANGE_MAX + int + default 54 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 53 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 53 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 100 + config ESP_HOSTED_SPI_GPIO_RESET_SLAVE int "GPIO pin for Reseting slave ESP" - default 54 if IDF_TARGET_ESP32P4 && SLAVE_IDF_TARGET_ESP32C6 + default 12 if IDF_TARGET_ESP32P4 + default 10 if IDF_TARGET_ESP32H2 default 5 + range ESP_HOSTED_SPI_RESET_RANGE_MIN ESP_HOSTED_SPI_RESET_RANGE_MAX help GPIO pin for Resetting ESP SPI slave device. Should be connected to RST/EN of ESP SPI slave device. endmenu @@ -320,9 +458,9 @@ ESP32XX_SPI_CLK_FREQ_RANGE_MAX := 40 "Optimize SPI CLK by increasing till host practically can support" config ESP_HOSTED_SPI_FREQ_ESP32XX - depends on SLAVE_IDF_TARGET_ESP32C2 || SLAVE_IDF_TARGET_ESP32C3 || SLAVE_IDF_TARGET_ESP32S2 || SLAVE_IDF_TARGET_ESP32S3 || SLAVE_IDF_TARGET_ESP32C5 + depends on SLAVE_IDF_TARGET_ESP32C2 || SLAVE_IDF_TARGET_ESP32C3 || SLAVE_IDF_TARGET_ESP32S2 || SLAVE_IDF_TARGET_ESP32S3 || SLAVE_IDF_TARGET_ESP32C5 || SLAVE_IDF_TARGET_ESP32C61 int "SPI Clock Freq" - default 30 if SLAVE_IDF_TARGET_ESP32C2 || SLAVE_IDF_TARGET_ESP32C3 || SLAVE_IDF_TARGET_ESP32S2 || SLAVE_IDF_TARGET_ESP32S3 || SLAVE_IDF_TARGET_ESP32C5 + default 40 if SLAVE_IDF_TARGET_ESP32C2 || SLAVE_IDF_TARGET_ESP32C3 || SLAVE_IDF_TARGET_ESP32S2 || SLAVE_IDF_TARGET_ESP32S3 || SLAVE_IDF_TARGET_ESP32C5 || SLAVE_IDF_TARGET_ESP32C61 range $(ESP32XX_SPI_CLK_FREQ_RANGE_MIN) $(ESP32XX_SPI_CLK_FREQ_RANGE_MAX) help "Optimize SPI CLK by increasing till host practically can support" @@ -331,7 +469,7 @@ ESP32XX_SPI_CLK_FREQ_RANGE_MAX := 40 int default ESP_HOSTED_SPI_FREQ_ESP32 if SLAVE_IDF_TARGET_ESP32 default ESP_HOSTED_SPI_FREQ_ESP32C6 if SLAVE_IDF_TARGET_ESP32C6 - default ESP_HOSTED_SPI_FREQ_ESP32XX if SLAVE_IDF_TARGET_ESP32C2 || SLAVE_IDF_TARGET_ESP32C3 || SLAVE_IDF_TARGET_ESP32S2 || SLAVE_IDF_TARGET_ESP32S3 || SLAVE_IDF_TARGET_ESP32C5 + default ESP_HOSTED_SPI_FREQ_ESP32XX if SLAVE_IDF_TARGET_ESP32C2 || SLAVE_IDF_TARGET_ESP32C3 || SLAVE_IDF_TARGET_ESP32S2 || SLAVE_IDF_TARGET_ESP32S3 || SLAVE_IDF_TARGET_ESP32C5 || SLAVE_IDF_TARGET_ESP32C61 help "Optimize SPI CLK by increasing till host practically can support" @@ -393,13 +531,45 @@ ESP32XX_SPI_CLK_FREQ_RANGE_MAX := 40 endchoice - config ESP_HOSTED_SDIO_GPIO_RESET_SLAVE - int "GPIO pin for Reseting slave ESP" - default 54 if IDF_TARGET_ESP32P4 - default 42 if IDF_TARGET_ESP32S3 - default 5 + choice + prompt "SDIO Slot To Use" + default ESP_HOSTED_SDIO_SLOT_1 help - GPIO pin for Resetting ESP SDIO slave device. Should be connected to RST/EN of ESP SDIO slave device. + On the ESP32-P4 EV Board: + - Slot 0 connects to the MicroSD Card slot + - Slot 1 connects to the on-board ESP32-C6 + For the ESP32, Slot 0 is usually occupied by SPI Flash and not usable for SDIO. + For the ESP32-P4, Slot 0 is IOMUXed and GPIO values cannot be changed + + config ESP_HOSTED_SDIO_SLOT_0 + depends on IDF_TARGET_ESP32P4 || IDF_TARGET_ESP32S3 + bool "Slot 0" + + config ESP_HOSTED_SDIO_SLOT_1 + bool "Slot 1" + endchoice + + config ESP_HOSTED_SDIO_SLOT + int + default 0 if ESP_HOSTED_SDIO_SLOT_0 + default 1 if ESP_HOSTED_SDIO_SLOT_1 + + config ESP_HOSTED_SD_PWR_CTRL_LDO_INTERNAL_IO + depends on SOC_SDMMC_IO_POWER_EXTERNAL + bool "SDIO power supply comes from internal LDO IO (READ HELP!)" + default n + help + Only needed when the SDIO module is connected to specific IO pins which can be used for high-speed SDIO. + Please read the schematic first and check if the SD VDD is connected to any internal LDO output. + Unselect this option if the SDIO is powered by an external power supply. + For ESP32-P4 EV Board, SDMMC slot 0 may require internal LDO output. + + config ESP_HOSTED_SD_PWR_CTRL_LDO_IO_ID + depends on SOC_SDMMC_IO_POWER_EXTERNAL && ESP_HOSTED_SD_PWR_CTRL_LDO_INTERNAL_IO + int "LDO ID" + default 4 if IDF_TARGET_ESP32P4 + help + Please check your schematic first and input your LDO ID. choice prompt "SDIO Bus Width" @@ -432,64 +602,304 @@ ESP32XX_SDIO_CLK_FREQ_KHZ_RANGE_MAX := 50000 help "Optimize SDIO CLK by increasing till host practically can support. Clock frequency for ESP32-P4 as host <= 40MHz" - config ESP_HOSTED_SDIO_PIN_CMD + config ESP_HOSTED_SDIO_CMD_GPIO_RANGE_MIN + int + default 51 if ESP_HOSTED_P4_C5_CORE_BOARD + default 19 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 4 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 15 if IDF_TARGET_ESP32 + default 0 + + config ESP_HOSTED_SDIO_CMD_GPIO_RANGE_MAX + int + default 51 if ESP_HOSTED_P4_C5_CORE_BOARD + default 19 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 4 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 15 if IDF_TARGET_ESP32 + default 100 + + config ESP_HOSTED_SDIO_CLK_GPIO_RANGE_MIN + int + default 50 if ESP_HOSTED_P4_C5_CORE_BOARD + default 18 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 33 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 14 if IDF_TARGET_ESP32 + default 0 + + config ESP_HOSTED_SDIO_CLK_GPIO_RANGE_MAX + int + default 50 if ESP_HOSTED_P4_C5_CORE_BOARD + default 18 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 33 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 14 if IDF_TARGET_ESP32 + default 100 + + config ESP_HOSTED_SDIO_D0_GPIO_RANGE_MIN + int + default 49 if ESP_HOSTED_P4_C5_CORE_BOARD + default 14 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 20 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 2 if IDF_TARGET_ESP32 + default 0 + + config ESP_HOSTED_SDIO_D0_GPIO_RANGE_MAX + int + default 49 if ESP_HOSTED_P4_C5_CORE_BOARD + default 14 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 20 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 2 if IDF_TARGET_ESP32 + default 100 + + config ESP_HOSTED_SDIO_D1_GPIO_RANGE_MIN + int + default 48 if ESP_HOSTED_P4_C5_CORE_BOARD + default 15 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 23 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 4 if IDF_TARGET_ESP32 + default 0 + + config ESP_HOSTED_SDIO_D1_GPIO_RANGE_MAX + int + default 48 if ESP_HOSTED_P4_C5_CORE_BOARD + default 15 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 23 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 4 if IDF_TARGET_ESP32 + default 100 + + config ESP_HOSTED_SDIO_D2_GPIO_RANGE_MIN + int + default 53 if ESP_HOSTED_P4_C5_CORE_BOARD + default 16 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 21 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 12 if IDF_TARGET_ESP32 + default 0 + + config ESP_HOSTED_SDIO_D2_GPIO_RANGE_MAX + int + default 53 if ESP_HOSTED_P4_C5_CORE_BOARD + default 16 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 21 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 12 if IDF_TARGET_ESP32 + default 100 + + config ESP_HOSTED_SDIO_D3_GPIO_RANGE_MIN + int + default 52 if ESP_HOSTED_P4_C5_CORE_BOARD + default 17 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 22 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 13 if IDF_TARGET_ESP32 + default 0 + + config ESP_HOSTED_SDIO_D3_GPIO_RANGE_MAX + int + default 52 if ESP_HOSTED_P4_C5_CORE_BOARD + default 17 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 22 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 13 if IDF_TARGET_ESP32 + default 100 + + config ESP_HOSTED_SDIO_RESET_SLAVE_GPIO_MIN + int + default 54 if ESP_HOSTED_P4_C5_CORE_BOARD + default 54 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 53 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 5 if IDF_TARGET_ESP32 + default 0 + help + GPIO pin for Resetting ESP SDIO slave device. Should be connected to RST/EN of ESP SDIO slave device. + + config ESP_HOSTED_SDIO_RESET_SLAVE_GPIO_MAX + int + default 54 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 53 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 5 if IDF_TARGET_ESP32 + default 100 + +### *START* GPIO SDIO pin configurations for Slot 0 and 1 + config ESP_HOSTED_PRIV_SDIO_PIN_CMD_SLOT_0 + depends on ESP_HOSTED_SDIO_SLOT_0 int "CMD GPIO number" default 47 if IDF_TARGET_ESP32S3 - default 19 if IDF_TARGET_ESP32P4 + range 44 44 if IDF_TARGET_ESP32P4 range 15 15 if IDF_TARGET_ESP32 help "Value can only be configured for some targets. Displayed always for reference." - config ESP_HOSTED_SDIO_PIN_CLK + config ESP_HOSTED_PRIV_SDIO_PIN_CMD_SLOT_1 + depends on ESP_HOSTED_SDIO_SLOT_1 + int "CMD GPIO number" + default 47 if IDF_TARGET_ESP32S3 + default 19 if IDF_TARGET_ESP32P4 + default 15 if IDF_TARGET_ESP32 + range ESP_HOSTED_SDIO_CMD_GPIO_RANGE_MIN ESP_HOSTED_SDIO_CMD_GPIO_RANGE_MAX + help + CMD GPIO pin for SDIO. Range enforced dynamically based on slave target to ensure IOMUX compliance. + + config ESP_HOSTED_PRIV_SDIO_PIN_CLK_SLOT_0 + depends on ESP_HOSTED_SDIO_SLOT_0 int "CLK GPIO number" default 19 if IDF_TARGET_ESP32S3 - default 18 if IDF_TARGET_ESP32P4 + range 43 43 if IDF_TARGET_ESP32P4 range 14 14 if IDF_TARGET_ESP32 help "Value can only be configured for some targets. Displayed always for reference." - config ESP_HOSTED_SDIO_PIN_D0 + config ESP_HOSTED_PRIV_SDIO_PIN_CLK_SLOT_1 + depends on ESP_HOSTED_SDIO_SLOT_1 + int "CLK GPIO number" + default 19 if IDF_TARGET_ESP32S3 + default 18 if IDF_TARGET_ESP32P4 + default 14 if IDF_TARGET_ESP32 + range ESP_HOSTED_SDIO_CLK_GPIO_RANGE_MIN ESP_HOSTED_SDIO_CLK_GPIO_RANGE_MAX + help + CLK GPIO pin for SDIO. Range enforced dynamically based on slave target to ensure IOMUX compliance. + + config ESP_HOSTED_PRIV_SDIO_PIN_D0_SLOT_0 + depends on ESP_HOSTED_SDIO_SLOT_0 int "D0 GPIO number" default 13 if IDF_TARGET_ESP32S3 - default 14 if IDF_TARGET_ESP32P4 + range 39 39 if IDF_TARGET_ESP32P4 range 2 2 if IDF_TARGET_ESP32 help "Value can only be configured for some targets. Displayed always for reference." + config ESP_HOSTED_PRIV_SDIO_PIN_D0_SLOT_1 + depends on ESP_HOSTED_SDIO_SLOT_1 + int "D0 GPIO number" + default 13 if IDF_TARGET_ESP32S3 + default 14 if IDF_TARGET_ESP32P4 + default 2 if IDF_TARGET_ESP32 + range ESP_HOSTED_SDIO_D0_GPIO_RANGE_MIN ESP_HOSTED_SDIO_D0_GPIO_RANGE_MAX + help + D0 GPIO pin for SDIO. Range enforced dynamically based on slave target to ensure IOMUX compliance. + if ESP_HOSTED_SDIO_4_BIT_BUS - config ESP_HOSTED_SDIO_PRIV_PIN_D1_4BIT_BUS + config ESP_HOSTED_PRIV_SDIO_PIN_D1_4BIT_BUS_SLOT_0 + depends on ESP_HOSTED_SDIO_SLOT_0 int "D1 GPIO number" default 35 if IDF_TARGET_ESP32S3 - default 15 if IDF_TARGET_ESP32P4 + range 40 40 if IDF_TARGET_ESP32P4 range 4 4 if IDF_TARGET_ESP32 help "Value can only be configured for some targets. Displayed always for reference." - config ESP_HOSTED_SDIO_PIN_D2 + config ESP_HOSTED_PRIV_SDIO_PIN_D1_4BIT_BUS_SLOT_1 + depends on ESP_HOSTED_SDIO_SLOT_1 + int "D1 GPIO number" + default 35 if IDF_TARGET_ESP32S3 + default 15 if IDF_TARGET_ESP32P4 + default 4 if IDF_TARGET_ESP32 + range ESP_HOSTED_SDIO_D1_GPIO_RANGE_MIN ESP_HOSTED_SDIO_D1_GPIO_RANGE_MAX + help + D1 GPIO pin for SDIO. Range enforced dynamically based on slave target to ensure IOMUX compliance. + + config ESP_HOSTED_PRIV_SDIO_PIN_D2_4BIT_BUS_SLOT_0 + depends on ESP_HOSTED_SDIO_SLOT_0 int "D2 GPIO number" default 20 if IDF_TARGET_ESP32S3 - default 16 if IDF_TARGET_ESP32P4 + range 41 41 if IDF_TARGET_ESP32P4 range 12 12 if IDF_TARGET_ESP32 help "Value can only be configured for some targets. Displayed always for reference." - config ESP_HOSTED_SDIO_PIN_D3 + config ESP_HOSTED_PRIV_SDIO_PIN_D2_4BIT_BUS_SLOT_1 + depends on ESP_HOSTED_SDIO_SLOT_1 + int "D2 GPIO number" + default 20 if IDF_TARGET_ESP32S3 + default 16 if IDF_TARGET_ESP32P4 + default 12 if IDF_TARGET_ESP32 + range ESP_HOSTED_SDIO_D2_GPIO_RANGE_MIN ESP_HOSTED_SDIO_D2_GPIO_RANGE_MAX + help + D2 GPIO pin for SDIO. Range enforced dynamically based on slave target to ensure IOMUX compliance. + + config ESP_HOSTED_PRIV_SDIO_PIN_D3_4BIT_BUS_SLOT_0 + depends on ESP_HOSTED_SDIO_SLOT_0 int "D3 GPIO number" default 9 if IDF_TARGET_ESP32S3 - default 17 if IDF_TARGET_ESP32P4 + range 42 42 if IDF_TARGET_ESP32P4 range 13 13 if IDF_TARGET_ESP32 help "Value can only be configured for some targets. Displayed always for reference." + + config ESP_HOSTED_PRIV_SDIO_PIN_D3_4BIT_BUS_SLOT_1 + depends on ESP_HOSTED_SDIO_SLOT_1 + int "D3 GPIO number" + default 9 if IDF_TARGET_ESP32S3 + default 17 if IDF_TARGET_ESP32P4 + default 13 if IDF_TARGET_ESP32 + range ESP_HOSTED_SDIO_D3_GPIO_RANGE_MIN ESP_HOSTED_SDIO_D3_GPIO_RANGE_MAX + help + D3 GPIO pin for SDIO. Range enforced dynamically based on slave target to ensure IOMUX compliance. endif if !ESP_HOSTED_SDIO_4_BIT_BUS - config ESP_HOSTED_SDIO_PRIV_PIN_D1_1BIT_BUS + config ESP_HOSTED_PRIV_SDIO_PIN_D1_1BIT_BUS_SLOT_0 + depends on ESP_HOSTED_SDIO_SLOT_0 int "D1 GPIO number (Interrupt Line)" default 35 if IDF_TARGET_ESP32S3 - default 15 if IDF_TARGET_ESP32P4 + range 40 40 if IDF_TARGET_ESP32P4 range 4 4 if IDF_TARGET_ESP32 help "Value can only be configured for some targets. Displayed always for reference." + config ESP_HOSTED_PRIV_SDIO_PIN_D1_1BIT_BUS_SLOT_1 + depends on ESP_HOSTED_SDIO_SLOT_1 + int "D1 GPIO number (Interrupt Line)" + default 35 if IDF_TARGET_ESP32S3 + default 15 if IDF_TARGET_ESP32P4 + default 4 if IDF_TARGET_ESP32 + range ESP_HOSTED_SDIO_D1_GPIO_RANGE_MIN ESP_HOSTED_SDIO_D1_GPIO_RANGE_MAX + help + D1 GPIO pin for SDIO. Range enforced dynamically based on slave target to ensure IOMUX compliance. + endif + + config ESP_HOSTED_SDIO_GPIO_RESET_SLAVE + int "GPIO pin for Reseting slave ESP" + default 54 if IDF_TARGET_ESP32P4 + default 42 if IDF_TARGET_ESP32S3 + default 5 if IDF_TARGET_ESP32 + range ESP_HOSTED_SDIO_RESET_SLAVE_GPIO_MIN ESP_HOSTED_SDIO_RESET_SLAVE_GPIO_MAX + help + GPIO pin for Resetting ESP SDIO slave device. Should be connected to RST/EN of ESP SDIO slave device. + +### *END* GPIO SDIO pin configurations for Slot 0 and 1 + + config ESP_HOSTED_SDIO_PIN_CMD + int + default ESP_HOSTED_PRIV_SDIO_PIN_CMD_SLOT_0 if ESP_HOSTED_SDIO_SLOT_0 + default ESP_HOSTED_PRIV_SDIO_PIN_CMD_SLOT_1 if ESP_HOSTED_SDIO_SLOT_1 + + config ESP_HOSTED_SDIO_PIN_CLK + int + default ESP_HOSTED_PRIV_SDIO_PIN_CLK_SLOT_0 if ESP_HOSTED_SDIO_SLOT_0 + default ESP_HOSTED_PRIV_SDIO_PIN_CLK_SLOT_1 if ESP_HOSTED_SDIO_SLOT_1 + + config ESP_HOSTED_SDIO_PIN_D0 + int + default ESP_HOSTED_PRIV_SDIO_PIN_D0_SLOT_0 if ESP_HOSTED_SDIO_SLOT_0 + default ESP_HOSTED_PRIV_SDIO_PIN_D0_SLOT_1 if ESP_HOSTED_SDIO_SLOT_1 + + if ESP_HOSTED_SDIO_4_BIT_BUS + config ESP_HOSTED_SDIO_PRIV_PIN_D1_4BIT_BUS + int + default ESP_HOSTED_PRIV_SDIO_PIN_D1_4BIT_BUS_SLOT_0 if ESP_HOSTED_SDIO_SLOT_0 + default ESP_HOSTED_PRIV_SDIO_PIN_D1_4BIT_BUS_SLOT_1 if ESP_HOSTED_SDIO_SLOT_1 + + config ESP_HOSTED_SDIO_PIN_D2 + int + default ESP_HOSTED_PRIV_SDIO_PIN_D2_4BIT_BUS_SLOT_0 if ESP_HOSTED_SDIO_SLOT_0 + default ESP_HOSTED_PRIV_SDIO_PIN_D2_4BIT_BUS_SLOT_1 if ESP_HOSTED_SDIO_SLOT_1 + + config ESP_HOSTED_SDIO_PIN_D3 + int + default ESP_HOSTED_PRIV_SDIO_PIN_D3_4BIT_BUS_SLOT_0 if ESP_HOSTED_SDIO_SLOT_0 + default ESP_HOSTED_PRIV_SDIO_PIN_D3_4BIT_BUS_SLOT_1 if ESP_HOSTED_SDIO_SLOT_1 + endif + + if !ESP_HOSTED_SDIO_4_BIT_BUS + config ESP_HOSTED_SDIO_PRIV_PIN_D1_1BIT_BUS + int + default ESP_HOSTED_PRIV_SDIO_PIN_D1_1BIT_BUS_SLOT_0 if ESP_HOSTED_SDIO_SLOT_0 + default ESP_HOSTED_PRIV_SDIO_PIN_D1_1BIT_BUS_SLOT_1 if ESP_HOSTED_SDIO_SLOT_1 endif config ESP_HOSTED_SDIO_PIN_D1 @@ -567,69 +977,197 @@ ESP32XX_SDIO_CLK_FREQ_KHZ_RANGE_MAX := 50000 endchoice menu "Host GPIOs Config" + config ESP_HOSTED_SPI_HD_CS_RANGE_MIN + int + default 19 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 4 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 4 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default -1 + + config ESP_HOSTED_SPI_HD_CS_RANGE_MAX + int + default 19 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 4 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 4 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 100 + config ESP_HOSTED_SPI_HD_GPIO_CS int "GPIO pin for Host CS" + default 7 if IDF_TARGET_ESP32P4 default 10 if IDF_TARGET_ESP32S3 - default 19 if IDF_TARGET_ESP32P4 - default 15 + default 1 if IDF_TARGET_ESP32H2 + default -1 if !IDF_TARGET_ESP32P4 || !IDF_TARGET_ESP32H2 || !IDF_TARGET_ESP32S3 + range ESP_HOSTED_SPI_HD_CS_RANGE_MIN ESP_HOSTED_SPI_HD_CS_RANGE_MAX help SPI Half-duplex controller Host CS + config ESP_HOSTED_SPI_HD_CLK_RANGE_MIN + int + default 18 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 33 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 33 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default -1 + + config ESP_HOSTED_SPI_HD_CLK_RANGE_MAX + int + default 18 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 33 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 33 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 100 + config ESP_HOSTED_SPI_HD_GPIO_CLK int "GPIO pin for Host CLK" + default 9 if IDF_TARGET_ESP32P4 default 12 if IDF_TARGET_ESP32S3 - default 18 if IDF_TARGET_ESP32P4 - default 18 + default 4 if IDF_TARGET_ESP32H2 + default -1 if !IDF_TARGET_ESP32P4 || !IDF_TARGET_ESP32H2 || !IDF_TARGET_ESP32S3 + range ESP_HOSTED_SPI_HD_CLK_RANGE_MIN ESP_HOSTED_SPI_HD_CLK_RANGE_MAX help SPI Half-duplex controller Host CLK + config ESP_HOSTED_SPI_HD_D0_RANGE_MIN + int + default 14 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 23 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 23 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default -1 + + config ESP_HOSTED_SPI_HD_D0_RANGE_MAX + int + default 14 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 23 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 23 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 100 + config ESP_HOSTED_SPI_HD_GPIO_D0 int "GPIO pin for Host D0" + default 8 if IDF_TARGET_ESP32P4 default 11 if IDF_TARGET_ESP32S3 - default 14 if IDF_TARGET_ESP32P4 - default 2 + default 5 if IDF_TARGET_ESP32H2 + default -1 if !IDF_TARGET_ESP32P4 || !IDF_TARGET_ESP32H2 || !IDF_TARGET_ESP32S3 + range ESP_HOSTED_SPI_HD_D0_RANGE_MIN ESP_HOSTED_SPI_HD_D0_RANGE_MAX help SPI Half-duplex controller Host D0 + config ESP_HOSTED_SPI_HD_D1_RANGE_MIN + int + default 15 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 22 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 22 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default -1 + + config ESP_HOSTED_SPI_HD_D1_RANGE_MAX + int + default 15 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 22 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 22 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 100 + config ESP_HOSTED_SPI_HD_GPIO_D1 int "GPIO pin for Host D1" + default 10 if IDF_TARGET_ESP32P4 default 13 if IDF_TARGET_ESP32S3 - default 15 if IDF_TARGET_ESP32P4 - default 4 + default 0 if IDF_TARGET_ESP32H2 + default -1 if !IDF_TARGET_ESP32P4 || !IDF_TARGET_ESP32H2 || !IDF_TARGET_ESP32S3 + range ESP_HOSTED_SPI_HD_D1_RANGE_MIN ESP_HOSTED_SPI_HD_D1_RANGE_MAX help SPI Half-duplex controller Host D1 + config ESP_HOSTED_SPI_HD_D2_RANGE_MIN + int + default 16 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 20 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 20 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default -1 + + config ESP_HOSTED_SPI_HD_D2_RANGE_MAX + int + default 16 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 20 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 20 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 100 + config ESP_HOSTED_SPI_HD_GPIO_D2 depends on ESP_HOSTED_SPI_HD_PRIV_INTERFACE_4_DATA_LINES int "GPIO pin for Host D2" + default 11 if IDF_TARGET_ESP32P4 default 14 if IDF_TARGET_ESP32S3 - default 16 if IDF_TARGET_ESP32P4 - default 12 + default 2 if IDF_TARGET_ESP32H2 + default -1 if !IDF_TARGET_ESP32P4 || !IDF_TARGET_ESP32H2 || !IDF_TARGET_ESP32S3 + range ESP_HOSTED_SPI_HD_D2_RANGE_MIN ESP_HOSTED_SPI_HD_D2_RANGE_MAX help SPI Half-duplex controller Host D2 + config ESP_HOSTED_SPI_HD_D3_RANGE_MIN + int + default 17 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 21 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 21 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default -1 + + config ESP_HOSTED_SPI_HD_D3_RANGE_MAX + int + default 17 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 21 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 21 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 100 + config ESP_HOSTED_SPI_HD_GPIO_D3 depends on ESP_HOSTED_SPI_HD_PRIV_INTERFACE_4_DATA_LINES int "GPIO pin for Host D3" + default 6 if IDF_TARGET_ESP32P4 default 9 if IDF_TARGET_ESP32S3 - default 17 if IDF_TARGET_ESP32P4 - default 13 + default 3 if IDF_TARGET_ESP32H2 + default -1 if !IDF_TARGET_ESP32P4 || !IDF_TARGET_ESP32H2 || !IDF_TARGET_ESP32S3 + range ESP_HOSTED_SPI_HD_D3_RANGE_MIN ESP_HOSTED_SPI_HD_D3_RANGE_MAX help SPI Half-duplex controller Host D3 + config ESP_HOSTED_SPI_HD_DATA_READY_RANGE_MIN + int + default 6 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 32 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 32 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default -1 + + config ESP_HOSTED_SPI_HD_DATA_READY_RANGE_MAX + int + default 6 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 32 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 32 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 100 + config ESP_HOSTED_SPI_HD_GPIO_DATA_READY int "GPIO pin for data ready interrupt" + default 13 if IDF_TARGET_ESP32P4 default 4 if IDF_TARGET_ESP32S3 - default 6 if IDF_TARGET_ESP32P4 - default 8 + default 12 if IDF_TARGET_ESP32H2 + default -1 if !IDF_TARGET_ESP32P4 || !IDF_TARGET_ESP32H2 || !IDF_TARGET_ESP32S3 + range ESP_HOSTED_SPI_HD_DATA_READY_RANGE_MIN ESP_HOSTED_SPI_HD_DATA_READY_RANGE_MAX help GPIO pin for indicating host that slave has data to be read by host + config ESP_HOSTED_SPI_HD_RESET_RANGE_MIN + int + default 54 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 53 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 53 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default -1 + + config ESP_HOSTED_SPI_HD_RESET_RANGE_MAX + int + default 54 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 53 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C5 + default 53 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C2 + default 100 + config ESP_HOSTED_SPI_HD_GPIO_RESET_SLAVE int "GPIO pin for Reseting slave ESP" + default 12 if IDF_TARGET_ESP32P4 default 5 if IDF_TARGET_ESP32S3 - default 54 if IDF_TARGET_ESP32P4 && SLAVE_IDF_TARGET_ESP32C6 - default 5 + default 10 if IDF_TARGET_ESP32H2 + default -1 if !IDF_TARGET_ESP32P4 || !IDF_TARGET_ESP32H2 || !IDF_TARGET_ESP32S3 + range ESP_HOSTED_SPI_HD_RESET_RANGE_MIN ESP_HOSTED_SPI_HD_RESET_RANGE_MAX help GPIO pin for Resetting ESP slave device. Should be connected to RST/EN of ESP SPI slave device. endmenu @@ -649,9 +1187,9 @@ ESP32XX_SPI_HD_CLK_FREQ_RANGE_MAX := 40 "Optimize CLK by increasing till host practically can support" config ESP_HOSTED_SPI_HD_FREQ_ESP32XX - depends on SLAVE_IDF_TARGET_ESP32C2 || SLAVE_IDF_TARGET_ESP32C3 || SLAVE_IDF_TARGET_ESP32S2 || SLAVE_IDF_TARGET_ESP32S3 || SLAVE_IDF_TARGET_ESP32C5 + depends on SLAVE_IDF_TARGET_ESP32C2 || SLAVE_IDF_TARGET_ESP32C3 || SLAVE_IDF_TARGET_ESP32S2 || SLAVE_IDF_TARGET_ESP32S3 || SLAVE_IDF_TARGET_ESP32C5 || SLAVE_IDF_TARGET_ESP32C61 int "SPI HD Clock Freq (MHz)" - default 10 if SLAVE_IDF_TARGET_ESP32C2 || SLAVE_IDF_TARGET_ESP32C3 || SLAVE_IDF_TARGET_ESP32S2 || SLAVE_IDF_TARGET_ESP32S3 || SLAVE_IDF_TARGET_ESP32C5 + default 40 if SLAVE_IDF_TARGET_ESP32C2 || SLAVE_IDF_TARGET_ESP32C3 || SLAVE_IDF_TARGET_ESP32S2 || SLAVE_IDF_TARGET_ESP32S3 || SLAVE_IDF_TARGET_ESP32C5 || SLAVE_IDF_TARGET_ESP32C61 range $(ESP32XX_SPI_HD_CLK_FREQ_RANGE_MIN) $(ESP32XX_SPI_HD_CLK_FREQ_RANGE_MAX) help "Optimize CLK by increasing till host practically can support" @@ -659,7 +1197,7 @@ ESP32XX_SPI_HD_CLK_FREQ_RANGE_MAX := 40 config ESP_HOSTED_SPI_HD_CLK_FREQ int default ESP_HOSTED_SPI_HD_FREQ_ESP32C6 if SLAVE_IDF_TARGET_ESP32C6 - default ESP_HOSTED_SPI_HD_FREQ_ESP32XX if SLAVE_IDF_TARGET_ESP32C2 || SLAVE_IDF_TARGET_ESP32C3 || SLAVE_IDF_TARGET_ESP32S2 || SLAVE_IDF_TARGET_ESP32S3 || SLAVE_IDF_TARGET_ESP32C5 + default ESP_HOSTED_SPI_HD_FREQ_ESP32XX if SLAVE_IDF_TARGET_ESP32C2 || SLAVE_IDF_TARGET_ESP32C3 || SLAVE_IDF_TARGET_ESP32S2 || SLAVE_IDF_TARGET_ESP32S3 || SLAVE_IDF_TARGET_ESP32C5 || SLAVE_IDF_TARGET_ESP32C61 help "Optimize CLK by increasing till host practically can support" @@ -710,6 +1248,16 @@ ESP32XX_SPI_HD_CLK_FREQ_RANGE_MAX := 40 help Select UART Port to Use. Do not select the UART Port used for console output (if enabled) + config ESP_HOSTED_UART_TX_RANGE_MIN + int + default 14 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 0 + + config ESP_HOSTED_UART_TX_RANGE_MAX + int + default 14 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 100 + config ESP_HOSTED_UART_PIN_TX int "TX GPIO number" default 13 if IDF_TARGET_ESP32 @@ -718,9 +1266,21 @@ ESP32XX_SPI_HD_CLK_FREQ_RANGE_MAX := 40 default 21 if IDF_TARGET_ESP32C6 default 5 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 14 if IDF_TARGET_ESP32P4 + default 12 if IDF_TARGET_ESP32H2 + range ESP_HOSTED_UART_TX_RANGE_MIN ESP_HOSTED_UART_TX_RANGE_MAX help GPIO used for UART TX + config ESP_HOSTED_UART_RX_RANGE_MIN + int + default 15 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 0 + + config ESP_HOSTED_UART_RX_RANGE_MAX + int + default 15 if ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD && SLAVE_IDF_TARGET_ESP32C6 + default 100 + config ESP_HOSTED_UART_PIN_RX int "RX GPIO number" default 12 if IDF_TARGET_ESP32 @@ -729,6 +1289,8 @@ ESP32XX_SPI_HD_CLK_FREQ_RANGE_MAX := 40 default 20 if IDF_TARGET_ESP32C6 default 4 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 15 if IDF_TARGET_ESP32P4 + default 22 if IDF_TARGET_ESP32H2 + range ESP_HOSTED_UART_RX_RANGE_MIN ESP_HOSTED_UART_RX_RANGE_MAX help GPIO used for UART RX @@ -811,14 +1373,59 @@ ESP32XX_SPI_HD_CLK_FREQ_RANGE_MAX := 40 ENABLE/DISABLE software UART checksum endmenu - config ESP_HOSTED_GPIO_SLAVE_RESET_SLAVE + menu "Common Slave Reset Strategy" + choice ESP_HOSTED_SLAVE_RESET_STRATEGY + bool "When to reset the slave device" + default ESP_HOSTED_SLAVE_RESET_ON_EVERY_HOST_BOOTUP + help + Select Select when to reset the slave + + config ESP_HOSTED_SLAVE_RESET_ON_EVERY_HOST_BOOTUP + bool "Reset slave on every host bootup" + help + Reset the slave device every time the host boots up. This ensures a clean + transport state and prevents any inconsistent states, but causes + the slave to reboot every time. + + config ESP_HOSTED_SLAVE_RESET_ONLY_IF_NECESSARY + bool "Reset slave only if necessary" + depends on ESP_HOSTED_SDIO_HOST_INTERFACE + help + Only reset the slave if initialization fails. This reduces slave + reboots but assumes the slave interface is in a consistent state. + If initialization fails, the host will assume the slave is in an + inconsistent or deinitialized state and will reset it. + Note: This option is only available for SDIO transport. + endchoice + + config ESP_HOSTED_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE + bool "Enable host auto-restart on communication failure" + depends on ESP_HOSTED_SLAVE_RESET_ONLY_IF_NECESSARY + default y + help + Enable host to automatically restart if it fails to establish communication with the slave. + When enabled, the host will reset itself to recover the connection if the slave + becomes non-responsive for the configured timeout period. This acts as a safeguard + in case the slave does not issue the first event on the transport line. + + config ESP_HOSTED_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE_TIMEOUT + depends on ESP_HOSTED_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE + int "Communication failure timeout (seconds)" + default 5 + help + Maximum time in seconds that the host will wait for a response from the slave + before triggering an automatic restart. If no communication is established within + this period, the host will reset itself to recover the connection. + endmenu + + config ESP_HOSTED_GPIO_SLAVE_RESET_SLAVE int default ESP_HOSTED_SPI_GPIO_RESET_SLAVE if ESP_HOSTED_SPI_HOST_INTERFACE default ESP_HOSTED_SDIO_GPIO_RESET_SLAVE if ESP_HOSTED_SDIO_HOST_INTERFACE default ESP_HOSTED_SPI_HD_GPIO_RESET_SLAVE if ESP_HOSTED_SPI_HD_HOST_INTERFACE default ESP_HOSTED_UART_GPIO_RESET_SLAVE if ESP_HOSTED_UART_HOST_INTERFACE - config ESP_HOSTED_RESET_GPIO_ACTIVE_LOW + config ESP_HOSTED_RESET_GPIO_ACTIVE_LOW bool default n if ESP_HOSTED_SDIO_RESET_ACTIVE_HIGH || ESP_HOSTED_SPI_RESET_ACTIVE_HIGH || ESP_HOSTED_SPI_HD_RESET_ACTIVE_HIGH || ESP_HOSTED_UART_RESET_ACTIVE_HIGH default y if ESP_HOSTED_SDIO_RESET_ACTIVE_LOW || ESP_HOSTED_SPI_RESET_ACTIVE_LOW || ESP_HOSTED_SPI_HD_RESET_ACTIVE_LOW || ESP_HOSTED_UART_RESET_ACTIVE_LOW @@ -893,6 +1500,37 @@ ESP32XX_SPI_HD_CLK_FREQ_RANGE_MAX := 40 default 3072 endmenu + config ESP_HOSTED_ENABLE_ITWT + bool "Enable iTWT support" + depends on SLAVE_SOC_WIFI_HE_SUPPORT + default y + help + Enable Wi-Fi iTWT (individual Target Wake Time) APIs on Host. Using the API, Host + can instruct the co-processor to negotiate specific wake and sleep schedules with + the access point (AP) for lower power consumption. + + config ESP_HOSTED_ENABLE_GPIO_CONTROL + bool "Enable GPIO control on co-processor" + default n + help + Enable RPC methods that allow the HOST MCU to configure and control GPIOs + on the co-processor. Leave disabled unless you really need it. + GPIO requests that target pins used by the active transport will be rejected. + + config ESP_HOSTED_ENABLE_DPP + bool "Enable Wi-Fi Easy Connect (DPP)" + default n + help + Enable Wi-Fi Easy Connect (DPP) support + + config ESP_HOSTED_DPP_URI_LEN_MAX + int "Maximum length of URI used to generate QR code in Wi-Fi Easy Connect" + depends on ESP_HOSTED_ENABLE_DPP + default 255 + help + URIs used to generate the QR code should be less than this length. + Increase this value if the received URI can be larger + config ESP_HOSTED_USE_MEMPOOL bool "Cache allocated memory like mempool - helps to reduce malloc calls" default y @@ -919,6 +1557,20 @@ ESP32XX_SPI_HD_CLK_FREQ_RANGE_MAX := 40 Increase this number if you need to send more simultaneous RPC requests. Note: the slave will only process one RPC request (sync and async) at a time + config ESP_HOSTED_CLI_ENABLED + bool "Enable CLI Shell" + default y + help + Only registers ESP-Hosted cli commands to the existing CLI session opened earlier by other components than esp-hosted + + config ESP_HOSTED_CLI_NEW_INSTANCE + depends on ESP_HOSTED_CLI_ENABLED + bool "Create new instance & do not re-use existing session if any" + default n + help + Starts a new CLI instance when enabled & registers esp hosted as well. + Refrain from enabling this option, if your example already creates cli session, for example, iperf example. + menu "Debug Settings" config ESP_HOSTED_RAW_THROUGHPUT_TRANSPORT @@ -964,6 +1616,11 @@ ESP32XX_SPI_HD_CLK_FREQ_RANGE_MAX := 40 help On comparing with slave packet stats helps to understand any packet loss at hosted + config ESP_PKT_STATS_INTERVAL_SEC + depends on ESP_PKT_STATS + int "Packet stats reporting interval (sec)" + default 30 + endmenu menu "Data path options" @@ -1029,4 +1686,163 @@ ESP32XX_SPI_HD_CLK_FREQ_RANGE_MAX := 40 Once the Wi-Fi is no more stressed, data throttling would be stopped, once slave Wi-Fi load is lower than this threshold endmenu + + config ESP_HOSTED_DECODE_WIFI_RESERVED_FIELD + bool "Copy Wi-Fi configuration reserved field values" + default n + help + ESP-IDF Wi-Fi structures contain reserved bitmask values. + Enable this option if you want to copy these values between host and co-processor. + It is usually safe to ignore these reserved values. + + config ESP_HOSTED_NETWORK_SPLIT_ENABLED + bool "Enable Network Split: Shared IP address between host and slave" + default n + help + Enables the LWIP stack on the slave to process its own set of ports, + alongside the host stack. Helps split network traffic and allows + background tasks on the slave, even when the host is in low-power mode. + + menu "LWIP port config" + depends on ESP_HOSTED_NETWORK_SPLIT_ENABLED + + menu "Host side (remote) LWIP port config" + config LWIP_TCP_LOCAL_PORT_RANGE_START + int "Host TCP start port" + default 49152 + help + Host side TCP start port. Slave defaults to 61440 + Slave range: 61440-65535 + Host range: 49152-61439 + + config LWIP_TCP_LOCAL_PORT_RANGE_END + int "Host TCP end port" + default 61439 + help + Host side TCP end port. Slave defaults to 65535 + Slave range: 61440-65535 + Host range: 49152-61439 + + config LWIP_UDP_LOCAL_PORT_RANGE_START + int "Host UDP start port" + default 49152 + help + Host side UDP start port. Slave defaults to 61440 + Slave range: 61440-65535 + Host range: 49152-61439 + + config LWIP_UDP_LOCAL_PORT_RANGE_END + int "Host UDP end port" + default 61439 + help + Host side UDP end port. Slave defaults to 65535 + Slave range: 61440-65535 + Host range: 49152-61439 + endmenu + + menu "Slave side (remote) LWIP port config" + config LWIP_TCP_REMOTE_PORT_RANGE_START + int "Slave TCP start port" + default 61440 + help + Slave side TCP start port. Host defaults to 49152 + Slave range: 61440-65535 + Host range: 49152-61439 + + config LWIP_TCP_REMOTE_PORT_RANGE_END + int "Slave TCP end port" + default 65535 + help + Slave side TCP end port. Host defaults to 61439 + Slave range: 61440-65535 + Host range: 49152-61439 + + config LWIP_UDP_REMOTE_PORT_RANGE_START + int "Slave UDP start port" + default 61440 + help + Slave side UDP start port. Host defaults to 49152 + Slave range: 61440-65535 + Host range: 49152-61439 + + config LWIP_UDP_REMOTE_PORT_RANGE_END + int "Slave UDP end port" + default 65535 + help + Slave side UDP end port. Host defaults to 61439 + Slave range: 61440-65535 + Host range: 49152-61439 + endmenu + + endmenu + + config ESP_HOSTED_HOST_POWER_SAVE_ENABLED + bool "Allow host to power save" + depends on SOC_LIGHT_SLEEP_SUPPORTED || (SOC_DEEP_SLEEP_SUPPORTED && SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP) + default n + + config ESP_HOSTED_HOST_DEEP_SLEEP_ALLOWED + bool "Allow host to enter deep sleep. Slave will wakeup host using GPIO" + depends on ESP_HOSTED_HOST_POWER_SAVE_ENABLED && (SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP && SOC_DEEP_SLEEP_SUPPORTED) + default y + help + Allow host to deep sleep for highest power saving. Only RTC memory and RTC GPIOs remain + powered during deep sleep. Slave will wake up host using a GPIO when needed. Host must + configure a valid RTC GPIO for wakeup. Deep sleep provides maximum power savings but has + longer wakeup time compared to light sleep. + + + menu "Host Power Save Configuration" + depends on ESP_HOSTED_HOST_DEEP_SLEEP_ALLOWED + + config ESP_HOSTED_HOST_WAKEUP_GPIO + int "Host in: Host Wakeup GPIO" + default 5 if C2_C5_MODULE_SUB_BOARD + default 6 if IDF_TARGET_ESP32P4 && SLAVE_CHIPSET_ESP32C6 && !ESP_HOSTED_SPI_HD_HOST_INTERFACE + default 4 if IDF_TARGET_ESP32P4 && SLAVE_CHIPSET_ESP32C6 && ESP_HOSTED_SPI_HD_HOST_INTERFACE + default 6 if IDF_TARGET_ESP32P4 && SLAVE_CHIPSET_ESP32C5 + default 6 if IDF_TARGET_ESP32P4 && !SLAVE_CHIPSET_ESP32C6 && !SLAVE_CHIPSET_ESP32C5 + default 1 if IDF_TARGET_ESP32C3 + default -1 + range -1 15 if IDF_TARGET_ESP32P4 + help + GPIO number to use for host wakeup from sleep. + Set to -1 to disable GPIO wakeup. + Only RTC GPIOs are supported for deep-sleep-wakeup. + + choice PRIV_HOST_WAKEUP_GPIO_LEVEL + bool "Host Wakeup GPIO Level" + default PRIV_HOST_WAKEUP_GPIO_LEVEL_HIGH + + config PRIV_HOST_WAKEUP_GPIO_LEVEL_HIGH + bool "High" + config PRIV_HOST_WAKEUP_GPIO_LEVEL_LOW + bool "Low" + endchoice + + config ESP_HOSTED_HOST_WAKEUP_GPIO_LEVEL + int + default 1 if PRIV_HOST_WAKEUP_GPIO_LEVEL_HIGH + default 0 if PRIV_HOST_WAKEUP_GPIO_LEVEL_LOW + help + GPIO level to use for host wakeup from sleep. + Set to 0 to use low level, set to 1 to use high level. + + endmenu + + # Config Validation + if ESP_HOSTED_HOST_DEEP_SLEEP_ALLOWED + if !ESP_HOSTED_SDIO_HOST_INTERFACE && ESP_HOSTED_SLAVE_RESET_ONLY_IF_NECESSARY + comment "Error: Invalid configuration. Slave reset is mandatory for non SDIO transports" + endif + + if ESP_HOSTED_HOST_WAKEUP_GPIO = -1 + comment "Error: Host wake-up GPIO is mandatory" + endif + + if ESP_HOSTED_SLAVE_RESET_ONLY_IF_NECESSARY && !ESP_HOSTED_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE + comment "Recommended to set up 'auto-restart of host' if communication with slave fails" + endif + endif + endmenu diff --git a/README.md b/README.md index 43135b72..b8017e08 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ This can be any generic microcontroller (MCU). We demonstrate any ESP as host. U - Host extends the capabilities of the Hosted co-processor through Remote Procedure Calls (RPCs). The Host MCU sends these RPC commands to the Hosted co-processor using a reliable communication bus, like SPI, SDIO, or UART. The Hosted co-processor then handles the RPC and provides the requested functionality to the Host MCU. - The data (network or Bluetooth) is packaged efficiently at the transport layer to minimize overhead and delays when passing between the Host and co-processor. - This modular design allows any MCU to be used as the Host, and any ESP chip with Wi-Fi and/or Bluetooth to be used as the Hosted co-processor. The RPC calls can also be extended to provide any function required by the Host, as long as the co-processor can support it. +- The RPCs implemented are [listed in this document](https://github.com/espressif/esp-hosted-mcu/blob/main/docs/implemented_rpcs.md), including the ESP-Hosted release version that implements the RPCs. ## 3 Solution Flexibility @@ -45,6 +46,10 @@ This can be any generic microcontroller (MCU). We demonstrate any ESP as host. U - **Extensible RPC library** - The Remote Procedure Call (RPC) used by ESP-Hosted can be extended to provide any function required by the Host, as long as the co-processor can support it. Currently, the essential [ESP-IDF](https://github.com/espressif/esp-idf) Wi-Fi functions have been implemented. +## 3.1 Features Supported by ESP-Hosted + +See the [Features](https://github.com/espressif/esp-hosted-mcu/blob/main/docs/features.md) document for features currently supported by ESP-Hosted. + ## 4 Quick Demo with ESP32-P4-Function-EV-Board Impatient to test? We've got you covered! @@ -149,11 +154,15 @@ Legends: - Bluetooth uses dedicated platform, UART and Wi-Fi uses any other base transport - In other platforms, Bluetooth and Wi-Fi re-use same platform and hence use less GPIOs and less complicated - This transport combination allows Bluetooth to use dedicated uart transportt with additional 2 or 4 depending on hardware flow control. -- (S) : Sheild box reading +- (S) : Shield box reading - (O) : Over the air reading - TBD : To be determined - iperf : iperf2 with test resukts in mbps +> [!NOTE] +> +> For the shield box readings maked with (S), full network set up explained in [Shield Box Test Setup](shield-box-test-setup.md) + **Host can be any ESP chipset or any non-ESP MCU.** ###### Hosted Transports table @@ -163,16 +172,15 @@ Legends: | Standard SPI | FD | 6 | jumper or PCB | Any_Slave | udp: 24 tcp: 22 | udp: 25 tcp: 22| Simplest solution for quick test | | Dual SPI | HD | 5 | jumper or PCB | Any_Slave [1] | udp: 32 tcp: 26 (O) | udp: 33 tcp: 25 (O) | Better throughput, but half duplex | | Quad SPI | HD | 7 | PCB only | Any_Slave [1] | udp: 41 tcp: 29 (O) | udp: 42 tcp: 28 (O) | Due to signal integrity, PCB is mandatory | -| SDIO 1-Bit | HD | 4 | jumper or PCB | ESP32, ESP32-C6 | TBD | TBD | Stepping stone for PCB based SDIO 4-bit | -| SDIO 4-Bit | HD | 6 | PCB only | ESP32, ESP32-C6 | udp: 79.5 tcp: 53.4 (S) | udp: 68.1 tcp: 44 (S) | Highest performance | +| SDIO 1-Bit | HD | 4 | jumper or PCB | ESP32, ESP32-C6, ESP32-C5, ESP32-C61 | TBD | TBD | Stepping stone for PCB based SDIO 4-bit | +| SDIO 4-Bit | HD | 6 | PCB only | ESP32, ESP32-C6, ESP32-C5, ESP32-C61 | udp: 79.5 tcp: 53.4 (S) | udp: 68.1 tcp: 44 (S) | Highest performance | | Only BT over UART | FD | 2 or 4 | jumper or PCB | Any_Slave | NA | NA | Dedicated Bluetooth over UART pins | | UART | FD | 2 | jumper or PCB | Any_Slave | udp: 0.68 tcp: 0.67 (O) | udp: 0.68 tcp: 0.60 (O) | UART dedicated for BT & Wi-Fi [2] | | Dedicated platforms | FD | Extra 2 or 4 | jumper or PCB | Any_Slave | NA | NA | UART dedicated for BT & Wi-Fi on any other transport | > [!NOTE] > - [1] Dual/Quad SPI is not supported on ESP32 -> -> - [2] UART is only suitable for low throughput environments +> - [2] UART is suitable only for low throughput environments. Throughput was obtained with a baud rate of 921600. On the ESP32-P4 + C6 development board, a baud rate of 4 Mbits/s can be achieved, giving TCP/UDP throughput of around 3.3 MBits/s. With jumper cables, 'Standard SPI' and 'Dual SPI' solutions are easiest to evaluate, without much of hardware dependencies. SDIO 1-Bit can be tested with jumper cables, but it needs some additional hardware config, such as installation of external pull-up registers. @@ -261,6 +269,8 @@ Check [examples](https://github.com/espressif/esp-hosted-mcu/tree/main/examples) If you encounter issues with using ESP-Hosted, see the following guide: - [Troubleshooting Guide](https://github.com/espressif/esp-hosted-mcu/blob/main/docs/troubleshooting.md) +- [Migration Guide](https://github.com/espressif/esp-hosted-mcu/blob/main/docs/migration_guide.md) +- if you are upgrading to ESP-Hosted version V2.5.2 (or later) from an earlier version, there has been a change in the operation of the Bluetooth Controller on the co-processor. See [Migrating to V2.5.2](https://github.com/espressif/esp-hosted-mcu/blob/main/docs/migration_guide.md#migrating-to-v252) in the Migration Guide for more information. ## 11 References diff --git a/common/esp_hosted_header.h b/common/esp_hosted_header.h index be13c3a9..d7c16bad 100644 --- a/common/esp_hosted_header.h +++ b/common/esp_hosted_header.h @@ -4,6 +4,9 @@ #ifndef __ESP_HOSTED_HEADER__H #define __ESP_HOSTED_HEADER__H +/* Add packet number to debug any drops or out-of-seq packets */ +//#define ESP_PKT_NUM_DEBUG 1 + struct esp_payload_header { uint8_t if_type:4; uint8_t if_num:4; @@ -14,6 +17,9 @@ struct esp_payload_header { uint16_t seq_num; uint8_t throttle_cmd:2; uint8_t reserved2:6; +#ifdef ESP_PKT_NUM_DEBUG + uint16_t pkt_num; +#endif /* Position of union field has to always be last, * this is required for hci_pkt_type */ union { @@ -26,6 +32,9 @@ struct esp_payload_header { /* ESP Payload Header Flags */ #define MORE_FRAGMENT (1 << 0) +#define FLAG_WAKEUP_PKT (1 << 1) +#define FLAG_POWER_SAVE_STARTED (1 << 2) +#define FLAG_POWER_SAVE_STOPPED (1 << 3) #define H_ESP_PAYLOAD_HEADER_OFFSET sizeof(struct esp_payload_header) diff --git a/common/esp_hosted_lwip_src_port_hook.h b/common/esp_hosted_lwip_src_port_hook.h new file mode 100644 index 00000000..4ea558f3 --- /dev/null +++ b/common/esp_hosted_lwip_src_port_hook.h @@ -0,0 +1,73 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Unlicense OR CC0-1.0 + */ + + +#ifndef __ESP_HOSTED_LWIP_SRC_PORT_HOOK_H__ +#define __ESP_HOSTED_LWIP_SRC_PORT_HOOK_H__ + +#include "sdkconfig.h" + +#if defined(CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED) +#include "lwip/opt.h" +/* ----------------------------------Slave (local) Port Config---------------------------------------- */ +/* If configured, Any new UDP socket would automatically bind as local port within this specified UDP port range. + * Please note, Reserved ports (generally <1024) like DHCP, etc would still work as they generally are hardcoded + */ + +#define ENSURE_PORT_RANGE(port, START, END) \ + (((port) >= (START) && (port) <= (END)) ? \ + (port) : \ + (((port) % ((END) - (START) + 1)) + (START))) + +#ifdef CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_START +#define TCP_LOCAL_PORT_RANGE_START CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_START +#define TCP_LOCAL_PORT_RANGE_END CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_END +#define TCP_ENSURE_LOCAL_PORT_RANGE(port) ENSURE_PORT_RANGE(port, TCP_LOCAL_PORT_RANGE_START, TCP_LOCAL_PORT_RANGE_END) +#if CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_END == 0xffff + #define IS_LOCAL_TCP_PORT(port) (port>=TCP_LOCAL_PORT_RANGE_START) +#else + #define IS_LOCAL_TCP_PORT(port) (port>=TCP_LOCAL_PORT_RANGE_START && (port<=CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_END)) +#endif +#endif + +#ifdef CONFIG_LWIP_TCP_REMOTE_PORT_RANGE_START +#define TCP_REMOTE_PORT_RANGE_START CONFIG_LWIP_TCP_REMOTE_PORT_RANGE_START +#define TCP_REMOTE_PORT_RANGE_END CONFIG_LWIP_TCP_REMOTE_PORT_RANGE_END +#define TCP_ENSURE_REMOTE_PORT_RANGE(port) ENSURE_PORT_RANGE(port, TCP_REMOTE_PORT_RANGE_START, TCP_REMOTE_PORT_RANGE_END) +#if CONFIG_LWIP_TCP_REMOTE_PORT_RANGE_END == 0xffff + #define IS_REMOTE_TCP_PORT(port) (port>=TCP_REMOTE_PORT_RANGE_START) +#else + #define IS_REMOTE_TCP_PORT(port) (port>=TCP_REMOTE_PORT_RANGE_START && (port<=CONFIG_LWIP_TCP_REMOTE_PORT_RANGE_END)) +#endif +#endif + +#ifdef CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_START +#define UDP_LOCAL_PORT_RANGE_START CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_START +#define UDP_LOCAL_PORT_RANGE_END CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_END +#define UDP_ENSURE_LOCAL_PORT_RANGE(port) ENSURE_PORT_RANGE(port, UDP_LOCAL_PORT_RANGE_START, UDP_LOCAL_PORT_RANGE_END) + +#if CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_END == 0xffff + #define IS_LOCAL_UDP_PORT(port) (port>=UDP_LOCAL_PORT_RANGE_START) +#else + #define IS_LOCAL_UDP_PORT(port) (port>=UDP_LOCAL_PORT_RANGE_START && (port<=CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_END)) +#endif +#define DNS_PORT_ALLOWED(port) IS_LOCAL_UDP_PORT(port) +#endif + +#ifdef CONFIG_LWIP_UDP_REMOTE_PORT_RANGE_START +#define UDP_REMOTE_PORT_RANGE_START CONFIG_LWIP_UDP_REMOTE_PORT_RANGE_START +#define UDP_REMOTE_PORT_RANGE_END CONFIG_LWIP_UDP_REMOTE_PORT_RANGE_END +#define UDP_ENSURE_REMOTE_PORT_RANGE(port) ENSURE_PORT_RANGE(port, UDP_REMOTE_PORT_RANGE_START, UDP_REMOTE_PORT_RANGE_END) + +#if CONFIG_LWIP_UDP_REMOTE_PORT_RANGE_END == 0xffff + #define IS_REMOTE_UDP_PORT(port) (port>=UDP_REMOTE_PORT_RANGE_START) +#else + #define IS_REMOTE_UDP_PORT(port) (port>=UDP_REMOTE_PORT_RANGE_START && (port<=CONFIG_LWIP_UDP_REMOTE_PORT_RANGE_END)) +#endif +#endif + +#endif +#endif /* __ESP_HOSTED_LWIP_SOURCE_PORT_BINDING_HOOK_H__ */ diff --git a/common/log/esp_hosted_log.h b/common/log/esp_hosted_log.h index 6ddc6cda..2c012710 100644 --- a/common/log/esp_hosted_log.h +++ b/common/log/esp_hosted_log.h @@ -18,17 +18,20 @@ #define __ESP_HOSTED_LOG_H #include "esp_log.h" -#define ESP_PRIV_HEXDUMP(tag1, tag2, buff, len, curr_level) \ +#define ESP_PRIV_HEXDUMP(tag1, tag2, buff, buf_len, display_len, curr_level) \ if ( LOG_LOCAL_LEVEL >= curr_level) { \ - ESP_LOG_LEVEL_LOCAL(curr_level, tag1, "%s: len[%d]", tag2, (int)len); \ - ESP_LOG_BUFFER_HEXDUMP(tag2, buff, len, curr_level); \ + int len_to_print = 0; \ + len_to_print = display_lenbase.descriptor == &wifi_scan_time__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } +void wifi_scan_channel_bitmap__init + (WifiScanChannelBitmap *message) +{ + static const WifiScanChannelBitmap init_value = WIFI_SCAN_CHANNEL_BITMAP__INIT; + *message = init_value; +} +size_t wifi_scan_channel_bitmap__get_packed_size + (const WifiScanChannelBitmap *message) +{ + assert(message->base.descriptor == &wifi_scan_channel_bitmap__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t wifi_scan_channel_bitmap__pack + (const WifiScanChannelBitmap *message, + uint8_t *out) +{ + assert(message->base.descriptor == &wifi_scan_channel_bitmap__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t wifi_scan_channel_bitmap__pack_to_buffer + (const WifiScanChannelBitmap *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &wifi_scan_channel_bitmap__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +WifiScanChannelBitmap * + wifi_scan_channel_bitmap__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (WifiScanChannelBitmap *) + protobuf_c_message_unpack (&wifi_scan_channel_bitmap__descriptor, + allocator, len, data); +} +void wifi_scan_channel_bitmap__free_unpacked + (WifiScanChannelBitmap *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &wifi_scan_channel_bitmap__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} void wifi_scan_config__init (WifiScanConfig *message) { @@ -412,6 +457,51 @@ void wifi_pmf_config__free_unpacked assert(message->base.descriptor == &wifi_pmf_config__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } +void wifi_bss_max_idle_config__init + (WifiBssMaxIdleConfig *message) +{ + static const WifiBssMaxIdleConfig init_value = WIFI_BSS_MAX_IDLE_CONFIG__INIT; + *message = init_value; +} +size_t wifi_bss_max_idle_config__get_packed_size + (const WifiBssMaxIdleConfig *message) +{ + assert(message->base.descriptor == &wifi_bss_max_idle_config__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t wifi_bss_max_idle_config__pack + (const WifiBssMaxIdleConfig *message, + uint8_t *out) +{ + assert(message->base.descriptor == &wifi_bss_max_idle_config__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t wifi_bss_max_idle_config__pack_to_buffer + (const WifiBssMaxIdleConfig *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &wifi_bss_max_idle_config__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +WifiBssMaxIdleConfig * + wifi_bss_max_idle_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (WifiBssMaxIdleConfig *) + protobuf_c_message_unpack (&wifi_bss_max_idle_config__descriptor, + allocator, len, data); +} +void wifi_bss_max_idle_config__free_unpacked + (WifiBssMaxIdleConfig *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &wifi_bss_max_idle_config__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} void wifi_ap_config__init (WifiApConfig *message) { @@ -1897,6 +1987,96 @@ void wifi_bandwidths__free_unpacked assert(message->base.descriptor == &wifi_bandwidths__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } +void wifi_itwt_setup_config__init + (WifiItwtSetupConfig *message) +{ + static const WifiItwtSetupConfig init_value = WIFI_ITWT_SETUP_CONFIG__INIT; + *message = init_value; +} +size_t wifi_itwt_setup_config__get_packed_size + (const WifiItwtSetupConfig *message) +{ + assert(message->base.descriptor == &wifi_itwt_setup_config__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t wifi_itwt_setup_config__pack + (const WifiItwtSetupConfig *message, + uint8_t *out) +{ + assert(message->base.descriptor == &wifi_itwt_setup_config__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t wifi_itwt_setup_config__pack_to_buffer + (const WifiItwtSetupConfig *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &wifi_itwt_setup_config__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +WifiItwtSetupConfig * + wifi_itwt_setup_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (WifiItwtSetupConfig *) + protobuf_c_message_unpack (&wifi_itwt_setup_config__descriptor, + allocator, len, data); +} +void wifi_itwt_setup_config__free_unpacked + (WifiItwtSetupConfig *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &wifi_itwt_setup_config__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void wifi_twt_config__init + (WifiTwtConfig *message) +{ + static const WifiTwtConfig init_value = WIFI_TWT_CONFIG__INIT; + *message = init_value; +} +size_t wifi_twt_config__get_packed_size + (const WifiTwtConfig *message) +{ + assert(message->base.descriptor == &wifi_twt_config__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t wifi_twt_config__pack + (const WifiTwtConfig *message, + uint8_t *out) +{ + assert(message->base.descriptor == &wifi_twt_config__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t wifi_twt_config__pack_to_buffer + (const WifiTwtConfig *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &wifi_twt_config__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +WifiTwtConfig * + wifi_twt_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (WifiTwtConfig *) + protobuf_c_message_unpack (&wifi_twt_config__descriptor, + allocator, len, data); +} +void wifi_twt_config__free_unpacked + (WifiTwtConfig *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &wifi_twt_config__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} void connected_stalist__init (ConnectedSTAList *message) { @@ -1942,6 +2122,51 @@ void connected_stalist__free_unpacked assert(message->base.descriptor == &connected_stalist__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } +void eap_fast_config__init + (EapFastConfig *message) +{ + static const EapFastConfig init_value = EAP_FAST_CONFIG__INIT; + *message = init_value; +} +size_t eap_fast_config__get_packed_size + (const EapFastConfig *message) +{ + assert(message->base.descriptor == &eap_fast_config__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t eap_fast_config__pack + (const EapFastConfig *message, + uint8_t *out) +{ + assert(message->base.descriptor == &eap_fast_config__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t eap_fast_config__pack_to_buffer + (const EapFastConfig *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &eap_fast_config__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +EapFastConfig * + eap_fast_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (EapFastConfig *) + protobuf_c_message_unpack (&eap_fast_config__descriptor, + allocator, len, data); +} +void eap_fast_config__free_unpacked + (EapFastConfig *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &eap_fast_config__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} void rpc__req__get_mac_address__init (RpcReqGetMacAddress *message) { @@ -2752,6 +2977,96 @@ void rpc__resp__otaend__free_unpacked assert(message->base.descriptor == &rpc__resp__otaend__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } +void rpc__req__otaactivate__init + (RpcReqOTAActivate *message) +{ + static const RpcReqOTAActivate init_value = RPC__REQ__OTAACTIVATE__INIT; + *message = init_value; +} +size_t rpc__req__otaactivate__get_packed_size + (const RpcReqOTAActivate *message) +{ + assert(message->base.descriptor == &rpc__req__otaactivate__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__otaactivate__pack + (const RpcReqOTAActivate *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__otaactivate__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__otaactivate__pack_to_buffer + (const RpcReqOTAActivate *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__otaactivate__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqOTAActivate * + rpc__req__otaactivate__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqOTAActivate *) + protobuf_c_message_unpack (&rpc__req__otaactivate__descriptor, + allocator, len, data); +} +void rpc__req__otaactivate__free_unpacked + (RpcReqOTAActivate *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__otaactivate__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__otaactivate__init + (RpcRespOTAActivate *message) +{ + static const RpcRespOTAActivate init_value = RPC__RESP__OTAACTIVATE__INIT; + *message = init_value; +} +size_t rpc__resp__otaactivate__get_packed_size + (const RpcRespOTAActivate *message) +{ + assert(message->base.descriptor == &rpc__resp__otaactivate__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__otaactivate__pack + (const RpcRespOTAActivate *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__otaactivate__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__otaactivate__pack_to_buffer + (const RpcRespOTAActivate *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__otaactivate__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespOTAActivate * + rpc__resp__otaactivate__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespOTAActivate *) + protobuf_c_message_unpack (&rpc__resp__otaactivate__descriptor, + allocator, len, data); +} +void rpc__resp__otaactivate__free_unpacked + (RpcRespOTAActivate *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__otaactivate__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} void rpc__req__wifi_set_max_tx_power__init (RpcReqWifiSetMaxTxPower *message) { @@ -6802,1190 +7117,13030 @@ void rpc__resp__wifi_get_band_mode__free_unpacked assert(message->base.descriptor == &rpc__resp__wifi_get_band_mode__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -void rpc__req__get_coprocessor_fw_version__init - (RpcReqGetCoprocessorFwVersion *message) +void rpc__req__wifi_set_inactive_time__init + (RpcReqWifiSetInactiveTime *message) { - static const RpcReqGetCoprocessorFwVersion init_value = RPC__REQ__GET_COPROCESSOR_FW_VERSION__INIT; + static const RpcReqWifiSetInactiveTime init_value = RPC__REQ__WIFI_SET_INACTIVE_TIME__INIT; *message = init_value; } -size_t rpc__req__get_coprocessor_fw_version__get_packed_size - (const RpcReqGetCoprocessorFwVersion *message) +size_t rpc__req__wifi_set_inactive_time__get_packed_size + (const RpcReqWifiSetInactiveTime *message) { - assert(message->base.descriptor == &rpc__req__get_coprocessor_fw_version__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_set_inactive_time__descriptor); return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); } -size_t rpc__req__get_coprocessor_fw_version__pack - (const RpcReqGetCoprocessorFwVersion *message, +size_t rpc__req__wifi_set_inactive_time__pack + (const RpcReqWifiSetInactiveTime *message, uint8_t *out) { - assert(message->base.descriptor == &rpc__req__get_coprocessor_fw_version__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_set_inactive_time__descriptor); return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); } -size_t rpc__req__get_coprocessor_fw_version__pack_to_buffer - (const RpcReqGetCoprocessorFwVersion *message, +size_t rpc__req__wifi_set_inactive_time__pack_to_buffer + (const RpcReqWifiSetInactiveTime *message, ProtobufCBuffer *buffer) { - assert(message->base.descriptor == &rpc__req__get_coprocessor_fw_version__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_set_inactive_time__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } -RpcReqGetCoprocessorFwVersion * - rpc__req__get_coprocessor_fw_version__unpack +RpcReqWifiSetInactiveTime * + rpc__req__wifi_set_inactive_time__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { - return (RpcReqGetCoprocessorFwVersion *) - protobuf_c_message_unpack (&rpc__req__get_coprocessor_fw_version__descriptor, + return (RpcReqWifiSetInactiveTime *) + protobuf_c_message_unpack (&rpc__req__wifi_set_inactive_time__descriptor, allocator, len, data); } -void rpc__req__get_coprocessor_fw_version__free_unpacked - (RpcReqGetCoprocessorFwVersion *message, +void rpc__req__wifi_set_inactive_time__free_unpacked + (RpcReqWifiSetInactiveTime *message, ProtobufCAllocator *allocator) { if(!message) return; - assert(message->base.descriptor == &rpc__req__get_coprocessor_fw_version__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_set_inactive_time__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -void rpc__resp__get_coprocessor_fw_version__init - (RpcRespGetCoprocessorFwVersion *message) +void rpc__resp__wifi_set_inactive_time__init + (RpcRespWifiSetInactiveTime *message) { - static const RpcRespGetCoprocessorFwVersion init_value = RPC__RESP__GET_COPROCESSOR_FW_VERSION__INIT; + static const RpcRespWifiSetInactiveTime init_value = RPC__RESP__WIFI_SET_INACTIVE_TIME__INIT; *message = init_value; } -size_t rpc__resp__get_coprocessor_fw_version__get_packed_size - (const RpcRespGetCoprocessorFwVersion *message) +size_t rpc__resp__wifi_set_inactive_time__get_packed_size + (const RpcRespWifiSetInactiveTime *message) { - assert(message->base.descriptor == &rpc__resp__get_coprocessor_fw_version__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_set_inactive_time__descriptor); return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); } -size_t rpc__resp__get_coprocessor_fw_version__pack - (const RpcRespGetCoprocessorFwVersion *message, +size_t rpc__resp__wifi_set_inactive_time__pack + (const RpcRespWifiSetInactiveTime *message, uint8_t *out) { - assert(message->base.descriptor == &rpc__resp__get_coprocessor_fw_version__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_set_inactive_time__descriptor); return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); } -size_t rpc__resp__get_coprocessor_fw_version__pack_to_buffer - (const RpcRespGetCoprocessorFwVersion *message, +size_t rpc__resp__wifi_set_inactive_time__pack_to_buffer + (const RpcRespWifiSetInactiveTime *message, ProtobufCBuffer *buffer) { - assert(message->base.descriptor == &rpc__resp__get_coprocessor_fw_version__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_set_inactive_time__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } -RpcRespGetCoprocessorFwVersion * - rpc__resp__get_coprocessor_fw_version__unpack +RpcRespWifiSetInactiveTime * + rpc__resp__wifi_set_inactive_time__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { - return (RpcRespGetCoprocessorFwVersion *) - protobuf_c_message_unpack (&rpc__resp__get_coprocessor_fw_version__descriptor, + return (RpcRespWifiSetInactiveTime *) + protobuf_c_message_unpack (&rpc__resp__wifi_set_inactive_time__descriptor, allocator, len, data); } -void rpc__resp__get_coprocessor_fw_version__free_unpacked - (RpcRespGetCoprocessorFwVersion *message, +void rpc__resp__wifi_set_inactive_time__free_unpacked + (RpcRespWifiSetInactiveTime *message, ProtobufCAllocator *allocator) { if(!message) return; - assert(message->base.descriptor == &rpc__resp__get_coprocessor_fw_version__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_set_inactive_time__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -void rpc__event__wifi_event_no_args__init - (RpcEventWifiEventNoArgs *message) +void rpc__req__wifi_get_inactive_time__init + (RpcReqWifiGetInactiveTime *message) { - static const RpcEventWifiEventNoArgs init_value = RPC__EVENT__WIFI_EVENT_NO_ARGS__INIT; + static const RpcReqWifiGetInactiveTime init_value = RPC__REQ__WIFI_GET_INACTIVE_TIME__INIT; *message = init_value; } -size_t rpc__event__wifi_event_no_args__get_packed_size - (const RpcEventWifiEventNoArgs *message) +size_t rpc__req__wifi_get_inactive_time__get_packed_size + (const RpcReqWifiGetInactiveTime *message) { - assert(message->base.descriptor == &rpc__event__wifi_event_no_args__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_get_inactive_time__descriptor); return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); } -size_t rpc__event__wifi_event_no_args__pack - (const RpcEventWifiEventNoArgs *message, +size_t rpc__req__wifi_get_inactive_time__pack + (const RpcReqWifiGetInactiveTime *message, uint8_t *out) { - assert(message->base.descriptor == &rpc__event__wifi_event_no_args__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_get_inactive_time__descriptor); return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); } -size_t rpc__event__wifi_event_no_args__pack_to_buffer - (const RpcEventWifiEventNoArgs *message, +size_t rpc__req__wifi_get_inactive_time__pack_to_buffer + (const RpcReqWifiGetInactiveTime *message, ProtobufCBuffer *buffer) { - assert(message->base.descriptor == &rpc__event__wifi_event_no_args__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_get_inactive_time__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } -RpcEventWifiEventNoArgs * - rpc__event__wifi_event_no_args__unpack +RpcReqWifiGetInactiveTime * + rpc__req__wifi_get_inactive_time__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { - return (RpcEventWifiEventNoArgs *) - protobuf_c_message_unpack (&rpc__event__wifi_event_no_args__descriptor, + return (RpcReqWifiGetInactiveTime *) + protobuf_c_message_unpack (&rpc__req__wifi_get_inactive_time__descriptor, allocator, len, data); } -void rpc__event__wifi_event_no_args__free_unpacked - (RpcEventWifiEventNoArgs *message, +void rpc__req__wifi_get_inactive_time__free_unpacked + (RpcReqWifiGetInactiveTime *message, ProtobufCAllocator *allocator) { if(!message) return; - assert(message->base.descriptor == &rpc__event__wifi_event_no_args__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_get_inactive_time__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -void rpc__event__espinit__init - (RpcEventESPInit *message) +void rpc__resp__wifi_get_inactive_time__init + (RpcRespWifiGetInactiveTime *message) { - static const RpcEventESPInit init_value = RPC__EVENT__ESPINIT__INIT; + static const RpcRespWifiGetInactiveTime init_value = RPC__RESP__WIFI_GET_INACTIVE_TIME__INIT; *message = init_value; } -size_t rpc__event__espinit__get_packed_size - (const RpcEventESPInit *message) +size_t rpc__resp__wifi_get_inactive_time__get_packed_size + (const RpcRespWifiGetInactiveTime *message) { - assert(message->base.descriptor == &rpc__event__espinit__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_get_inactive_time__descriptor); return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); } -size_t rpc__event__espinit__pack - (const RpcEventESPInit *message, +size_t rpc__resp__wifi_get_inactive_time__pack + (const RpcRespWifiGetInactiveTime *message, uint8_t *out) { - assert(message->base.descriptor == &rpc__event__espinit__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_get_inactive_time__descriptor); return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); } -size_t rpc__event__espinit__pack_to_buffer - (const RpcEventESPInit *message, +size_t rpc__resp__wifi_get_inactive_time__pack_to_buffer + (const RpcRespWifiGetInactiveTime *message, ProtobufCBuffer *buffer) { - assert(message->base.descriptor == &rpc__event__espinit__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_get_inactive_time__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } -RpcEventESPInit * - rpc__event__espinit__unpack +RpcRespWifiGetInactiveTime * + rpc__resp__wifi_get_inactive_time__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { - return (RpcEventESPInit *) - protobuf_c_message_unpack (&rpc__event__espinit__descriptor, + return (RpcRespWifiGetInactiveTime *) + protobuf_c_message_unpack (&rpc__resp__wifi_get_inactive_time__descriptor, allocator, len, data); } -void rpc__event__espinit__free_unpacked - (RpcEventESPInit *message, +void rpc__resp__wifi_get_inactive_time__free_unpacked + (RpcRespWifiGetInactiveTime *message, ProtobufCAllocator *allocator) { if(!message) return; - assert(message->base.descriptor == &rpc__event__espinit__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_get_inactive_time__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -void rpc__event__heartbeat__init - (RpcEventHeartbeat *message) +void rpc__req__wifi_sta_itwt_setup__init + (RpcReqWifiStaItwtSetup *message) { - static const RpcEventHeartbeat init_value = RPC__EVENT__HEARTBEAT__INIT; + static const RpcReqWifiStaItwtSetup init_value = RPC__REQ__WIFI_STA_ITWT_SETUP__INIT; *message = init_value; } -size_t rpc__event__heartbeat__get_packed_size - (const RpcEventHeartbeat *message) +size_t rpc__req__wifi_sta_itwt_setup__get_packed_size + (const RpcReqWifiStaItwtSetup *message) { - assert(message->base.descriptor == &rpc__event__heartbeat__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_setup__descriptor); return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); } -size_t rpc__event__heartbeat__pack - (const RpcEventHeartbeat *message, +size_t rpc__req__wifi_sta_itwt_setup__pack + (const RpcReqWifiStaItwtSetup *message, uint8_t *out) { - assert(message->base.descriptor == &rpc__event__heartbeat__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_setup__descriptor); return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); } -size_t rpc__event__heartbeat__pack_to_buffer - (const RpcEventHeartbeat *message, +size_t rpc__req__wifi_sta_itwt_setup__pack_to_buffer + (const RpcReqWifiStaItwtSetup *message, ProtobufCBuffer *buffer) { - assert(message->base.descriptor == &rpc__event__heartbeat__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_setup__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } -RpcEventHeartbeat * - rpc__event__heartbeat__unpack +RpcReqWifiStaItwtSetup * + rpc__req__wifi_sta_itwt_setup__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { - return (RpcEventHeartbeat *) - protobuf_c_message_unpack (&rpc__event__heartbeat__descriptor, + return (RpcReqWifiStaItwtSetup *) + protobuf_c_message_unpack (&rpc__req__wifi_sta_itwt_setup__descriptor, allocator, len, data); } -void rpc__event__heartbeat__free_unpacked - (RpcEventHeartbeat *message, +void rpc__req__wifi_sta_itwt_setup__free_unpacked + (RpcReqWifiStaItwtSetup *message, ProtobufCAllocator *allocator) { if(!message) return; - assert(message->base.descriptor == &rpc__event__heartbeat__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_setup__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -void rpc__event__ap__sta_disconnected__init - (RpcEventAPStaDisconnected *message) +void rpc__resp__wifi_sta_itwt_setup__init + (RpcRespWifiStaItwtSetup *message) { - static const RpcEventAPStaDisconnected init_value = RPC__EVENT__AP__STA_DISCONNECTED__INIT; + static const RpcRespWifiStaItwtSetup init_value = RPC__RESP__WIFI_STA_ITWT_SETUP__INIT; *message = init_value; } -size_t rpc__event__ap__sta_disconnected__get_packed_size - (const RpcEventAPStaDisconnected *message) +size_t rpc__resp__wifi_sta_itwt_setup__get_packed_size + (const RpcRespWifiStaItwtSetup *message) { - assert(message->base.descriptor == &rpc__event__ap__sta_disconnected__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_setup__descriptor); return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); } -size_t rpc__event__ap__sta_disconnected__pack - (const RpcEventAPStaDisconnected *message, +size_t rpc__resp__wifi_sta_itwt_setup__pack + (const RpcRespWifiStaItwtSetup *message, uint8_t *out) { - assert(message->base.descriptor == &rpc__event__ap__sta_disconnected__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_setup__descriptor); return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); } -size_t rpc__event__ap__sta_disconnected__pack_to_buffer - (const RpcEventAPStaDisconnected *message, +size_t rpc__resp__wifi_sta_itwt_setup__pack_to_buffer + (const RpcRespWifiStaItwtSetup *message, ProtobufCBuffer *buffer) { - assert(message->base.descriptor == &rpc__event__ap__sta_disconnected__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_setup__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } -RpcEventAPStaDisconnected * - rpc__event__ap__sta_disconnected__unpack +RpcRespWifiStaItwtSetup * + rpc__resp__wifi_sta_itwt_setup__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { - return (RpcEventAPStaDisconnected *) - protobuf_c_message_unpack (&rpc__event__ap__sta_disconnected__descriptor, + return (RpcRespWifiStaItwtSetup *) + protobuf_c_message_unpack (&rpc__resp__wifi_sta_itwt_setup__descriptor, allocator, len, data); } -void rpc__event__ap__sta_disconnected__free_unpacked - (RpcEventAPStaDisconnected *message, +void rpc__resp__wifi_sta_itwt_setup__free_unpacked + (RpcRespWifiStaItwtSetup *message, ProtobufCAllocator *allocator) { if(!message) return; - assert(message->base.descriptor == &rpc__event__ap__sta_disconnected__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_setup__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -void rpc__event__ap__sta_connected__init - (RpcEventAPStaConnected *message) +void rpc__req__wifi_sta_itwt_teardown__init + (RpcReqWifiStaItwtTeardown *message) { - static const RpcEventAPStaConnected init_value = RPC__EVENT__AP__STA_CONNECTED__INIT; + static const RpcReqWifiStaItwtTeardown init_value = RPC__REQ__WIFI_STA_ITWT_TEARDOWN__INIT; *message = init_value; } -size_t rpc__event__ap__sta_connected__get_packed_size - (const RpcEventAPStaConnected *message) +size_t rpc__req__wifi_sta_itwt_teardown__get_packed_size + (const RpcReqWifiStaItwtTeardown *message) { - assert(message->base.descriptor == &rpc__event__ap__sta_connected__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_teardown__descriptor); return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); } -size_t rpc__event__ap__sta_connected__pack - (const RpcEventAPStaConnected *message, +size_t rpc__req__wifi_sta_itwt_teardown__pack + (const RpcReqWifiStaItwtTeardown *message, uint8_t *out) { - assert(message->base.descriptor == &rpc__event__ap__sta_connected__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_teardown__descriptor); return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); } -size_t rpc__event__ap__sta_connected__pack_to_buffer - (const RpcEventAPStaConnected *message, +size_t rpc__req__wifi_sta_itwt_teardown__pack_to_buffer + (const RpcReqWifiStaItwtTeardown *message, ProtobufCBuffer *buffer) { - assert(message->base.descriptor == &rpc__event__ap__sta_connected__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_teardown__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } -RpcEventAPStaConnected * - rpc__event__ap__sta_connected__unpack +RpcReqWifiStaItwtTeardown * + rpc__req__wifi_sta_itwt_teardown__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { - return (RpcEventAPStaConnected *) - protobuf_c_message_unpack (&rpc__event__ap__sta_connected__descriptor, + return (RpcReqWifiStaItwtTeardown *) + protobuf_c_message_unpack (&rpc__req__wifi_sta_itwt_teardown__descriptor, allocator, len, data); } -void rpc__event__ap__sta_connected__free_unpacked - (RpcEventAPStaConnected *message, +void rpc__req__wifi_sta_itwt_teardown__free_unpacked + (RpcReqWifiStaItwtTeardown *message, ProtobufCAllocator *allocator) { if(!message) return; - assert(message->base.descriptor == &rpc__event__ap__sta_connected__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_teardown__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -void rpc__event__sta_scan_done__init - (RpcEventStaScanDone *message) +void rpc__resp__wifi_sta_itwt_teardown__init + (RpcRespWifiStaItwtTeardown *message) { - static const RpcEventStaScanDone init_value = RPC__EVENT__STA_SCAN_DONE__INIT; + static const RpcRespWifiStaItwtTeardown init_value = RPC__RESP__WIFI_STA_ITWT_TEARDOWN__INIT; *message = init_value; } -size_t rpc__event__sta_scan_done__get_packed_size - (const RpcEventStaScanDone *message) +size_t rpc__resp__wifi_sta_itwt_teardown__get_packed_size + (const RpcRespWifiStaItwtTeardown *message) { - assert(message->base.descriptor == &rpc__event__sta_scan_done__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_teardown__descriptor); return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); } -size_t rpc__event__sta_scan_done__pack - (const RpcEventStaScanDone *message, +size_t rpc__resp__wifi_sta_itwt_teardown__pack + (const RpcRespWifiStaItwtTeardown *message, uint8_t *out) { - assert(message->base.descriptor == &rpc__event__sta_scan_done__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_teardown__descriptor); return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); } -size_t rpc__event__sta_scan_done__pack_to_buffer - (const RpcEventStaScanDone *message, +size_t rpc__resp__wifi_sta_itwt_teardown__pack_to_buffer + (const RpcRespWifiStaItwtTeardown *message, ProtobufCBuffer *buffer) { - assert(message->base.descriptor == &rpc__event__sta_scan_done__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_teardown__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } -RpcEventStaScanDone * - rpc__event__sta_scan_done__unpack +RpcRespWifiStaItwtTeardown * + rpc__resp__wifi_sta_itwt_teardown__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { - return (RpcEventStaScanDone *) - protobuf_c_message_unpack (&rpc__event__sta_scan_done__descriptor, + return (RpcRespWifiStaItwtTeardown *) + protobuf_c_message_unpack (&rpc__resp__wifi_sta_itwt_teardown__descriptor, allocator, len, data); } -void rpc__event__sta_scan_done__free_unpacked - (RpcEventStaScanDone *message, +void rpc__resp__wifi_sta_itwt_teardown__free_unpacked + (RpcRespWifiStaItwtTeardown *message, ProtobufCAllocator *allocator) { if(!message) return; - assert(message->base.descriptor == &rpc__event__sta_scan_done__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_teardown__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -void rpc__event__sta_connected__init - (RpcEventStaConnected *message) +void rpc__req__wifi_sta_itwt_suspend__init + (RpcReqWifiStaItwtSuspend *message) { - static const RpcEventStaConnected init_value = RPC__EVENT__STA_CONNECTED__INIT; + static const RpcReqWifiStaItwtSuspend init_value = RPC__REQ__WIFI_STA_ITWT_SUSPEND__INIT; *message = init_value; } -size_t rpc__event__sta_connected__get_packed_size - (const RpcEventStaConnected *message) +size_t rpc__req__wifi_sta_itwt_suspend__get_packed_size + (const RpcReqWifiStaItwtSuspend *message) { - assert(message->base.descriptor == &rpc__event__sta_connected__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_suspend__descriptor); return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); } -size_t rpc__event__sta_connected__pack - (const RpcEventStaConnected *message, +size_t rpc__req__wifi_sta_itwt_suspend__pack + (const RpcReqWifiStaItwtSuspend *message, uint8_t *out) { - assert(message->base.descriptor == &rpc__event__sta_connected__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_suspend__descriptor); return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); } -size_t rpc__event__sta_connected__pack_to_buffer - (const RpcEventStaConnected *message, +size_t rpc__req__wifi_sta_itwt_suspend__pack_to_buffer + (const RpcReqWifiStaItwtSuspend *message, ProtobufCBuffer *buffer) { - assert(message->base.descriptor == &rpc__event__sta_connected__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_suspend__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } -RpcEventStaConnected * - rpc__event__sta_connected__unpack +RpcReqWifiStaItwtSuspend * + rpc__req__wifi_sta_itwt_suspend__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { - return (RpcEventStaConnected *) - protobuf_c_message_unpack (&rpc__event__sta_connected__descriptor, + return (RpcReqWifiStaItwtSuspend *) + protobuf_c_message_unpack (&rpc__req__wifi_sta_itwt_suspend__descriptor, allocator, len, data); } -void rpc__event__sta_connected__free_unpacked - (RpcEventStaConnected *message, +void rpc__req__wifi_sta_itwt_suspend__free_unpacked + (RpcReqWifiStaItwtSuspend *message, ProtobufCAllocator *allocator) { if(!message) return; - assert(message->base.descriptor == &rpc__event__sta_connected__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_suspend__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -void rpc__event__sta_disconnected__init - (RpcEventStaDisconnected *message) +void rpc__resp__wifi_sta_itwt_suspend__init + (RpcRespWifiStaItwtSuspend *message) { - static const RpcEventStaDisconnected init_value = RPC__EVENT__STA_DISCONNECTED__INIT; + static const RpcRespWifiStaItwtSuspend init_value = RPC__RESP__WIFI_STA_ITWT_SUSPEND__INIT; *message = init_value; } -size_t rpc__event__sta_disconnected__get_packed_size - (const RpcEventStaDisconnected *message) +size_t rpc__resp__wifi_sta_itwt_suspend__get_packed_size + (const RpcRespWifiStaItwtSuspend *message) { - assert(message->base.descriptor == &rpc__event__sta_disconnected__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_suspend__descriptor); return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); } -size_t rpc__event__sta_disconnected__pack - (const RpcEventStaDisconnected *message, +size_t rpc__resp__wifi_sta_itwt_suspend__pack + (const RpcRespWifiStaItwtSuspend *message, uint8_t *out) { - assert(message->base.descriptor == &rpc__event__sta_disconnected__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_suspend__descriptor); return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); } -size_t rpc__event__sta_disconnected__pack_to_buffer - (const RpcEventStaDisconnected *message, +size_t rpc__resp__wifi_sta_itwt_suspend__pack_to_buffer + (const RpcRespWifiStaItwtSuspend *message, ProtobufCBuffer *buffer) { - assert(message->base.descriptor == &rpc__event__sta_disconnected__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_suspend__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } -RpcEventStaDisconnected * - rpc__event__sta_disconnected__unpack +RpcRespWifiStaItwtSuspend * + rpc__resp__wifi_sta_itwt_suspend__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { - return (RpcEventStaDisconnected *) - protobuf_c_message_unpack (&rpc__event__sta_disconnected__descriptor, + return (RpcRespWifiStaItwtSuspend *) + protobuf_c_message_unpack (&rpc__resp__wifi_sta_itwt_suspend__descriptor, allocator, len, data); } -void rpc__event__sta_disconnected__free_unpacked - (RpcEventStaDisconnected *message, +void rpc__resp__wifi_sta_itwt_suspend__free_unpacked + (RpcRespWifiStaItwtSuspend *message, ProtobufCAllocator *allocator) { if(!message) return; - assert(message->base.descriptor == &rpc__event__sta_disconnected__descriptor); + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_suspend__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -void rpc__init - (Rpc *message) +void rpc__req__wifi_sta_itwt_get_flow_id_status__init + (RpcReqWifiStaItwtGetFlowIdStatus *message) { - static const Rpc init_value = RPC__INIT; + static const RpcReqWifiStaItwtGetFlowIdStatus init_value = RPC__REQ__WIFI_STA_ITWT_GET_FLOW_ID_STATUS__INIT; *message = init_value; } -size_t rpc__get_packed_size - (const Rpc *message) +size_t rpc__req__wifi_sta_itwt_get_flow_id_status__get_packed_size + (const RpcReqWifiStaItwtGetFlowIdStatus *message) { - assert(message->base.descriptor == &rpc__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_get_flow_id_status__descriptor); return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); } -size_t rpc__pack - (const Rpc *message, +size_t rpc__req__wifi_sta_itwt_get_flow_id_status__pack + (const RpcReqWifiStaItwtGetFlowIdStatus *message, uint8_t *out) { - assert(message->base.descriptor == &rpc__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_get_flow_id_status__descriptor); return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); } -size_t rpc__pack_to_buffer - (const Rpc *message, +size_t rpc__req__wifi_sta_itwt_get_flow_id_status__pack_to_buffer + (const RpcReqWifiStaItwtGetFlowIdStatus *message, ProtobufCBuffer *buffer) { - assert(message->base.descriptor == &rpc__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_get_flow_id_status__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } -Rpc * - rpc__unpack +RpcReqWifiStaItwtGetFlowIdStatus * + rpc__req__wifi_sta_itwt_get_flow_id_status__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { - return (Rpc *) - protobuf_c_message_unpack (&rpc__descriptor, + return (RpcReqWifiStaItwtGetFlowIdStatus *) + protobuf_c_message_unpack (&rpc__req__wifi_sta_itwt_get_flow_id_status__descriptor, allocator, len, data); } -void rpc__free_unpacked - (Rpc *message, +void rpc__req__wifi_sta_itwt_get_flow_id_status__free_unpacked + (RpcReqWifiStaItwtGetFlowIdStatus *message, ProtobufCAllocator *allocator) { if(!message) return; - assert(message->base.descriptor == &rpc__descriptor); + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_get_flow_id_status__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor wifi_init_config__field_descriptors[20] = +void rpc__resp__wifi_sta_itwt_get_flow_id_status__init + (RpcRespWifiStaItwtGetFlowIdStatus *message) { - { - "static_rx_buf_num", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiInitConfig, static_rx_buf_num), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "dynamic_rx_buf_num", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiInitConfig, dynamic_rx_buf_num), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "tx_buf_type", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiInitConfig, tx_buf_type), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "static_tx_buf_num", - 4, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiInitConfig, static_tx_buf_num), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "dynamic_tx_buf_num", - 5, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiInitConfig, dynamic_tx_buf_num), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "cache_tx_buf_num", - 6, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiInitConfig, cache_tx_buf_num), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "csi_enable", - 7, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiInitConfig, csi_enable), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "ampdu_rx_enable", - 8, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiInitConfig, ampdu_rx_enable), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "ampdu_tx_enable", - 9, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiInitConfig, ampdu_tx_enable), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "amsdu_tx_enable", - 10, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiInitConfig, amsdu_tx_enable), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { + static const RpcRespWifiStaItwtGetFlowIdStatus init_value = RPC__RESP__WIFI_STA_ITWT_GET_FLOW_ID_STATUS__INIT; + *message = init_value; +} +size_t rpc__resp__wifi_sta_itwt_get_flow_id_status__get_packed_size + (const RpcRespWifiStaItwtGetFlowIdStatus *message) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_get_flow_id_status__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__wifi_sta_itwt_get_flow_id_status__pack + (const RpcRespWifiStaItwtGetFlowIdStatus *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_get_flow_id_status__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__wifi_sta_itwt_get_flow_id_status__pack_to_buffer + (const RpcRespWifiStaItwtGetFlowIdStatus *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_get_flow_id_status__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespWifiStaItwtGetFlowIdStatus * + rpc__resp__wifi_sta_itwt_get_flow_id_status__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespWifiStaItwtGetFlowIdStatus *) + protobuf_c_message_unpack (&rpc__resp__wifi_sta_itwt_get_flow_id_status__descriptor, + allocator, len, data); +} +void rpc__resp__wifi_sta_itwt_get_flow_id_status__free_unpacked + (RpcRespWifiStaItwtGetFlowIdStatus *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_get_flow_id_status__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__wifi_sta_itwt_send_probe_req__init + (RpcReqWifiStaItwtSendProbeReq *message) +{ + static const RpcReqWifiStaItwtSendProbeReq init_value = RPC__REQ__WIFI_STA_ITWT_SEND_PROBE_REQ__INIT; + *message = init_value; +} +size_t rpc__req__wifi_sta_itwt_send_probe_req__get_packed_size + (const RpcReqWifiStaItwtSendProbeReq *message) +{ + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_send_probe_req__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__wifi_sta_itwt_send_probe_req__pack + (const RpcReqWifiStaItwtSendProbeReq *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_send_probe_req__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__wifi_sta_itwt_send_probe_req__pack_to_buffer + (const RpcReqWifiStaItwtSendProbeReq *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_send_probe_req__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqWifiStaItwtSendProbeReq * + rpc__req__wifi_sta_itwt_send_probe_req__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqWifiStaItwtSendProbeReq *) + protobuf_c_message_unpack (&rpc__req__wifi_sta_itwt_send_probe_req__descriptor, + allocator, len, data); +} +void rpc__req__wifi_sta_itwt_send_probe_req__free_unpacked + (RpcReqWifiStaItwtSendProbeReq *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_send_probe_req__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__wifi_sta_itwt_send_probe_req__init + (RpcRespWifiStaItwtSendProbeReq *message) +{ + static const RpcRespWifiStaItwtSendProbeReq init_value = RPC__RESP__WIFI_STA_ITWT_SEND_PROBE_REQ__INIT; + *message = init_value; +} +size_t rpc__resp__wifi_sta_itwt_send_probe_req__get_packed_size + (const RpcRespWifiStaItwtSendProbeReq *message) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_send_probe_req__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__wifi_sta_itwt_send_probe_req__pack + (const RpcRespWifiStaItwtSendProbeReq *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_send_probe_req__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__wifi_sta_itwt_send_probe_req__pack_to_buffer + (const RpcRespWifiStaItwtSendProbeReq *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_send_probe_req__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespWifiStaItwtSendProbeReq * + rpc__resp__wifi_sta_itwt_send_probe_req__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespWifiStaItwtSendProbeReq *) + protobuf_c_message_unpack (&rpc__resp__wifi_sta_itwt_send_probe_req__descriptor, + allocator, len, data); +} +void rpc__resp__wifi_sta_itwt_send_probe_req__free_unpacked + (RpcRespWifiStaItwtSendProbeReq *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_send_probe_req__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__wifi_sta_itwt_set_target_wake_time_offset__init + (RpcReqWifiStaItwtSetTargetWakeTimeOffset *message) +{ + static const RpcReqWifiStaItwtSetTargetWakeTimeOffset init_value = RPC__REQ__WIFI_STA_ITWT_SET_TARGET_WAKE_TIME_OFFSET__INIT; + *message = init_value; +} +size_t rpc__req__wifi_sta_itwt_set_target_wake_time_offset__get_packed_size + (const RpcReqWifiStaItwtSetTargetWakeTimeOffset *message) +{ + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_set_target_wake_time_offset__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__wifi_sta_itwt_set_target_wake_time_offset__pack + (const RpcReqWifiStaItwtSetTargetWakeTimeOffset *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_set_target_wake_time_offset__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__wifi_sta_itwt_set_target_wake_time_offset__pack_to_buffer + (const RpcReqWifiStaItwtSetTargetWakeTimeOffset *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_set_target_wake_time_offset__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqWifiStaItwtSetTargetWakeTimeOffset * + rpc__req__wifi_sta_itwt_set_target_wake_time_offset__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqWifiStaItwtSetTargetWakeTimeOffset *) + protobuf_c_message_unpack (&rpc__req__wifi_sta_itwt_set_target_wake_time_offset__descriptor, + allocator, len, data); +} +void rpc__req__wifi_sta_itwt_set_target_wake_time_offset__free_unpacked + (RpcReqWifiStaItwtSetTargetWakeTimeOffset *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__wifi_sta_itwt_set_target_wake_time_offset__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__init + (RpcRespWifiStaItwtSetTargetWakeTimeOffset *message) +{ + static const RpcRespWifiStaItwtSetTargetWakeTimeOffset init_value = RPC__RESP__WIFI_STA_ITWT_SET_TARGET_WAKE_TIME_OFFSET__INIT; + *message = init_value; +} +size_t rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__get_packed_size + (const RpcRespWifiStaItwtSetTargetWakeTimeOffset *message) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__pack + (const RpcRespWifiStaItwtSetTargetWakeTimeOffset *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__pack_to_buffer + (const RpcRespWifiStaItwtSetTargetWakeTimeOffset *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespWifiStaItwtSetTargetWakeTimeOffset * + rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespWifiStaItwtSetTargetWakeTimeOffset *) + protobuf_c_message_unpack (&rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__descriptor, + allocator, len, data); +} +void rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__free_unpacked + (RpcRespWifiStaItwtSetTargetWakeTimeOffset *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__wifi_sta_twt_config__init + (RpcReqWifiStaTwtConfig *message) +{ + static const RpcReqWifiStaTwtConfig init_value = RPC__REQ__WIFI_STA_TWT_CONFIG__INIT; + *message = init_value; +} +size_t rpc__req__wifi_sta_twt_config__get_packed_size + (const RpcReqWifiStaTwtConfig *message) +{ + assert(message->base.descriptor == &rpc__req__wifi_sta_twt_config__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__wifi_sta_twt_config__pack + (const RpcReqWifiStaTwtConfig *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__wifi_sta_twt_config__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__wifi_sta_twt_config__pack_to_buffer + (const RpcReqWifiStaTwtConfig *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__wifi_sta_twt_config__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqWifiStaTwtConfig * + rpc__req__wifi_sta_twt_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqWifiStaTwtConfig *) + protobuf_c_message_unpack (&rpc__req__wifi_sta_twt_config__descriptor, + allocator, len, data); +} +void rpc__req__wifi_sta_twt_config__free_unpacked + (RpcReqWifiStaTwtConfig *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__wifi_sta_twt_config__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__wifi_sta_twt_config__init + (RpcRespWifiStaTwtConfig *message) +{ + static const RpcRespWifiStaTwtConfig init_value = RPC__RESP__WIFI_STA_TWT_CONFIG__INIT; + *message = init_value; +} +size_t rpc__resp__wifi_sta_twt_config__get_packed_size + (const RpcRespWifiStaTwtConfig *message) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_twt_config__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__wifi_sta_twt_config__pack + (const RpcRespWifiStaTwtConfig *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_twt_config__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__wifi_sta_twt_config__pack_to_buffer + (const RpcRespWifiStaTwtConfig *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_twt_config__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespWifiStaTwtConfig * + rpc__resp__wifi_sta_twt_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespWifiStaTwtConfig *) + protobuf_c_message_unpack (&rpc__resp__wifi_sta_twt_config__descriptor, + allocator, len, data); +} +void rpc__resp__wifi_sta_twt_config__free_unpacked + (RpcRespWifiStaTwtConfig *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__wifi_sta_twt_config__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__get_coprocessor_fw_version__init + (RpcReqGetCoprocessorFwVersion *message) +{ + static const RpcReqGetCoprocessorFwVersion init_value = RPC__REQ__GET_COPROCESSOR_FW_VERSION__INIT; + *message = init_value; +} +size_t rpc__req__get_coprocessor_fw_version__get_packed_size + (const RpcReqGetCoprocessorFwVersion *message) +{ + assert(message->base.descriptor == &rpc__req__get_coprocessor_fw_version__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__get_coprocessor_fw_version__pack + (const RpcReqGetCoprocessorFwVersion *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__get_coprocessor_fw_version__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__get_coprocessor_fw_version__pack_to_buffer + (const RpcReqGetCoprocessorFwVersion *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__get_coprocessor_fw_version__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqGetCoprocessorFwVersion * + rpc__req__get_coprocessor_fw_version__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqGetCoprocessorFwVersion *) + protobuf_c_message_unpack (&rpc__req__get_coprocessor_fw_version__descriptor, + allocator, len, data); +} +void rpc__req__get_coprocessor_fw_version__free_unpacked + (RpcReqGetCoprocessorFwVersion *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__get_coprocessor_fw_version__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__get_coprocessor_fw_version__init + (RpcRespGetCoprocessorFwVersion *message) +{ + static const RpcRespGetCoprocessorFwVersion init_value = RPC__RESP__GET_COPROCESSOR_FW_VERSION__INIT; + *message = init_value; +} +size_t rpc__resp__get_coprocessor_fw_version__get_packed_size + (const RpcRespGetCoprocessorFwVersion *message) +{ + assert(message->base.descriptor == &rpc__resp__get_coprocessor_fw_version__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__get_coprocessor_fw_version__pack + (const RpcRespGetCoprocessorFwVersion *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__get_coprocessor_fw_version__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__get_coprocessor_fw_version__pack_to_buffer + (const RpcRespGetCoprocessorFwVersion *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__get_coprocessor_fw_version__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespGetCoprocessorFwVersion * + rpc__resp__get_coprocessor_fw_version__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespGetCoprocessorFwVersion *) + protobuf_c_message_unpack (&rpc__resp__get_coprocessor_fw_version__descriptor, + allocator, len, data); +} +void rpc__resp__get_coprocessor_fw_version__free_unpacked + (RpcRespGetCoprocessorFwVersion *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__get_coprocessor_fw_version__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__set_dhcp_dns_status__init + (RpcReqSetDhcpDnsStatus *message) +{ + static const RpcReqSetDhcpDnsStatus init_value = RPC__REQ__SET_DHCP_DNS_STATUS__INIT; + *message = init_value; +} +size_t rpc__req__set_dhcp_dns_status__get_packed_size + (const RpcReqSetDhcpDnsStatus *message) +{ + assert(message->base.descriptor == &rpc__req__set_dhcp_dns_status__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__set_dhcp_dns_status__pack + (const RpcReqSetDhcpDnsStatus *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__set_dhcp_dns_status__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__set_dhcp_dns_status__pack_to_buffer + (const RpcReqSetDhcpDnsStatus *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__set_dhcp_dns_status__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqSetDhcpDnsStatus * + rpc__req__set_dhcp_dns_status__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqSetDhcpDnsStatus *) + protobuf_c_message_unpack (&rpc__req__set_dhcp_dns_status__descriptor, + allocator, len, data); +} +void rpc__req__set_dhcp_dns_status__free_unpacked + (RpcReqSetDhcpDnsStatus *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__set_dhcp_dns_status__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__set_dhcp_dns_status__init + (RpcRespSetDhcpDnsStatus *message) +{ + static const RpcRespSetDhcpDnsStatus init_value = RPC__RESP__SET_DHCP_DNS_STATUS__INIT; + *message = init_value; +} +size_t rpc__resp__set_dhcp_dns_status__get_packed_size + (const RpcRespSetDhcpDnsStatus *message) +{ + assert(message->base.descriptor == &rpc__resp__set_dhcp_dns_status__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__set_dhcp_dns_status__pack + (const RpcRespSetDhcpDnsStatus *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__set_dhcp_dns_status__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__set_dhcp_dns_status__pack_to_buffer + (const RpcRespSetDhcpDnsStatus *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__set_dhcp_dns_status__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespSetDhcpDnsStatus * + rpc__resp__set_dhcp_dns_status__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespSetDhcpDnsStatus *) + protobuf_c_message_unpack (&rpc__resp__set_dhcp_dns_status__descriptor, + allocator, len, data); +} +void rpc__resp__set_dhcp_dns_status__free_unpacked + (RpcRespSetDhcpDnsStatus *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__set_dhcp_dns_status__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__get_dhcp_dns_status__init + (RpcReqGetDhcpDnsStatus *message) +{ + static const RpcReqGetDhcpDnsStatus init_value = RPC__REQ__GET_DHCP_DNS_STATUS__INIT; + *message = init_value; +} +size_t rpc__req__get_dhcp_dns_status__get_packed_size + (const RpcReqGetDhcpDnsStatus *message) +{ + assert(message->base.descriptor == &rpc__req__get_dhcp_dns_status__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__get_dhcp_dns_status__pack + (const RpcReqGetDhcpDnsStatus *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__get_dhcp_dns_status__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__get_dhcp_dns_status__pack_to_buffer + (const RpcReqGetDhcpDnsStatus *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__get_dhcp_dns_status__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqGetDhcpDnsStatus * + rpc__req__get_dhcp_dns_status__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqGetDhcpDnsStatus *) + protobuf_c_message_unpack (&rpc__req__get_dhcp_dns_status__descriptor, + allocator, len, data); +} +void rpc__req__get_dhcp_dns_status__free_unpacked + (RpcReqGetDhcpDnsStatus *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__get_dhcp_dns_status__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__get_dhcp_dns_status__init + (RpcRespGetDhcpDnsStatus *message) +{ + static const RpcRespGetDhcpDnsStatus init_value = RPC__RESP__GET_DHCP_DNS_STATUS__INIT; + *message = init_value; +} +size_t rpc__resp__get_dhcp_dns_status__get_packed_size + (const RpcRespGetDhcpDnsStatus *message) +{ + assert(message->base.descriptor == &rpc__resp__get_dhcp_dns_status__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__get_dhcp_dns_status__pack + (const RpcRespGetDhcpDnsStatus *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__get_dhcp_dns_status__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__get_dhcp_dns_status__pack_to_buffer + (const RpcRespGetDhcpDnsStatus *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__get_dhcp_dns_status__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespGetDhcpDnsStatus * + rpc__resp__get_dhcp_dns_status__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespGetDhcpDnsStatus *) + protobuf_c_message_unpack (&rpc__resp__get_dhcp_dns_status__descriptor, + allocator, len, data); +} +void rpc__resp__get_dhcp_dns_status__free_unpacked + (RpcRespGetDhcpDnsStatus *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__get_dhcp_dns_status__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__supp_dpp_init__init + (RpcReqSuppDppInit *message) +{ + static const RpcReqSuppDppInit init_value = RPC__REQ__SUPP_DPP_INIT__INIT; + *message = init_value; +} +size_t rpc__req__supp_dpp_init__get_packed_size + (const RpcReqSuppDppInit *message) +{ + assert(message->base.descriptor == &rpc__req__supp_dpp_init__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__supp_dpp_init__pack + (const RpcReqSuppDppInit *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__supp_dpp_init__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__supp_dpp_init__pack_to_buffer + (const RpcReqSuppDppInit *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__supp_dpp_init__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqSuppDppInit * + rpc__req__supp_dpp_init__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqSuppDppInit *) + protobuf_c_message_unpack (&rpc__req__supp_dpp_init__descriptor, + allocator, len, data); +} +void rpc__req__supp_dpp_init__free_unpacked + (RpcReqSuppDppInit *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__supp_dpp_init__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__supp_dpp_init__init + (RpcRespSuppDppInit *message) +{ + static const RpcRespSuppDppInit init_value = RPC__RESP__SUPP_DPP_INIT__INIT; + *message = init_value; +} +size_t rpc__resp__supp_dpp_init__get_packed_size + (const RpcRespSuppDppInit *message) +{ + assert(message->base.descriptor == &rpc__resp__supp_dpp_init__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__supp_dpp_init__pack + (const RpcRespSuppDppInit *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__supp_dpp_init__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__supp_dpp_init__pack_to_buffer + (const RpcRespSuppDppInit *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__supp_dpp_init__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespSuppDppInit * + rpc__resp__supp_dpp_init__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespSuppDppInit *) + protobuf_c_message_unpack (&rpc__resp__supp_dpp_init__descriptor, + allocator, len, data); +} +void rpc__resp__supp_dpp_init__free_unpacked + (RpcRespSuppDppInit *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__supp_dpp_init__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__supp_dpp_deinit__init + (RpcReqSuppDppDeinit *message) +{ + static const RpcReqSuppDppDeinit init_value = RPC__REQ__SUPP_DPP_DEINIT__INIT; + *message = init_value; +} +size_t rpc__req__supp_dpp_deinit__get_packed_size + (const RpcReqSuppDppDeinit *message) +{ + assert(message->base.descriptor == &rpc__req__supp_dpp_deinit__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__supp_dpp_deinit__pack + (const RpcReqSuppDppDeinit *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__supp_dpp_deinit__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__supp_dpp_deinit__pack_to_buffer + (const RpcReqSuppDppDeinit *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__supp_dpp_deinit__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqSuppDppDeinit * + rpc__req__supp_dpp_deinit__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqSuppDppDeinit *) + protobuf_c_message_unpack (&rpc__req__supp_dpp_deinit__descriptor, + allocator, len, data); +} +void rpc__req__supp_dpp_deinit__free_unpacked + (RpcReqSuppDppDeinit *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__supp_dpp_deinit__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__supp_dpp_deinit__init + (RpcRespSuppDppDeinit *message) +{ + static const RpcRespSuppDppDeinit init_value = RPC__RESP__SUPP_DPP_DEINIT__INIT; + *message = init_value; +} +size_t rpc__resp__supp_dpp_deinit__get_packed_size + (const RpcRespSuppDppDeinit *message) +{ + assert(message->base.descriptor == &rpc__resp__supp_dpp_deinit__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__supp_dpp_deinit__pack + (const RpcRespSuppDppDeinit *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__supp_dpp_deinit__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__supp_dpp_deinit__pack_to_buffer + (const RpcRespSuppDppDeinit *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__supp_dpp_deinit__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespSuppDppDeinit * + rpc__resp__supp_dpp_deinit__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespSuppDppDeinit *) + protobuf_c_message_unpack (&rpc__resp__supp_dpp_deinit__descriptor, + allocator, len, data); +} +void rpc__resp__supp_dpp_deinit__free_unpacked + (RpcRespSuppDppDeinit *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__supp_dpp_deinit__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__supp_dpp_bootstrap_gen__init + (RpcReqSuppDppBootstrapGen *message) +{ + static const RpcReqSuppDppBootstrapGen init_value = RPC__REQ__SUPP_DPP_BOOTSTRAP_GEN__INIT; + *message = init_value; +} +size_t rpc__req__supp_dpp_bootstrap_gen__get_packed_size + (const RpcReqSuppDppBootstrapGen *message) +{ + assert(message->base.descriptor == &rpc__req__supp_dpp_bootstrap_gen__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__supp_dpp_bootstrap_gen__pack + (const RpcReqSuppDppBootstrapGen *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__supp_dpp_bootstrap_gen__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__supp_dpp_bootstrap_gen__pack_to_buffer + (const RpcReqSuppDppBootstrapGen *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__supp_dpp_bootstrap_gen__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqSuppDppBootstrapGen * + rpc__req__supp_dpp_bootstrap_gen__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqSuppDppBootstrapGen *) + protobuf_c_message_unpack (&rpc__req__supp_dpp_bootstrap_gen__descriptor, + allocator, len, data); +} +void rpc__req__supp_dpp_bootstrap_gen__free_unpacked + (RpcReqSuppDppBootstrapGen *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__supp_dpp_bootstrap_gen__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__supp_dpp_bootstrap_gen__init + (RpcRespSuppDppBootstrapGen *message) +{ + static const RpcRespSuppDppBootstrapGen init_value = RPC__RESP__SUPP_DPP_BOOTSTRAP_GEN__INIT; + *message = init_value; +} +size_t rpc__resp__supp_dpp_bootstrap_gen__get_packed_size + (const RpcRespSuppDppBootstrapGen *message) +{ + assert(message->base.descriptor == &rpc__resp__supp_dpp_bootstrap_gen__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__supp_dpp_bootstrap_gen__pack + (const RpcRespSuppDppBootstrapGen *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__supp_dpp_bootstrap_gen__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__supp_dpp_bootstrap_gen__pack_to_buffer + (const RpcRespSuppDppBootstrapGen *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__supp_dpp_bootstrap_gen__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespSuppDppBootstrapGen * + rpc__resp__supp_dpp_bootstrap_gen__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespSuppDppBootstrapGen *) + protobuf_c_message_unpack (&rpc__resp__supp_dpp_bootstrap_gen__descriptor, + allocator, len, data); +} +void rpc__resp__supp_dpp_bootstrap_gen__free_unpacked + (RpcRespSuppDppBootstrapGen *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__supp_dpp_bootstrap_gen__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__supp_dpp_start_listen__init + (RpcReqSuppDppStartListen *message) +{ + static const RpcReqSuppDppStartListen init_value = RPC__REQ__SUPP_DPP_START_LISTEN__INIT; + *message = init_value; +} +size_t rpc__req__supp_dpp_start_listen__get_packed_size + (const RpcReqSuppDppStartListen *message) +{ + assert(message->base.descriptor == &rpc__req__supp_dpp_start_listen__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__supp_dpp_start_listen__pack + (const RpcReqSuppDppStartListen *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__supp_dpp_start_listen__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__supp_dpp_start_listen__pack_to_buffer + (const RpcReqSuppDppStartListen *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__supp_dpp_start_listen__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqSuppDppStartListen * + rpc__req__supp_dpp_start_listen__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqSuppDppStartListen *) + protobuf_c_message_unpack (&rpc__req__supp_dpp_start_listen__descriptor, + allocator, len, data); +} +void rpc__req__supp_dpp_start_listen__free_unpacked + (RpcReqSuppDppStartListen *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__supp_dpp_start_listen__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__supp_dpp_start_listen__init + (RpcRespSuppDppStartListen *message) +{ + static const RpcRespSuppDppStartListen init_value = RPC__RESP__SUPP_DPP_START_LISTEN__INIT; + *message = init_value; +} +size_t rpc__resp__supp_dpp_start_listen__get_packed_size + (const RpcRespSuppDppStartListen *message) +{ + assert(message->base.descriptor == &rpc__resp__supp_dpp_start_listen__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__supp_dpp_start_listen__pack + (const RpcRespSuppDppStartListen *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__supp_dpp_start_listen__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__supp_dpp_start_listen__pack_to_buffer + (const RpcRespSuppDppStartListen *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__supp_dpp_start_listen__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespSuppDppStartListen * + rpc__resp__supp_dpp_start_listen__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespSuppDppStartListen *) + protobuf_c_message_unpack (&rpc__resp__supp_dpp_start_listen__descriptor, + allocator, len, data); +} +void rpc__resp__supp_dpp_start_listen__free_unpacked + (RpcRespSuppDppStartListen *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__supp_dpp_start_listen__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__supp_dpp_stop_listen__init + (RpcReqSuppDppStopListen *message) +{ + static const RpcReqSuppDppStopListen init_value = RPC__REQ__SUPP_DPP_STOP_LISTEN__INIT; + *message = init_value; +} +size_t rpc__req__supp_dpp_stop_listen__get_packed_size + (const RpcReqSuppDppStopListen *message) +{ + assert(message->base.descriptor == &rpc__req__supp_dpp_stop_listen__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__supp_dpp_stop_listen__pack + (const RpcReqSuppDppStopListen *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__supp_dpp_stop_listen__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__supp_dpp_stop_listen__pack_to_buffer + (const RpcReqSuppDppStopListen *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__supp_dpp_stop_listen__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqSuppDppStopListen * + rpc__req__supp_dpp_stop_listen__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqSuppDppStopListen *) + protobuf_c_message_unpack (&rpc__req__supp_dpp_stop_listen__descriptor, + allocator, len, data); +} +void rpc__req__supp_dpp_stop_listen__free_unpacked + (RpcReqSuppDppStopListen *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__supp_dpp_stop_listen__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__supp_dpp_stop_listen__init + (RpcRespSuppDppStopListen *message) +{ + static const RpcRespSuppDppStopListen init_value = RPC__RESP__SUPP_DPP_STOP_LISTEN__INIT; + *message = init_value; +} +size_t rpc__resp__supp_dpp_stop_listen__get_packed_size + (const RpcRespSuppDppStopListen *message) +{ + assert(message->base.descriptor == &rpc__resp__supp_dpp_stop_listen__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__supp_dpp_stop_listen__pack + (const RpcRespSuppDppStopListen *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__supp_dpp_stop_listen__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__supp_dpp_stop_listen__pack_to_buffer + (const RpcRespSuppDppStopListen *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__supp_dpp_stop_listen__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespSuppDppStopListen * + rpc__resp__supp_dpp_stop_listen__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespSuppDppStopListen *) + protobuf_c_message_unpack (&rpc__resp__supp_dpp_stop_listen__descriptor, + allocator, len, data); +} +void rpc__resp__supp_dpp_stop_listen__free_unpacked + (RpcRespSuppDppStopListen *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__supp_dpp_stop_listen__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__iface_mac_addr_set_get__init + (RpcReqIfaceMacAddrSetGet *message) +{ + static const RpcReqIfaceMacAddrSetGet init_value = RPC__REQ__IFACE_MAC_ADDR_SET_GET__INIT; + *message = init_value; +} +size_t rpc__req__iface_mac_addr_set_get__get_packed_size + (const RpcReqIfaceMacAddrSetGet *message) +{ + assert(message->base.descriptor == &rpc__req__iface_mac_addr_set_get__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__iface_mac_addr_set_get__pack + (const RpcReqIfaceMacAddrSetGet *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__iface_mac_addr_set_get__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__iface_mac_addr_set_get__pack_to_buffer + (const RpcReqIfaceMacAddrSetGet *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__iface_mac_addr_set_get__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqIfaceMacAddrSetGet * + rpc__req__iface_mac_addr_set_get__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqIfaceMacAddrSetGet *) + protobuf_c_message_unpack (&rpc__req__iface_mac_addr_set_get__descriptor, + allocator, len, data); +} +void rpc__req__iface_mac_addr_set_get__free_unpacked + (RpcReqIfaceMacAddrSetGet *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__iface_mac_addr_set_get__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__iface_mac_addr_set_get__init + (RpcRespIfaceMacAddrSetGet *message) +{ + static const RpcRespIfaceMacAddrSetGet init_value = RPC__RESP__IFACE_MAC_ADDR_SET_GET__INIT; + *message = init_value; +} +size_t rpc__resp__iface_mac_addr_set_get__get_packed_size + (const RpcRespIfaceMacAddrSetGet *message) +{ + assert(message->base.descriptor == &rpc__resp__iface_mac_addr_set_get__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__iface_mac_addr_set_get__pack + (const RpcRespIfaceMacAddrSetGet *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__iface_mac_addr_set_get__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__iface_mac_addr_set_get__pack_to_buffer + (const RpcRespIfaceMacAddrSetGet *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__iface_mac_addr_set_get__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespIfaceMacAddrSetGet * + rpc__resp__iface_mac_addr_set_get__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespIfaceMacAddrSetGet *) + protobuf_c_message_unpack (&rpc__resp__iface_mac_addr_set_get__descriptor, + allocator, len, data); +} +void rpc__resp__iface_mac_addr_set_get__free_unpacked + (RpcRespIfaceMacAddrSetGet *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__iface_mac_addr_set_get__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__iface_mac_addr_len_get__init + (RpcReqIfaceMacAddrLenGet *message) +{ + static const RpcReqIfaceMacAddrLenGet init_value = RPC__REQ__IFACE_MAC_ADDR_LEN_GET__INIT; + *message = init_value; +} +size_t rpc__req__iface_mac_addr_len_get__get_packed_size + (const RpcReqIfaceMacAddrLenGet *message) +{ + assert(message->base.descriptor == &rpc__req__iface_mac_addr_len_get__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__iface_mac_addr_len_get__pack + (const RpcReqIfaceMacAddrLenGet *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__iface_mac_addr_len_get__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__iface_mac_addr_len_get__pack_to_buffer + (const RpcReqIfaceMacAddrLenGet *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__iface_mac_addr_len_get__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqIfaceMacAddrLenGet * + rpc__req__iface_mac_addr_len_get__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqIfaceMacAddrLenGet *) + protobuf_c_message_unpack (&rpc__req__iface_mac_addr_len_get__descriptor, + allocator, len, data); +} +void rpc__req__iface_mac_addr_len_get__free_unpacked + (RpcReqIfaceMacAddrLenGet *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__iface_mac_addr_len_get__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__iface_mac_addr_len_get__init + (RpcRespIfaceMacAddrLenGet *message) +{ + static const RpcRespIfaceMacAddrLenGet init_value = RPC__RESP__IFACE_MAC_ADDR_LEN_GET__INIT; + *message = init_value; +} +size_t rpc__resp__iface_mac_addr_len_get__get_packed_size + (const RpcRespIfaceMacAddrLenGet *message) +{ + assert(message->base.descriptor == &rpc__resp__iface_mac_addr_len_get__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__iface_mac_addr_len_get__pack + (const RpcRespIfaceMacAddrLenGet *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__iface_mac_addr_len_get__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__iface_mac_addr_len_get__pack_to_buffer + (const RpcRespIfaceMacAddrLenGet *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__iface_mac_addr_len_get__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespIfaceMacAddrLenGet * + rpc__resp__iface_mac_addr_len_get__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespIfaceMacAddrLenGet *) + protobuf_c_message_unpack (&rpc__resp__iface_mac_addr_len_get__descriptor, + allocator, len, data); +} +void rpc__resp__iface_mac_addr_len_get__free_unpacked + (RpcRespIfaceMacAddrLenGet *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__iface_mac_addr_len_get__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__feature_control__init + (RpcReqFeatureControl *message) +{ + static const RpcReqFeatureControl init_value = RPC__REQ__FEATURE_CONTROL__INIT; + *message = init_value; +} +size_t rpc__req__feature_control__get_packed_size + (const RpcReqFeatureControl *message) +{ + assert(message->base.descriptor == &rpc__req__feature_control__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__feature_control__pack + (const RpcReqFeatureControl *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__feature_control__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__feature_control__pack_to_buffer + (const RpcReqFeatureControl *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__feature_control__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqFeatureControl * + rpc__req__feature_control__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqFeatureControl *) + protobuf_c_message_unpack (&rpc__req__feature_control__descriptor, + allocator, len, data); +} +void rpc__req__feature_control__free_unpacked + (RpcReqFeatureControl *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__feature_control__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__feature_control__init + (RpcRespFeatureControl *message) +{ + static const RpcRespFeatureControl init_value = RPC__RESP__FEATURE_CONTROL__INIT; + *message = init_value; +} +size_t rpc__resp__feature_control__get_packed_size + (const RpcRespFeatureControl *message) +{ + assert(message->base.descriptor == &rpc__resp__feature_control__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__feature_control__pack + (const RpcRespFeatureControl *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__feature_control__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__feature_control__pack_to_buffer + (const RpcRespFeatureControl *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__feature_control__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespFeatureControl * + rpc__resp__feature_control__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespFeatureControl *) + protobuf_c_message_unpack (&rpc__resp__feature_control__descriptor, + allocator, len, data); +} +void rpc__resp__feature_control__free_unpacked + (RpcRespFeatureControl *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__feature_control__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__wifi_event_no_args__init + (RpcEventWifiEventNoArgs *message) +{ + static const RpcEventWifiEventNoArgs init_value = RPC__EVENT__WIFI_EVENT_NO_ARGS__INIT; + *message = init_value; +} +size_t rpc__event__wifi_event_no_args__get_packed_size + (const RpcEventWifiEventNoArgs *message) +{ + assert(message->base.descriptor == &rpc__event__wifi_event_no_args__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__wifi_event_no_args__pack + (const RpcEventWifiEventNoArgs *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__wifi_event_no_args__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__wifi_event_no_args__pack_to_buffer + (const RpcEventWifiEventNoArgs *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__wifi_event_no_args__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventWifiEventNoArgs * + rpc__event__wifi_event_no_args__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventWifiEventNoArgs *) + protobuf_c_message_unpack (&rpc__event__wifi_event_no_args__descriptor, + allocator, len, data); +} +void rpc__event__wifi_event_no_args__free_unpacked + (RpcEventWifiEventNoArgs *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__wifi_event_no_args__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__espinit__init + (RpcEventESPInit *message) +{ + static const RpcEventESPInit init_value = RPC__EVENT__ESPINIT__INIT; + *message = init_value; +} +size_t rpc__event__espinit__get_packed_size + (const RpcEventESPInit *message) +{ + assert(message->base.descriptor == &rpc__event__espinit__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__espinit__pack + (const RpcEventESPInit *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__espinit__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__espinit__pack_to_buffer + (const RpcEventESPInit *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__espinit__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventESPInit * + rpc__event__espinit__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventESPInit *) + protobuf_c_message_unpack (&rpc__event__espinit__descriptor, + allocator, len, data); +} +void rpc__event__espinit__free_unpacked + (RpcEventESPInit *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__espinit__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__heartbeat__init + (RpcEventHeartbeat *message) +{ + static const RpcEventHeartbeat init_value = RPC__EVENT__HEARTBEAT__INIT; + *message = init_value; +} +size_t rpc__event__heartbeat__get_packed_size + (const RpcEventHeartbeat *message) +{ + assert(message->base.descriptor == &rpc__event__heartbeat__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__heartbeat__pack + (const RpcEventHeartbeat *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__heartbeat__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__heartbeat__pack_to_buffer + (const RpcEventHeartbeat *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__heartbeat__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventHeartbeat * + rpc__event__heartbeat__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventHeartbeat *) + protobuf_c_message_unpack (&rpc__event__heartbeat__descriptor, + allocator, len, data); +} +void rpc__event__heartbeat__free_unpacked + (RpcEventHeartbeat *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__heartbeat__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__ap__sta_disconnected__init + (RpcEventAPStaDisconnected *message) +{ + static const RpcEventAPStaDisconnected init_value = RPC__EVENT__AP__STA_DISCONNECTED__INIT; + *message = init_value; +} +size_t rpc__event__ap__sta_disconnected__get_packed_size + (const RpcEventAPStaDisconnected *message) +{ + assert(message->base.descriptor == &rpc__event__ap__sta_disconnected__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__ap__sta_disconnected__pack + (const RpcEventAPStaDisconnected *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__ap__sta_disconnected__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__ap__sta_disconnected__pack_to_buffer + (const RpcEventAPStaDisconnected *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__ap__sta_disconnected__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventAPStaDisconnected * + rpc__event__ap__sta_disconnected__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventAPStaDisconnected *) + protobuf_c_message_unpack (&rpc__event__ap__sta_disconnected__descriptor, + allocator, len, data); +} +void rpc__event__ap__sta_disconnected__free_unpacked + (RpcEventAPStaDisconnected *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__ap__sta_disconnected__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__ap__sta_connected__init + (RpcEventAPStaConnected *message) +{ + static const RpcEventAPStaConnected init_value = RPC__EVENT__AP__STA_CONNECTED__INIT; + *message = init_value; +} +size_t rpc__event__ap__sta_connected__get_packed_size + (const RpcEventAPStaConnected *message) +{ + assert(message->base.descriptor == &rpc__event__ap__sta_connected__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__ap__sta_connected__pack + (const RpcEventAPStaConnected *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__ap__sta_connected__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__ap__sta_connected__pack_to_buffer + (const RpcEventAPStaConnected *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__ap__sta_connected__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventAPStaConnected * + rpc__event__ap__sta_connected__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventAPStaConnected *) + protobuf_c_message_unpack (&rpc__event__ap__sta_connected__descriptor, + allocator, len, data); +} +void rpc__event__ap__sta_connected__free_unpacked + (RpcEventAPStaConnected *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__ap__sta_connected__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__sta_scan_done__init + (RpcEventStaScanDone *message) +{ + static const RpcEventStaScanDone init_value = RPC__EVENT__STA_SCAN_DONE__INIT; + *message = init_value; +} +size_t rpc__event__sta_scan_done__get_packed_size + (const RpcEventStaScanDone *message) +{ + assert(message->base.descriptor == &rpc__event__sta_scan_done__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__sta_scan_done__pack + (const RpcEventStaScanDone *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__sta_scan_done__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__sta_scan_done__pack_to_buffer + (const RpcEventStaScanDone *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__sta_scan_done__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventStaScanDone * + rpc__event__sta_scan_done__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventStaScanDone *) + protobuf_c_message_unpack (&rpc__event__sta_scan_done__descriptor, + allocator, len, data); +} +void rpc__event__sta_scan_done__free_unpacked + (RpcEventStaScanDone *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__sta_scan_done__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__sta_connected__init + (RpcEventStaConnected *message) +{ + static const RpcEventStaConnected init_value = RPC__EVENT__STA_CONNECTED__INIT; + *message = init_value; +} +size_t rpc__event__sta_connected__get_packed_size + (const RpcEventStaConnected *message) +{ + assert(message->base.descriptor == &rpc__event__sta_connected__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__sta_connected__pack + (const RpcEventStaConnected *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__sta_connected__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__sta_connected__pack_to_buffer + (const RpcEventStaConnected *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__sta_connected__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventStaConnected * + rpc__event__sta_connected__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventStaConnected *) + protobuf_c_message_unpack (&rpc__event__sta_connected__descriptor, + allocator, len, data); +} +void rpc__event__sta_connected__free_unpacked + (RpcEventStaConnected *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__sta_connected__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__sta_disconnected__init + (RpcEventStaDisconnected *message) +{ + static const RpcEventStaDisconnected init_value = RPC__EVENT__STA_DISCONNECTED__INIT; + *message = init_value; +} +size_t rpc__event__sta_disconnected__get_packed_size + (const RpcEventStaDisconnected *message) +{ + assert(message->base.descriptor == &rpc__event__sta_disconnected__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__sta_disconnected__pack + (const RpcEventStaDisconnected *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__sta_disconnected__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__sta_disconnected__pack_to_buffer + (const RpcEventStaDisconnected *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__sta_disconnected__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventStaDisconnected * + rpc__event__sta_disconnected__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventStaDisconnected *) + protobuf_c_message_unpack (&rpc__event__sta_disconnected__descriptor, + allocator, len, data); +} +void rpc__event__sta_disconnected__free_unpacked + (RpcEventStaDisconnected *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__sta_disconnected__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__dhcp_dns_status__init + (RpcEventDhcpDnsStatus *message) +{ + static const RpcEventDhcpDnsStatus init_value = RPC__EVENT__DHCP_DNS_STATUS__INIT; + *message = init_value; +} +size_t rpc__event__dhcp_dns_status__get_packed_size + (const RpcEventDhcpDnsStatus *message) +{ + assert(message->base.descriptor == &rpc__event__dhcp_dns_status__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__dhcp_dns_status__pack + (const RpcEventDhcpDnsStatus *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__dhcp_dns_status__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__dhcp_dns_status__pack_to_buffer + (const RpcEventDhcpDnsStatus *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__dhcp_dns_status__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventDhcpDnsStatus * + rpc__event__dhcp_dns_status__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventDhcpDnsStatus *) + protobuf_c_message_unpack (&rpc__event__dhcp_dns_status__descriptor, + allocator, len, data); +} +void rpc__event__dhcp_dns_status__free_unpacked + (RpcEventDhcpDnsStatus *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__dhcp_dns_status__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__sta_itwt_setup__init + (RpcEventStaItwtSetup *message) +{ + static const RpcEventStaItwtSetup init_value = RPC__EVENT__STA_ITWT_SETUP__INIT; + *message = init_value; +} +size_t rpc__event__sta_itwt_setup__get_packed_size + (const RpcEventStaItwtSetup *message) +{ + assert(message->base.descriptor == &rpc__event__sta_itwt_setup__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__sta_itwt_setup__pack + (const RpcEventStaItwtSetup *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__sta_itwt_setup__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__sta_itwt_setup__pack_to_buffer + (const RpcEventStaItwtSetup *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__sta_itwt_setup__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventStaItwtSetup * + rpc__event__sta_itwt_setup__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventStaItwtSetup *) + protobuf_c_message_unpack (&rpc__event__sta_itwt_setup__descriptor, + allocator, len, data); +} +void rpc__event__sta_itwt_setup__free_unpacked + (RpcEventStaItwtSetup *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__sta_itwt_setup__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__sta_itwt_teardown__init + (RpcEventStaItwtTeardown *message) +{ + static const RpcEventStaItwtTeardown init_value = RPC__EVENT__STA_ITWT_TEARDOWN__INIT; + *message = init_value; +} +size_t rpc__event__sta_itwt_teardown__get_packed_size + (const RpcEventStaItwtTeardown *message) +{ + assert(message->base.descriptor == &rpc__event__sta_itwt_teardown__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__sta_itwt_teardown__pack + (const RpcEventStaItwtTeardown *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__sta_itwt_teardown__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__sta_itwt_teardown__pack_to_buffer + (const RpcEventStaItwtTeardown *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__sta_itwt_teardown__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventStaItwtTeardown * + rpc__event__sta_itwt_teardown__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventStaItwtTeardown *) + protobuf_c_message_unpack (&rpc__event__sta_itwt_teardown__descriptor, + allocator, len, data); +} +void rpc__event__sta_itwt_teardown__free_unpacked + (RpcEventStaItwtTeardown *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__sta_itwt_teardown__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__sta_itwt_suspend__init + (RpcEventStaItwtSuspend *message) +{ + static const RpcEventStaItwtSuspend init_value = RPC__EVENT__STA_ITWT_SUSPEND__INIT; + *message = init_value; +} +size_t rpc__event__sta_itwt_suspend__get_packed_size + (const RpcEventStaItwtSuspend *message) +{ + assert(message->base.descriptor == &rpc__event__sta_itwt_suspend__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__sta_itwt_suspend__pack + (const RpcEventStaItwtSuspend *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__sta_itwt_suspend__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__sta_itwt_suspend__pack_to_buffer + (const RpcEventStaItwtSuspend *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__sta_itwt_suspend__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventStaItwtSuspend * + rpc__event__sta_itwt_suspend__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventStaItwtSuspend *) + protobuf_c_message_unpack (&rpc__event__sta_itwt_suspend__descriptor, + allocator, len, data); +} +void rpc__event__sta_itwt_suspend__free_unpacked + (RpcEventStaItwtSuspend *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__sta_itwt_suspend__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__sta_itwt_probe__init + (RpcEventStaItwtProbe *message) +{ + static const RpcEventStaItwtProbe init_value = RPC__EVENT__STA_ITWT_PROBE__INIT; + *message = init_value; +} +size_t rpc__event__sta_itwt_probe__get_packed_size + (const RpcEventStaItwtProbe *message) +{ + assert(message->base.descriptor == &rpc__event__sta_itwt_probe__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__sta_itwt_probe__pack + (const RpcEventStaItwtProbe *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__sta_itwt_probe__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__sta_itwt_probe__pack_to_buffer + (const RpcEventStaItwtProbe *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__sta_itwt_probe__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventStaItwtProbe * + rpc__event__sta_itwt_probe__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventStaItwtProbe *) + protobuf_c_message_unpack (&rpc__event__sta_itwt_probe__descriptor, + allocator, len, data); +} +void rpc__event__sta_itwt_probe__free_unpacked + (RpcEventStaItwtProbe *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__sta_itwt_probe__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__wifi_sta_enterprise_enable__init + (RpcReqWifiStaEnterpriseEnable *message) +{ + static const RpcReqWifiStaEnterpriseEnable init_value = RPC__REQ__WIFI_STA_ENTERPRISE_ENABLE__INIT; + *message = init_value; +} +size_t rpc__req__wifi_sta_enterprise_enable__get_packed_size + (const RpcReqWifiStaEnterpriseEnable *message) +{ + assert(message->base.descriptor == &rpc__req__wifi_sta_enterprise_enable__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__wifi_sta_enterprise_enable__pack + (const RpcReqWifiStaEnterpriseEnable *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__wifi_sta_enterprise_enable__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__wifi_sta_enterprise_enable__pack_to_buffer + (const RpcReqWifiStaEnterpriseEnable *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__wifi_sta_enterprise_enable__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqWifiStaEnterpriseEnable * + rpc__req__wifi_sta_enterprise_enable__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqWifiStaEnterpriseEnable *) + protobuf_c_message_unpack (&rpc__req__wifi_sta_enterprise_enable__descriptor, + allocator, len, data); +} +void rpc__req__wifi_sta_enterprise_enable__free_unpacked + (RpcReqWifiStaEnterpriseEnable *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__wifi_sta_enterprise_enable__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__wifi_sta_enterprise_enable__init + (RpcRespWifiStaEnterpriseEnable *message) +{ + static const RpcRespWifiStaEnterpriseEnable init_value = RPC__RESP__WIFI_STA_ENTERPRISE_ENABLE__INIT; + *message = init_value; +} +size_t rpc__resp__wifi_sta_enterprise_enable__get_packed_size + (const RpcRespWifiStaEnterpriseEnable *message) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_enterprise_enable__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__wifi_sta_enterprise_enable__pack + (const RpcRespWifiStaEnterpriseEnable *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_enterprise_enable__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__wifi_sta_enterprise_enable__pack_to_buffer + (const RpcRespWifiStaEnterpriseEnable *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_enterprise_enable__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespWifiStaEnterpriseEnable * + rpc__resp__wifi_sta_enterprise_enable__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespWifiStaEnterpriseEnable *) + protobuf_c_message_unpack (&rpc__resp__wifi_sta_enterprise_enable__descriptor, + allocator, len, data); +} +void rpc__resp__wifi_sta_enterprise_enable__free_unpacked + (RpcRespWifiStaEnterpriseEnable *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__wifi_sta_enterprise_enable__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__wifi_sta_enterprise_disable__init + (RpcReqWifiStaEnterpriseDisable *message) +{ + static const RpcReqWifiStaEnterpriseDisable init_value = RPC__REQ__WIFI_STA_ENTERPRISE_DISABLE__INIT; + *message = init_value; +} +size_t rpc__req__wifi_sta_enterprise_disable__get_packed_size + (const RpcReqWifiStaEnterpriseDisable *message) +{ + assert(message->base.descriptor == &rpc__req__wifi_sta_enterprise_disable__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__wifi_sta_enterprise_disable__pack + (const RpcReqWifiStaEnterpriseDisable *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__wifi_sta_enterprise_disable__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__wifi_sta_enterprise_disable__pack_to_buffer + (const RpcReqWifiStaEnterpriseDisable *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__wifi_sta_enterprise_disable__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqWifiStaEnterpriseDisable * + rpc__req__wifi_sta_enterprise_disable__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqWifiStaEnterpriseDisable *) + protobuf_c_message_unpack (&rpc__req__wifi_sta_enterprise_disable__descriptor, + allocator, len, data); +} +void rpc__req__wifi_sta_enterprise_disable__free_unpacked + (RpcReqWifiStaEnterpriseDisable *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__wifi_sta_enterprise_disable__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__wifi_sta_enterprise_disable__init + (RpcRespWifiStaEnterpriseDisable *message) +{ + static const RpcRespWifiStaEnterpriseDisable init_value = RPC__RESP__WIFI_STA_ENTERPRISE_DISABLE__INIT; + *message = init_value; +} +size_t rpc__resp__wifi_sta_enterprise_disable__get_packed_size + (const RpcRespWifiStaEnterpriseDisable *message) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_enterprise_disable__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__wifi_sta_enterprise_disable__pack + (const RpcRespWifiStaEnterpriseDisable *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_enterprise_disable__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__wifi_sta_enterprise_disable__pack_to_buffer + (const RpcRespWifiStaEnterpriseDisable *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__wifi_sta_enterprise_disable__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespWifiStaEnterpriseDisable * + rpc__resp__wifi_sta_enterprise_disable__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespWifiStaEnterpriseDisable *) + protobuf_c_message_unpack (&rpc__resp__wifi_sta_enterprise_disable__descriptor, + allocator, len, data); +} +void rpc__resp__wifi_sta_enterprise_disable__free_unpacked + (RpcRespWifiStaEnterpriseDisable *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__wifi_sta_enterprise_disable__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_set_identity__init + (RpcReqEapSetIdentity *message) +{ + static const RpcReqEapSetIdentity init_value = RPC__REQ__EAP_SET_IDENTITY__INIT; + *message = init_value; +} +size_t rpc__req__eap_set_identity__get_packed_size + (const RpcReqEapSetIdentity *message) +{ + assert(message->base.descriptor == &rpc__req__eap_set_identity__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_set_identity__pack + (const RpcReqEapSetIdentity *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_set_identity__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_set_identity__pack_to_buffer + (const RpcReqEapSetIdentity *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_set_identity__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapSetIdentity * + rpc__req__eap_set_identity__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapSetIdentity *) + protobuf_c_message_unpack (&rpc__req__eap_set_identity__descriptor, + allocator, len, data); +} +void rpc__req__eap_set_identity__free_unpacked + (RpcReqEapSetIdentity *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_set_identity__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_set_identity__init + (RpcRespEapSetIdentity *message) +{ + static const RpcRespEapSetIdentity init_value = RPC__RESP__EAP_SET_IDENTITY__INIT; + *message = init_value; +} +size_t rpc__resp__eap_set_identity__get_packed_size + (const RpcRespEapSetIdentity *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_identity__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_set_identity__pack + (const RpcRespEapSetIdentity *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_identity__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_set_identity__pack_to_buffer + (const RpcRespEapSetIdentity *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_identity__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapSetIdentity * + rpc__resp__eap_set_identity__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapSetIdentity *) + protobuf_c_message_unpack (&rpc__resp__eap_set_identity__descriptor, + allocator, len, data); +} +void rpc__resp__eap_set_identity__free_unpacked + (RpcRespEapSetIdentity *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_set_identity__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_clear_identity__init + (RpcReqEapClearIdentity *message) +{ + static const RpcReqEapClearIdentity init_value = RPC__REQ__EAP_CLEAR_IDENTITY__INIT; + *message = init_value; +} +size_t rpc__req__eap_clear_identity__get_packed_size + (const RpcReqEapClearIdentity *message) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_identity__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_clear_identity__pack + (const RpcReqEapClearIdentity *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_identity__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_clear_identity__pack_to_buffer + (const RpcReqEapClearIdentity *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_identity__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapClearIdentity * + rpc__req__eap_clear_identity__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapClearIdentity *) + protobuf_c_message_unpack (&rpc__req__eap_clear_identity__descriptor, + allocator, len, data); +} +void rpc__req__eap_clear_identity__free_unpacked + (RpcReqEapClearIdentity *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_clear_identity__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_clear_identity__init + (RpcRespEapClearIdentity *message) +{ + static const RpcRespEapClearIdentity init_value = RPC__RESP__EAP_CLEAR_IDENTITY__INIT; + *message = init_value; +} +size_t rpc__resp__eap_clear_identity__get_packed_size + (const RpcRespEapClearIdentity *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_identity__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_clear_identity__pack + (const RpcRespEapClearIdentity *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_identity__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_clear_identity__pack_to_buffer + (const RpcRespEapClearIdentity *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_identity__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapClearIdentity * + rpc__resp__eap_clear_identity__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapClearIdentity *) + protobuf_c_message_unpack (&rpc__resp__eap_clear_identity__descriptor, + allocator, len, data); +} +void rpc__resp__eap_clear_identity__free_unpacked + (RpcRespEapClearIdentity *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_clear_identity__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_set_username__init + (RpcReqEapSetUsername *message) +{ + static const RpcReqEapSetUsername init_value = RPC__REQ__EAP_SET_USERNAME__INIT; + *message = init_value; +} +size_t rpc__req__eap_set_username__get_packed_size + (const RpcReqEapSetUsername *message) +{ + assert(message->base.descriptor == &rpc__req__eap_set_username__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_set_username__pack + (const RpcReqEapSetUsername *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_set_username__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_set_username__pack_to_buffer + (const RpcReqEapSetUsername *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_set_username__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapSetUsername * + rpc__req__eap_set_username__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapSetUsername *) + protobuf_c_message_unpack (&rpc__req__eap_set_username__descriptor, + allocator, len, data); +} +void rpc__req__eap_set_username__free_unpacked + (RpcReqEapSetUsername *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_set_username__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_set_username__init + (RpcRespEapSetUsername *message) +{ + static const RpcRespEapSetUsername init_value = RPC__RESP__EAP_SET_USERNAME__INIT; + *message = init_value; +} +size_t rpc__resp__eap_set_username__get_packed_size + (const RpcRespEapSetUsername *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_username__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_set_username__pack + (const RpcRespEapSetUsername *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_username__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_set_username__pack_to_buffer + (const RpcRespEapSetUsername *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_username__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapSetUsername * + rpc__resp__eap_set_username__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapSetUsername *) + protobuf_c_message_unpack (&rpc__resp__eap_set_username__descriptor, + allocator, len, data); +} +void rpc__resp__eap_set_username__free_unpacked + (RpcRespEapSetUsername *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_set_username__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_clear_username__init + (RpcReqEapClearUsername *message) +{ + static const RpcReqEapClearUsername init_value = RPC__REQ__EAP_CLEAR_USERNAME__INIT; + *message = init_value; +} +size_t rpc__req__eap_clear_username__get_packed_size + (const RpcReqEapClearUsername *message) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_username__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_clear_username__pack + (const RpcReqEapClearUsername *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_username__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_clear_username__pack_to_buffer + (const RpcReqEapClearUsername *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_username__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapClearUsername * + rpc__req__eap_clear_username__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapClearUsername *) + protobuf_c_message_unpack (&rpc__req__eap_clear_username__descriptor, + allocator, len, data); +} +void rpc__req__eap_clear_username__free_unpacked + (RpcReqEapClearUsername *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_clear_username__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_clear_username__init + (RpcRespEapClearUsername *message) +{ + static const RpcRespEapClearUsername init_value = RPC__RESP__EAP_CLEAR_USERNAME__INIT; + *message = init_value; +} +size_t rpc__resp__eap_clear_username__get_packed_size + (const RpcRespEapClearUsername *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_username__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_clear_username__pack + (const RpcRespEapClearUsername *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_username__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_clear_username__pack_to_buffer + (const RpcRespEapClearUsername *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_username__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapClearUsername * + rpc__resp__eap_clear_username__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapClearUsername *) + protobuf_c_message_unpack (&rpc__resp__eap_clear_username__descriptor, + allocator, len, data); +} +void rpc__resp__eap_clear_username__free_unpacked + (RpcRespEapClearUsername *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_clear_username__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_set_password__init + (RpcReqEapSetPassword *message) +{ + static const RpcReqEapSetPassword init_value = RPC__REQ__EAP_SET_PASSWORD__INIT; + *message = init_value; +} +size_t rpc__req__eap_set_password__get_packed_size + (const RpcReqEapSetPassword *message) +{ + assert(message->base.descriptor == &rpc__req__eap_set_password__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_set_password__pack + (const RpcReqEapSetPassword *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_set_password__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_set_password__pack_to_buffer + (const RpcReqEapSetPassword *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_set_password__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapSetPassword * + rpc__req__eap_set_password__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapSetPassword *) + protobuf_c_message_unpack (&rpc__req__eap_set_password__descriptor, + allocator, len, data); +} +void rpc__req__eap_set_password__free_unpacked + (RpcReqEapSetPassword *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_set_password__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_set_password__init + (RpcRespEapSetPassword *message) +{ + static const RpcRespEapSetPassword init_value = RPC__RESP__EAP_SET_PASSWORD__INIT; + *message = init_value; +} +size_t rpc__resp__eap_set_password__get_packed_size + (const RpcRespEapSetPassword *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_password__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_set_password__pack + (const RpcRespEapSetPassword *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_password__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_set_password__pack_to_buffer + (const RpcRespEapSetPassword *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_password__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapSetPassword * + rpc__resp__eap_set_password__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapSetPassword *) + protobuf_c_message_unpack (&rpc__resp__eap_set_password__descriptor, + allocator, len, data); +} +void rpc__resp__eap_set_password__free_unpacked + (RpcRespEapSetPassword *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_set_password__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_clear_password__init + (RpcReqEapClearPassword *message) +{ + static const RpcReqEapClearPassword init_value = RPC__REQ__EAP_CLEAR_PASSWORD__INIT; + *message = init_value; +} +size_t rpc__req__eap_clear_password__get_packed_size + (const RpcReqEapClearPassword *message) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_password__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_clear_password__pack + (const RpcReqEapClearPassword *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_password__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_clear_password__pack_to_buffer + (const RpcReqEapClearPassword *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_password__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapClearPassword * + rpc__req__eap_clear_password__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapClearPassword *) + protobuf_c_message_unpack (&rpc__req__eap_clear_password__descriptor, + allocator, len, data); +} +void rpc__req__eap_clear_password__free_unpacked + (RpcReqEapClearPassword *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_clear_password__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_clear_password__init + (RpcRespEapClearPassword *message) +{ + static const RpcRespEapClearPassword init_value = RPC__RESP__EAP_CLEAR_PASSWORD__INIT; + *message = init_value; +} +size_t rpc__resp__eap_clear_password__get_packed_size + (const RpcRespEapClearPassword *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_password__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_clear_password__pack + (const RpcRespEapClearPassword *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_password__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_clear_password__pack_to_buffer + (const RpcRespEapClearPassword *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_password__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapClearPassword * + rpc__resp__eap_clear_password__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapClearPassword *) + protobuf_c_message_unpack (&rpc__resp__eap_clear_password__descriptor, + allocator, len, data); +} +void rpc__resp__eap_clear_password__free_unpacked + (RpcRespEapClearPassword *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_clear_password__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_set_new_password__init + (RpcReqEapSetNewPassword *message) +{ + static const RpcReqEapSetNewPassword init_value = RPC__REQ__EAP_SET_NEW_PASSWORD__INIT; + *message = init_value; +} +size_t rpc__req__eap_set_new_password__get_packed_size + (const RpcReqEapSetNewPassword *message) +{ + assert(message->base.descriptor == &rpc__req__eap_set_new_password__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_set_new_password__pack + (const RpcReqEapSetNewPassword *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_set_new_password__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_set_new_password__pack_to_buffer + (const RpcReqEapSetNewPassword *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_set_new_password__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapSetNewPassword * + rpc__req__eap_set_new_password__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapSetNewPassword *) + protobuf_c_message_unpack (&rpc__req__eap_set_new_password__descriptor, + allocator, len, data); +} +void rpc__req__eap_set_new_password__free_unpacked + (RpcReqEapSetNewPassword *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_set_new_password__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_set_new_password__init + (RpcRespEapSetNewPassword *message) +{ + static const RpcRespEapSetNewPassword init_value = RPC__RESP__EAP_SET_NEW_PASSWORD__INIT; + *message = init_value; +} +size_t rpc__resp__eap_set_new_password__get_packed_size + (const RpcRespEapSetNewPassword *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_new_password__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_set_new_password__pack + (const RpcRespEapSetNewPassword *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_new_password__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_set_new_password__pack_to_buffer + (const RpcRespEapSetNewPassword *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_new_password__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapSetNewPassword * + rpc__resp__eap_set_new_password__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapSetNewPassword *) + protobuf_c_message_unpack (&rpc__resp__eap_set_new_password__descriptor, + allocator, len, data); +} +void rpc__resp__eap_set_new_password__free_unpacked + (RpcRespEapSetNewPassword *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_set_new_password__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_clear_new_password__init + (RpcReqEapClearNewPassword *message) +{ + static const RpcReqEapClearNewPassword init_value = RPC__REQ__EAP_CLEAR_NEW_PASSWORD__INIT; + *message = init_value; +} +size_t rpc__req__eap_clear_new_password__get_packed_size + (const RpcReqEapClearNewPassword *message) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_new_password__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_clear_new_password__pack + (const RpcReqEapClearNewPassword *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_new_password__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_clear_new_password__pack_to_buffer + (const RpcReqEapClearNewPassword *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_new_password__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapClearNewPassword * + rpc__req__eap_clear_new_password__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapClearNewPassword *) + protobuf_c_message_unpack (&rpc__req__eap_clear_new_password__descriptor, + allocator, len, data); +} +void rpc__req__eap_clear_new_password__free_unpacked + (RpcReqEapClearNewPassword *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_clear_new_password__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_clear_new_password__init + (RpcRespEapClearNewPassword *message) +{ + static const RpcRespEapClearNewPassword init_value = RPC__RESP__EAP_CLEAR_NEW_PASSWORD__INIT; + *message = init_value; +} +size_t rpc__resp__eap_clear_new_password__get_packed_size + (const RpcRespEapClearNewPassword *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_new_password__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_clear_new_password__pack + (const RpcRespEapClearNewPassword *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_new_password__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_clear_new_password__pack_to_buffer + (const RpcRespEapClearNewPassword *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_new_password__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapClearNewPassword * + rpc__resp__eap_clear_new_password__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapClearNewPassword *) + protobuf_c_message_unpack (&rpc__resp__eap_clear_new_password__descriptor, + allocator, len, data); +} +void rpc__resp__eap_clear_new_password__free_unpacked + (RpcRespEapClearNewPassword *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_clear_new_password__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_set_ca_cert__init + (RpcReqEapSetCaCert *message) +{ + static const RpcReqEapSetCaCert init_value = RPC__REQ__EAP_SET_CA_CERT__INIT; + *message = init_value; +} +size_t rpc__req__eap_set_ca_cert__get_packed_size + (const RpcReqEapSetCaCert *message) +{ + assert(message->base.descriptor == &rpc__req__eap_set_ca_cert__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_set_ca_cert__pack + (const RpcReqEapSetCaCert *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_set_ca_cert__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_set_ca_cert__pack_to_buffer + (const RpcReqEapSetCaCert *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_set_ca_cert__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapSetCaCert * + rpc__req__eap_set_ca_cert__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapSetCaCert *) + protobuf_c_message_unpack (&rpc__req__eap_set_ca_cert__descriptor, + allocator, len, data); +} +void rpc__req__eap_set_ca_cert__free_unpacked + (RpcReqEapSetCaCert *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_set_ca_cert__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_set_ca_cert__init + (RpcRespEapSetCaCert *message) +{ + static const RpcRespEapSetCaCert init_value = RPC__RESP__EAP_SET_CA_CERT__INIT; + *message = init_value; +} +size_t rpc__resp__eap_set_ca_cert__get_packed_size + (const RpcRespEapSetCaCert *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_ca_cert__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_set_ca_cert__pack + (const RpcRespEapSetCaCert *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_ca_cert__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_set_ca_cert__pack_to_buffer + (const RpcRespEapSetCaCert *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_ca_cert__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapSetCaCert * + rpc__resp__eap_set_ca_cert__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapSetCaCert *) + protobuf_c_message_unpack (&rpc__resp__eap_set_ca_cert__descriptor, + allocator, len, data); +} +void rpc__resp__eap_set_ca_cert__free_unpacked + (RpcRespEapSetCaCert *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_set_ca_cert__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_clear_ca_cert__init + (RpcReqEapClearCaCert *message) +{ + static const RpcReqEapClearCaCert init_value = RPC__REQ__EAP_CLEAR_CA_CERT__INIT; + *message = init_value; +} +size_t rpc__req__eap_clear_ca_cert__get_packed_size + (const RpcReqEapClearCaCert *message) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_ca_cert__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_clear_ca_cert__pack + (const RpcReqEapClearCaCert *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_ca_cert__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_clear_ca_cert__pack_to_buffer + (const RpcReqEapClearCaCert *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_ca_cert__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapClearCaCert * + rpc__req__eap_clear_ca_cert__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapClearCaCert *) + protobuf_c_message_unpack (&rpc__req__eap_clear_ca_cert__descriptor, + allocator, len, data); +} +void rpc__req__eap_clear_ca_cert__free_unpacked + (RpcReqEapClearCaCert *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_clear_ca_cert__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_clear_ca_cert__init + (RpcRespEapClearCaCert *message) +{ + static const RpcRespEapClearCaCert init_value = RPC__RESP__EAP_CLEAR_CA_CERT__INIT; + *message = init_value; +} +size_t rpc__resp__eap_clear_ca_cert__get_packed_size + (const RpcRespEapClearCaCert *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_ca_cert__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_clear_ca_cert__pack + (const RpcRespEapClearCaCert *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_ca_cert__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_clear_ca_cert__pack_to_buffer + (const RpcRespEapClearCaCert *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_ca_cert__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapClearCaCert * + rpc__resp__eap_clear_ca_cert__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapClearCaCert *) + protobuf_c_message_unpack (&rpc__resp__eap_clear_ca_cert__descriptor, + allocator, len, data); +} +void rpc__resp__eap_clear_ca_cert__free_unpacked + (RpcRespEapClearCaCert *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_clear_ca_cert__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_set_certificate_and_key__init + (RpcReqEapSetCertificateAndKey *message) +{ + static const RpcReqEapSetCertificateAndKey init_value = RPC__REQ__EAP_SET_CERTIFICATE_AND_KEY__INIT; + *message = init_value; +} +size_t rpc__req__eap_set_certificate_and_key__get_packed_size + (const RpcReqEapSetCertificateAndKey *message) +{ + assert(message->base.descriptor == &rpc__req__eap_set_certificate_and_key__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_set_certificate_and_key__pack + (const RpcReqEapSetCertificateAndKey *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_set_certificate_and_key__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_set_certificate_and_key__pack_to_buffer + (const RpcReqEapSetCertificateAndKey *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_set_certificate_and_key__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapSetCertificateAndKey * + rpc__req__eap_set_certificate_and_key__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapSetCertificateAndKey *) + protobuf_c_message_unpack (&rpc__req__eap_set_certificate_and_key__descriptor, + allocator, len, data); +} +void rpc__req__eap_set_certificate_and_key__free_unpacked + (RpcReqEapSetCertificateAndKey *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_set_certificate_and_key__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_set_certificate_and_key__init + (RpcRespEapSetCertificateAndKey *message) +{ + static const RpcRespEapSetCertificateAndKey init_value = RPC__RESP__EAP_SET_CERTIFICATE_AND_KEY__INIT; + *message = init_value; +} +size_t rpc__resp__eap_set_certificate_and_key__get_packed_size + (const RpcRespEapSetCertificateAndKey *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_certificate_and_key__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_set_certificate_and_key__pack + (const RpcRespEapSetCertificateAndKey *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_certificate_and_key__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_set_certificate_and_key__pack_to_buffer + (const RpcRespEapSetCertificateAndKey *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_certificate_and_key__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapSetCertificateAndKey * + rpc__resp__eap_set_certificate_and_key__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapSetCertificateAndKey *) + protobuf_c_message_unpack (&rpc__resp__eap_set_certificate_and_key__descriptor, + allocator, len, data); +} +void rpc__resp__eap_set_certificate_and_key__free_unpacked + (RpcRespEapSetCertificateAndKey *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_set_certificate_and_key__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_clear_certificate_and_key__init + (RpcReqEapClearCertificateAndKey *message) +{ + static const RpcReqEapClearCertificateAndKey init_value = RPC__REQ__EAP_CLEAR_CERTIFICATE_AND_KEY__INIT; + *message = init_value; +} +size_t rpc__req__eap_clear_certificate_and_key__get_packed_size + (const RpcReqEapClearCertificateAndKey *message) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_certificate_and_key__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_clear_certificate_and_key__pack + (const RpcReqEapClearCertificateAndKey *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_certificate_and_key__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_clear_certificate_and_key__pack_to_buffer + (const RpcReqEapClearCertificateAndKey *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_clear_certificate_and_key__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapClearCertificateAndKey * + rpc__req__eap_clear_certificate_and_key__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapClearCertificateAndKey *) + protobuf_c_message_unpack (&rpc__req__eap_clear_certificate_and_key__descriptor, + allocator, len, data); +} +void rpc__req__eap_clear_certificate_and_key__free_unpacked + (RpcReqEapClearCertificateAndKey *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_clear_certificate_and_key__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_clear_certificate_and_key__init + (RpcRespEapClearCertificateAndKey *message) +{ + static const RpcRespEapClearCertificateAndKey init_value = RPC__RESP__EAP_CLEAR_CERTIFICATE_AND_KEY__INIT; + *message = init_value; +} +size_t rpc__resp__eap_clear_certificate_and_key__get_packed_size + (const RpcRespEapClearCertificateAndKey *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_certificate_and_key__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_clear_certificate_and_key__pack + (const RpcRespEapClearCertificateAndKey *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_certificate_and_key__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_clear_certificate_and_key__pack_to_buffer + (const RpcRespEapClearCertificateAndKey *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_clear_certificate_and_key__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapClearCertificateAndKey * + rpc__resp__eap_clear_certificate_and_key__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapClearCertificateAndKey *) + protobuf_c_message_unpack (&rpc__resp__eap_clear_certificate_and_key__descriptor, + allocator, len, data); +} +void rpc__resp__eap_clear_certificate_and_key__free_unpacked + (RpcRespEapClearCertificateAndKey *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_clear_certificate_and_key__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_set_disable_time_check__init + (RpcReqEapSetDisableTimeCheck *message) +{ + static const RpcReqEapSetDisableTimeCheck init_value = RPC__REQ__EAP_SET_DISABLE_TIME_CHECK__INIT; + *message = init_value; +} +size_t rpc__req__eap_set_disable_time_check__get_packed_size + (const RpcReqEapSetDisableTimeCheck *message) +{ + assert(message->base.descriptor == &rpc__req__eap_set_disable_time_check__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_set_disable_time_check__pack + (const RpcReqEapSetDisableTimeCheck *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_set_disable_time_check__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_set_disable_time_check__pack_to_buffer + (const RpcReqEapSetDisableTimeCheck *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_set_disable_time_check__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapSetDisableTimeCheck * + rpc__req__eap_set_disable_time_check__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapSetDisableTimeCheck *) + protobuf_c_message_unpack (&rpc__req__eap_set_disable_time_check__descriptor, + allocator, len, data); +} +void rpc__req__eap_set_disable_time_check__free_unpacked + (RpcReqEapSetDisableTimeCheck *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_set_disable_time_check__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_set_disable_time_check__init + (RpcRespEapSetDisableTimeCheck *message) +{ + static const RpcRespEapSetDisableTimeCheck init_value = RPC__RESP__EAP_SET_DISABLE_TIME_CHECK__INIT; + *message = init_value; +} +size_t rpc__resp__eap_set_disable_time_check__get_packed_size + (const RpcRespEapSetDisableTimeCheck *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_disable_time_check__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_set_disable_time_check__pack + (const RpcRespEapSetDisableTimeCheck *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_disable_time_check__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_set_disable_time_check__pack_to_buffer + (const RpcRespEapSetDisableTimeCheck *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_disable_time_check__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapSetDisableTimeCheck * + rpc__resp__eap_set_disable_time_check__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapSetDisableTimeCheck *) + protobuf_c_message_unpack (&rpc__resp__eap_set_disable_time_check__descriptor, + allocator, len, data); +} +void rpc__resp__eap_set_disable_time_check__free_unpacked + (RpcRespEapSetDisableTimeCheck *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_set_disable_time_check__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_get_disable_time_check__init + (RpcReqEapGetDisableTimeCheck *message) +{ + static const RpcReqEapGetDisableTimeCheck init_value = RPC__REQ__EAP_GET_DISABLE_TIME_CHECK__INIT; + *message = init_value; +} +size_t rpc__req__eap_get_disable_time_check__get_packed_size + (const RpcReqEapGetDisableTimeCheck *message) +{ + assert(message->base.descriptor == &rpc__req__eap_get_disable_time_check__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_get_disable_time_check__pack + (const RpcReqEapGetDisableTimeCheck *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_get_disable_time_check__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_get_disable_time_check__pack_to_buffer + (const RpcReqEapGetDisableTimeCheck *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_get_disable_time_check__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapGetDisableTimeCheck * + rpc__req__eap_get_disable_time_check__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapGetDisableTimeCheck *) + protobuf_c_message_unpack (&rpc__req__eap_get_disable_time_check__descriptor, + allocator, len, data); +} +void rpc__req__eap_get_disable_time_check__free_unpacked + (RpcReqEapGetDisableTimeCheck *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_get_disable_time_check__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_get_disable_time_check__init + (RpcRespEapGetDisableTimeCheck *message) +{ + static const RpcRespEapGetDisableTimeCheck init_value = RPC__RESP__EAP_GET_DISABLE_TIME_CHECK__INIT; + *message = init_value; +} +size_t rpc__resp__eap_get_disable_time_check__get_packed_size + (const RpcRespEapGetDisableTimeCheck *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_get_disable_time_check__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_get_disable_time_check__pack + (const RpcRespEapGetDisableTimeCheck *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_get_disable_time_check__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_get_disable_time_check__pack_to_buffer + (const RpcRespEapGetDisableTimeCheck *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_get_disable_time_check__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapGetDisableTimeCheck * + rpc__resp__eap_get_disable_time_check__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapGetDisableTimeCheck *) + protobuf_c_message_unpack (&rpc__resp__eap_get_disable_time_check__descriptor, + allocator, len, data); +} +void rpc__resp__eap_get_disable_time_check__free_unpacked + (RpcRespEapGetDisableTimeCheck *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_get_disable_time_check__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_set_ttls_phase2_method__init + (RpcReqEapSetTtlsPhase2Method *message) +{ + static const RpcReqEapSetTtlsPhase2Method init_value = RPC__REQ__EAP_SET_TTLS_PHASE2_METHOD__INIT; + *message = init_value; +} +size_t rpc__req__eap_set_ttls_phase2_method__get_packed_size + (const RpcReqEapSetTtlsPhase2Method *message) +{ + assert(message->base.descriptor == &rpc__req__eap_set_ttls_phase2_method__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_set_ttls_phase2_method__pack + (const RpcReqEapSetTtlsPhase2Method *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_set_ttls_phase2_method__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_set_ttls_phase2_method__pack_to_buffer + (const RpcReqEapSetTtlsPhase2Method *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_set_ttls_phase2_method__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapSetTtlsPhase2Method * + rpc__req__eap_set_ttls_phase2_method__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapSetTtlsPhase2Method *) + protobuf_c_message_unpack (&rpc__req__eap_set_ttls_phase2_method__descriptor, + allocator, len, data); +} +void rpc__req__eap_set_ttls_phase2_method__free_unpacked + (RpcReqEapSetTtlsPhase2Method *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_set_ttls_phase2_method__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_set_ttls_phase2_method__init + (RpcRespEapSetTtlsPhase2Method *message) +{ + static const RpcRespEapSetTtlsPhase2Method init_value = RPC__RESP__EAP_SET_TTLS_PHASE2_METHOD__INIT; + *message = init_value; +} +size_t rpc__resp__eap_set_ttls_phase2_method__get_packed_size + (const RpcRespEapSetTtlsPhase2Method *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_ttls_phase2_method__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_set_ttls_phase2_method__pack + (const RpcRespEapSetTtlsPhase2Method *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_ttls_phase2_method__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_set_ttls_phase2_method__pack_to_buffer + (const RpcRespEapSetTtlsPhase2Method *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_ttls_phase2_method__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapSetTtlsPhase2Method * + rpc__resp__eap_set_ttls_phase2_method__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapSetTtlsPhase2Method *) + protobuf_c_message_unpack (&rpc__resp__eap_set_ttls_phase2_method__descriptor, + allocator, len, data); +} +void rpc__resp__eap_set_ttls_phase2_method__free_unpacked + (RpcRespEapSetTtlsPhase2Method *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_set_ttls_phase2_method__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_set_suiteb192bit_certification__init + (RpcReqEapSetSuiteb192bitCertification *message) +{ + static const RpcReqEapSetSuiteb192bitCertification init_value = RPC__REQ__EAP_SET_SUITEB192BIT_CERTIFICATION__INIT; + *message = init_value; +} +size_t rpc__req__eap_set_suiteb192bit_certification__get_packed_size + (const RpcReqEapSetSuiteb192bitCertification *message) +{ + assert(message->base.descriptor == &rpc__req__eap_set_suiteb192bit_certification__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_set_suiteb192bit_certification__pack + (const RpcReqEapSetSuiteb192bitCertification *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_set_suiteb192bit_certification__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_set_suiteb192bit_certification__pack_to_buffer + (const RpcReqEapSetSuiteb192bitCertification *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_set_suiteb192bit_certification__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapSetSuiteb192bitCertification * + rpc__req__eap_set_suiteb192bit_certification__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapSetSuiteb192bitCertification *) + protobuf_c_message_unpack (&rpc__req__eap_set_suiteb192bit_certification__descriptor, + allocator, len, data); +} +void rpc__req__eap_set_suiteb192bit_certification__free_unpacked + (RpcReqEapSetSuiteb192bitCertification *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_set_suiteb192bit_certification__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_set_suiteb192bit_certification__init + (RpcRespEapSetSuiteb192bitCertification *message) +{ + static const RpcRespEapSetSuiteb192bitCertification init_value = RPC__RESP__EAP_SET_SUITEB192BIT_CERTIFICATION__INIT; + *message = init_value; +} +size_t rpc__resp__eap_set_suiteb192bit_certification__get_packed_size + (const RpcRespEapSetSuiteb192bitCertification *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_suiteb192bit_certification__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_set_suiteb192bit_certification__pack + (const RpcRespEapSetSuiteb192bitCertification *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_suiteb192bit_certification__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_set_suiteb192bit_certification__pack_to_buffer + (const RpcRespEapSetSuiteb192bitCertification *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_suiteb192bit_certification__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapSetSuiteb192bitCertification * + rpc__resp__eap_set_suiteb192bit_certification__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapSetSuiteb192bitCertification *) + protobuf_c_message_unpack (&rpc__resp__eap_set_suiteb192bit_certification__descriptor, + allocator, len, data); +} +void rpc__resp__eap_set_suiteb192bit_certification__free_unpacked + (RpcRespEapSetSuiteb192bitCertification *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_set_suiteb192bit_certification__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_set_pac_file__init + (RpcReqEapSetPacFile *message) +{ + static const RpcReqEapSetPacFile init_value = RPC__REQ__EAP_SET_PAC_FILE__INIT; + *message = init_value; +} +size_t rpc__req__eap_set_pac_file__get_packed_size + (const RpcReqEapSetPacFile *message) +{ + assert(message->base.descriptor == &rpc__req__eap_set_pac_file__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_set_pac_file__pack + (const RpcReqEapSetPacFile *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_set_pac_file__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_set_pac_file__pack_to_buffer + (const RpcReqEapSetPacFile *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_set_pac_file__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapSetPacFile * + rpc__req__eap_set_pac_file__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapSetPacFile *) + protobuf_c_message_unpack (&rpc__req__eap_set_pac_file__descriptor, + allocator, len, data); +} +void rpc__req__eap_set_pac_file__free_unpacked + (RpcReqEapSetPacFile *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_set_pac_file__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_set_pac_file__init + (RpcRespEapSetPacFile *message) +{ + static const RpcRespEapSetPacFile init_value = RPC__RESP__EAP_SET_PAC_FILE__INIT; + *message = init_value; +} +size_t rpc__resp__eap_set_pac_file__get_packed_size + (const RpcRespEapSetPacFile *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_pac_file__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_set_pac_file__pack + (const RpcRespEapSetPacFile *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_pac_file__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_set_pac_file__pack_to_buffer + (const RpcRespEapSetPacFile *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_pac_file__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapSetPacFile * + rpc__resp__eap_set_pac_file__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapSetPacFile *) + protobuf_c_message_unpack (&rpc__resp__eap_set_pac_file__descriptor, + allocator, len, data); +} +void rpc__resp__eap_set_pac_file__free_unpacked + (RpcRespEapSetPacFile *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_set_pac_file__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_set_fast_params__init + (RpcReqEapSetFastParams *message) +{ + static const RpcReqEapSetFastParams init_value = RPC__REQ__EAP_SET_FAST_PARAMS__INIT; + *message = init_value; +} +size_t rpc__req__eap_set_fast_params__get_packed_size + (const RpcReqEapSetFastParams *message) +{ + assert(message->base.descriptor == &rpc__req__eap_set_fast_params__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_set_fast_params__pack + (const RpcReqEapSetFastParams *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_set_fast_params__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_set_fast_params__pack_to_buffer + (const RpcReqEapSetFastParams *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_set_fast_params__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapSetFastParams * + rpc__req__eap_set_fast_params__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapSetFastParams *) + protobuf_c_message_unpack (&rpc__req__eap_set_fast_params__descriptor, + allocator, len, data); +} +void rpc__req__eap_set_fast_params__free_unpacked + (RpcReqEapSetFastParams *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_set_fast_params__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_set_fast_params__init + (RpcRespEapSetFastParams *message) +{ + static const RpcRespEapSetFastParams init_value = RPC__RESP__EAP_SET_FAST_PARAMS__INIT; + *message = init_value; +} +size_t rpc__resp__eap_set_fast_params__get_packed_size + (const RpcRespEapSetFastParams *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_fast_params__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_set_fast_params__pack + (const RpcRespEapSetFastParams *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_fast_params__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_set_fast_params__pack_to_buffer + (const RpcRespEapSetFastParams *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_fast_params__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapSetFastParams * + rpc__resp__eap_set_fast_params__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapSetFastParams *) + protobuf_c_message_unpack (&rpc__resp__eap_set_fast_params__descriptor, + allocator, len, data); +} +void rpc__resp__eap_set_fast_params__free_unpacked + (RpcRespEapSetFastParams *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_set_fast_params__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_use_default_cert_bundle__init + (RpcReqEapUseDefaultCertBundle *message) +{ + static const RpcReqEapUseDefaultCertBundle init_value = RPC__REQ__EAP_USE_DEFAULT_CERT_BUNDLE__INIT; + *message = init_value; +} +size_t rpc__req__eap_use_default_cert_bundle__get_packed_size + (const RpcReqEapUseDefaultCertBundle *message) +{ + assert(message->base.descriptor == &rpc__req__eap_use_default_cert_bundle__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_use_default_cert_bundle__pack + (const RpcReqEapUseDefaultCertBundle *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_use_default_cert_bundle__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_use_default_cert_bundle__pack_to_buffer + (const RpcReqEapUseDefaultCertBundle *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_use_default_cert_bundle__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapUseDefaultCertBundle * + rpc__req__eap_use_default_cert_bundle__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapUseDefaultCertBundle *) + protobuf_c_message_unpack (&rpc__req__eap_use_default_cert_bundle__descriptor, + allocator, len, data); +} +void rpc__req__eap_use_default_cert_bundle__free_unpacked + (RpcReqEapUseDefaultCertBundle *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_use_default_cert_bundle__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_use_default_cert_bundle__init + (RpcRespEapUseDefaultCertBundle *message) +{ + static const RpcRespEapUseDefaultCertBundle init_value = RPC__RESP__EAP_USE_DEFAULT_CERT_BUNDLE__INIT; + *message = init_value; +} +size_t rpc__resp__eap_use_default_cert_bundle__get_packed_size + (const RpcRespEapUseDefaultCertBundle *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_use_default_cert_bundle__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_use_default_cert_bundle__pack + (const RpcRespEapUseDefaultCertBundle *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_use_default_cert_bundle__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_use_default_cert_bundle__pack_to_buffer + (const RpcRespEapUseDefaultCertBundle *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_use_default_cert_bundle__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapUseDefaultCertBundle * + rpc__resp__eap_use_default_cert_bundle__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapUseDefaultCertBundle *) + protobuf_c_message_unpack (&rpc__resp__eap_use_default_cert_bundle__descriptor, + allocator, len, data); +} +void rpc__resp__eap_use_default_cert_bundle__free_unpacked + (RpcRespEapUseDefaultCertBundle *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_use_default_cert_bundle__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__wifi_set_okc_support__init + (RpcReqWifiSetOkcSupport *message) +{ + static const RpcReqWifiSetOkcSupport init_value = RPC__REQ__WIFI_SET_OKC_SUPPORT__INIT; + *message = init_value; +} +size_t rpc__req__wifi_set_okc_support__get_packed_size + (const RpcReqWifiSetOkcSupport *message) +{ + assert(message->base.descriptor == &rpc__req__wifi_set_okc_support__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__wifi_set_okc_support__pack + (const RpcReqWifiSetOkcSupport *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__wifi_set_okc_support__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__wifi_set_okc_support__pack_to_buffer + (const RpcReqWifiSetOkcSupport *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__wifi_set_okc_support__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqWifiSetOkcSupport * + rpc__req__wifi_set_okc_support__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqWifiSetOkcSupport *) + protobuf_c_message_unpack (&rpc__req__wifi_set_okc_support__descriptor, + allocator, len, data); +} +void rpc__req__wifi_set_okc_support__free_unpacked + (RpcReqWifiSetOkcSupport *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__wifi_set_okc_support__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__wifi_set_okc_support__init + (RpcRespWifiSetOkcSupport *message) +{ + static const RpcRespWifiSetOkcSupport init_value = RPC__RESP__WIFI_SET_OKC_SUPPORT__INIT; + *message = init_value; +} +size_t rpc__resp__wifi_set_okc_support__get_packed_size + (const RpcRespWifiSetOkcSupport *message) +{ + assert(message->base.descriptor == &rpc__resp__wifi_set_okc_support__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__wifi_set_okc_support__pack + (const RpcRespWifiSetOkcSupport *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__wifi_set_okc_support__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__wifi_set_okc_support__pack_to_buffer + (const RpcRespWifiSetOkcSupport *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__wifi_set_okc_support__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespWifiSetOkcSupport * + rpc__resp__wifi_set_okc_support__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespWifiSetOkcSupport *) + protobuf_c_message_unpack (&rpc__resp__wifi_set_okc_support__descriptor, + allocator, len, data); +} +void rpc__resp__wifi_set_okc_support__free_unpacked + (RpcRespWifiSetOkcSupport *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__wifi_set_okc_support__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_set_domain_name__init + (RpcReqEapSetDomainName *message) +{ + static const RpcReqEapSetDomainName init_value = RPC__REQ__EAP_SET_DOMAIN_NAME__INIT; + *message = init_value; +} +size_t rpc__req__eap_set_domain_name__get_packed_size + (const RpcReqEapSetDomainName *message) +{ + assert(message->base.descriptor == &rpc__req__eap_set_domain_name__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_set_domain_name__pack + (const RpcReqEapSetDomainName *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_set_domain_name__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_set_domain_name__pack_to_buffer + (const RpcReqEapSetDomainName *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_set_domain_name__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapSetDomainName * + rpc__req__eap_set_domain_name__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapSetDomainName *) + protobuf_c_message_unpack (&rpc__req__eap_set_domain_name__descriptor, + allocator, len, data); +} +void rpc__req__eap_set_domain_name__free_unpacked + (RpcReqEapSetDomainName *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_set_domain_name__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_set_domain_name__init + (RpcRespEapSetDomainName *message) +{ + static const RpcRespEapSetDomainName init_value = RPC__RESP__EAP_SET_DOMAIN_NAME__INIT; + *message = init_value; +} +size_t rpc__resp__eap_set_domain_name__get_packed_size + (const RpcRespEapSetDomainName *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_domain_name__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_set_domain_name__pack + (const RpcRespEapSetDomainName *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_domain_name__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_set_domain_name__pack_to_buffer + (const RpcRespEapSetDomainName *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_domain_name__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapSetDomainName * + rpc__resp__eap_set_domain_name__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapSetDomainName *) + protobuf_c_message_unpack (&rpc__resp__eap_set_domain_name__descriptor, + allocator, len, data); +} +void rpc__resp__eap_set_domain_name__free_unpacked + (RpcRespEapSetDomainName *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_set_domain_name__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__eap_set_eap_methods__init + (RpcReqEapSetEapMethods *message) +{ + static const RpcReqEapSetEapMethods init_value = RPC__REQ__EAP_SET_EAP_METHODS__INIT; + *message = init_value; +} +size_t rpc__req__eap_set_eap_methods__get_packed_size + (const RpcReqEapSetEapMethods *message) +{ + assert(message->base.descriptor == &rpc__req__eap_set_eap_methods__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__eap_set_eap_methods__pack + (const RpcReqEapSetEapMethods *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__eap_set_eap_methods__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__eap_set_eap_methods__pack_to_buffer + (const RpcReqEapSetEapMethods *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__eap_set_eap_methods__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqEapSetEapMethods * + rpc__req__eap_set_eap_methods__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqEapSetEapMethods *) + protobuf_c_message_unpack (&rpc__req__eap_set_eap_methods__descriptor, + allocator, len, data); +} +void rpc__req__eap_set_eap_methods__free_unpacked + (RpcReqEapSetEapMethods *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__eap_set_eap_methods__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__eap_set_eap_methods__init + (RpcRespEapSetEapMethods *message) +{ + static const RpcRespEapSetEapMethods init_value = RPC__RESP__EAP_SET_EAP_METHODS__INIT; + *message = init_value; +} +size_t rpc__resp__eap_set_eap_methods__get_packed_size + (const RpcRespEapSetEapMethods *message) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_eap_methods__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__eap_set_eap_methods__pack + (const RpcRespEapSetEapMethods *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_eap_methods__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__eap_set_eap_methods__pack_to_buffer + (const RpcRespEapSetEapMethods *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__eap_set_eap_methods__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespEapSetEapMethods * + rpc__resp__eap_set_eap_methods__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespEapSetEapMethods *) + protobuf_c_message_unpack (&rpc__resp__eap_set_eap_methods__descriptor, + allocator, len, data); +} +void rpc__resp__eap_set_eap_methods__free_unpacked + (RpcRespEapSetEapMethods *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__eap_set_eap_methods__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__supp_dpp_uri_ready__init + (RpcEventSuppDppUriReady *message) +{ + static const RpcEventSuppDppUriReady init_value = RPC__EVENT__SUPP_DPP_URI_READY__INIT; + *message = init_value; +} +size_t rpc__event__supp_dpp_uri_ready__get_packed_size + (const RpcEventSuppDppUriReady *message) +{ + assert(message->base.descriptor == &rpc__event__supp_dpp_uri_ready__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__supp_dpp_uri_ready__pack + (const RpcEventSuppDppUriReady *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__supp_dpp_uri_ready__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__supp_dpp_uri_ready__pack_to_buffer + (const RpcEventSuppDppUriReady *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__supp_dpp_uri_ready__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventSuppDppUriReady * + rpc__event__supp_dpp_uri_ready__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventSuppDppUriReady *) + protobuf_c_message_unpack (&rpc__event__supp_dpp_uri_ready__descriptor, + allocator, len, data); +} +void rpc__event__supp_dpp_uri_ready__free_unpacked + (RpcEventSuppDppUriReady *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__supp_dpp_uri_ready__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__supp_dpp_cfg_recvd__init + (RpcEventSuppDppCfgRecvd *message) +{ + static const RpcEventSuppDppCfgRecvd init_value = RPC__EVENT__SUPP_DPP_CFG_RECVD__INIT; + *message = init_value; +} +size_t rpc__event__supp_dpp_cfg_recvd__get_packed_size + (const RpcEventSuppDppCfgRecvd *message) +{ + assert(message->base.descriptor == &rpc__event__supp_dpp_cfg_recvd__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__supp_dpp_cfg_recvd__pack + (const RpcEventSuppDppCfgRecvd *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__supp_dpp_cfg_recvd__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__supp_dpp_cfg_recvd__pack_to_buffer + (const RpcEventSuppDppCfgRecvd *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__supp_dpp_cfg_recvd__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventSuppDppCfgRecvd * + rpc__event__supp_dpp_cfg_recvd__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventSuppDppCfgRecvd *) + protobuf_c_message_unpack (&rpc__event__supp_dpp_cfg_recvd__descriptor, + allocator, len, data); +} +void rpc__event__supp_dpp_cfg_recvd__free_unpacked + (RpcEventSuppDppCfgRecvd *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__supp_dpp_cfg_recvd__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__supp_dpp_fail__init + (RpcEventSuppDppFail *message) +{ + static const RpcEventSuppDppFail init_value = RPC__EVENT__SUPP_DPP_FAIL__INIT; + *message = init_value; +} +size_t rpc__event__supp_dpp_fail__get_packed_size + (const RpcEventSuppDppFail *message) +{ + assert(message->base.descriptor == &rpc__event__supp_dpp_fail__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__supp_dpp_fail__pack + (const RpcEventSuppDppFail *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__supp_dpp_fail__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__supp_dpp_fail__pack_to_buffer + (const RpcEventSuppDppFail *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__supp_dpp_fail__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventSuppDppFail * + rpc__event__supp_dpp_fail__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventSuppDppFail *) + protobuf_c_message_unpack (&rpc__event__supp_dpp_fail__descriptor, + allocator, len, data); +} +void rpc__event__supp_dpp_fail__free_unpacked + (RpcEventSuppDppFail *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__supp_dpp_fail__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__wifi_dpp_uri_ready__init + (RpcEventWifiDppUriReady *message) +{ + static const RpcEventWifiDppUriReady init_value = RPC__EVENT__WIFI_DPP_URI_READY__INIT; + *message = init_value; +} +size_t rpc__event__wifi_dpp_uri_ready__get_packed_size + (const RpcEventWifiDppUriReady *message) +{ + assert(message->base.descriptor == &rpc__event__wifi_dpp_uri_ready__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__wifi_dpp_uri_ready__pack + (const RpcEventWifiDppUriReady *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__wifi_dpp_uri_ready__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__wifi_dpp_uri_ready__pack_to_buffer + (const RpcEventWifiDppUriReady *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__wifi_dpp_uri_ready__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventWifiDppUriReady * + rpc__event__wifi_dpp_uri_ready__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventWifiDppUriReady *) + protobuf_c_message_unpack (&rpc__event__wifi_dpp_uri_ready__descriptor, + allocator, len, data); +} +void rpc__event__wifi_dpp_uri_ready__free_unpacked + (RpcEventWifiDppUriReady *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__wifi_dpp_uri_ready__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__wifi_dpp_cfg_recvd__init + (RpcEventWifiDppCfgRecvd *message) +{ + static const RpcEventWifiDppCfgRecvd init_value = RPC__EVENT__WIFI_DPP_CFG_RECVD__INIT; + *message = init_value; +} +size_t rpc__event__wifi_dpp_cfg_recvd__get_packed_size + (const RpcEventWifiDppCfgRecvd *message) +{ + assert(message->base.descriptor == &rpc__event__wifi_dpp_cfg_recvd__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__wifi_dpp_cfg_recvd__pack + (const RpcEventWifiDppCfgRecvd *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__wifi_dpp_cfg_recvd__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__wifi_dpp_cfg_recvd__pack_to_buffer + (const RpcEventWifiDppCfgRecvd *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__wifi_dpp_cfg_recvd__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventWifiDppCfgRecvd * + rpc__event__wifi_dpp_cfg_recvd__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventWifiDppCfgRecvd *) + protobuf_c_message_unpack (&rpc__event__wifi_dpp_cfg_recvd__descriptor, + allocator, len, data); +} +void rpc__event__wifi_dpp_cfg_recvd__free_unpacked + (RpcEventWifiDppCfgRecvd *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__wifi_dpp_cfg_recvd__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__event__wifi_dpp_fail__init + (RpcEventWifiDppFail *message) +{ + static const RpcEventWifiDppFail init_value = RPC__EVENT__WIFI_DPP_FAIL__INIT; + *message = init_value; +} +size_t rpc__event__wifi_dpp_fail__get_packed_size + (const RpcEventWifiDppFail *message) +{ + assert(message->base.descriptor == &rpc__event__wifi_dpp_fail__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__event__wifi_dpp_fail__pack + (const RpcEventWifiDppFail *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__event__wifi_dpp_fail__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__event__wifi_dpp_fail__pack_to_buffer + (const RpcEventWifiDppFail *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__event__wifi_dpp_fail__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcEventWifiDppFail * + rpc__event__wifi_dpp_fail__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcEventWifiDppFail *) + protobuf_c_message_unpack (&rpc__event__wifi_dpp_fail__descriptor, + allocator, len, data); +} +void rpc__event__wifi_dpp_fail__free_unpacked + (RpcEventWifiDppFail *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__event__wifi_dpp_fail__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__gpio_config__init + (RpcGpioConfig *message) +{ + static const RpcGpioConfig init_value = RPC__GPIO_CONFIG__INIT; + *message = init_value; +} +size_t rpc__gpio_config__get_packed_size + (const RpcGpioConfig *message) +{ + assert(message->base.descriptor == &rpc__gpio_config__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__gpio_config__pack + (const RpcGpioConfig *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__gpio_config__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__gpio_config__pack_to_buffer + (const RpcGpioConfig *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__gpio_config__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcGpioConfig * + rpc__gpio_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcGpioConfig *) + protobuf_c_message_unpack (&rpc__gpio_config__descriptor, + allocator, len, data); +} +void rpc__gpio_config__free_unpacked + (RpcGpioConfig *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__gpio_config__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__gpio_config__init + (RpcReqGpioConfig *message) +{ + static const RpcReqGpioConfig init_value = RPC__REQ__GPIO_CONFIG__INIT; + *message = init_value; +} +size_t rpc__req__gpio_config__get_packed_size + (const RpcReqGpioConfig *message) +{ + assert(message->base.descriptor == &rpc__req__gpio_config__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__gpio_config__pack + (const RpcReqGpioConfig *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__gpio_config__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__gpio_config__pack_to_buffer + (const RpcReqGpioConfig *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__gpio_config__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqGpioConfig * + rpc__req__gpio_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqGpioConfig *) + protobuf_c_message_unpack (&rpc__req__gpio_config__descriptor, + allocator, len, data); +} +void rpc__req__gpio_config__free_unpacked + (RpcReqGpioConfig *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__gpio_config__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__gpio_config__init + (RpcRespGpioConfig *message) +{ + static const RpcRespGpioConfig init_value = RPC__RESP__GPIO_CONFIG__INIT; + *message = init_value; +} +size_t rpc__resp__gpio_config__get_packed_size + (const RpcRespGpioConfig *message) +{ + assert(message->base.descriptor == &rpc__resp__gpio_config__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__gpio_config__pack + (const RpcRespGpioConfig *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__gpio_config__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__gpio_config__pack_to_buffer + (const RpcRespGpioConfig *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__gpio_config__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespGpioConfig * + rpc__resp__gpio_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespGpioConfig *) + protobuf_c_message_unpack (&rpc__resp__gpio_config__descriptor, + allocator, len, data); +} +void rpc__resp__gpio_config__free_unpacked + (RpcRespGpioConfig *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__gpio_config__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__gpio_reset__init + (RpcReqGpioReset *message) +{ + static const RpcReqGpioReset init_value = RPC__REQ__GPIO_RESET__INIT; + *message = init_value; +} +size_t rpc__req__gpio_reset__get_packed_size + (const RpcReqGpioReset *message) +{ + assert(message->base.descriptor == &rpc__req__gpio_reset__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__gpio_reset__pack + (const RpcReqGpioReset *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__gpio_reset__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__gpio_reset__pack_to_buffer + (const RpcReqGpioReset *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__gpio_reset__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqGpioReset * + rpc__req__gpio_reset__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqGpioReset *) + protobuf_c_message_unpack (&rpc__req__gpio_reset__descriptor, + allocator, len, data); +} +void rpc__req__gpio_reset__free_unpacked + (RpcReqGpioReset *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__gpio_reset__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__gpio_reset_pin__init + (RpcRespGpioResetPin *message) +{ + static const RpcRespGpioResetPin init_value = RPC__RESP__GPIO_RESET_PIN__INIT; + *message = init_value; +} +size_t rpc__resp__gpio_reset_pin__get_packed_size + (const RpcRespGpioResetPin *message) +{ + assert(message->base.descriptor == &rpc__resp__gpio_reset_pin__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__gpio_reset_pin__pack + (const RpcRespGpioResetPin *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__gpio_reset_pin__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__gpio_reset_pin__pack_to_buffer + (const RpcRespGpioResetPin *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__gpio_reset_pin__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespGpioResetPin * + rpc__resp__gpio_reset_pin__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespGpioResetPin *) + protobuf_c_message_unpack (&rpc__resp__gpio_reset_pin__descriptor, + allocator, len, data); +} +void rpc__resp__gpio_reset_pin__free_unpacked + (RpcRespGpioResetPin *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__gpio_reset_pin__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__gpio_set_level__init + (RpcReqGpioSetLevel *message) +{ + static const RpcReqGpioSetLevel init_value = RPC__REQ__GPIO_SET_LEVEL__INIT; + *message = init_value; +} +size_t rpc__req__gpio_set_level__get_packed_size + (const RpcReqGpioSetLevel *message) +{ + assert(message->base.descriptor == &rpc__req__gpio_set_level__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__gpio_set_level__pack + (const RpcReqGpioSetLevel *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__gpio_set_level__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__gpio_set_level__pack_to_buffer + (const RpcReqGpioSetLevel *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__gpio_set_level__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqGpioSetLevel * + rpc__req__gpio_set_level__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqGpioSetLevel *) + protobuf_c_message_unpack (&rpc__req__gpio_set_level__descriptor, + allocator, len, data); +} +void rpc__req__gpio_set_level__free_unpacked + (RpcReqGpioSetLevel *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__gpio_set_level__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__gpio_set_level__init + (RpcRespGpioSetLevel *message) +{ + static const RpcRespGpioSetLevel init_value = RPC__RESP__GPIO_SET_LEVEL__INIT; + *message = init_value; +} +size_t rpc__resp__gpio_set_level__get_packed_size + (const RpcRespGpioSetLevel *message) +{ + assert(message->base.descriptor == &rpc__resp__gpio_set_level__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__gpio_set_level__pack + (const RpcRespGpioSetLevel *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__gpio_set_level__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__gpio_set_level__pack_to_buffer + (const RpcRespGpioSetLevel *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__gpio_set_level__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespGpioSetLevel * + rpc__resp__gpio_set_level__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespGpioSetLevel *) + protobuf_c_message_unpack (&rpc__resp__gpio_set_level__descriptor, + allocator, len, data); +} +void rpc__resp__gpio_set_level__free_unpacked + (RpcRespGpioSetLevel *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__gpio_set_level__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__gpio_get_level__init + (RpcReqGpioGetLevel *message) +{ + static const RpcReqGpioGetLevel init_value = RPC__REQ__GPIO_GET_LEVEL__INIT; + *message = init_value; +} +size_t rpc__req__gpio_get_level__get_packed_size + (const RpcReqGpioGetLevel *message) +{ + assert(message->base.descriptor == &rpc__req__gpio_get_level__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__gpio_get_level__pack + (const RpcReqGpioGetLevel *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__gpio_get_level__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__gpio_get_level__pack_to_buffer + (const RpcReqGpioGetLevel *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__gpio_get_level__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqGpioGetLevel * + rpc__req__gpio_get_level__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqGpioGetLevel *) + protobuf_c_message_unpack (&rpc__req__gpio_get_level__descriptor, + allocator, len, data); +} +void rpc__req__gpio_get_level__free_unpacked + (RpcReqGpioGetLevel *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__gpio_get_level__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__gpio_get_level__init + (RpcRespGpioGetLevel *message) +{ + static const RpcRespGpioGetLevel init_value = RPC__RESP__GPIO_GET_LEVEL__INIT; + *message = init_value; +} +size_t rpc__resp__gpio_get_level__get_packed_size + (const RpcRespGpioGetLevel *message) +{ + assert(message->base.descriptor == &rpc__resp__gpio_get_level__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__gpio_get_level__pack + (const RpcRespGpioGetLevel *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__gpio_get_level__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__gpio_get_level__pack_to_buffer + (const RpcRespGpioGetLevel *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__gpio_get_level__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespGpioGetLevel * + rpc__resp__gpio_get_level__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespGpioGetLevel *) + protobuf_c_message_unpack (&rpc__resp__gpio_get_level__descriptor, + allocator, len, data); +} +void rpc__resp__gpio_get_level__free_unpacked + (RpcRespGpioGetLevel *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__gpio_get_level__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__gpio_set_direction__init + (RpcReqGpioSetDirection *message) +{ + static const RpcReqGpioSetDirection init_value = RPC__REQ__GPIO_SET_DIRECTION__INIT; + *message = init_value; +} +size_t rpc__req__gpio_set_direction__get_packed_size + (const RpcReqGpioSetDirection *message) +{ + assert(message->base.descriptor == &rpc__req__gpio_set_direction__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__gpio_set_direction__pack + (const RpcReqGpioSetDirection *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__gpio_set_direction__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__gpio_set_direction__pack_to_buffer + (const RpcReqGpioSetDirection *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__gpio_set_direction__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqGpioSetDirection * + rpc__req__gpio_set_direction__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqGpioSetDirection *) + protobuf_c_message_unpack (&rpc__req__gpio_set_direction__descriptor, + allocator, len, data); +} +void rpc__req__gpio_set_direction__free_unpacked + (RpcReqGpioSetDirection *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__gpio_set_direction__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__gpio_set_direction__init + (RpcRespGpioSetDirection *message) +{ + static const RpcRespGpioSetDirection init_value = RPC__RESP__GPIO_SET_DIRECTION__INIT; + *message = init_value; +} +size_t rpc__resp__gpio_set_direction__get_packed_size + (const RpcRespGpioSetDirection *message) +{ + assert(message->base.descriptor == &rpc__resp__gpio_set_direction__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__gpio_set_direction__pack + (const RpcRespGpioSetDirection *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__gpio_set_direction__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__gpio_set_direction__pack_to_buffer + (const RpcRespGpioSetDirection *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__gpio_set_direction__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespGpioSetDirection * + rpc__resp__gpio_set_direction__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespGpioSetDirection *) + protobuf_c_message_unpack (&rpc__resp__gpio_set_direction__descriptor, + allocator, len, data); +} +void rpc__resp__gpio_set_direction__free_unpacked + (RpcRespGpioSetDirection *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__gpio_set_direction__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__gpio_input_enable__init + (RpcReqGpioInputEnable *message) +{ + static const RpcReqGpioInputEnable init_value = RPC__REQ__GPIO_INPUT_ENABLE__INIT; + *message = init_value; +} +size_t rpc__req__gpio_input_enable__get_packed_size + (const RpcReqGpioInputEnable *message) +{ + assert(message->base.descriptor == &rpc__req__gpio_input_enable__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__gpio_input_enable__pack + (const RpcReqGpioInputEnable *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__gpio_input_enable__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__gpio_input_enable__pack_to_buffer + (const RpcReqGpioInputEnable *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__gpio_input_enable__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqGpioInputEnable * + rpc__req__gpio_input_enable__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqGpioInputEnable *) + protobuf_c_message_unpack (&rpc__req__gpio_input_enable__descriptor, + allocator, len, data); +} +void rpc__req__gpio_input_enable__free_unpacked + (RpcReqGpioInputEnable *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__gpio_input_enable__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__gpio_input_enable__init + (RpcRespGpioInputEnable *message) +{ + static const RpcRespGpioInputEnable init_value = RPC__RESP__GPIO_INPUT_ENABLE__INIT; + *message = init_value; +} +size_t rpc__resp__gpio_input_enable__get_packed_size + (const RpcRespGpioInputEnable *message) +{ + assert(message->base.descriptor == &rpc__resp__gpio_input_enable__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__gpio_input_enable__pack + (const RpcRespGpioInputEnable *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__gpio_input_enable__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__gpio_input_enable__pack_to_buffer + (const RpcRespGpioInputEnable *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__gpio_input_enable__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespGpioInputEnable * + rpc__resp__gpio_input_enable__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespGpioInputEnable *) + protobuf_c_message_unpack (&rpc__resp__gpio_input_enable__descriptor, + allocator, len, data); +} +void rpc__resp__gpio_input_enable__free_unpacked + (RpcRespGpioInputEnable *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__gpio_input_enable__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__req__gpio_set_pull_mode__init + (RpcReqGpioSetPullMode *message) +{ + static const RpcReqGpioSetPullMode init_value = RPC__REQ__GPIO_SET_PULL_MODE__INIT; + *message = init_value; +} +size_t rpc__req__gpio_set_pull_mode__get_packed_size + (const RpcReqGpioSetPullMode *message) +{ + assert(message->base.descriptor == &rpc__req__gpio_set_pull_mode__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__req__gpio_set_pull_mode__pack + (const RpcReqGpioSetPullMode *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__req__gpio_set_pull_mode__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__req__gpio_set_pull_mode__pack_to_buffer + (const RpcReqGpioSetPullMode *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__req__gpio_set_pull_mode__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcReqGpioSetPullMode * + rpc__req__gpio_set_pull_mode__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcReqGpioSetPullMode *) + protobuf_c_message_unpack (&rpc__req__gpio_set_pull_mode__descriptor, + allocator, len, data); +} +void rpc__req__gpio_set_pull_mode__free_unpacked + (RpcReqGpioSetPullMode *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__req__gpio_set_pull_mode__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__resp__gpio_set_pull_mode__init + (RpcRespGpioSetPullMode *message) +{ + static const RpcRespGpioSetPullMode init_value = RPC__RESP__GPIO_SET_PULL_MODE__INIT; + *message = init_value; +} +size_t rpc__resp__gpio_set_pull_mode__get_packed_size + (const RpcRespGpioSetPullMode *message) +{ + assert(message->base.descriptor == &rpc__resp__gpio_set_pull_mode__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__resp__gpio_set_pull_mode__pack + (const RpcRespGpioSetPullMode *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__resp__gpio_set_pull_mode__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__resp__gpio_set_pull_mode__pack_to_buffer + (const RpcRespGpioSetPullMode *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__resp__gpio_set_pull_mode__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RpcRespGpioSetPullMode * + rpc__resp__gpio_set_pull_mode__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RpcRespGpioSetPullMode *) + protobuf_c_message_unpack (&rpc__resp__gpio_set_pull_mode__descriptor, + allocator, len, data); +} +void rpc__resp__gpio_set_pull_mode__free_unpacked + (RpcRespGpioSetPullMode *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__resp__gpio_set_pull_mode__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void rpc__init + (Rpc *message) +{ + static const Rpc init_value = RPC__INIT; + *message = init_value; +} +size_t rpc__get_packed_size + (const Rpc *message) +{ + assert(message->base.descriptor == &rpc__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t rpc__pack + (const Rpc *message, + uint8_t *out) +{ + assert(message->base.descriptor == &rpc__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t rpc__pack_to_buffer + (const Rpc *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &rpc__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Rpc * + rpc__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Rpc *) + protobuf_c_message_unpack (&rpc__descriptor, + allocator, len, data); +} +void rpc__free_unpacked + (Rpc *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &rpc__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor wifi_init_config__field_descriptors[24] = +{ + { + "static_rx_buf_num", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, static_rx_buf_num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "dynamic_rx_buf_num", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, dynamic_rx_buf_num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "tx_buf_type", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, tx_buf_type), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "static_tx_buf_num", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, static_tx_buf_num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "dynamic_tx_buf_num", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, dynamic_tx_buf_num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "cache_tx_buf_num", + 6, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, cache_tx_buf_num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "csi_enable", + 7, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, csi_enable), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ampdu_rx_enable", + 8, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, ampdu_rx_enable), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ampdu_tx_enable", + 9, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, ampdu_tx_enable), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "amsdu_tx_enable", + 10, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, amsdu_tx_enable), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { "nvs_enable", 11, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiInitConfig, nvs_enable), + offsetof(WifiInitConfig, nvs_enable), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "nano_enable", + 12, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, nano_enable), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "rx_ba_win", + 13, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, rx_ba_win), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "wifi_task_core_id", + 14, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, wifi_task_core_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "beacon_max_len", + 15, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, beacon_max_len), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "mgmt_sbuf_num", + 16, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, mgmt_sbuf_num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "feature_caps", + 17, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, feature_caps), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "sta_disconnected_pm", + 18, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, sta_disconnected_pm), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "espnow_max_encrypt_num", + 19, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, espnow_max_encrypt_num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "magic", + 20, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, magic), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "rx_mgmt_buf_type", + 21, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, rx_mgmt_buf_type), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "rx_mgmt_buf_num", + 22, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, rx_mgmt_buf_num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "tx_hetb_queue_num", + 23, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, tx_hetb_queue_num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "dump_hesigb_enable", + 24, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiInitConfig, dump_hesigb_enable), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_init_config__field_indices_by_name[] = { + 7, /* field[7] = ampdu_rx_enable */ + 8, /* field[8] = ampdu_tx_enable */ + 9, /* field[9] = amsdu_tx_enable */ + 14, /* field[14] = beacon_max_len */ + 5, /* field[5] = cache_tx_buf_num */ + 6, /* field[6] = csi_enable */ + 23, /* field[23] = dump_hesigb_enable */ + 1, /* field[1] = dynamic_rx_buf_num */ + 4, /* field[4] = dynamic_tx_buf_num */ + 18, /* field[18] = espnow_max_encrypt_num */ + 16, /* field[16] = feature_caps */ + 19, /* field[19] = magic */ + 15, /* field[15] = mgmt_sbuf_num */ + 11, /* field[11] = nano_enable */ + 10, /* field[10] = nvs_enable */ + 12, /* field[12] = rx_ba_win */ + 21, /* field[21] = rx_mgmt_buf_num */ + 20, /* field[20] = rx_mgmt_buf_type */ + 17, /* field[17] = sta_disconnected_pm */ + 0, /* field[0] = static_rx_buf_num */ + 3, /* field[3] = static_tx_buf_num */ + 2, /* field[2] = tx_buf_type */ + 22, /* field[22] = tx_hetb_queue_num */ + 13, /* field[13] = wifi_task_core_id */ +}; +static const ProtobufCIntRange wifi_init_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 24 } +}; +const ProtobufCMessageDescriptor wifi_init_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_init_config", + "WifiInitConfig", + "WifiInitConfig", + "", + sizeof(WifiInitConfig), + 24, + wifi_init_config__field_descriptors, + wifi_init_config__field_indices_by_name, + 1, wifi_init_config__number_ranges, + (ProtobufCMessageInit) wifi_init_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_country__field_descriptors[5] = +{ + { + "cc", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiCountry, cc), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "schan", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiCountry, schan), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "nchan", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiCountry, nchan), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "max_tx_power", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiCountry, max_tx_power), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "policy", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiCountry, policy), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_country__field_indices_by_name[] = { + 0, /* field[0] = cc */ + 3, /* field[3] = max_tx_power */ + 2, /* field[2] = nchan */ + 4, /* field[4] = policy */ + 1, /* field[1] = schan */ +}; +static const ProtobufCIntRange wifi_country__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 5 } +}; +const ProtobufCMessageDescriptor wifi_country__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_country", + "WifiCountry", + "WifiCountry", + "", + sizeof(WifiCountry), + 5, + wifi_country__field_descriptors, + wifi_country__field_indices_by_name, + 1, wifi_country__number_ranges, + (ProtobufCMessageInit) wifi_country__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_active_scan_time__field_descriptors[2] = +{ + { + "min", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiActiveScanTime, min), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "max", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiActiveScanTime, max), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_active_scan_time__field_indices_by_name[] = { + 1, /* field[1] = max */ + 0, /* field[0] = min */ +}; +static const ProtobufCIntRange wifi_active_scan_time__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_active_scan_time__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_active_scan_time", + "WifiActiveScanTime", + "WifiActiveScanTime", + "", + sizeof(WifiActiveScanTime), + 2, + wifi_active_scan_time__field_descriptors, + wifi_active_scan_time__field_indices_by_name, + 1, wifi_active_scan_time__number_ranges, + (ProtobufCMessageInit) wifi_active_scan_time__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_scan_time__field_descriptors[2] = +{ + { + "active", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(WifiScanTime, active), + &wifi_active_scan_time__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "passive", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiScanTime, passive), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_scan_time__field_indices_by_name[] = { + 0, /* field[0] = active */ + 1, /* field[1] = passive */ +}; +static const ProtobufCIntRange wifi_scan_time__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_scan_time__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_scan_time", + "WifiScanTime", + "WifiScanTime", + "", + sizeof(WifiScanTime), + 2, + wifi_scan_time__field_descriptors, + wifi_scan_time__field_indices_by_name, + 1, wifi_scan_time__number_ranges, + (ProtobufCMessageInit) wifi_scan_time__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_scan_channel_bitmap__field_descriptors[2] = +{ + { + "ghz_2_channels", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiScanChannelBitmap, ghz_2_channels), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ghz_5_channels", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiScanChannelBitmap, ghz_5_channels), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_scan_channel_bitmap__field_indices_by_name[] = { + 0, /* field[0] = ghz_2_channels */ + 1, /* field[1] = ghz_5_channels */ +}; +static const ProtobufCIntRange wifi_scan_channel_bitmap__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_scan_channel_bitmap__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_scan_channel_bitmap", + "WifiScanChannelBitmap", + "WifiScanChannelBitmap", + "", + sizeof(WifiScanChannelBitmap), + 2, + wifi_scan_channel_bitmap__field_descriptors, + wifi_scan_channel_bitmap__field_indices_by_name, + 1, wifi_scan_channel_bitmap__number_ranges, + (ProtobufCMessageInit) wifi_scan_channel_bitmap__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_scan_config__field_descriptors[8] = +{ + { + "ssid", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiScanConfig, ssid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "bssid", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiScanConfig, bssid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "channel", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiScanConfig, channel), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "show_hidden", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiScanConfig, show_hidden), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "scan_type", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiScanConfig, scan_type), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "scan_time", + 6, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(WifiScanConfig, scan_time), + &wifi_scan_time__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "home_chan_dwell_time", + 7, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiScanConfig, home_chan_dwell_time), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "channel_bitmap", + 8, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(WifiScanConfig, channel_bitmap), + &wifi_scan_channel_bitmap__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_scan_config__field_indices_by_name[] = { + 1, /* field[1] = bssid */ + 2, /* field[2] = channel */ + 7, /* field[7] = channel_bitmap */ + 6, /* field[6] = home_chan_dwell_time */ + 5, /* field[5] = scan_time */ + 4, /* field[4] = scan_type */ + 3, /* field[3] = show_hidden */ + 0, /* field[0] = ssid */ +}; +static const ProtobufCIntRange wifi_scan_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 8 } +}; +const ProtobufCMessageDescriptor wifi_scan_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_scan_config", + "WifiScanConfig", + "WifiScanConfig", + "", + sizeof(WifiScanConfig), + 8, + wifi_scan_config__field_descriptors, + wifi_scan_config__field_indices_by_name, + 1, wifi_scan_config__number_ranges, + (ProtobufCMessageInit) wifi_scan_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_he_ap_info__field_descriptors[2] = +{ + { + "bitmask", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiHeApInfo, bitmask), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "bssid_index", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiHeApInfo, bssid_index), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_he_ap_info__field_indices_by_name[] = { + 0, /* field[0] = bitmask */ + 1, /* field[1] = bssid_index */ +}; +static const ProtobufCIntRange wifi_he_ap_info__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_he_ap_info__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_he_ap_info", + "WifiHeApInfo", + "WifiHeApInfo", + "", + sizeof(WifiHeApInfo), + 2, + wifi_he_ap_info__field_descriptors, + wifi_he_ap_info__field_indices_by_name, + 1, wifi_he_ap_info__number_ranges, + (ProtobufCMessageInit) wifi_he_ap_info__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_ap_record__field_descriptors[15] = +{ + { + "bssid", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiApRecord, bssid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ssid", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiApRecord, ssid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "primary", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiApRecord, primary), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "second", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiApRecord, second), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "rssi", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiApRecord, rssi), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "authmode", + 6, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiApRecord, authmode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "pairwise_cipher", + 7, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiApRecord, pairwise_cipher), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "group_cipher", + 8, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiApRecord, group_cipher), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ant", + 9, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiApRecord, ant), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "bitmask", + 10, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiApRecord, bitmask), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "country", + 11, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(WifiApRecord, country), + &wifi_country__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "he_ap", + 12, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(WifiApRecord, he_ap), + &wifi_he_ap_info__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "bandwidth", + 13, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiApRecord, bandwidth), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "vht_ch_freq1", + 14, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiApRecord, vht_ch_freq1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "vht_ch_freq2", + 15, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiApRecord, vht_ch_freq2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_ap_record__field_indices_by_name[] = { + 8, /* field[8] = ant */ + 5, /* field[5] = authmode */ + 12, /* field[12] = bandwidth */ + 9, /* field[9] = bitmask */ + 0, /* field[0] = bssid */ + 10, /* field[10] = country */ + 7, /* field[7] = group_cipher */ + 11, /* field[11] = he_ap */ + 6, /* field[6] = pairwise_cipher */ + 2, /* field[2] = primary */ + 4, /* field[4] = rssi */ + 3, /* field[3] = second */ + 1, /* field[1] = ssid */ + 13, /* field[13] = vht_ch_freq1 */ + 14, /* field[14] = vht_ch_freq2 */ +}; +static const ProtobufCIntRange wifi_ap_record__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 15 } +}; +const ProtobufCMessageDescriptor wifi_ap_record__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_ap_record", + "WifiApRecord", + "WifiApRecord", + "", + sizeof(WifiApRecord), + 15, + wifi_ap_record__field_descriptors, + wifi_ap_record__field_indices_by_name, + 1, wifi_ap_record__number_ranges, + (ProtobufCMessageInit) wifi_ap_record__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_scan_threshold__field_descriptors[3] = +{ + { + "rssi", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiScanThreshold, rssi), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "authmode", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiScanThreshold, authmode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "rssi_5g_adjustment", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiScanThreshold, rssi_5g_adjustment), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_scan_threshold__field_indices_by_name[] = { + 1, /* field[1] = authmode */ + 0, /* field[0] = rssi */ + 2, /* field[2] = rssi_5g_adjustment */ +}; +static const ProtobufCIntRange wifi_scan_threshold__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor wifi_scan_threshold__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_scan_threshold", + "WifiScanThreshold", + "WifiScanThreshold", + "", + sizeof(WifiScanThreshold), + 3, + wifi_scan_threshold__field_descriptors, + wifi_scan_threshold__field_indices_by_name, + 1, wifi_scan_threshold__number_ranges, + (ProtobufCMessageInit) wifi_scan_threshold__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_pmf_config__field_descriptors[2] = +{ + { + "capable", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiPmfConfig, capable), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "required", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiPmfConfig, required), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_pmf_config__field_indices_by_name[] = { + 0, /* field[0] = capable */ + 1, /* field[1] = required */ +}; +static const ProtobufCIntRange wifi_pmf_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_pmf_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_pmf_config", + "WifiPmfConfig", + "WifiPmfConfig", + "", + sizeof(WifiPmfConfig), + 2, + wifi_pmf_config__field_descriptors, + wifi_pmf_config__field_indices_by_name, + 1, wifi_pmf_config__number_ranges, + (ProtobufCMessageInit) wifi_pmf_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_bss_max_idle_config__field_descriptors[2] = +{ + { + "period", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiBssMaxIdleConfig, period), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "protected_keep_alive", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiBssMaxIdleConfig, protected_keep_alive), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_bss_max_idle_config__field_indices_by_name[] = { + 0, /* field[0] = period */ + 1, /* field[1] = protected_keep_alive */ +}; +static const ProtobufCIntRange wifi_bss_max_idle_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_bss_max_idle_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_bss_max_idle_config", + "WifiBssMaxIdleConfig", + "WifiBssMaxIdleConfig", + "", + sizeof(WifiBssMaxIdleConfig), + 2, + wifi_bss_max_idle_config__field_descriptors, + wifi_bss_max_idle_config__field_indices_by_name, + 1, wifi_bss_max_idle_config__number_ranges, + (ProtobufCMessageInit) wifi_bss_max_idle_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_ap_config__field_descriptors[18] = +{ + { + "ssid", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, ssid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "password", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, password), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ssid_len", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, ssid_len), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "channel", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, channel), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "authmode", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, authmode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ssid_hidden", + 6, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, ssid_hidden), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "max_connection", + 7, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, max_connection), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "beacon_interval", + 8, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, beacon_interval), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "pairwise_cipher", + 9, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, pairwise_cipher), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ftm_responder", + 10, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, ftm_responder), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "pmf_cfg", + 11, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, pmf_cfg), + &wifi_pmf_config__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "sae_pwe_h2e", + 12, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, sae_pwe_h2e), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "csa_count", + 13, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, csa_count), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "dtim_period", + 14, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, dtim_period), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "transition_disable", + 15, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, transition_disable), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "sae_ext", + 16, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, sae_ext), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "bss_max_idle_cfg", + 17, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, bss_max_idle_cfg), + &wifi_bss_max_idle_config__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "gtk_rekey_interval", + 18, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiApConfig, gtk_rekey_interval), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_ap_config__field_indices_by_name[] = { + 4, /* field[4] = authmode */ + 7, /* field[7] = beacon_interval */ + 16, /* field[16] = bss_max_idle_cfg */ + 3, /* field[3] = channel */ + 12, /* field[12] = csa_count */ + 13, /* field[13] = dtim_period */ + 9, /* field[9] = ftm_responder */ + 17, /* field[17] = gtk_rekey_interval */ + 6, /* field[6] = max_connection */ + 8, /* field[8] = pairwise_cipher */ + 1, /* field[1] = password */ + 10, /* field[10] = pmf_cfg */ + 15, /* field[15] = sae_ext */ + 11, /* field[11] = sae_pwe_h2e */ + 0, /* field[0] = ssid */ + 5, /* field[5] = ssid_hidden */ + 2, /* field[2] = ssid_len */ + 14, /* field[14] = transition_disable */ +}; +static const ProtobufCIntRange wifi_ap_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 18 } +}; +const ProtobufCMessageDescriptor wifi_ap_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_ap_config", + "WifiApConfig", + "WifiApConfig", + "", + sizeof(WifiApConfig), + 18, + wifi_ap_config__field_descriptors, + wifi_ap_config__field_indices_by_name, + 1, wifi_ap_config__number_ranges, + (ProtobufCMessageInit) wifi_ap_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_sta_config__field_descriptors[16] = +{ + { + "ssid", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, ssid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "password", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, password), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "scan_method", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, scan_method), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "bssid_set", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, bssid_set), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "bssid", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, bssid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "channel", + 6, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, channel), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "listen_interval", + 7, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, listen_interval), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "sort_method", + 8, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, sort_method), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "threshold", + 9, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, threshold), + &wifi_scan_threshold__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "pmf_cfg", + 10, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, pmf_cfg), + &wifi_pmf_config__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "bitmask", + 11, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, bitmask), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "sae_pwe_h2e", + 12, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, sae_pwe_h2e), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "failure_retry_cnt", + 13, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, failure_retry_cnt), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "he_bitmask", + 14, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, he_bitmask), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "sae_h2e_identifier", + 15, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, sae_h2e_identifier), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "sae_pk_mode", + 16, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiStaConfig, sae_pk_mode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_sta_config__field_indices_by_name[] = { + 10, /* field[10] = bitmask */ + 4, /* field[4] = bssid */ + 3, /* field[3] = bssid_set */ + 5, /* field[5] = channel */ + 12, /* field[12] = failure_retry_cnt */ + 13, /* field[13] = he_bitmask */ + 6, /* field[6] = listen_interval */ + 1, /* field[1] = password */ + 9, /* field[9] = pmf_cfg */ + 14, /* field[14] = sae_h2e_identifier */ + 15, /* field[15] = sae_pk_mode */ + 11, /* field[11] = sae_pwe_h2e */ + 2, /* field[2] = scan_method */ + 7, /* field[7] = sort_method */ + 0, /* field[0] = ssid */ + 8, /* field[8] = threshold */ +}; +static const ProtobufCIntRange wifi_sta_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 16 } +}; +const ProtobufCMessageDescriptor wifi_sta_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_sta_config", + "WifiStaConfig", + "WifiStaConfig", + "", + sizeof(WifiStaConfig), + 16, + wifi_sta_config__field_descriptors, + wifi_sta_config__field_indices_by_name, + 1, wifi_sta_config__number_ranges, + (ProtobufCMessageInit) wifi_sta_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_config__field_descriptors[2] = +{ + { + "ap", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(WifiConfig, u_case), + offsetof(WifiConfig, ap), + &wifi_ap_config__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "sta", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(WifiConfig, u_case), + offsetof(WifiConfig, sta), + &wifi_sta_config__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_config__field_indices_by_name[] = { + 0, /* field[0] = ap */ + 1, /* field[1] = sta */ +}; +static const ProtobufCIntRange wifi_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_config", + "WifiConfig", + "WifiConfig", + "", + sizeof(WifiConfig), + 2, + wifi_config__field_descriptors, + wifi_config__field_indices_by_name, + 1, wifi_config__number_ranges, + (ProtobufCMessageInit) wifi_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_sta_info__field_descriptors[3] = +{ + { + "mac", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiStaInfo, mac), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "rssi", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiStaInfo, rssi), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "bitmask", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiStaInfo, bitmask), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_sta_info__field_indices_by_name[] = { + 2, /* field[2] = bitmask */ + 0, /* field[0] = mac */ + 1, /* field[1] = rssi */ +}; +static const ProtobufCIntRange wifi_sta_info__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor wifi_sta_info__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_sta_info", + "WifiStaInfo", + "WifiStaInfo", + "", + sizeof(WifiStaInfo), + 3, + wifi_sta_info__field_descriptors, + wifi_sta_info__field_indices_by_name, + 1, wifi_sta_info__number_ranges, + (ProtobufCMessageInit) wifi_sta_info__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_sta_list__field_descriptors[2] = +{ + { + "sta", + 1, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(WifiStaList, n_sta), + offsetof(WifiStaList, sta), + &wifi_sta_info__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "num", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiStaList, num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_sta_list__field_indices_by_name[] = { + 1, /* field[1] = num */ + 0, /* field[0] = sta */ +}; +static const ProtobufCIntRange wifi_sta_list__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_sta_list__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_sta_list", + "WifiStaList", + "WifiStaList", + "", + sizeof(WifiStaList), + 2, + wifi_sta_list__field_descriptors, + wifi_sta_list__field_indices_by_name, + 1, wifi_sta_list__number_ranges, + (ProtobufCMessageInit) wifi_sta_list__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_pkt_rx_ctrl__field_descriptors[19] = +{ + { + "rssi", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, rssi), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "rate", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, rate), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "sig_mode", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, sig_mode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "mcs", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, mcs), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "cwb", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, cwb), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "smoothing", + 6, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, smoothing), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "not_sounding", + 7, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, not_sounding), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "aggregation", + 8, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, aggregation), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "stbc", + 9, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, stbc), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "fec_coding", + 10, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, fec_coding), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "sgi", + 11, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, sgi), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "noise_floor", + 12, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, noise_floor), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ampdu_cnt", + 13, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, ampdu_cnt), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "channel", + 14, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, channel), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "secondary_channel", + 15, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, secondary_channel), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "timestamp", + 16, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, timestamp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ant", + 17, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, ant), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "sig_len", + 18, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, sig_len), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "rx_state", + 19, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPktRxCtrl, rx_state), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_pkt_rx_ctrl__field_indices_by_name[] = { + 7, /* field[7] = aggregation */ + 12, /* field[12] = ampdu_cnt */ + 16, /* field[16] = ant */ + 13, /* field[13] = channel */ + 4, /* field[4] = cwb */ + 9, /* field[9] = fec_coding */ + 3, /* field[3] = mcs */ + 11, /* field[11] = noise_floor */ + 6, /* field[6] = not_sounding */ + 1, /* field[1] = rate */ + 0, /* field[0] = rssi */ + 18, /* field[18] = rx_state */ + 14, /* field[14] = secondary_channel */ + 10, /* field[10] = sgi */ + 17, /* field[17] = sig_len */ + 2, /* field[2] = sig_mode */ + 5, /* field[5] = smoothing */ + 8, /* field[8] = stbc */ + 15, /* field[15] = timestamp */ +}; +static const ProtobufCIntRange wifi_pkt_rx_ctrl__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 19 } +}; +const ProtobufCMessageDescriptor wifi_pkt_rx_ctrl__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_pkt_rx_ctrl", + "WifiPktRxCtrl", + "WifiPktRxCtrl", + "", + sizeof(WifiPktRxCtrl), + 19, + wifi_pkt_rx_ctrl__field_descriptors, + wifi_pkt_rx_ctrl__field_indices_by_name, + 1, wifi_pkt_rx_ctrl__number_ranges, + (ProtobufCMessageInit) wifi_pkt_rx_ctrl__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_promiscuous_pkt__field_descriptors[2] = +{ + { + "rx_ctrl", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(WifiPromiscuousPkt, rx_ctrl), + &wifi_pkt_rx_ctrl__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "payload", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiPromiscuousPkt, payload), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_promiscuous_pkt__field_indices_by_name[] = { + 1, /* field[1] = payload */ + 0, /* field[0] = rx_ctrl */ +}; +static const ProtobufCIntRange wifi_promiscuous_pkt__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_promiscuous_pkt__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_promiscuous_pkt", + "WifiPromiscuousPkt", + "WifiPromiscuousPkt", + "", + sizeof(WifiPromiscuousPkt), + 2, + wifi_promiscuous_pkt__field_descriptors, + wifi_promiscuous_pkt__field_indices_by_name, + 1, wifi_promiscuous_pkt__number_ranges, + (ProtobufCMessageInit) wifi_promiscuous_pkt__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_promiscuous_filter__field_descriptors[1] = +{ + { + "filter_mask", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiPromiscuousFilter, filter_mask), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_promiscuous_filter__field_indices_by_name[] = { + 0, /* field[0] = filter_mask */ +}; +static const ProtobufCIntRange wifi_promiscuous_filter__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor wifi_promiscuous_filter__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_promiscuous_filter", + "WifiPromiscuousFilter", + "WifiPromiscuousFilter", + "", + sizeof(WifiPromiscuousFilter), + 1, + wifi_promiscuous_filter__field_descriptors, + wifi_promiscuous_filter__field_indices_by_name, + 1, wifi_promiscuous_filter__number_ranges, + (ProtobufCMessageInit) wifi_promiscuous_filter__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_csi_config__field_descriptors[7] = +{ + { + "lltf_en", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiCsiConfig, lltf_en), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "htltf_en", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiCsiConfig, htltf_en), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "stbc_htltf2_en", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiCsiConfig, stbc_htltf2_en), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ltf_merge_en", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiCsiConfig, ltf_merge_en), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "channel_filter_en", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiCsiConfig, channel_filter_en), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "manu_scale", + 6, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiCsiConfig, manu_scale), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "shift", + 7, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiCsiConfig, shift), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_csi_config__field_indices_by_name[] = { + 4, /* field[4] = channel_filter_en */ + 1, /* field[1] = htltf_en */ + 0, /* field[0] = lltf_en */ + 3, /* field[3] = ltf_merge_en */ + 5, /* field[5] = manu_scale */ + 6, /* field[6] = shift */ + 2, /* field[2] = stbc_htltf2_en */ +}; +static const ProtobufCIntRange wifi_csi_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 7 } +}; +const ProtobufCMessageDescriptor wifi_csi_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_csi_config", + "WifiCsiConfig", + "WifiCsiConfig", + "", + sizeof(WifiCsiConfig), + 7, + wifi_csi_config__field_descriptors, + wifi_csi_config__field_indices_by_name, + 1, wifi_csi_config__number_ranges, + (ProtobufCMessageInit) wifi_csi_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_csi_info__field_descriptors[6] = +{ + { + "rx_ctrl", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(WifiCsiInfo, rx_ctrl), + &wifi_pkt_rx_ctrl__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "mac", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiCsiInfo, mac), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "dmac", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiCsiInfo, dmac), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "first_word_invalid", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiCsiInfo, first_word_invalid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "buf", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiCsiInfo, buf), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "len", + 6, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiCsiInfo, len), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_csi_info__field_indices_by_name[] = { + 4, /* field[4] = buf */ + 2, /* field[2] = dmac */ + 3, /* field[3] = first_word_invalid */ + 5, /* field[5] = len */ + 1, /* field[1] = mac */ + 0, /* field[0] = rx_ctrl */ +}; +static const ProtobufCIntRange wifi_csi_info__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 6 } +}; +const ProtobufCMessageDescriptor wifi_csi_info__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_csi_info", + "WifiCsiInfo", + "WifiCsiInfo", + "", + sizeof(WifiCsiInfo), + 6, + wifi_csi_info__field_descriptors, + wifi_csi_info__field_indices_by_name, + 1, wifi_csi_info__number_ranges, + (ProtobufCMessageInit) wifi_csi_info__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_ant_gpio__field_descriptors[2] = +{ + { + "gpio_select", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiAntGpio, gpio_select), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "gpio_num", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiAntGpio, gpio_num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_ant_gpio__field_indices_by_name[] = { + 1, /* field[1] = gpio_num */ + 0, /* field[0] = gpio_select */ +}; +static const ProtobufCIntRange wifi_ant_gpio__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_ant_gpio__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_ant_gpio", + "WifiAntGpio", + "WifiAntGpio", + "", + sizeof(WifiAntGpio), + 2, + wifi_ant_gpio__field_descriptors, + wifi_ant_gpio__field_indices_by_name, + 1, wifi_ant_gpio__number_ranges, + (ProtobufCMessageInit) wifi_ant_gpio__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_ant_gpio_config__field_descriptors[1] = +{ + { + "gpio_cfgs", + 1, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(WifiAntGpioConfig, n_gpio_cfgs), + offsetof(WifiAntGpioConfig, gpio_cfgs), + &wifi_ant_gpio__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_ant_gpio_config__field_indices_by_name[] = { + 0, /* field[0] = gpio_cfgs */ +}; +static const ProtobufCIntRange wifi_ant_gpio_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor wifi_ant_gpio_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_ant_gpio_config", + "WifiAntGpioConfig", + "WifiAntGpioConfig", + "", + sizeof(WifiAntGpioConfig), + 1, + wifi_ant_gpio_config__field_descriptors, + wifi_ant_gpio_config__field_indices_by_name, + 1, wifi_ant_gpio_config__number_ranges, + (ProtobufCMessageInit) wifi_ant_gpio_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_ant_config__field_descriptors[5] = +{ + { + "rx_ant_mode", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiAntConfig, rx_ant_mode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "rx_ant_default", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiAntConfig, rx_ant_default), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "tx_ant_mode", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiAntConfig, tx_ant_mode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "enabled_ant0", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiAntConfig, enabled_ant0), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "enabled_ant1", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiAntConfig, enabled_ant1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_ant_config__field_indices_by_name[] = { + 3, /* field[3] = enabled_ant0 */ + 4, /* field[4] = enabled_ant1 */ + 1, /* field[1] = rx_ant_default */ + 0, /* field[0] = rx_ant_mode */ + 2, /* field[2] = tx_ant_mode */ +}; +static const ProtobufCIntRange wifi_ant_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 5 } +}; +const ProtobufCMessageDescriptor wifi_ant_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_ant_config", + "WifiAntConfig", + "WifiAntConfig", + "", + sizeof(WifiAntConfig), + 5, + wifi_ant_config__field_descriptors, + wifi_ant_config__field_indices_by_name, + 1, wifi_ant_config__number_ranges, + (ProtobufCMessageInit) wifi_ant_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_action_tx_req__field_descriptors[5] = +{ + { + "ifx", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiActionTxReq, ifx), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "dest_mac", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiActionTxReq, dest_mac), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "no_ack", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiActionTxReq, no_ack), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "data_len", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiActionTxReq, data_len), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "data", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiActionTxReq, data), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_action_tx_req__field_indices_by_name[] = { + 4, /* field[4] = data */ + 3, /* field[3] = data_len */ + 1, /* field[1] = dest_mac */ + 0, /* field[0] = ifx */ + 2, /* field[2] = no_ack */ +}; +static const ProtobufCIntRange wifi_action_tx_req__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 5 } +}; +const ProtobufCMessageDescriptor wifi_action_tx_req__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_action_tx_req", + "WifiActionTxReq", + "WifiActionTxReq", + "", + sizeof(WifiActionTxReq), + 5, + wifi_action_tx_req__field_descriptors, + wifi_action_tx_req__field_indices_by_name, + 1, wifi_action_tx_req__number_ranges, + (ProtobufCMessageInit) wifi_action_tx_req__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_ftm_initiator_cfg__field_descriptors[4] = +{ + { + "resp_mac", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiFtmInitiatorCfg, resp_mac), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "channel", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiFtmInitiatorCfg, channel), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "frm_count", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiFtmInitiatorCfg, frm_count), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "burst_period", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiFtmInitiatorCfg, burst_period), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_ftm_initiator_cfg__field_indices_by_name[] = { + 3, /* field[3] = burst_period */ + 1, /* field[1] = channel */ + 2, /* field[2] = frm_count */ + 0, /* field[0] = resp_mac */ +}; +static const ProtobufCIntRange wifi_ftm_initiator_cfg__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor wifi_ftm_initiator_cfg__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_ftm_initiator_cfg", + "WifiFtmInitiatorCfg", + "WifiFtmInitiatorCfg", + "", + sizeof(WifiFtmInitiatorCfg), + 4, + wifi_ftm_initiator_cfg__field_descriptors, + wifi_ftm_initiator_cfg__field_indices_by_name, + 1, wifi_ftm_initiator_cfg__number_ranges, + (ProtobufCMessageInit) wifi_ftm_initiator_cfg__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_event_sta_scan_done__field_descriptors[3] = +{ + { + "status", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventStaScanDone, status), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "number", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventStaScanDone, number), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "scan_id", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventStaScanDone, scan_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_event_sta_scan_done__field_indices_by_name[] = { + 1, /* field[1] = number */ + 2, /* field[2] = scan_id */ + 0, /* field[0] = status */ +}; +static const ProtobufCIntRange wifi_event_sta_scan_done__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor wifi_event_sta_scan_done__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_event_sta_scan_done", + "WifiEventStaScanDone", + "WifiEventStaScanDone", + "", + sizeof(WifiEventStaScanDone), + 3, + wifi_event_sta_scan_done__field_descriptors, + wifi_event_sta_scan_done__field_indices_by_name, + 1, wifi_event_sta_scan_done__number_ranges, + (ProtobufCMessageInit) wifi_event_sta_scan_done__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_event_sta_connected__field_descriptors[6] = +{ + { + "ssid", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiEventStaConnected, ssid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ssid_len", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventStaConnected, ssid_len), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "bssid", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiEventStaConnected, bssid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "channel", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventStaConnected, channel), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "authmode", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiEventStaConnected, authmode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "aid", + 6, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiEventStaConnected, aid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_event_sta_connected__field_indices_by_name[] = { + 5, /* field[5] = aid */ + 4, /* field[4] = authmode */ + 2, /* field[2] = bssid */ + 3, /* field[3] = channel */ + 0, /* field[0] = ssid */ + 1, /* field[1] = ssid_len */ +}; +static const ProtobufCIntRange wifi_event_sta_connected__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 6 } +}; +const ProtobufCMessageDescriptor wifi_event_sta_connected__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_event_sta_connected", + "WifiEventStaConnected", + "WifiEventStaConnected", + "", + sizeof(WifiEventStaConnected), + 6, + wifi_event_sta_connected__field_descriptors, + wifi_event_sta_connected__field_indices_by_name, + 1, wifi_event_sta_connected__number_ranges, + (ProtobufCMessageInit) wifi_event_sta_connected__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_event_sta_disconnected__field_descriptors[5] = +{ + { + "ssid", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiEventStaDisconnected, ssid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ssid_len", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventStaDisconnected, ssid_len), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "bssid", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiEventStaDisconnected, bssid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "reason", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventStaDisconnected, reason), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "rssi", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiEventStaDisconnected, rssi), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_event_sta_disconnected__field_indices_by_name[] = { + 2, /* field[2] = bssid */ + 3, /* field[3] = reason */ + 4, /* field[4] = rssi */ + 0, /* field[0] = ssid */ + 1, /* field[1] = ssid_len */ +}; +static const ProtobufCIntRange wifi_event_sta_disconnected__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 5 } +}; +const ProtobufCMessageDescriptor wifi_event_sta_disconnected__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_event_sta_disconnected", + "WifiEventStaDisconnected", + "WifiEventStaDisconnected", + "", + sizeof(WifiEventStaDisconnected), + 5, + wifi_event_sta_disconnected__field_descriptors, + wifi_event_sta_disconnected__field_indices_by_name, + 1, wifi_event_sta_disconnected__number_ranges, + (ProtobufCMessageInit) wifi_event_sta_disconnected__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_event_sta_authmode_change__field_descriptors[2] = +{ + { + "old_mode", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiEventStaAuthmodeChange, old_mode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "new_mode", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiEventStaAuthmodeChange, new_mode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_event_sta_authmode_change__field_indices_by_name[] = { + 1, /* field[1] = new_mode */ + 0, /* field[0] = old_mode */ +}; +static const ProtobufCIntRange wifi_event_sta_authmode_change__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_event_sta_authmode_change__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_event_sta_authmode_change", + "WifiEventStaAuthmodeChange", + "WifiEventStaAuthmodeChange", + "", + sizeof(WifiEventStaAuthmodeChange), + 2, + wifi_event_sta_authmode_change__field_descriptors, + wifi_event_sta_authmode_change__field_indices_by_name, + 1, wifi_event_sta_authmode_change__number_ranges, + (ProtobufCMessageInit) wifi_event_sta_authmode_change__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_event_sta_wps_er_pin__field_descriptors[1] = +{ + { + "pin_code", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiEventStaWpsErPin, pin_code), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_event_sta_wps_er_pin__field_indices_by_name[] = { + 0, /* field[0] = pin_code */ +}; +static const ProtobufCIntRange wifi_event_sta_wps_er_pin__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor wifi_event_sta_wps_er_pin__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_event_sta_wps_er_pin", + "WifiEventStaWpsErPin", + "WifiEventStaWpsErPin", + "", + sizeof(WifiEventStaWpsErPin), + 1, + wifi_event_sta_wps_er_pin__field_descriptors, + wifi_event_sta_wps_er_pin__field_indices_by_name, + 1, wifi_event_sta_wps_er_pin__number_ranges, + (ProtobufCMessageInit) wifi_event_sta_wps_er_pin__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor ap_cred__field_descriptors[2] = +{ + { + "ssid", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(ApCred, ssid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "passphrase", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(ApCred, passphrase), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned ap_cred__field_indices_by_name[] = { + 1, /* field[1] = passphrase */ + 0, /* field[0] = ssid */ +}; +static const ProtobufCIntRange ap_cred__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor ap_cred__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ap_cred", + "ApCred", + "ApCred", + "", + sizeof(ApCred), + 2, + ap_cred__field_descriptors, + ap_cred__field_indices_by_name, + 1, ap_cred__number_ranges, + (ProtobufCMessageInit) ap_cred__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_event_sta_wps_er_success__field_descriptors[2] = +{ + { + "ap_cred_cnt", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventStaWpsErSuccess, ap_cred_cnt), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ap_creds", + 2, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(WifiEventStaWpsErSuccess, n_ap_creds), + offsetof(WifiEventStaWpsErSuccess, ap_creds), + &ap_cred__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_event_sta_wps_er_success__field_indices_by_name[] = { + 0, /* field[0] = ap_cred_cnt */ + 1, /* field[1] = ap_creds */ +}; +static const ProtobufCIntRange wifi_event_sta_wps_er_success__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_event_sta_wps_er_success__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_event_sta_wps_er_success", + "WifiEventStaWpsErSuccess", + "WifiEventStaWpsErSuccess", + "", + sizeof(WifiEventStaWpsErSuccess), + 2, + wifi_event_sta_wps_er_success__field_descriptors, + wifi_event_sta_wps_er_success__field_indices_by_name, + 1, wifi_event_sta_wps_er_success__number_ranges, + (ProtobufCMessageInit) wifi_event_sta_wps_er_success__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_event_ap_probe_req_rx__field_descriptors[2] = +{ + { + "rssi", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiEventApProbeReqRx, rssi), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "mac", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventApProbeReqRx, mac), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_event_ap_probe_req_rx__field_indices_by_name[] = { + 1, /* field[1] = mac */ + 0, /* field[0] = rssi */ +}; +static const ProtobufCIntRange wifi_event_ap_probe_req_rx__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_event_ap_probe_req_rx__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_event_ap_probe_req_rx", + "WifiEventApProbeReqRx", + "WifiEventApProbeReqRx", + "", + sizeof(WifiEventApProbeReqRx), + 2, + wifi_event_ap_probe_req_rx__field_descriptors, + wifi_event_ap_probe_req_rx__field_indices_by_name, + 1, wifi_event_ap_probe_req_rx__number_ranges, + (ProtobufCMessageInit) wifi_event_ap_probe_req_rx__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_event_bss_rssi_low__field_descriptors[1] = +{ + { + "rssi", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiEventBssRssiLow, rssi), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_event_bss_rssi_low__field_indices_by_name[] = { + 0, /* field[0] = rssi */ +}; +static const ProtobufCIntRange wifi_event_bss_rssi_low__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor wifi_event_bss_rssi_low__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_event_bss_rssi_low", + "WifiEventBssRssiLow", + "WifiEventBssRssiLow", + "", + sizeof(WifiEventBssRssiLow), + 1, + wifi_event_bss_rssi_low__field_descriptors, + wifi_event_bss_rssi_low__field_indices_by_name, + 1, wifi_event_bss_rssi_low__number_ranges, + (ProtobufCMessageInit) wifi_event_bss_rssi_low__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_ftm_report_entry__field_descriptors[7] = +{ + { + "dlog_token", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiFtmReportEntry, dlog_token), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "rssi", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiFtmReportEntry, rssi), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "rtt", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiFtmReportEntry, rtt), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "t1", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(WifiFtmReportEntry, t1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "t2", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(WifiFtmReportEntry, t2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "t3", + 6, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(WifiFtmReportEntry, t3), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "t4", + 7, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(WifiFtmReportEntry, t4), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_ftm_report_entry__field_indices_by_name[] = { + 0, /* field[0] = dlog_token */ + 1, /* field[1] = rssi */ + 2, /* field[2] = rtt */ + 3, /* field[3] = t1 */ + 4, /* field[4] = t2 */ + 5, /* field[5] = t3 */ + 6, /* field[6] = t4 */ +}; +static const ProtobufCIntRange wifi_ftm_report_entry__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 7 } +}; +const ProtobufCMessageDescriptor wifi_ftm_report_entry__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_ftm_report_entry", + "WifiFtmReportEntry", + "WifiFtmReportEntry", + "", + sizeof(WifiFtmReportEntry), + 7, + wifi_ftm_report_entry__field_descriptors, + wifi_ftm_report_entry__field_indices_by_name, + 1, wifi_ftm_report_entry__number_ranges, + (ProtobufCMessageInit) wifi_ftm_report_entry__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_event_ftm_report__field_descriptors[7] = +{ + { + "peer_mac", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiEventFtmReport, peer_mac), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "status", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiEventFtmReport, status), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "rtt_raw", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventFtmReport, rtt_raw), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "rtt_est", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventFtmReport, rtt_est), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "dist_est", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventFtmReport, dist_est), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ftm_report_data", + 6, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(WifiEventFtmReport, n_ftm_report_data), + offsetof(WifiEventFtmReport, ftm_report_data), + &wifi_ftm_report_entry__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ftm_report_num_entries", + 7, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventFtmReport, ftm_report_num_entries), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_event_ftm_report__field_indices_by_name[] = { + 4, /* field[4] = dist_est */ + 5, /* field[5] = ftm_report_data */ + 6, /* field[6] = ftm_report_num_entries */ + 0, /* field[0] = peer_mac */ + 3, /* field[3] = rtt_est */ + 2, /* field[2] = rtt_raw */ + 1, /* field[1] = status */ +}; +static const ProtobufCIntRange wifi_event_ftm_report__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 7 } +}; +const ProtobufCMessageDescriptor wifi_event_ftm_report__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_event_ftm_report", + "WifiEventFtmReport", + "WifiEventFtmReport", + "", + sizeof(WifiEventFtmReport), + 7, + wifi_event_ftm_report__field_descriptors, + wifi_event_ftm_report__field_indices_by_name, + 1, wifi_event_ftm_report__number_ranges, + (ProtobufCMessageInit) wifi_event_ftm_report__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_event_action_tx_status__field_descriptors[4] = +{ + { + "ifx", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiEventActionTxStatus, ifx), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "context", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventActionTxStatus, context), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "da", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiEventActionTxStatus, da), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "status", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventActionTxStatus, status), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_event_action_tx_status__field_indices_by_name[] = { + 1, /* field[1] = context */ + 2, /* field[2] = da */ + 0, /* field[0] = ifx */ + 3, /* field[3] = status */ +}; +static const ProtobufCIntRange wifi_event_action_tx_status__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor wifi_event_action_tx_status__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_event_action_tx_status", + "WifiEventActionTxStatus", + "WifiEventActionTxStatus", + "", + sizeof(WifiEventActionTxStatus), + 4, + wifi_event_action_tx_status__field_descriptors, + wifi_event_action_tx_status__field_indices_by_name, + 1, wifi_event_action_tx_status__number_ranges, + (ProtobufCMessageInit) wifi_event_action_tx_status__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_event_roc_done__field_descriptors[1] = +{ + { + "context", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiEventRocDone, context), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_event_roc_done__field_indices_by_name[] = { + 0, /* field[0] = context */ +}; +static const ProtobufCIntRange wifi_event_roc_done__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor wifi_event_roc_done__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_event_roc_done", + "WifiEventRocDone", + "WifiEventRocDone", + "", + sizeof(WifiEventRocDone), + 1, + wifi_event_roc_done__field_descriptors, + wifi_event_roc_done__field_indices_by_name, + 1, wifi_event_roc_done__number_ranges, + (ProtobufCMessageInit) wifi_event_roc_done__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_event_ap_wps_rg_pin__field_descriptors[1] = +{ + { + "pin_code", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiEventApWpsRgPin, pin_code), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_event_ap_wps_rg_pin__field_indices_by_name[] = { + 0, /* field[0] = pin_code */ +}; +static const ProtobufCIntRange wifi_event_ap_wps_rg_pin__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor wifi_event_ap_wps_rg_pin__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_event_ap_wps_rg_pin", + "WifiEventApWpsRgPin", + "WifiEventApWpsRgPin", + "", + sizeof(WifiEventApWpsRgPin), + 1, + wifi_event_ap_wps_rg_pin__field_descriptors, + wifi_event_ap_wps_rg_pin__field_indices_by_name, + 1, wifi_event_ap_wps_rg_pin__number_ranges, + (ProtobufCMessageInit) wifi_event_ap_wps_rg_pin__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_event_ap_wps_rg_fail_reason__field_descriptors[2] = +{ + { + "reason", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(WifiEventApWpsRgFailReason, reason), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "peer_macaddr", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiEventApWpsRgFailReason, peer_macaddr), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_event_ap_wps_rg_fail_reason__field_indices_by_name[] = { + 1, /* field[1] = peer_macaddr */ + 0, /* field[0] = reason */ +}; +static const ProtobufCIntRange wifi_event_ap_wps_rg_fail_reason__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_event_ap_wps_rg_fail_reason__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_event_ap_wps_rg_fail_reason", + "WifiEventApWpsRgFailReason", + "WifiEventApWpsRgFailReason", + "", + sizeof(WifiEventApWpsRgFailReason), + 2, + wifi_event_ap_wps_rg_fail_reason__field_descriptors, + wifi_event_ap_wps_rg_fail_reason__field_indices_by_name, + 1, wifi_event_ap_wps_rg_fail_reason__number_ranges, + (ProtobufCMessageInit) wifi_event_ap_wps_rg_fail_reason__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_event_ap_wps_rg_success__field_descriptors[1] = +{ + { + "peer_macaddr", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(WifiEventApWpsRgSuccess, peer_macaddr), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_event_ap_wps_rg_success__field_indices_by_name[] = { + 0, /* field[0] = peer_macaddr */ +}; +static const ProtobufCIntRange wifi_event_ap_wps_rg_success__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor wifi_event_ap_wps_rg_success__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_event_ap_wps_rg_success", + "WifiEventApWpsRgSuccess", + "WifiEventApWpsRgSuccess", + "", + sizeof(WifiEventApWpsRgSuccess), + 1, + wifi_event_ap_wps_rg_success__field_descriptors, + wifi_event_ap_wps_rg_success__field_indices_by_name, + 1, wifi_event_ap_wps_rg_success__number_ranges, + (ProtobufCMessageInit) wifi_event_ap_wps_rg_success__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_protocols__field_descriptors[2] = +{ + { + "ghz_2g", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiProtocols, ghz_2g), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ghz_5g", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiProtocols, ghz_5g), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_protocols__field_indices_by_name[] = { + 0, /* field[0] = ghz_2g */ + 1, /* field[1] = ghz_5g */ +}; +static const ProtobufCIntRange wifi_protocols__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_protocols__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_protocols", + "WifiProtocols", + "WifiProtocols", + "", + sizeof(WifiProtocols), + 2, + wifi_protocols__field_descriptors, + wifi_protocols__field_indices_by_name, + 1, wifi_protocols__number_ranges, + (ProtobufCMessageInit) wifi_protocols__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_bandwidths__field_descriptors[2] = +{ + { + "ghz_2g", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiBandwidths, ghz_2g), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ghz_5g", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiBandwidths, ghz_5g), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_bandwidths__field_indices_by_name[] = { + 0, /* field[0] = ghz_2g */ + 1, /* field[1] = ghz_5g */ +}; +static const ProtobufCIntRange wifi_bandwidths__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_bandwidths__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_bandwidths", + "WifiBandwidths", + "WifiBandwidths", + "", + sizeof(WifiBandwidths), + 2, + wifi_bandwidths__field_descriptors, + wifi_bandwidths__field_indices_by_name, + 1, wifi_bandwidths__number_ranges, + (ProtobufCMessageInit) wifi_bandwidths__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_itwt_setup_config__field_descriptors[6] = +{ + { + "setup_cmd", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiItwtSetupConfig, setup_cmd), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "bitmask_1", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiItwtSetupConfig, bitmask_1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "min_wake_dura", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiItwtSetupConfig, min_wake_dura), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "wake_invl_mant", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiItwtSetupConfig, wake_invl_mant), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "twt_id", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiItwtSetupConfig, twt_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "timeout_time_ms", + 6, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(WifiItwtSetupConfig, timeout_time_ms), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_itwt_setup_config__field_indices_by_name[] = { + 1, /* field[1] = bitmask_1 */ + 2, /* field[2] = min_wake_dura */ + 0, /* field[0] = setup_cmd */ + 5, /* field[5] = timeout_time_ms */ + 4, /* field[4] = twt_id */ + 3, /* field[3] = wake_invl_mant */ +}; +static const ProtobufCIntRange wifi_itwt_setup_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 6 } +}; +const ProtobufCMessageDescriptor wifi_itwt_setup_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_itwt_setup_config", + "WifiItwtSetupConfig", + "WifiItwtSetupConfig", + "", + sizeof(WifiItwtSetupConfig), + 6, + wifi_itwt_setup_config__field_descriptors, + wifi_itwt_setup_config__field_indices_by_name, + 1, wifi_itwt_setup_config__number_ranges, + (ProtobufCMessageInit) wifi_itwt_setup_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor wifi_twt_config__field_descriptors[2] = +{ + { + "post_wakeup_event", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiTwtConfig, post_wakeup_event), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "twt_enable_keep_alive", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(WifiTwtConfig, twt_enable_keep_alive), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned wifi_twt_config__field_indices_by_name[] = { + 0, /* field[0] = post_wakeup_event */ + 1, /* field[1] = twt_enable_keep_alive */ +}; +static const ProtobufCIntRange wifi_twt_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor wifi_twt_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "wifi_twt_config", + "WifiTwtConfig", + "WifiTwtConfig", + "", + sizeof(WifiTwtConfig), + 2, + wifi_twt_config__field_descriptors, + wifi_twt_config__field_indices_by_name, + 1, wifi_twt_config__number_ranges, + (ProtobufCMessageInit) wifi_twt_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor connected_stalist__field_descriptors[2] = +{ + { + "mac", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(ConnectedSTAList, mac), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "rssi", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(ConnectedSTAList, rssi), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned connected_stalist__field_indices_by_name[] = { + 0, /* field[0] = mac */ + 1, /* field[1] = rssi */ +}; +static const ProtobufCIntRange connected_stalist__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor connected_stalist__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ConnectedSTAList", + "ConnectedSTAList", + "ConnectedSTAList", + "", + sizeof(ConnectedSTAList), + 2, + connected_stalist__field_descriptors, + connected_stalist__field_indices_by_name, + 1, connected_stalist__number_ranges, + (ProtobufCMessageInit) connected_stalist__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor eap_fast_config__field_descriptors[3] = +{ + { + "fast_provisioning", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(EapFastConfig, fast_provisioning), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "fast_max_pac_list_len", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(EapFastConfig, fast_max_pac_list_len), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "fast_pac_format_binary", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(EapFastConfig, fast_pac_format_binary), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned eap_fast_config__field_indices_by_name[] = { + 1, /* field[1] = fast_max_pac_list_len */ + 2, /* field[2] = fast_pac_format_binary */ + 0, /* field[0] = fast_provisioning */ +}; +static const ProtobufCIntRange eap_fast_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor eap_fast_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "eap_fast_config", + "EapFastConfig", + "EapFastConfig", + "", + sizeof(EapFastConfig), + 3, + eap_fast_config__field_descriptors, + eap_fast_config__field_indices_by_name, + 1, eap_fast_config__number_ranges, + (ProtobufCMessageInit) eap_fast_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__get_mac_address__field_descriptors[1] = +{ + { + "mode", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqGetMacAddress, mode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__get_mac_address__field_indices_by_name[] = { + 0, /* field[0] = mode */ +}; +static const ProtobufCIntRange rpc__req__get_mac_address__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__get_mac_address__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_GetMacAddress", + "RpcReqGetMacAddress", + "RpcReqGetMacAddress", + "", + sizeof(RpcReqGetMacAddress), + 1, + rpc__req__get_mac_address__field_descriptors, + rpc__req__get_mac_address__field_indices_by_name, + 1, rpc__req__get_mac_address__number_ranges, + (ProtobufCMessageInit) rpc__req__get_mac_address__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__get_mac_address__field_descriptors[2] = +{ + { + "mac", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(RpcRespGetMacAddress, mac), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "resp", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespGetMacAddress, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__get_mac_address__field_indices_by_name[] = { + 0, /* field[0] = mac */ + 1, /* field[1] = resp */ +}; +static const ProtobufCIntRange rpc__resp__get_mac_address__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__get_mac_address__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_GetMacAddress", + "RpcRespGetMacAddress", + "RpcRespGetMacAddress", + "", + sizeof(RpcRespGetMacAddress), + 2, + rpc__resp__get_mac_address__field_descriptors, + rpc__resp__get_mac_address__field_indices_by_name, + 1, rpc__resp__get_mac_address__number_ranges, + (ProtobufCMessageInit) rpc__resp__get_mac_address__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__get_mode__field_descriptors NULL +#define rpc__req__get_mode__field_indices_by_name NULL +#define rpc__req__get_mode__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__get_mode__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_GetMode", + "RpcReqGetMode", + "RpcReqGetMode", + "", + sizeof(RpcReqGetMode), + 0, + rpc__req__get_mode__field_descriptors, + rpc__req__get_mode__field_indices_by_name, + 0, rpc__req__get_mode__number_ranges, + (ProtobufCMessageInit) rpc__req__get_mode__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__get_mode__field_descriptors[2] = +{ + { + "mode", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespGetMode, mode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "resp", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespGetMode, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__get_mode__field_indices_by_name[] = { + 0, /* field[0] = mode */ + 1, /* field[1] = resp */ +}; +static const ProtobufCIntRange rpc__resp__get_mode__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__get_mode__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_GetMode", + "RpcRespGetMode", + "RpcRespGetMode", + "", + sizeof(RpcRespGetMode), + 2, + rpc__resp__get_mode__field_descriptors, + rpc__resp__get_mode__field_indices_by_name, + 1, rpc__resp__get_mode__number_ranges, + (ProtobufCMessageInit) rpc__resp__get_mode__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__set_mode__field_descriptors[1] = +{ + { + "mode", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqSetMode, mode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__set_mode__field_indices_by_name[] = { + 0, /* field[0] = mode */ +}; +static const ProtobufCIntRange rpc__req__set_mode__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__set_mode__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_SetMode", + "RpcReqSetMode", + "RpcReqSetMode", + "", + sizeof(RpcReqSetMode), + 1, + rpc__req__set_mode__field_descriptors, + rpc__req__set_mode__field_indices_by_name, + 1, rpc__req__set_mode__number_ranges, + (ProtobufCMessageInit) rpc__req__set_mode__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__set_mode__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespSetMode, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__set_mode__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__set_mode__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__set_mode__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_SetMode", + "RpcRespSetMode", + "RpcRespSetMode", + "", + sizeof(RpcRespSetMode), + 1, + rpc__resp__set_mode__field_descriptors, + rpc__resp__set_mode__field_indices_by_name, + 1, rpc__resp__set_mode__number_ranges, + (ProtobufCMessageInit) rpc__resp__set_mode__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__get_ps__field_descriptors NULL +#define rpc__req__get_ps__field_indices_by_name NULL +#define rpc__req__get_ps__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__get_ps__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_GetPs", + "RpcReqGetPs", + "RpcReqGetPs", + "", + sizeof(RpcReqGetPs), + 0, + rpc__req__get_ps__field_descriptors, + rpc__req__get_ps__field_indices_by_name, + 0, rpc__req__get_ps__number_ranges, + (ProtobufCMessageInit) rpc__req__get_ps__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__get_ps__field_descriptors[2] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespGetPs, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "type", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespGetPs, type), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__get_ps__field_indices_by_name[] = { + 0, /* field[0] = resp */ + 1, /* field[1] = type */ +}; +static const ProtobufCIntRange rpc__resp__get_ps__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__get_ps__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_GetPs", + "RpcRespGetPs", + "RpcRespGetPs", + "", + sizeof(RpcRespGetPs), + 2, + rpc__resp__get_ps__field_descriptors, + rpc__resp__get_ps__field_indices_by_name, + 1, rpc__resp__get_ps__number_ranges, + (ProtobufCMessageInit) rpc__resp__get_ps__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__set_ps__field_descriptors[1] = +{ + { + "type", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqSetPs, type), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__set_ps__field_indices_by_name[] = { + 0, /* field[0] = type */ +}; +static const ProtobufCIntRange rpc__req__set_ps__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__set_ps__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_SetPs", + "RpcReqSetPs", + "RpcReqSetPs", + "", + sizeof(RpcReqSetPs), + 1, + rpc__req__set_ps__field_descriptors, + rpc__req__set_ps__field_indices_by_name, + 1, rpc__req__set_ps__number_ranges, + (ProtobufCMessageInit) rpc__req__set_ps__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__set_ps__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespSetPs, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__set_ps__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__set_ps__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__set_ps__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_SetPs", + "RpcRespSetPs", + "RpcRespSetPs", + "", + sizeof(RpcRespSetPs), + 1, + rpc__resp__set_ps__field_descriptors, + rpc__resp__set_ps__field_indices_by_name, + 1, rpc__resp__set_ps__number_ranges, + (ProtobufCMessageInit) rpc__resp__set_ps__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__set_mac_address__field_descriptors[2] = +{ + { + "mac", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(RpcReqSetMacAddress, mac), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "mode", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqSetMacAddress, mode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__set_mac_address__field_indices_by_name[] = { + 0, /* field[0] = mac */ + 1, /* field[1] = mode */ +}; +static const ProtobufCIntRange rpc__req__set_mac_address__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__req__set_mac_address__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_SetMacAddress", + "RpcReqSetMacAddress", + "RpcReqSetMacAddress", + "", + sizeof(RpcReqSetMacAddress), + 2, + rpc__req__set_mac_address__field_descriptors, + rpc__req__set_mac_address__field_indices_by_name, + 1, rpc__req__set_mac_address__number_ranges, + (ProtobufCMessageInit) rpc__req__set_mac_address__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__set_mac_address__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespSetMacAddress, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__set_mac_address__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__set_mac_address__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__set_mac_address__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_SetMacAddress", + "RpcRespSetMacAddress", + "RpcRespSetMacAddress", + "", + sizeof(RpcRespSetMacAddress), + 1, + rpc__resp__set_mac_address__field_descriptors, + rpc__resp__set_mac_address__field_indices_by_name, + 1, rpc__resp__set_mac_address__number_ranges, + (ProtobufCMessageInit) rpc__resp__set_mac_address__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__otabegin__field_descriptors NULL +#define rpc__req__otabegin__field_indices_by_name NULL +#define rpc__req__otabegin__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__otabegin__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_OTABegin", + "RpcReqOTABegin", + "RpcReqOTABegin", + "", + sizeof(RpcReqOTABegin), + 0, + rpc__req__otabegin__field_descriptors, + rpc__req__otabegin__field_indices_by_name, + 0, rpc__req__otabegin__number_ranges, + (ProtobufCMessageInit) rpc__req__otabegin__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__otabegin__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespOTABegin, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__otabegin__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__otabegin__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__otabegin__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_OTABegin", + "RpcRespOTABegin", + "RpcRespOTABegin", + "", + sizeof(RpcRespOTABegin), + 1, + rpc__resp__otabegin__field_descriptors, + rpc__resp__otabegin__field_indices_by_name, + 1, rpc__resp__otabegin__number_ranges, + (ProtobufCMessageInit) rpc__resp__otabegin__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__otawrite__field_descriptors[1] = +{ + { + "ota_data", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(RpcReqOTAWrite, ota_data), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__otawrite__field_indices_by_name[] = { + 0, /* field[0] = ota_data */ +}; +static const ProtobufCIntRange rpc__req__otawrite__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__otawrite__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_OTAWrite", + "RpcReqOTAWrite", + "RpcReqOTAWrite", + "", + sizeof(RpcReqOTAWrite), + 1, + rpc__req__otawrite__field_descriptors, + rpc__req__otawrite__field_indices_by_name, + 1, rpc__req__otawrite__number_ranges, + (ProtobufCMessageInit) rpc__req__otawrite__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__otawrite__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespOTAWrite, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__otawrite__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__otawrite__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__otawrite__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_OTAWrite", + "RpcRespOTAWrite", + "RpcRespOTAWrite", + "", + sizeof(RpcRespOTAWrite), + 1, + rpc__resp__otawrite__field_descriptors, + rpc__resp__otawrite__field_indices_by_name, + 1, rpc__resp__otawrite__number_ranges, + (ProtobufCMessageInit) rpc__resp__otawrite__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__otaend__field_descriptors NULL +#define rpc__req__otaend__field_indices_by_name NULL +#define rpc__req__otaend__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__otaend__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_OTAEnd", + "RpcReqOTAEnd", + "RpcReqOTAEnd", + "", + sizeof(RpcReqOTAEnd), + 0, + rpc__req__otaend__field_descriptors, + rpc__req__otaend__field_indices_by_name, + 0, rpc__req__otaend__number_ranges, + (ProtobufCMessageInit) rpc__req__otaend__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__otaend__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespOTAEnd, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__otaend__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__otaend__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__otaend__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_OTAEnd", + "RpcRespOTAEnd", + "RpcRespOTAEnd", + "", + sizeof(RpcRespOTAEnd), + 1, + rpc__resp__otaend__field_descriptors, + rpc__resp__otaend__field_indices_by_name, + 1, rpc__resp__otaend__number_ranges, + (ProtobufCMessageInit) rpc__resp__otaend__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__otaactivate__field_descriptors NULL +#define rpc__req__otaactivate__field_indices_by_name NULL +#define rpc__req__otaactivate__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__otaactivate__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_OTAActivate", + "RpcReqOTAActivate", + "RpcReqOTAActivate", + "", + sizeof(RpcReqOTAActivate), + 0, + rpc__req__otaactivate__field_descriptors, + rpc__req__otaactivate__field_indices_by_name, + 0, rpc__req__otaactivate__number_ranges, + (ProtobufCMessageInit) rpc__req__otaactivate__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__otaactivate__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespOTAActivate, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__otaactivate__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__otaactivate__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__otaactivate__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_OTAActivate", + "RpcRespOTAActivate", + "RpcRespOTAActivate", + "", + sizeof(RpcRespOTAActivate), + 1, + rpc__resp__otaactivate__field_descriptors, + rpc__resp__otaactivate__field_indices_by_name, + 1, rpc__resp__otaactivate__number_ranges, + (ProtobufCMessageInit) rpc__resp__otaactivate__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_set_max_tx_power__field_descriptors[1] = +{ + { + "power", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiSetMaxTxPower, power), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__wifi_set_max_tx_power__field_indices_by_name[] = { + 0, /* field[0] = power */ +}; +static const ProtobufCIntRange rpc__req__wifi_set_max_tx_power__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_set_max_tx_power__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiSetMaxTxPower", + "RpcReqWifiSetMaxTxPower", + "RpcReqWifiSetMaxTxPower", + "", + sizeof(RpcReqWifiSetMaxTxPower), + 1, + rpc__req__wifi_set_max_tx_power__field_descriptors, + rpc__req__wifi_set_max_tx_power__field_indices_by_name, + 1, rpc__req__wifi_set_max_tx_power__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_set_max_tx_power__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_set_max_tx_power__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiSetMaxTxPower, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_set_max_tx_power__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_set_max_tx_power__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_set_max_tx_power__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiSetMaxTxPower", + "RpcRespWifiSetMaxTxPower", + "RpcRespWifiSetMaxTxPower", + "", + sizeof(RpcRespWifiSetMaxTxPower), + 1, + rpc__resp__wifi_set_max_tx_power__field_descriptors, + rpc__resp__wifi_set_max_tx_power__field_indices_by_name, + 1, rpc__resp__wifi_set_max_tx_power__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_set_max_tx_power__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_get_max_tx_power__field_descriptors NULL +#define rpc__req__wifi_get_max_tx_power__field_indices_by_name NULL +#define rpc__req__wifi_get_max_tx_power__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_get_max_tx_power__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiGetMaxTxPower", + "RpcReqWifiGetMaxTxPower", + "RpcReqWifiGetMaxTxPower", + "", + sizeof(RpcReqWifiGetMaxTxPower), + 0, + rpc__req__wifi_get_max_tx_power__field_descriptors, + rpc__req__wifi_get_max_tx_power__field_indices_by_name, + 0, rpc__req__wifi_get_max_tx_power__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_get_max_tx_power__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_get_max_tx_power__field_descriptors[2] = +{ + { + "power", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiGetMaxTxPower, power), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "resp", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiGetMaxTxPower, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_get_max_tx_power__field_indices_by_name[] = { + 0, /* field[0] = power */ + 1, /* field[1] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_get_max_tx_power__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_get_max_tx_power__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiGetMaxTxPower", + "RpcRespWifiGetMaxTxPower", + "RpcRespWifiGetMaxTxPower", + "", + sizeof(RpcRespWifiGetMaxTxPower), + 2, + rpc__resp__wifi_get_max_tx_power__field_descriptors, + rpc__resp__wifi_get_max_tx_power__field_indices_by_name, + 1, rpc__resp__wifi_get_max_tx_power__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_get_max_tx_power__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__config_heartbeat__field_descriptors[2] = +{ + { + "enable", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(RpcReqConfigHeartbeat, enable), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "duration", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqConfigHeartbeat, duration), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__config_heartbeat__field_indices_by_name[] = { + 1, /* field[1] = duration */ + 0, /* field[0] = enable */ +}; +static const ProtobufCIntRange rpc__req__config_heartbeat__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__req__config_heartbeat__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_ConfigHeartbeat", + "RpcReqConfigHeartbeat", + "RpcReqConfigHeartbeat", + "", + sizeof(RpcReqConfigHeartbeat), + 2, + rpc__req__config_heartbeat__field_descriptors, + rpc__req__config_heartbeat__field_indices_by_name, + 1, rpc__req__config_heartbeat__number_ranges, + (ProtobufCMessageInit) rpc__req__config_heartbeat__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__config_heartbeat__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespConfigHeartbeat, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__config_heartbeat__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__config_heartbeat__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__config_heartbeat__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_ConfigHeartbeat", + "RpcRespConfigHeartbeat", + "RpcRespConfigHeartbeat", + "", + sizeof(RpcRespConfigHeartbeat), + 1, + rpc__resp__config_heartbeat__field_descriptors, + rpc__resp__config_heartbeat__field_indices_by_name, + 1, rpc__resp__config_heartbeat__number_ranges, + (ProtobufCMessageInit) rpc__resp__config_heartbeat__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_init__field_descriptors[1] = +{ + { + "cfg", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiInit, cfg), + &wifi_init_config__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__wifi_init__field_indices_by_name[] = { + 0, /* field[0] = cfg */ +}; +static const ProtobufCIntRange rpc__req__wifi_init__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_init__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiInit", + "RpcReqWifiInit", + "RpcReqWifiInit", + "", + sizeof(RpcReqWifiInit), + 1, + rpc__req__wifi_init__field_descriptors, + rpc__req__wifi_init__field_indices_by_name, + 1, rpc__req__wifi_init__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_init__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_init__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiInit, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_init__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_init__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_init__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiInit", + "RpcRespWifiInit", + "RpcRespWifiInit", + "", + sizeof(RpcRespWifiInit), + 1, + rpc__resp__wifi_init__field_descriptors, + rpc__resp__wifi_init__field_indices_by_name, + 1, rpc__resp__wifi_init__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_init__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_deinit__field_descriptors NULL +#define rpc__req__wifi_deinit__field_indices_by_name NULL +#define rpc__req__wifi_deinit__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_deinit__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiDeinit", + "RpcReqWifiDeinit", + "RpcReqWifiDeinit", + "", + sizeof(RpcReqWifiDeinit), + 0, + rpc__req__wifi_deinit__field_descriptors, + rpc__req__wifi_deinit__field_indices_by_name, + 0, rpc__req__wifi_deinit__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_deinit__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_deinit__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiDeinit, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_deinit__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_deinit__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_deinit__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiDeinit", + "RpcRespWifiDeinit", + "RpcRespWifiDeinit", + "", + sizeof(RpcRespWifiDeinit), + 1, + rpc__resp__wifi_deinit__field_descriptors, + rpc__resp__wifi_deinit__field_indices_by_name, + 1, rpc__resp__wifi_deinit__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_deinit__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_set_config__field_descriptors[2] = +{ + { + "iface", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiSetConfig, iface), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "cfg", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiSetConfig, cfg), + &wifi_config__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__wifi_set_config__field_indices_by_name[] = { + 1, /* field[1] = cfg */ + 0, /* field[0] = iface */ +}; +static const ProtobufCIntRange rpc__req__wifi_set_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_set_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiSetConfig", + "RpcReqWifiSetConfig", + "RpcReqWifiSetConfig", + "", + sizeof(RpcReqWifiSetConfig), + 2, + rpc__req__wifi_set_config__field_descriptors, + rpc__req__wifi_set_config__field_indices_by_name, + 1, rpc__req__wifi_set_config__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_set_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_set_config__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiSetConfig, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_set_config__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_set_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_set_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiSetConfig", + "RpcRespWifiSetConfig", + "RpcRespWifiSetConfig", + "", + sizeof(RpcRespWifiSetConfig), + 1, + rpc__resp__wifi_set_config__field_descriptors, + rpc__resp__wifi_set_config__field_indices_by_name, + 1, rpc__resp__wifi_set_config__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_set_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_get_config__field_descriptors[1] = +{ + { + "iface", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiGetConfig, iface), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__wifi_get_config__field_indices_by_name[] = { + 0, /* field[0] = iface */ +}; +static const ProtobufCIntRange rpc__req__wifi_get_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_get_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiGetConfig", + "RpcReqWifiGetConfig", + "RpcReqWifiGetConfig", + "", + sizeof(RpcReqWifiGetConfig), + 1, + rpc__req__wifi_get_config__field_descriptors, + rpc__req__wifi_get_config__field_indices_by_name, + 1, rpc__req__wifi_get_config__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_get_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_get_config__field_descriptors[3] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiGetConfig, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "iface", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiGetConfig, iface), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "cfg", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiGetConfig, cfg), + &wifi_config__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_get_config__field_indices_by_name[] = { + 2, /* field[2] = cfg */ + 1, /* field[1] = iface */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_get_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_get_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiGetConfig", + "RpcRespWifiGetConfig", + "RpcRespWifiGetConfig", + "", + sizeof(RpcRespWifiGetConfig), + 3, + rpc__resp__wifi_get_config__field_descriptors, + rpc__resp__wifi_get_config__field_indices_by_name, + 1, rpc__resp__wifi_get_config__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_get_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_connect__field_descriptors NULL +#define rpc__req__wifi_connect__field_indices_by_name NULL +#define rpc__req__wifi_connect__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_connect__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiConnect", + "RpcReqWifiConnect", + "RpcReqWifiConnect", + "", + sizeof(RpcReqWifiConnect), + 0, + rpc__req__wifi_connect__field_descriptors, + rpc__req__wifi_connect__field_indices_by_name, + 0, rpc__req__wifi_connect__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_connect__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_connect__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiConnect, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_connect__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_connect__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_connect__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiConnect", + "RpcRespWifiConnect", + "RpcRespWifiConnect", + "", + sizeof(RpcRespWifiConnect), + 1, + rpc__resp__wifi_connect__field_descriptors, + rpc__resp__wifi_connect__field_indices_by_name, + 1, rpc__resp__wifi_connect__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_connect__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_disconnect__field_descriptors NULL +#define rpc__req__wifi_disconnect__field_indices_by_name NULL +#define rpc__req__wifi_disconnect__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_disconnect__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiDisconnect", + "RpcReqWifiDisconnect", + "RpcReqWifiDisconnect", + "", + sizeof(RpcReqWifiDisconnect), + 0, + rpc__req__wifi_disconnect__field_descriptors, + rpc__req__wifi_disconnect__field_indices_by_name, + 0, rpc__req__wifi_disconnect__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_disconnect__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_disconnect__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiDisconnect, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_disconnect__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_disconnect__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_disconnect__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiDisconnect", + "RpcRespWifiDisconnect", + "RpcRespWifiDisconnect", + "", + sizeof(RpcRespWifiDisconnect), + 1, + rpc__resp__wifi_disconnect__field_descriptors, + rpc__resp__wifi_disconnect__field_indices_by_name, + 1, rpc__resp__wifi_disconnect__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_disconnect__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_start__field_descriptors NULL +#define rpc__req__wifi_start__field_indices_by_name NULL +#define rpc__req__wifi_start__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_start__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiStart", + "RpcReqWifiStart", + "RpcReqWifiStart", + "", + sizeof(RpcReqWifiStart), + 0, + rpc__req__wifi_start__field_descriptors, + rpc__req__wifi_start__field_indices_by_name, + 0, rpc__req__wifi_start__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_start__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_start__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiStart, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_start__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_start__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_start__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiStart", + "RpcRespWifiStart", + "RpcRespWifiStart", + "", + sizeof(RpcRespWifiStart), + 1, + rpc__resp__wifi_start__field_descriptors, + rpc__resp__wifi_start__field_indices_by_name, + 1, rpc__resp__wifi_start__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_start__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_stop__field_descriptors NULL +#define rpc__req__wifi_stop__field_indices_by_name NULL +#define rpc__req__wifi_stop__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_stop__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiStop", + "RpcReqWifiStop", + "RpcReqWifiStop", + "", + sizeof(RpcReqWifiStop), + 0, + rpc__req__wifi_stop__field_descriptors, + rpc__req__wifi_stop__field_indices_by_name, + 0, rpc__req__wifi_stop__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_stop__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_stop__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiStop, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_stop__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_stop__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_stop__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiStop", + "RpcRespWifiStop", + "RpcRespWifiStop", + "", + sizeof(RpcRespWifiStop), + 1, + rpc__resp__wifi_stop__field_descriptors, + rpc__resp__wifi_stop__field_indices_by_name, + 1, rpc__resp__wifi_stop__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_stop__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_scan_start__field_descriptors[3] = +{ + { + "config", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiScanStart, config), + &wifi_scan_config__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "block", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiScanStart, block), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "config_set", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiScanStart, config_set), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__wifi_scan_start__field_indices_by_name[] = { + 1, /* field[1] = block */ + 0, /* field[0] = config */ + 2, /* field[2] = config_set */ +}; +static const ProtobufCIntRange rpc__req__wifi_scan_start__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_scan_start__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiScanStart", + "RpcReqWifiScanStart", + "RpcReqWifiScanStart", + "", + sizeof(RpcReqWifiScanStart), + 3, + rpc__req__wifi_scan_start__field_descriptors, + rpc__req__wifi_scan_start__field_indices_by_name, + 1, rpc__req__wifi_scan_start__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_scan_start__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_scan_start__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiScanStart, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_scan_start__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_scan_start__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_scan_start__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiScanStart", + "RpcRespWifiScanStart", + "RpcRespWifiScanStart", + "", + sizeof(RpcRespWifiScanStart), + 1, + rpc__resp__wifi_scan_start__field_descriptors, + rpc__resp__wifi_scan_start__field_indices_by_name, + 1, rpc__resp__wifi_scan_start__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_scan_start__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_scan_stop__field_descriptors NULL +#define rpc__req__wifi_scan_stop__field_indices_by_name NULL +#define rpc__req__wifi_scan_stop__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_scan_stop__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiScanStop", + "RpcReqWifiScanStop", + "RpcReqWifiScanStop", + "", + sizeof(RpcReqWifiScanStop), + 0, + rpc__req__wifi_scan_stop__field_descriptors, + rpc__req__wifi_scan_stop__field_indices_by_name, + 0, rpc__req__wifi_scan_stop__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_scan_stop__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_scan_stop__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiScanStop, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_scan_stop__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_scan_stop__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_scan_stop__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiScanStop", + "RpcRespWifiScanStop", + "RpcRespWifiScanStop", + "", + sizeof(RpcRespWifiScanStop), + 1, + rpc__resp__wifi_scan_stop__field_descriptors, + rpc__resp__wifi_scan_stop__field_indices_by_name, + 1, rpc__resp__wifi_scan_stop__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_scan_stop__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_scan_get_ap_num__field_descriptors NULL +#define rpc__req__wifi_scan_get_ap_num__field_indices_by_name NULL +#define rpc__req__wifi_scan_get_ap_num__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_scan_get_ap_num__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiScanGetApNum", + "RpcReqWifiScanGetApNum", + "RpcReqWifiScanGetApNum", + "", + sizeof(RpcReqWifiScanGetApNum), + 0, + rpc__req__wifi_scan_get_ap_num__field_descriptors, + rpc__req__wifi_scan_get_ap_num__field_indices_by_name, + 0, rpc__req__wifi_scan_get_ap_num__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_scan_get_ap_num__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_scan_get_ap_num__field_descriptors[2] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiScanGetApNum, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "number", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiScanGetApNum, number), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_scan_get_ap_num__field_indices_by_name[] = { + 1, /* field[1] = number */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_scan_get_ap_num__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_scan_get_ap_num__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiScanGetApNum", + "RpcRespWifiScanGetApNum", + "RpcRespWifiScanGetApNum", + "", + sizeof(RpcRespWifiScanGetApNum), + 2, + rpc__resp__wifi_scan_get_ap_num__field_descriptors, + rpc__resp__wifi_scan_get_ap_num__field_indices_by_name, + 1, rpc__resp__wifi_scan_get_ap_num__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_scan_get_ap_num__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_scan_get_ap_records__field_descriptors[1] = +{ + { + "number", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiScanGetApRecords, number), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__wifi_scan_get_ap_records__field_indices_by_name[] = { + 0, /* field[0] = number */ +}; +static const ProtobufCIntRange rpc__req__wifi_scan_get_ap_records__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_scan_get_ap_records__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiScanGetApRecords", + "RpcReqWifiScanGetApRecords", + "RpcReqWifiScanGetApRecords", + "", + sizeof(RpcReqWifiScanGetApRecords), + 1, + rpc__req__wifi_scan_get_ap_records__field_descriptors, + rpc__req__wifi_scan_get_ap_records__field_indices_by_name, + 1, rpc__req__wifi_scan_get_ap_records__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_scan_get_ap_records__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_scan_get_ap_records__field_descriptors[3] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiScanGetApRecords, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "number", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiScanGetApRecords, number), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ap_records", + 3, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(RpcRespWifiScanGetApRecords, n_ap_records), + offsetof(RpcRespWifiScanGetApRecords, ap_records), + &wifi_ap_record__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_scan_get_ap_records__field_indices_by_name[] = { + 2, /* field[2] = ap_records */ + 1, /* field[1] = number */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_scan_get_ap_records__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_scan_get_ap_records__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiScanGetApRecords", + "RpcRespWifiScanGetApRecords", + "RpcRespWifiScanGetApRecords", + "", + sizeof(RpcRespWifiScanGetApRecords), + 3, + rpc__resp__wifi_scan_get_ap_records__field_descriptors, + rpc__resp__wifi_scan_get_ap_records__field_indices_by_name, + 1, rpc__resp__wifi_scan_get_ap_records__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_scan_get_ap_records__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_scan_get_ap_record__field_descriptors NULL +#define rpc__req__wifi_scan_get_ap_record__field_indices_by_name NULL +#define rpc__req__wifi_scan_get_ap_record__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_scan_get_ap_record__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiScanGetApRecord", + "RpcReqWifiScanGetApRecord", + "RpcReqWifiScanGetApRecord", + "", + sizeof(RpcReqWifiScanGetApRecord), + 0, + rpc__req__wifi_scan_get_ap_record__field_descriptors, + rpc__req__wifi_scan_get_ap_record__field_indices_by_name, + 0, rpc__req__wifi_scan_get_ap_record__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_scan_get_ap_record__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_scan_get_ap_record__field_descriptors[2] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiScanGetApRecord, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ap_record", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiScanGetApRecord, ap_record), + &wifi_ap_record__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_scan_get_ap_record__field_indices_by_name[] = { + 1, /* field[1] = ap_record */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_scan_get_ap_record__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_scan_get_ap_record__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiScanGetApRecord", + "RpcRespWifiScanGetApRecord", + "RpcRespWifiScanGetApRecord", + "", + sizeof(RpcRespWifiScanGetApRecord), + 2, + rpc__resp__wifi_scan_get_ap_record__field_descriptors, + rpc__resp__wifi_scan_get_ap_record__field_indices_by_name, + 1, rpc__resp__wifi_scan_get_ap_record__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_scan_get_ap_record__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_clear_ap_list__field_descriptors NULL +#define rpc__req__wifi_clear_ap_list__field_indices_by_name NULL +#define rpc__req__wifi_clear_ap_list__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_clear_ap_list__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiClearApList", + "RpcReqWifiClearApList", + "RpcReqWifiClearApList", + "", + sizeof(RpcReqWifiClearApList), + 0, + rpc__req__wifi_clear_ap_list__field_descriptors, + rpc__req__wifi_clear_ap_list__field_indices_by_name, + 0, rpc__req__wifi_clear_ap_list__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_clear_ap_list__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_clear_ap_list__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiClearApList, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_clear_ap_list__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_clear_ap_list__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_clear_ap_list__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiClearApList", + "RpcRespWifiClearApList", + "RpcRespWifiClearApList", + "", + sizeof(RpcRespWifiClearApList), + 1, + rpc__resp__wifi_clear_ap_list__field_descriptors, + rpc__resp__wifi_clear_ap_list__field_indices_by_name, + 1, rpc__resp__wifi_clear_ap_list__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_clear_ap_list__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_restore__field_descriptors NULL +#define rpc__req__wifi_restore__field_indices_by_name NULL +#define rpc__req__wifi_restore__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_restore__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiRestore", + "RpcReqWifiRestore", + "RpcReqWifiRestore", + "", + sizeof(RpcReqWifiRestore), + 0, + rpc__req__wifi_restore__field_descriptors, + rpc__req__wifi_restore__field_indices_by_name, + 0, rpc__req__wifi_restore__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_restore__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_restore__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiRestore, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_restore__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_restore__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_restore__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiRestore", + "RpcRespWifiRestore", + "RpcRespWifiRestore", + "", + sizeof(RpcRespWifiRestore), + 1, + rpc__resp__wifi_restore__field_descriptors, + rpc__resp__wifi_restore__field_indices_by_name, + 1, rpc__resp__wifi_restore__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_restore__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_clear_fast_connect__field_descriptors NULL +#define rpc__req__wifi_clear_fast_connect__field_indices_by_name NULL +#define rpc__req__wifi_clear_fast_connect__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_clear_fast_connect__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiClearFastConnect", + "RpcReqWifiClearFastConnect", + "RpcReqWifiClearFastConnect", + "", + sizeof(RpcReqWifiClearFastConnect), + 0, + rpc__req__wifi_clear_fast_connect__field_descriptors, + rpc__req__wifi_clear_fast_connect__field_indices_by_name, + 0, rpc__req__wifi_clear_fast_connect__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_clear_fast_connect__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_clear_fast_connect__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiClearFastConnect, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_clear_fast_connect__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_clear_fast_connect__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_clear_fast_connect__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiClearFastConnect", + "RpcRespWifiClearFastConnect", + "RpcRespWifiClearFastConnect", + "", + sizeof(RpcRespWifiClearFastConnect), + 1, + rpc__resp__wifi_clear_fast_connect__field_descriptors, + rpc__resp__wifi_clear_fast_connect__field_indices_by_name, + 1, rpc__resp__wifi_clear_fast_connect__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_clear_fast_connect__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_deauth_sta__field_descriptors[1] = +{ + { + "aid", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiDeauthSta, aid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__wifi_deauth_sta__field_indices_by_name[] = { + 0, /* field[0] = aid */ +}; +static const ProtobufCIntRange rpc__req__wifi_deauth_sta__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_deauth_sta__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiDeauthSta", + "RpcReqWifiDeauthSta", + "RpcReqWifiDeauthSta", + "", + sizeof(RpcReqWifiDeauthSta), + 1, + rpc__req__wifi_deauth_sta__field_descriptors, + rpc__req__wifi_deauth_sta__field_indices_by_name, + 1, rpc__req__wifi_deauth_sta__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_deauth_sta__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_deauth_sta__field_descriptors[2] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiDeauthSta, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "aid", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiDeauthSta, aid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_deauth_sta__field_indices_by_name[] = { + 1, /* field[1] = aid */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_deauth_sta__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_deauth_sta__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiDeauthSta", + "RpcRespWifiDeauthSta", + "RpcRespWifiDeauthSta", + "", + sizeof(RpcRespWifiDeauthSta), + 2, + rpc__resp__wifi_deauth_sta__field_descriptors, + rpc__resp__wifi_deauth_sta__field_indices_by_name, + 1, rpc__resp__wifi_deauth_sta__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_deauth_sta__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_sta_get_ap_info__field_descriptors NULL +#define rpc__req__wifi_sta_get_ap_info__field_indices_by_name NULL +#define rpc__req__wifi_sta_get_ap_info__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_sta_get_ap_info__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiStaGetApInfo", + "RpcReqWifiStaGetApInfo", + "RpcReqWifiStaGetApInfo", + "", + sizeof(RpcReqWifiStaGetApInfo), + 0, + rpc__req__wifi_sta_get_ap_info__field_descriptors, + rpc__req__wifi_sta_get_ap_info__field_indices_by_name, + 0, rpc__req__wifi_sta_get_ap_info__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_sta_get_ap_info__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_get_ap_info__field_descriptors[2] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiStaGetApInfo, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ap_record", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiStaGetApInfo, ap_record), + &wifi_ap_record__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_sta_get_ap_info__field_indices_by_name[] = { + 1, /* field[1] = ap_record */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_sta_get_ap_info__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_sta_get_ap_info__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiStaGetApInfo", + "RpcRespWifiStaGetApInfo", + "RpcRespWifiStaGetApInfo", + "", + sizeof(RpcRespWifiStaGetApInfo), + 2, + rpc__resp__wifi_sta_get_ap_info__field_descriptors, + rpc__resp__wifi_sta_get_ap_info__field_indices_by_name, + 1, rpc__resp__wifi_sta_get_ap_info__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_sta_get_ap_info__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_set_protocol__field_descriptors[2] = +{ + { + "ifx", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiSetProtocol, ifx), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "protocol_bitmap", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiSetProtocol, protocol_bitmap), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__wifi_set_protocol__field_indices_by_name[] = { + 0, /* field[0] = ifx */ + 1, /* field[1] = protocol_bitmap */ +}; +static const ProtobufCIntRange rpc__req__wifi_set_protocol__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_set_protocol__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiSetProtocol", + "RpcReqWifiSetProtocol", + "RpcReqWifiSetProtocol", + "", + sizeof(RpcReqWifiSetProtocol), + 2, + rpc__req__wifi_set_protocol__field_descriptors, + rpc__req__wifi_set_protocol__field_indices_by_name, + 1, rpc__req__wifi_set_protocol__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_set_protocol__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_set_protocol__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiSetProtocol, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_set_protocol__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_set_protocol__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_set_protocol__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiSetProtocol", + "RpcRespWifiSetProtocol", + "RpcRespWifiSetProtocol", + "", + sizeof(RpcRespWifiSetProtocol), + 1, + rpc__resp__wifi_set_protocol__field_descriptors, + rpc__resp__wifi_set_protocol__field_indices_by_name, + 1, rpc__resp__wifi_set_protocol__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_set_protocol__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_get_protocol__field_descriptors[1] = +{ + { + "ifx", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiGetProtocol, ifx), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__wifi_get_protocol__field_indices_by_name[] = { + 0, /* field[0] = ifx */ +}; +static const ProtobufCIntRange rpc__req__wifi_get_protocol__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_get_protocol__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiGetProtocol", + "RpcReqWifiGetProtocol", + "RpcReqWifiGetProtocol", + "", + sizeof(RpcReqWifiGetProtocol), + 1, + rpc__req__wifi_get_protocol__field_descriptors, + rpc__req__wifi_get_protocol__field_indices_by_name, + 1, rpc__req__wifi_get_protocol__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_get_protocol__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_get_protocol__field_descriptors[2] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiGetProtocol, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "protocol_bitmap", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiGetProtocol, protocol_bitmap), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_get_protocol__field_indices_by_name[] = { + 1, /* field[1] = protocol_bitmap */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_get_protocol__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_get_protocol__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiGetProtocol", + "RpcRespWifiGetProtocol", + "RpcRespWifiGetProtocol", + "", + sizeof(RpcRespWifiGetProtocol), + 2, + rpc__resp__wifi_get_protocol__field_descriptors, + rpc__resp__wifi_get_protocol__field_indices_by_name, + 1, rpc__resp__wifi_get_protocol__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_get_protocol__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_set_bandwidth__field_descriptors[2] = +{ + { + "ifx", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiSetBandwidth, ifx), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "bw", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiSetBandwidth, bw), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__wifi_set_bandwidth__field_indices_by_name[] = { + 1, /* field[1] = bw */ + 0, /* field[0] = ifx */ +}; +static const ProtobufCIntRange rpc__req__wifi_set_bandwidth__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_set_bandwidth__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiSetBandwidth", + "RpcReqWifiSetBandwidth", + "RpcReqWifiSetBandwidth", + "", + sizeof(RpcReqWifiSetBandwidth), + 2, + rpc__req__wifi_set_bandwidth__field_descriptors, + rpc__req__wifi_set_bandwidth__field_indices_by_name, + 1, rpc__req__wifi_set_bandwidth__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_set_bandwidth__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_set_bandwidth__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiSetBandwidth, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_set_bandwidth__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_set_bandwidth__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_set_bandwidth__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiSetBandwidth", + "RpcRespWifiSetBandwidth", + "RpcRespWifiSetBandwidth", + "", + sizeof(RpcRespWifiSetBandwidth), + 1, + rpc__resp__wifi_set_bandwidth__field_descriptors, + rpc__resp__wifi_set_bandwidth__field_indices_by_name, + 1, rpc__resp__wifi_set_bandwidth__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_set_bandwidth__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_get_bandwidth__field_descriptors[1] = +{ + { + "ifx", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiGetBandwidth, ifx), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__wifi_get_bandwidth__field_indices_by_name[] = { + 0, /* field[0] = ifx */ +}; +static const ProtobufCIntRange rpc__req__wifi_get_bandwidth__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_get_bandwidth__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiGetBandwidth", + "RpcReqWifiGetBandwidth", + "RpcReqWifiGetBandwidth", + "", + sizeof(RpcReqWifiGetBandwidth), + 1, + rpc__req__wifi_get_bandwidth__field_descriptors, + rpc__req__wifi_get_bandwidth__field_indices_by_name, + 1, rpc__req__wifi_get_bandwidth__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_get_bandwidth__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_get_bandwidth__field_descriptors[2] = +{ { - "nano_enable", - 12, + "resp", + 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiInitConfig, nano_enable), + offsetof(RpcRespWifiGetBandwidth, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "rx_ba_win", - 13, + "bw", + 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiInitConfig, rx_ba_win), + offsetof(RpcRespWifiGetBandwidth, bw), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_get_bandwidth__field_indices_by_name[] = { + 1, /* field[1] = bw */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_get_bandwidth__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_get_bandwidth__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiGetBandwidth", + "RpcRespWifiGetBandwidth", + "RpcRespWifiGetBandwidth", + "", + sizeof(RpcRespWifiGetBandwidth), + 2, + rpc__resp__wifi_get_bandwidth__field_descriptors, + rpc__resp__wifi_get_bandwidth__field_indices_by_name, + 1, rpc__resp__wifi_get_bandwidth__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_get_bandwidth__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_set_channel__field_descriptors[2] = +{ { - "wifi_task_core_id", - 14, + "primary", + 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiInitConfig, wifi_task_core_id), + offsetof(RpcReqWifiSetChannel, primary), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "beacon_max_len", - 15, + "second", + 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiInitConfig, beacon_max_len), + offsetof(RpcReqWifiSetChannel, second), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__wifi_set_channel__field_indices_by_name[] = { + 0, /* field[0] = primary */ + 1, /* field[1] = second */ +}; +static const ProtobufCIntRange rpc__req__wifi_set_channel__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_set_channel__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiSetChannel", + "RpcReqWifiSetChannel", + "RpcReqWifiSetChannel", + "", + sizeof(RpcReqWifiSetChannel), + 2, + rpc__req__wifi_set_channel__field_descriptors, + rpc__req__wifi_set_channel__field_indices_by_name, + 1, rpc__req__wifi_set_channel__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_set_channel__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_set_channel__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiSetChannel, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_set_channel__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_set_channel__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_set_channel__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiSetChannel", + "RpcRespWifiSetChannel", + "RpcRespWifiSetChannel", + "", + sizeof(RpcRespWifiSetChannel), + 1, + rpc__resp__wifi_set_channel__field_descriptors, + rpc__resp__wifi_set_channel__field_indices_by_name, + 1, rpc__resp__wifi_set_channel__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_set_channel__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_get_channel__field_descriptors NULL +#define rpc__req__wifi_get_channel__field_indices_by_name NULL +#define rpc__req__wifi_get_channel__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_get_channel__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiGetChannel", + "RpcReqWifiGetChannel", + "RpcReqWifiGetChannel", + "", + sizeof(RpcReqWifiGetChannel), + 0, + rpc__req__wifi_get_channel__field_descriptors, + rpc__req__wifi_get_channel__field_indices_by_name, + 0, rpc__req__wifi_get_channel__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_get_channel__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_get_channel__field_descriptors[3] = +{ { - "mgmt_sbuf_num", - 16, + "resp", + 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiInitConfig, mgmt_sbuf_num), + offsetof(RpcRespWifiGetChannel, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "feature_caps", - 17, + "primary", + 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiInitConfig, feature_caps), + offsetof(RpcRespWifiGetChannel, primary), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "second", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiGetChannel, second), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_get_channel__field_indices_by_name[] = { + 1, /* field[1] = primary */ + 0, /* field[0] = resp */ + 2, /* field[2] = second */ +}; +static const ProtobufCIntRange rpc__resp__wifi_get_channel__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_get_channel__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiGetChannel", + "RpcRespWifiGetChannel", + "RpcRespWifiGetChannel", + "", + sizeof(RpcRespWifiGetChannel), + 3, + rpc__resp__wifi_get_channel__field_descriptors, + rpc__resp__wifi_get_channel__field_indices_by_name, + 1, rpc__resp__wifi_get_channel__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_get_channel__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_set_storage__field_descriptors[1] = +{ + { + "storage", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiSetStorage, storage), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__wifi_set_storage__field_indices_by_name[] = { + 0, /* field[0] = storage */ +}; +static const ProtobufCIntRange rpc__req__wifi_set_storage__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_set_storage__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiSetStorage", + "RpcReqWifiSetStorage", + "RpcReqWifiSetStorage", + "", + sizeof(RpcReqWifiSetStorage), + 1, + rpc__req__wifi_set_storage__field_descriptors, + rpc__req__wifi_set_storage__field_indices_by_name, + 1, rpc__req__wifi_set_storage__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_set_storage__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_set_storage__field_descriptors[1] = +{ { - "sta_disconnected_pm", - 18, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiInitConfig, sta_disconnected_pm), + offsetof(RpcRespWifiSetStorage, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_set_storage__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_set_storage__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_set_storage__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiSetStorage", + "RpcRespWifiSetStorage", + "RpcRespWifiSetStorage", + "", + sizeof(RpcRespWifiSetStorage), + 1, + rpc__resp__wifi_set_storage__field_descriptors, + rpc__resp__wifi_set_storage__field_indices_by_name, + 1, rpc__resp__wifi_set_storage__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_set_storage__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_set_country_code__field_descriptors[2] = +{ { - "espnow_max_encrypt_num", - 19, + "country", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiInitConfig, espnow_max_encrypt_num), + offsetof(RpcReqWifiSetCountryCode, country), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "magic", - 20, + "ieee80211d_enabled", + 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ - offsetof(WifiInitConfig, magic), + offsetof(RpcReqWifiSetCountryCode, ieee80211d_enabled), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_init_config__field_indices_by_name[] = { - 7, /* field[7] = ampdu_rx_enable */ - 8, /* field[8] = ampdu_tx_enable */ - 9, /* field[9] = amsdu_tx_enable */ - 14, /* field[14] = beacon_max_len */ - 5, /* field[5] = cache_tx_buf_num */ - 6, /* field[6] = csi_enable */ - 1, /* field[1] = dynamic_rx_buf_num */ - 4, /* field[4] = dynamic_tx_buf_num */ - 18, /* field[18] = espnow_max_encrypt_num */ - 16, /* field[16] = feature_caps */ - 19, /* field[19] = magic */ - 15, /* field[15] = mgmt_sbuf_num */ - 11, /* field[11] = nano_enable */ - 10, /* field[10] = nvs_enable */ - 12, /* field[12] = rx_ba_win */ - 17, /* field[17] = sta_disconnected_pm */ - 0, /* field[0] = static_rx_buf_num */ - 3, /* field[3] = static_tx_buf_num */ - 2, /* field[2] = tx_buf_type */ - 13, /* field[13] = wifi_task_core_id */ +static const unsigned rpc__req__wifi_set_country_code__field_indices_by_name[] = { + 0, /* field[0] = country */ + 1, /* field[1] = ieee80211d_enabled */ }; -static const ProtobufCIntRange wifi_init_config__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__wifi_set_country_code__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 20 } + { 0, 2 } }; -const ProtobufCMessageDescriptor wifi_init_config__descriptor = +const ProtobufCMessageDescriptor rpc__req__wifi_set_country_code__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_init_config", - "WifiInitConfig", - "WifiInitConfig", + "Rpc_Req_WifiSetCountryCode", + "RpcReqWifiSetCountryCode", + "RpcReqWifiSetCountryCode", "", - sizeof(WifiInitConfig), - 20, - wifi_init_config__field_descriptors, - wifi_init_config__field_indices_by_name, - 1, wifi_init_config__number_ranges, - (ProtobufCMessageInit) wifi_init_config__init, + sizeof(RpcReqWifiSetCountryCode), + 2, + rpc__req__wifi_set_country_code__field_descriptors, + rpc__req__wifi_set_country_code__field_indices_by_name, + 1, rpc__req__wifi_set_country_code__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_set_country_code__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_country__field_descriptors[5] = +static const ProtobufCFieldDescriptor rpc__resp__wifi_set_country_code__field_descriptors[1] = { { - "cc", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiCountry, cc), + offsetof(RpcRespWifiSetCountryCode, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_set_country_code__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_set_country_code__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_set_country_code__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiSetCountryCode", + "RpcRespWifiSetCountryCode", + "RpcRespWifiSetCountryCode", + "", + sizeof(RpcRespWifiSetCountryCode), + 1, + rpc__resp__wifi_set_country_code__field_descriptors, + rpc__resp__wifi_set_country_code__field_indices_by_name, + 1, rpc__resp__wifi_set_country_code__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_set_country_code__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_get_country_code__field_descriptors NULL +#define rpc__req__wifi_get_country_code__field_indices_by_name NULL +#define rpc__req__wifi_get_country_code__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_get_country_code__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiGetCountryCode", + "RpcReqWifiGetCountryCode", + "RpcReqWifiGetCountryCode", + "", + sizeof(RpcReqWifiGetCountryCode), + 0, + rpc__req__wifi_get_country_code__field_descriptors, + rpc__req__wifi_get_country_code__field_indices_by_name, + 0, rpc__req__wifi_get_country_code__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_get_country_code__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_get_country_code__field_descriptors[2] = +{ { - "schan", - 2, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiCountry, schan), + offsetof(RpcRespWifiGetCountryCode, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "nchan", - 3, + "country", + 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiCountry, nchan), + offsetof(RpcRespWifiGetCountryCode, country), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_get_country_code__field_indices_by_name[] = { + 1, /* field[1] = country */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_get_country_code__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_get_country_code__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiGetCountryCode", + "RpcRespWifiGetCountryCode", + "RpcRespWifiGetCountryCode", + "", + sizeof(RpcRespWifiGetCountryCode), + 2, + rpc__resp__wifi_get_country_code__field_descriptors, + rpc__resp__wifi_get_country_code__field_indices_by_name, + 1, rpc__resp__wifi_get_country_code__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_get_country_code__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_set_country__field_descriptors[1] = +{ { - "max_tx_power", - 4, + "country", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ - offsetof(WifiCountry, max_tx_power), - NULL, + offsetof(RpcReqWifiSetCountry, country), + &wifi_country__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, - { - "policy", - 5, +}; +static const unsigned rpc__req__wifi_set_country__field_indices_by_name[] = { + 0, /* field[0] = country */ +}; +static const ProtobufCIntRange rpc__req__wifi_set_country__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_set_country__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiSetCountry", + "RpcReqWifiSetCountry", + "RpcReqWifiSetCountry", + "", + sizeof(RpcReqWifiSetCountry), + 1, + rpc__req__wifi_set_country__field_descriptors, + rpc__req__wifi_set_country__field_indices_by_name, + 1, rpc__req__wifi_set_country__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_set_country__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_set_country__field_descriptors[1] = +{ + { + "resp", + 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiCountry, policy), + offsetof(RpcRespWifiSetCountry, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_country__field_indices_by_name[] = { - 0, /* field[0] = cc */ - 3, /* field[3] = max_tx_power */ - 2, /* field[2] = nchan */ - 4, /* field[4] = policy */ - 1, /* field[1] = schan */ +static const unsigned rpc__resp__wifi_set_country__field_indices_by_name[] = { + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_country__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__wifi_set_country__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 5 } + { 0, 1 } }; -const ProtobufCMessageDescriptor wifi_country__descriptor = +const ProtobufCMessageDescriptor rpc__resp__wifi_set_country__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_country", - "WifiCountry", - "WifiCountry", + "Rpc_Resp_WifiSetCountry", + "RpcRespWifiSetCountry", + "RpcRespWifiSetCountry", "", - sizeof(WifiCountry), - 5, - wifi_country__field_descriptors, - wifi_country__field_indices_by_name, - 1, wifi_country__number_ranges, - (ProtobufCMessageInit) wifi_country__init, + sizeof(RpcRespWifiSetCountry), + 1, + rpc__resp__wifi_set_country__field_descriptors, + rpc__resp__wifi_set_country__field_indices_by_name, + 1, rpc__resp__wifi_set_country__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_set_country__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_active_scan_time__field_descriptors[2] = +#define rpc__req__wifi_get_country__field_descriptors NULL +#define rpc__req__wifi_get_country__field_indices_by_name NULL +#define rpc__req__wifi_get_country__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_get_country__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiGetCountry", + "RpcReqWifiGetCountry", + "RpcReqWifiGetCountry", + "", + sizeof(RpcReqWifiGetCountry), + 0, + rpc__req__wifi_get_country__field_descriptors, + rpc__req__wifi_get_country__field_indices_by_name, + 0, rpc__req__wifi_get_country__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_get_country__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_get_country__field_descriptors[2] = { { - "min", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiActiveScanTime, min), + offsetof(RpcRespWifiGetCountry, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "max", + "country", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ - offsetof(WifiActiveScanTime, max), - NULL, + offsetof(RpcRespWifiGetCountry, country), + &wifi_country__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_active_scan_time__field_indices_by_name[] = { - 1, /* field[1] = max */ - 0, /* field[0] = min */ +static const unsigned rpc__resp__wifi_get_country__field_indices_by_name[] = { + 1, /* field[1] = country */ + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_active_scan_time__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__wifi_get_country__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor wifi_active_scan_time__descriptor = +const ProtobufCMessageDescriptor rpc__resp__wifi_get_country__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_active_scan_time", - "WifiActiveScanTime", - "WifiActiveScanTime", + "Rpc_Resp_WifiGetCountry", + "RpcRespWifiGetCountry", + "RpcRespWifiGetCountry", "", - sizeof(WifiActiveScanTime), + sizeof(RpcRespWifiGetCountry), 2, - wifi_active_scan_time__field_descriptors, - wifi_active_scan_time__field_indices_by_name, - 1, wifi_active_scan_time__number_ranges, - (ProtobufCMessageInit) wifi_active_scan_time__init, + rpc__resp__wifi_get_country__field_descriptors, + rpc__resp__wifi_get_country__field_indices_by_name, + 1, rpc__resp__wifi_get_country__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_get_country__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_scan_time__field_descriptors[2] = +#define rpc__req__wifi_ap_get_sta_list__field_descriptors NULL +#define rpc__req__wifi_ap_get_sta_list__field_indices_by_name NULL +#define rpc__req__wifi_ap_get_sta_list__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_ap_get_sta_list__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiApGetStaList", + "RpcReqWifiApGetStaList", + "RpcReqWifiApGetStaList", + "", + sizeof(RpcReqWifiApGetStaList), + 0, + rpc__req__wifi_ap_get_sta_list__field_descriptors, + rpc__req__wifi_ap_get_sta_list__field_indices_by_name, + 0, rpc__req__wifi_ap_get_sta_list__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_ap_get_sta_list__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_ap_get_sta_list__field_descriptors[2] = { { - "active", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiScanTime, active), - &wifi_active_scan_time__descriptor, + offsetof(RpcRespWifiApGetStaList, resp), + NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "passive", + "sta_list", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ - offsetof(WifiScanTime, passive), - NULL, + offsetof(RpcRespWifiApGetStaList, sta_list), + &wifi_sta_list__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_scan_time__field_indices_by_name[] = { - 0, /* field[0] = active */ - 1, /* field[1] = passive */ +static const unsigned rpc__resp__wifi_ap_get_sta_list__field_indices_by_name[] = { + 0, /* field[0] = resp */ + 1, /* field[1] = sta_list */ }; -static const ProtobufCIntRange wifi_scan_time__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__wifi_ap_get_sta_list__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor wifi_scan_time__descriptor = +const ProtobufCMessageDescriptor rpc__resp__wifi_ap_get_sta_list__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_scan_time", - "WifiScanTime", - "WifiScanTime", + "Rpc_Resp_WifiApGetStaList", + "RpcRespWifiApGetStaList", + "RpcRespWifiApGetStaList", "", - sizeof(WifiScanTime), + sizeof(RpcRespWifiApGetStaList), 2, - wifi_scan_time__field_descriptors, - wifi_scan_time__field_indices_by_name, - 1, wifi_scan_time__number_ranges, - (ProtobufCMessageInit) wifi_scan_time__init, + rpc__resp__wifi_ap_get_sta_list__field_descriptors, + rpc__resp__wifi_ap_get_sta_list__field_indices_by_name, + 1, rpc__resp__wifi_ap_get_sta_list__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_ap_get_sta_list__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_scan_config__field_descriptors[7] = +static const ProtobufCFieldDescriptor rpc__req__wifi_ap_get_sta_aid__field_descriptors[1] = { { - "ssid", + "mac", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiScanConfig, ssid), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "bssid", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, - 0, /* quantifier_offset */ - offsetof(WifiScanConfig, bssid), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "channel", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(WifiScanConfig, channel), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "show_hidden", - 4, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(WifiScanConfig, show_hidden), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "scan_type", - 5, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiScanConfig, scan_type), + offsetof(RpcReqWifiApGetStaAid, mac), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__wifi_ap_get_sta_aid__field_indices_by_name[] = { + 0, /* field[0] = mac */ +}; +static const ProtobufCIntRange rpc__req__wifi_ap_get_sta_aid__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_ap_get_sta_aid__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiApGetStaAid", + "RpcReqWifiApGetStaAid", + "RpcReqWifiApGetStaAid", + "", + sizeof(RpcReqWifiApGetStaAid), + 1, + rpc__req__wifi_ap_get_sta_aid__field_descriptors, + rpc__req__wifi_ap_get_sta_aid__field_indices_by_name, + 1, rpc__req__wifi_ap_get_sta_aid__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_ap_get_sta_aid__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_sta_get_negotiated_phymode__field_descriptors NULL +#define rpc__req__wifi_sta_get_negotiated_phymode__field_indices_by_name NULL +#define rpc__req__wifi_sta_get_negotiated_phymode__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_sta_get_negotiated_phymode__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiStaGetNegotiatedPhymode", + "RpcReqWifiStaGetNegotiatedPhymode", + "RpcReqWifiStaGetNegotiatedPhymode", + "", + sizeof(RpcReqWifiStaGetNegotiatedPhymode), + 0, + rpc__req__wifi_sta_get_negotiated_phymode__field_descriptors, + rpc__req__wifi_sta_get_negotiated_phymode__field_indices_by_name, + 0, rpc__req__wifi_sta_get_negotiated_phymode__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_sta_get_negotiated_phymode__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_get_negotiated_phymode__field_descriptors[2] = +{ { - "scan_time", - 6, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiScanConfig, scan_time), - &wifi_scan_time__descriptor, + offsetof(RpcRespWifiStaGetNegotiatedPhymode, resp), + NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "home_chan_dwell_time", - 7, + "phymode", + 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiScanConfig, home_chan_dwell_time), + offsetof(RpcRespWifiStaGetNegotiatedPhymode, phymode), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_scan_config__field_indices_by_name[] = { - 1, /* field[1] = bssid */ - 2, /* field[2] = channel */ - 6, /* field[6] = home_chan_dwell_time */ - 5, /* field[5] = scan_time */ - 4, /* field[4] = scan_type */ - 3, /* field[3] = show_hidden */ - 0, /* field[0] = ssid */ +static const unsigned rpc__resp__wifi_sta_get_negotiated_phymode__field_indices_by_name[] = { + 1, /* field[1] = phymode */ + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_scan_config__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__wifi_sta_get_negotiated_phymode__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 7 } + { 0, 2 } }; -const ProtobufCMessageDescriptor wifi_scan_config__descriptor = +const ProtobufCMessageDescriptor rpc__resp__wifi_sta_get_negotiated_phymode__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_scan_config", - "WifiScanConfig", - "WifiScanConfig", + "Rpc_Resp_WifiStaGetNegotiatedPhymode", + "RpcRespWifiStaGetNegotiatedPhymode", + "RpcRespWifiStaGetNegotiatedPhymode", "", - sizeof(WifiScanConfig), - 7, - wifi_scan_config__field_descriptors, - wifi_scan_config__field_indices_by_name, - 1, wifi_scan_config__number_ranges, - (ProtobufCMessageInit) wifi_scan_config__init, + sizeof(RpcRespWifiStaGetNegotiatedPhymode), + 2, + rpc__resp__wifi_sta_get_negotiated_phymode__field_descriptors, + rpc__resp__wifi_sta_get_negotiated_phymode__field_indices_by_name, + 1, rpc__resp__wifi_sta_get_negotiated_phymode__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_sta_get_negotiated_phymode__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_he_ap_info__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__resp__wifi_ap_get_sta_aid__field_descriptors[2] = { { - "bitmask", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiHeApInfo, bitmask), + offsetof(RpcRespWifiApGetStaAid, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "bssid_index", + "aid", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiHeApInfo, bssid_index), + offsetof(RpcRespWifiApGetStaAid, aid), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_he_ap_info__field_indices_by_name[] = { - 0, /* field[0] = bitmask */ - 1, /* field[1] = bssid_index */ +static const unsigned rpc__resp__wifi_ap_get_sta_aid__field_indices_by_name[] = { + 1, /* field[1] = aid */ + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_he_ap_info__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__wifi_ap_get_sta_aid__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor wifi_he_ap_info__descriptor = +const ProtobufCMessageDescriptor rpc__resp__wifi_ap_get_sta_aid__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_he_ap_info", - "WifiHeApInfo", - "WifiHeApInfo", + "Rpc_Resp_WifiApGetStaAid", + "RpcRespWifiApGetStaAid", + "RpcRespWifiApGetStaAid", "", - sizeof(WifiHeApInfo), + sizeof(RpcRespWifiApGetStaAid), 2, - wifi_he_ap_info__field_descriptors, - wifi_he_ap_info__field_indices_by_name, - 1, wifi_he_ap_info__number_ranges, - (ProtobufCMessageInit) wifi_he_ap_info__init, + rpc__resp__wifi_ap_get_sta_aid__field_descriptors, + rpc__resp__wifi_ap_get_sta_aid__field_indices_by_name, + 1, rpc__resp__wifi_ap_get_sta_aid__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_ap_get_sta_aid__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_ap_record__field_descriptors[15] = +#define rpc__req__wifi_sta_get_rssi__field_descriptors NULL +#define rpc__req__wifi_sta_get_rssi__field_indices_by_name NULL +#define rpc__req__wifi_sta_get_rssi__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_sta_get_rssi__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiStaGetRssi", + "RpcReqWifiStaGetRssi", + "RpcReqWifiStaGetRssi", + "", + sizeof(RpcReqWifiStaGetRssi), + 0, + rpc__req__wifi_sta_get_rssi__field_descriptors, + rpc__req__wifi_sta_get_rssi__field_indices_by_name, + 0, rpc__req__wifi_sta_get_rssi__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_sta_get_rssi__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_get_rssi__field_descriptors[2] = { { - "bssid", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, - 0, /* quantifier_offset */ - offsetof(WifiApRecord, bssid), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "ssid", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, - 0, /* quantifier_offset */ - offsetof(WifiApRecord, ssid), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "primary", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(WifiApRecord, primary), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "second", - 4, - PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiApRecord, second), + offsetof(RpcRespWifiStaGetRssi, resp), NULL, NULL, 0, /* flags */ @@ -7993,3130 +20148,4142 @@ static const ProtobufCFieldDescriptor wifi_ap_record__field_descriptors[15] = }, { "rssi", - 5, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiApRecord, rssi), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "authmode", - 6, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiApRecord, authmode), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "pairwise_cipher", - 7, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiApRecord, pairwise_cipher), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "group_cipher", - 8, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiApRecord, group_cipher), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "ant", - 9, + 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiApRecord, ant), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "bitmask", - 10, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(WifiApRecord, bitmask), + offsetof(RpcRespWifiStaGetRssi, rssi), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_sta_get_rssi__field_indices_by_name[] = { + 0, /* field[0] = resp */ + 1, /* field[1] = rssi */ +}; +static const ProtobufCIntRange rpc__resp__wifi_sta_get_rssi__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_sta_get_rssi__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiStaGetRssi", + "RpcRespWifiStaGetRssi", + "RpcRespWifiStaGetRssi", + "", + sizeof(RpcRespWifiStaGetRssi), + 2, + rpc__resp__wifi_sta_get_rssi__field_descriptors, + rpc__resp__wifi_sta_get_rssi__field_indices_by_name, + 1, rpc__resp__wifi_sta_get_rssi__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_sta_get_rssi__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_sta_get_aid__field_descriptors NULL +#define rpc__req__wifi_sta_get_aid__field_indices_by_name NULL +#define rpc__req__wifi_sta_get_aid__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_sta_get_aid__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiStaGetAid", + "RpcReqWifiStaGetAid", + "RpcReqWifiStaGetAid", + "", + sizeof(RpcReqWifiStaGetAid), + 0, + rpc__req__wifi_sta_get_aid__field_descriptors, + rpc__req__wifi_sta_get_aid__field_indices_by_name, + 0, rpc__req__wifi_sta_get_aid__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_sta_get_aid__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_get_aid__field_descriptors[2] = +{ { - "country", - 11, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiApRecord, country), - &wifi_country__descriptor, + offsetof(RpcRespWifiStaGetAid, resp), NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "he_ap", - 12, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(WifiApRecord, he_ap), - &wifi_he_ap_info__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "bandwidth", - 13, + "aid", + 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiApRecord, bandwidth), + offsetof(RpcRespWifiStaGetAid, aid), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_sta_get_aid__field_indices_by_name[] = { + 1, /* field[1] = aid */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_sta_get_aid__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_sta_get_aid__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiStaGetAid", + "RpcRespWifiStaGetAid", + "RpcRespWifiStaGetAid", + "", + sizeof(RpcRespWifiStaGetAid), + 2, + rpc__resp__wifi_sta_get_aid__field_descriptors, + rpc__resp__wifi_sta_get_aid__field_indices_by_name, + 1, rpc__resp__wifi_sta_get_aid__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_sta_get_aid__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_set_protocols__field_descriptors[2] = +{ { - "vht_ch_freq1", - 14, + "ifx", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiApRecord, vht_ch_freq1), + offsetof(RpcReqWifiSetProtocols, ifx), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "vht_ch_freq2", - 15, + "protocols", + 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ - offsetof(WifiApRecord, vht_ch_freq2), - NULL, + offsetof(RpcReqWifiSetProtocols, protocols), + &wifi_protocols__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_ap_record__field_indices_by_name[] = { - 8, /* field[8] = ant */ - 5, /* field[5] = authmode */ - 12, /* field[12] = bandwidth */ - 9, /* field[9] = bitmask */ - 0, /* field[0] = bssid */ - 10, /* field[10] = country */ - 7, /* field[7] = group_cipher */ - 11, /* field[11] = he_ap */ - 6, /* field[6] = pairwise_cipher */ - 2, /* field[2] = primary */ - 4, /* field[4] = rssi */ - 3, /* field[3] = second */ - 1, /* field[1] = ssid */ - 13, /* field[13] = vht_ch_freq1 */ - 14, /* field[14] = vht_ch_freq2 */ +static const unsigned rpc__req__wifi_set_protocols__field_indices_by_name[] = { + 0, /* field[0] = ifx */ + 1, /* field[1] = protocols */ }; -static const ProtobufCIntRange wifi_ap_record__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__wifi_set_protocols__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 15 } + { 0, 2 } }; -const ProtobufCMessageDescriptor wifi_ap_record__descriptor = +const ProtobufCMessageDescriptor rpc__req__wifi_set_protocols__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_ap_record", - "WifiApRecord", - "WifiApRecord", + "Rpc_Req_WifiSetProtocols", + "RpcReqWifiSetProtocols", + "RpcReqWifiSetProtocols", "", - sizeof(WifiApRecord), - 15, - wifi_ap_record__field_descriptors, - wifi_ap_record__field_indices_by_name, - 1, wifi_ap_record__number_ranges, - (ProtobufCMessageInit) wifi_ap_record__init, + sizeof(RpcReqWifiSetProtocols), + 2, + rpc__req__wifi_set_protocols__field_descriptors, + rpc__req__wifi_set_protocols__field_indices_by_name, + 1, rpc__req__wifi_set_protocols__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_set_protocols__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_scan_threshold__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__resp__wifi_set_protocols__field_descriptors[2] = { { - "rssi", + "resp", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiScanThreshold, rssi), + offsetof(RpcRespWifiSetProtocols, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "authmode", + "ifx", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiScanThreshold, authmode), + offsetof(RpcRespWifiSetProtocols, ifx), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_scan_threshold__field_indices_by_name[] = { - 1, /* field[1] = authmode */ - 0, /* field[0] = rssi */ +static const unsigned rpc__resp__wifi_set_protocols__field_indices_by_name[] = { + 1, /* field[1] = ifx */ + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_scan_threshold__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__wifi_set_protocols__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor wifi_scan_threshold__descriptor = +const ProtobufCMessageDescriptor rpc__resp__wifi_set_protocols__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_scan_threshold", - "WifiScanThreshold", - "WifiScanThreshold", + "Rpc_Resp_WifiSetProtocols", + "RpcRespWifiSetProtocols", + "RpcRespWifiSetProtocols", "", - sizeof(WifiScanThreshold), + sizeof(RpcRespWifiSetProtocols), 2, - wifi_scan_threshold__field_descriptors, - wifi_scan_threshold__field_indices_by_name, - 1, wifi_scan_threshold__number_ranges, - (ProtobufCMessageInit) wifi_scan_threshold__init, + rpc__resp__wifi_set_protocols__field_descriptors, + rpc__resp__wifi_set_protocols__field_indices_by_name, + 1, rpc__resp__wifi_set_protocols__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_set_protocols__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_pmf_config__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__req__wifi_get_protocols__field_descriptors[1] = { { - "capable", + "ifx", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(WifiPmfConfig, capable), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "required", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiPmfConfig, required), + offsetof(RpcReqWifiGetProtocols, ifx), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_pmf_config__field_indices_by_name[] = { - 0, /* field[0] = capable */ - 1, /* field[1] = required */ +static const unsigned rpc__req__wifi_get_protocols__field_indices_by_name[] = { + 0, /* field[0] = ifx */ }; -static const ProtobufCIntRange wifi_pmf_config__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__wifi_get_protocols__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } + { 0, 1 } }; -const ProtobufCMessageDescriptor wifi_pmf_config__descriptor = +const ProtobufCMessageDescriptor rpc__req__wifi_get_protocols__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_pmf_config", - "WifiPmfConfig", - "WifiPmfConfig", + "Rpc_Req_WifiGetProtocols", + "RpcReqWifiGetProtocols", + "RpcReqWifiGetProtocols", "", - sizeof(WifiPmfConfig), - 2, - wifi_pmf_config__field_descriptors, - wifi_pmf_config__field_indices_by_name, - 1, wifi_pmf_config__number_ranges, - (ProtobufCMessageInit) wifi_pmf_config__init, + sizeof(RpcReqWifiGetProtocols), + 1, + rpc__req__wifi_get_protocols__field_descriptors, + rpc__req__wifi_get_protocols__field_indices_by_name, + 1, rpc__req__wifi_get_protocols__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_get_protocols__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_ap_config__field_descriptors[12] = +static const ProtobufCFieldDescriptor rpc__resp__wifi_get_protocols__field_descriptors[3] = { { - "ssid", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiApConfig, ssid), + offsetof(RpcRespWifiGetProtocols, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "password", + "ifx", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiApConfig, password), + offsetof(RpcRespWifiGetProtocols, ifx), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ssid_len", + "protocols", 3, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiGetProtocols, protocols), + &wifi_protocols__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__wifi_get_protocols__field_indices_by_name[] = { + 1, /* field[1] = ifx */ + 2, /* field[2] = protocols */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_get_protocols__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_get_protocols__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiGetProtocols", + "RpcRespWifiGetProtocols", + "RpcRespWifiGetProtocols", + "", + sizeof(RpcRespWifiGetProtocols), + 3, + rpc__resp__wifi_get_protocols__field_descriptors, + rpc__resp__wifi_get_protocols__field_indices_by_name, + 1, rpc__resp__wifi_get_protocols__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_get_protocols__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_set_bandwidths__field_descriptors[2] = +{ + { + "ifx", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiApConfig, ssid_len), + offsetof(RpcReqWifiSetBandwidths, ifx), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "channel", - 4, + "bandwidths", + 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ - offsetof(WifiApConfig, channel), - NULL, + offsetof(RpcReqWifiSetBandwidths, bandwidths), + &wifi_bandwidths__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__wifi_set_bandwidths__field_indices_by_name[] = { + 1, /* field[1] = bandwidths */ + 0, /* field[0] = ifx */ +}; +static const ProtobufCIntRange rpc__req__wifi_set_bandwidths__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_set_bandwidths__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiSetBandwidths", + "RpcReqWifiSetBandwidths", + "RpcReqWifiSetBandwidths", + "", + sizeof(RpcReqWifiSetBandwidths), + 2, + rpc__req__wifi_set_bandwidths__field_descriptors, + rpc__req__wifi_set_bandwidths__field_indices_by_name, + 1, rpc__req__wifi_set_bandwidths__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_set_bandwidths__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_set_bandwidths__field_descriptors[2] = +{ { - "authmode", - 5, + "resp", + 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiApConfig, authmode), + offsetof(RpcRespWifiSetBandwidths, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ssid_hidden", - 6, + "ifx", + 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiApConfig, ssid_hidden), + offsetof(RpcRespWifiSetBandwidths, ifx), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_set_bandwidths__field_indices_by_name[] = { + 1, /* field[1] = ifx */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_set_bandwidths__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_set_bandwidths__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiSetBandwidths", + "RpcRespWifiSetBandwidths", + "RpcRespWifiSetBandwidths", + "", + sizeof(RpcRespWifiSetBandwidths), + 2, + rpc__resp__wifi_set_bandwidths__field_descriptors, + rpc__resp__wifi_set_bandwidths__field_indices_by_name, + 1, rpc__resp__wifi_set_bandwidths__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_set_bandwidths__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_get_bandwidths__field_descriptors[1] = +{ { - "max_connection", - 7, + "ifx", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiApConfig, max_connection), + offsetof(RpcReqWifiGetBandwidths, ifx), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__wifi_get_bandwidths__field_indices_by_name[] = { + 0, /* field[0] = ifx */ +}; +static const ProtobufCIntRange rpc__req__wifi_get_bandwidths__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_get_bandwidths__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiGetBandwidths", + "RpcReqWifiGetBandwidths", + "RpcReqWifiGetBandwidths", + "", + sizeof(RpcReqWifiGetBandwidths), + 1, + rpc__req__wifi_get_bandwidths__field_descriptors, + rpc__req__wifi_get_bandwidths__field_indices_by_name, + 1, rpc__req__wifi_get_bandwidths__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_get_bandwidths__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_get_bandwidths__field_descriptors[3] = +{ { - "beacon_interval", - 8, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiApConfig, beacon_interval), + offsetof(RpcRespWifiGetBandwidths, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "pairwise_cipher", - 9, + "ifx", + 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiApConfig, pairwise_cipher), + offsetof(RpcRespWifiGetBandwidths, ifx), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ftm_responder", - 10, + "bandwidths", + 3, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, + PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ - offsetof(WifiApConfig, ftm_responder), - NULL, + offsetof(RpcRespWifiGetBandwidths, bandwidths), + &wifi_bandwidths__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_get_bandwidths__field_indices_by_name[] = { + 2, /* field[2] = bandwidths */ + 1, /* field[1] = ifx */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_get_bandwidths__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_get_bandwidths__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiGetBandwidths", + "RpcRespWifiGetBandwidths", + "RpcRespWifiGetBandwidths", + "", + sizeof(RpcRespWifiGetBandwidths), + 3, + rpc__resp__wifi_get_bandwidths__field_descriptors, + rpc__resp__wifi_get_bandwidths__field_indices_by_name, + 1, rpc__resp__wifi_get_bandwidths__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_get_bandwidths__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_set_band__field_descriptors[1] = +{ { - "pmf_cfg", - 11, + "band", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, + PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiApConfig, pmf_cfg), - &wifi_pmf_config__descriptor, + offsetof(RpcReqWifiSetBand, band), + NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__wifi_set_band__field_indices_by_name[] = { + 0, /* field[0] = band */ +}; +static const ProtobufCIntRange rpc__req__wifi_set_band__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_set_band__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiSetBand", + "RpcReqWifiSetBand", + "RpcReqWifiSetBand", + "", + sizeof(RpcReqWifiSetBand), + 1, + rpc__req__wifi_set_band__field_descriptors, + rpc__req__wifi_set_band__field_indices_by_name, + 1, rpc__req__wifi_set_band__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_set_band__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_set_band__field_descriptors[1] = +{ { - "sae_pwe_h2e", - 12, + "resp", + 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiApConfig, sae_pwe_h2e), + offsetof(RpcRespWifiSetBand, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_ap_config__field_indices_by_name[] = { - 4, /* field[4] = authmode */ - 7, /* field[7] = beacon_interval */ - 3, /* field[3] = channel */ - 9, /* field[9] = ftm_responder */ - 6, /* field[6] = max_connection */ - 8, /* field[8] = pairwise_cipher */ - 1, /* field[1] = password */ - 10, /* field[10] = pmf_cfg */ - 11, /* field[11] = sae_pwe_h2e */ - 0, /* field[0] = ssid */ - 5, /* field[5] = ssid_hidden */ - 2, /* field[2] = ssid_len */ +static const unsigned rpc__resp__wifi_set_band__field_indices_by_name[] = { + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_ap_config__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__wifi_set_band__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 12 } + { 0, 1 } }; -const ProtobufCMessageDescriptor wifi_ap_config__descriptor = +const ProtobufCMessageDescriptor rpc__resp__wifi_set_band__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_ap_config", - "WifiApConfig", - "WifiApConfig", + "Rpc_Resp_WifiSetBand", + "RpcRespWifiSetBand", + "RpcRespWifiSetBand", "", - sizeof(WifiApConfig), - 12, - wifi_ap_config__field_descriptors, - wifi_ap_config__field_indices_by_name, - 1, wifi_ap_config__number_ranges, - (ProtobufCMessageInit) wifi_ap_config__init, + sizeof(RpcRespWifiSetBand), + 1, + rpc__resp__wifi_set_band__field_descriptors, + rpc__resp__wifi_set_band__field_indices_by_name, + 1, rpc__resp__wifi_set_band__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_set_band__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_get_band__field_descriptors NULL +#define rpc__req__wifi_get_band__field_indices_by_name NULL +#define rpc__req__wifi_get_band__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_get_band__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiGetBand", + "RpcReqWifiGetBand", + "RpcReqWifiGetBand", + "", + sizeof(RpcReqWifiGetBand), + 0, + rpc__req__wifi_get_band__field_descriptors, + rpc__req__wifi_get_band__field_indices_by_name, + 0, rpc__req__wifi_get_band__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_get_band__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_sta_config__field_descriptors[15] = +static const ProtobufCFieldDescriptor rpc__resp__wifi_get_band__field_descriptors[2] = { { - "ssid", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiStaConfig, ssid), + offsetof(RpcRespWifiGetBand, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "password", + "band", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiStaConfig, password), + offsetof(RpcRespWifiGetBand, band), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_get_band__field_indices_by_name[] = { + 1, /* field[1] = band */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_get_band__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_get_band__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiGetBand", + "RpcRespWifiGetBand", + "RpcRespWifiGetBand", + "", + sizeof(RpcRespWifiGetBand), + 2, + rpc__resp__wifi_get_band__field_descriptors, + rpc__resp__wifi_get_band__field_indices_by_name, + 1, rpc__resp__wifi_get_band__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_get_band__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_set_band_mode__field_descriptors[1] = +{ { - "scan_method", - 3, + "bandmode", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiStaConfig, scan_method), + offsetof(RpcReqWifiSetBandMode, bandmode), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__wifi_set_band_mode__field_indices_by_name[] = { + 0, /* field[0] = bandmode */ +}; +static const ProtobufCIntRange rpc__req__wifi_set_band_mode__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_set_band_mode__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiSetBandMode", + "RpcReqWifiSetBandMode", + "RpcReqWifiSetBandMode", + "", + sizeof(RpcReqWifiSetBandMode), + 1, + rpc__req__wifi_set_band_mode__field_descriptors, + rpc__req__wifi_set_band_mode__field_indices_by_name, + 1, rpc__req__wifi_set_band_mode__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_set_band_mode__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_set_band_mode__field_descriptors[1] = +{ { - "bssid_set", - 4, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiStaConfig, bssid_set), + offsetof(RpcRespWifiSetBandMode, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_set_band_mode__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_set_band_mode__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_set_band_mode__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiSetBandMode", + "RpcRespWifiSetBandMode", + "RpcRespWifiSetBandMode", + "", + sizeof(RpcRespWifiSetBandMode), + 1, + rpc__resp__wifi_set_band_mode__field_descriptors, + rpc__resp__wifi_set_band_mode__field_indices_by_name, + 1, rpc__resp__wifi_set_band_mode__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_set_band_mode__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__wifi_get_band_mode__field_descriptors NULL +#define rpc__req__wifi_get_band_mode__field_indices_by_name NULL +#define rpc__req__wifi_get_band_mode__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_get_band_mode__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiGetBandMode", + "RpcReqWifiGetBandMode", + "RpcReqWifiGetBandMode", + "", + sizeof(RpcReqWifiGetBandMode), + 0, + rpc__req__wifi_get_band_mode__field_descriptors, + rpc__req__wifi_get_band_mode__field_indices_by_name, + 0, rpc__req__wifi_get_band_mode__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_get_band_mode__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_get_band_mode__field_descriptors[2] = +{ { - "bssid", - 5, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiStaConfig, bssid), + offsetof(RpcRespWifiGetBandMode, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "channel", - 6, + "bandmode", + 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiStaConfig, channel), + offsetof(RpcRespWifiGetBandMode, bandmode), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_get_band_mode__field_indices_by_name[] = { + 1, /* field[1] = bandmode */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_get_band_mode__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_get_band_mode__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiGetBandMode", + "RpcRespWifiGetBandMode", + "RpcRespWifiGetBandMode", + "", + sizeof(RpcRespWifiGetBandMode), + 2, + rpc__resp__wifi_get_band_mode__field_descriptors, + rpc__resp__wifi_get_band_mode__field_indices_by_name, + 1, rpc__resp__wifi_get_band_mode__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_get_band_mode__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_set_inactive_time__field_descriptors[2] = +{ { - "listen_interval", - 7, + "ifx", + 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiStaConfig, listen_interval), + offsetof(RpcReqWifiSetInactiveTime, ifx), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "sort_method", - 8, + "sec", + 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiStaConfig, sort_method), + offsetof(RpcReqWifiSetInactiveTime, sec), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__wifi_set_inactive_time__field_indices_by_name[] = { + 0, /* field[0] = ifx */ + 1, /* field[1] = sec */ +}; +static const ProtobufCIntRange rpc__req__wifi_set_inactive_time__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_set_inactive_time__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiSetInactiveTime", + "RpcReqWifiSetInactiveTime", + "RpcReqWifiSetInactiveTime", + "", + sizeof(RpcReqWifiSetInactiveTime), + 2, + rpc__req__wifi_set_inactive_time__field_descriptors, + rpc__req__wifi_set_inactive_time__field_indices_by_name, + 1, rpc__req__wifi_set_inactive_time__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_set_inactive_time__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_set_inactive_time__field_descriptors[1] = +{ { - "threshold", - 9, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiStaConfig, threshold), - &wifi_scan_threshold__descriptor, + offsetof(RpcRespWifiSetInactiveTime, resp), NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "pmf_cfg", - 10, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(WifiStaConfig, pmf_cfg), - &wifi_pmf_config__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_set_inactive_time__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_set_inactive_time__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_set_inactive_time__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiSetInactiveTime", + "RpcRespWifiSetInactiveTime", + "RpcRespWifiSetInactiveTime", + "", + sizeof(RpcRespWifiSetInactiveTime), + 1, + rpc__resp__wifi_set_inactive_time__field_descriptors, + rpc__resp__wifi_set_inactive_time__field_indices_by_name, + 1, rpc__resp__wifi_set_inactive_time__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_set_inactive_time__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_get_inactive_time__field_descriptors[1] = +{ { - "bitmask", - 11, + "ifx", + 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiStaConfig, bitmask), + offsetof(RpcReqWifiGetInactiveTime, ifx), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, - { - "sae_pwe_h2e", - 12, +}; +static const unsigned rpc__req__wifi_get_inactive_time__field_indices_by_name[] = { + 0, /* field[0] = ifx */ +}; +static const ProtobufCIntRange rpc__req__wifi_get_inactive_time__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_get_inactive_time__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiGetInactiveTime", + "RpcReqWifiGetInactiveTime", + "RpcReqWifiGetInactiveTime", + "", + sizeof(RpcReqWifiGetInactiveTime), + 1, + rpc__req__wifi_get_inactive_time__field_descriptors, + rpc__req__wifi_get_inactive_time__field_indices_by_name, + 1, rpc__req__wifi_get_inactive_time__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_get_inactive_time__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_get_inactive_time__field_descriptors[2] = +{ + { + "resp", + 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiStaConfig, sae_pwe_h2e), + offsetof(RpcRespWifiGetInactiveTime, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "failure_retry_cnt", - 13, + "sec", + 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiStaConfig, failure_retry_cnt), + offsetof(RpcRespWifiGetInactiveTime, sec), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_get_inactive_time__field_indices_by_name[] = { + 0, /* field[0] = resp */ + 1, /* field[1] = sec */ +}; +static const ProtobufCIntRange rpc__resp__wifi_get_inactive_time__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_get_inactive_time__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiGetInactiveTime", + "RpcRespWifiGetInactiveTime", + "RpcRespWifiGetInactiveTime", + "", + sizeof(RpcRespWifiGetInactiveTime), + 2, + rpc__resp__wifi_get_inactive_time__field_descriptors, + rpc__resp__wifi_get_inactive_time__field_indices_by_name, + 1, rpc__resp__wifi_get_inactive_time__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_get_inactive_time__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_sta_itwt_setup__field_descriptors[1] = +{ { - "he_bitmask", - 14, + "setup_config", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ - offsetof(WifiStaConfig, he_bitmask), - NULL, + offsetof(RpcReqWifiStaItwtSetup, setup_config), + &wifi_itwt_setup_config__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__wifi_sta_itwt_setup__field_indices_by_name[] = { + 0, /* field[0] = setup_config */ +}; +static const ProtobufCIntRange rpc__req__wifi_sta_itwt_setup__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_sta_itwt_setup__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiStaItwtSetup", + "RpcReqWifiStaItwtSetup", + "RpcReqWifiStaItwtSetup", + "", + sizeof(RpcReqWifiStaItwtSetup), + 1, + rpc__req__wifi_sta_itwt_setup__field_descriptors, + rpc__req__wifi_sta_itwt_setup__field_indices_by_name, + 1, rpc__req__wifi_sta_itwt_setup__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_sta_itwt_setup__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_itwt_setup__field_descriptors[1] = +{ { - "sae_h2e_identifier", - 15, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiStaConfig, sae_h2e_identifier), + offsetof(RpcRespWifiStaItwtSetup, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_sta_config__field_indices_by_name[] = { - 10, /* field[10] = bitmask */ - 4, /* field[4] = bssid */ - 3, /* field[3] = bssid_set */ - 5, /* field[5] = channel */ - 12, /* field[12] = failure_retry_cnt */ - 13, /* field[13] = he_bitmask */ - 6, /* field[6] = listen_interval */ - 1, /* field[1] = password */ - 9, /* field[9] = pmf_cfg */ - 14, /* field[14] = sae_h2e_identifier */ - 11, /* field[11] = sae_pwe_h2e */ - 2, /* field[2] = scan_method */ - 7, /* field[7] = sort_method */ - 0, /* field[0] = ssid */ - 8, /* field[8] = threshold */ +static const unsigned rpc__resp__wifi_sta_itwt_setup__field_indices_by_name[] = { + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_sta_config__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__wifi_sta_itwt_setup__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 15 } + { 0, 1 } }; -const ProtobufCMessageDescriptor wifi_sta_config__descriptor = +const ProtobufCMessageDescriptor rpc__resp__wifi_sta_itwt_setup__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_sta_config", - "WifiStaConfig", - "WifiStaConfig", + "Rpc_Resp_WifiStaItwtSetup", + "RpcRespWifiStaItwtSetup", + "RpcRespWifiStaItwtSetup", "", - sizeof(WifiStaConfig), - 15, - wifi_sta_config__field_descriptors, - wifi_sta_config__field_indices_by_name, - 1, wifi_sta_config__number_ranges, - (ProtobufCMessageInit) wifi_sta_config__init, + sizeof(RpcRespWifiStaItwtSetup), + 1, + rpc__resp__wifi_sta_itwt_setup__field_descriptors, + rpc__resp__wifi_sta_itwt_setup__field_indices_by_name, + 1, rpc__resp__wifi_sta_itwt_setup__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_sta_itwt_setup__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_config__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__req__wifi_sta_itwt_teardown__field_descriptors[1] = { { - "ap", + "flow_id", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(WifiConfig, u_case), - offsetof(WifiConfig, ap), - &wifi_ap_config__descriptor, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqWifiStaItwtTeardown, flow_id), NULL, - 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + NULL, + 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__wifi_sta_itwt_teardown__field_indices_by_name[] = { + 0, /* field[0] = flow_id */ +}; +static const ProtobufCIntRange rpc__req__wifi_sta_itwt_teardown__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_sta_itwt_teardown__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiStaItwtTeardown", + "RpcReqWifiStaItwtTeardown", + "RpcReqWifiStaItwtTeardown", + "", + sizeof(RpcReqWifiStaItwtTeardown), + 1, + rpc__req__wifi_sta_itwt_teardown__field_descriptors, + rpc__req__wifi_sta_itwt_teardown__field_indices_by_name, + 1, rpc__req__wifi_sta_itwt_teardown__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_sta_itwt_teardown__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_itwt_teardown__field_descriptors[1] = +{ { - "sta", - 2, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(WifiConfig, u_case), - offsetof(WifiConfig, sta), - &wifi_sta_config__descriptor, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiStaItwtTeardown, resp), NULL, - 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + NULL, + 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_config__field_indices_by_name[] = { - 0, /* field[0] = ap */ - 1, /* field[1] = sta */ +static const unsigned rpc__resp__wifi_sta_itwt_teardown__field_indices_by_name[] = { + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_config__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__wifi_sta_itwt_teardown__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } + { 0, 1 } }; -const ProtobufCMessageDescriptor wifi_config__descriptor = +const ProtobufCMessageDescriptor rpc__resp__wifi_sta_itwt_teardown__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_config", - "WifiConfig", - "WifiConfig", + "Rpc_Resp_WifiStaItwtTeardown", + "RpcRespWifiStaItwtTeardown", + "RpcRespWifiStaItwtTeardown", "", - sizeof(WifiConfig), - 2, - wifi_config__field_descriptors, - wifi_config__field_indices_by_name, - 1, wifi_config__number_ranges, - (ProtobufCMessageInit) wifi_config__init, + sizeof(RpcRespWifiStaItwtTeardown), + 1, + rpc__resp__wifi_sta_itwt_teardown__field_descriptors, + rpc__resp__wifi_sta_itwt_teardown__field_indices_by_name, + 1, rpc__resp__wifi_sta_itwt_teardown__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_sta_itwt_teardown__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_sta_info__field_descriptors[3] = +static const ProtobufCFieldDescriptor rpc__req__wifi_sta_itwt_suspend__field_descriptors[2] = { { - "mac", + "flow_id", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiStaInfo, mac), + offsetof(RpcReqWifiStaItwtSuspend, flow_id), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "rssi", + "suspend_time_ms", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiStaInfo, rssi), + offsetof(RpcReqWifiStaItwtSuspend, suspend_time_ms), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__wifi_sta_itwt_suspend__field_indices_by_name[] = { + 0, /* field[0] = flow_id */ + 1, /* field[1] = suspend_time_ms */ +}; +static const ProtobufCIntRange rpc__req__wifi_sta_itwt_suspend__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_sta_itwt_suspend__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiStaItwtSuspend", + "RpcReqWifiStaItwtSuspend", + "RpcReqWifiStaItwtSuspend", + "", + sizeof(RpcReqWifiStaItwtSuspend), + 2, + rpc__req__wifi_sta_itwt_suspend__field_descriptors, + rpc__req__wifi_sta_itwt_suspend__field_indices_by_name, + 1, rpc__req__wifi_sta_itwt_suspend__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_sta_itwt_suspend__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_itwt_suspend__field_descriptors[1] = +{ { - "bitmask", - 3, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiStaInfo, bitmask), + offsetof(RpcRespWifiStaItwtSuspend, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_sta_info__field_indices_by_name[] = { - 2, /* field[2] = bitmask */ - 0, /* field[0] = mac */ - 1, /* field[1] = rssi */ +static const unsigned rpc__resp__wifi_sta_itwt_suspend__field_indices_by_name[] = { + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_sta_info__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__wifi_sta_itwt_suspend__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 3 } + { 0, 1 } }; -const ProtobufCMessageDescriptor wifi_sta_info__descriptor = +const ProtobufCMessageDescriptor rpc__resp__wifi_sta_itwt_suspend__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_sta_info", - "WifiStaInfo", - "WifiStaInfo", + "Rpc_Resp_WifiStaItwtSuspend", + "RpcRespWifiStaItwtSuspend", + "RpcRespWifiStaItwtSuspend", "", - sizeof(WifiStaInfo), - 3, - wifi_sta_info__field_descriptors, - wifi_sta_info__field_indices_by_name, - 1, wifi_sta_info__number_ranges, - (ProtobufCMessageInit) wifi_sta_info__init, + sizeof(RpcRespWifiStaItwtSuspend), + 1, + rpc__resp__wifi_sta_itwt_suspend__field_descriptors, + rpc__resp__wifi_sta_itwt_suspend__field_indices_by_name, + 1, rpc__resp__wifi_sta_itwt_suspend__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_sta_itwt_suspend__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_sta_list__field_descriptors[2] = +#define rpc__req__wifi_sta_itwt_get_flow_id_status__field_descriptors NULL +#define rpc__req__wifi_sta_itwt_get_flow_id_status__field_indices_by_name NULL +#define rpc__req__wifi_sta_itwt_get_flow_id_status__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_sta_itwt_get_flow_id_status__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiStaItwtGetFlowIdStatus", + "RpcReqWifiStaItwtGetFlowIdStatus", + "RpcReqWifiStaItwtGetFlowIdStatus", + "", + sizeof(RpcReqWifiStaItwtGetFlowIdStatus), + 0, + rpc__req__wifi_sta_itwt_get_flow_id_status__field_descriptors, + rpc__req__wifi_sta_itwt_get_flow_id_status__field_indices_by_name, + 0, rpc__req__wifi_sta_itwt_get_flow_id_status__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_sta_itwt_get_flow_id_status__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_itwt_get_flow_id_status__field_descriptors[2] = { { - "sta", + "resp", 1, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(WifiStaList, n_sta), - offsetof(WifiStaList, sta), - &wifi_sta_info__descriptor, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespWifiStaItwtGetFlowIdStatus, resp), + NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "num", + "flow_id_bitmap", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiStaList, num), + offsetof(RpcRespWifiStaItwtGetFlowIdStatus, flow_id_bitmap), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_sta_list__field_indices_by_name[] = { - 1, /* field[1] = num */ - 0, /* field[0] = sta */ +static const unsigned rpc__resp__wifi_sta_itwt_get_flow_id_status__field_indices_by_name[] = { + 1, /* field[1] = flow_id_bitmap */ + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_sta_list__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__wifi_sta_itwt_get_flow_id_status__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor wifi_sta_list__descriptor = +const ProtobufCMessageDescriptor rpc__resp__wifi_sta_itwt_get_flow_id_status__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_sta_list", - "WifiStaList", - "WifiStaList", + "Rpc_Resp_WifiStaItwtGetFlowIdStatus", + "RpcRespWifiStaItwtGetFlowIdStatus", + "RpcRespWifiStaItwtGetFlowIdStatus", "", - sizeof(WifiStaList), + sizeof(RpcRespWifiStaItwtGetFlowIdStatus), 2, - wifi_sta_list__field_descriptors, - wifi_sta_list__field_indices_by_name, - 1, wifi_sta_list__number_ranges, - (ProtobufCMessageInit) wifi_sta_list__init, + rpc__resp__wifi_sta_itwt_get_flow_id_status__field_descriptors, + rpc__resp__wifi_sta_itwt_get_flow_id_status__field_indices_by_name, + 1, rpc__resp__wifi_sta_itwt_get_flow_id_status__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_sta_itwt_get_flow_id_status__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_pkt_rx_ctrl__field_descriptors[19] = +static const ProtobufCFieldDescriptor rpc__req__wifi_sta_itwt_send_probe_req__field_descriptors[1] = { { - "rssi", + "timeout_ms", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, rssi), + offsetof(RpcReqWifiStaItwtSendProbeReq, timeout_ms), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__wifi_sta_itwt_send_probe_req__field_indices_by_name[] = { + 0, /* field[0] = timeout_ms */ +}; +static const ProtobufCIntRange rpc__req__wifi_sta_itwt_send_probe_req__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_sta_itwt_send_probe_req__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiStaItwtSendProbeReq", + "RpcReqWifiStaItwtSendProbeReq", + "RpcReqWifiStaItwtSendProbeReq", + "", + sizeof(RpcReqWifiStaItwtSendProbeReq), + 1, + rpc__req__wifi_sta_itwt_send_probe_req__field_descriptors, + rpc__req__wifi_sta_itwt_send_probe_req__field_indices_by_name, + 1, rpc__req__wifi_sta_itwt_send_probe_req__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_sta_itwt_send_probe_req__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_itwt_send_probe_req__field_descriptors[1] = +{ { - "rate", - 2, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, rate), + offsetof(RpcRespWifiStaItwtSendProbeReq, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_sta_itwt_send_probe_req__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_sta_itwt_send_probe_req__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_sta_itwt_send_probe_req__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiStaItwtSendProbeReq", + "RpcRespWifiStaItwtSendProbeReq", + "RpcRespWifiStaItwtSendProbeReq", + "", + sizeof(RpcRespWifiStaItwtSendProbeReq), + 1, + rpc__resp__wifi_sta_itwt_send_probe_req__field_descriptors, + rpc__resp__wifi_sta_itwt_send_probe_req__field_indices_by_name, + 1, rpc__resp__wifi_sta_itwt_send_probe_req__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_sta_itwt_send_probe_req__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_sta_itwt_set_target_wake_time_offset__field_descriptors[1] = +{ { - "sig_mode", - 3, + "offset_us", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, sig_mode), + offsetof(RpcReqWifiStaItwtSetTargetWakeTimeOffset, offset_us), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__wifi_sta_itwt_set_target_wake_time_offset__field_indices_by_name[] = { + 0, /* field[0] = offset_us */ +}; +static const ProtobufCIntRange rpc__req__wifi_sta_itwt_set_target_wake_time_offset__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_sta_itwt_set_target_wake_time_offset__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiStaItwtSetTargetWakeTimeOffset", + "RpcReqWifiStaItwtSetTargetWakeTimeOffset", + "RpcReqWifiStaItwtSetTargetWakeTimeOffset", + "", + sizeof(RpcReqWifiStaItwtSetTargetWakeTimeOffset), + 1, + rpc__req__wifi_sta_itwt_set_target_wake_time_offset__field_descriptors, + rpc__req__wifi_sta_itwt_set_target_wake_time_offset__field_indices_by_name, + 1, rpc__req__wifi_sta_itwt_set_target_wake_time_offset__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_sta_itwt_set_target_wake_time_offset__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__field_descriptors[1] = +{ { - "mcs", - 4, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, mcs), + offsetof(RpcRespWifiStaItwtSetTargetWakeTimeOffset, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiStaItwtSetTargetWakeTimeOffset", + "RpcRespWifiStaItwtSetTargetWakeTimeOffset", + "RpcRespWifiStaItwtSetTargetWakeTimeOffset", + "", + sizeof(RpcRespWifiStaItwtSetTargetWakeTimeOffset), + 1, + rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__field_descriptors, + rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__field_indices_by_name, + 1, rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__wifi_sta_twt_config__field_descriptors[1] = +{ { - "cwb", - 5, + "config", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, cwb), - NULL, + offsetof(RpcReqWifiStaTwtConfig, config), + &wifi_twt_config__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__wifi_sta_twt_config__field_indices_by_name[] = { + 0, /* field[0] = config */ +}; +static const ProtobufCIntRange rpc__req__wifi_sta_twt_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__wifi_sta_twt_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiStaTwtConfig", + "RpcReqWifiStaTwtConfig", + "RpcReqWifiStaTwtConfig", + "", + sizeof(RpcReqWifiStaTwtConfig), + 1, + rpc__req__wifi_sta_twt_config__field_descriptors, + rpc__req__wifi_sta_twt_config__field_indices_by_name, + 1, rpc__req__wifi_sta_twt_config__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_sta_twt_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_twt_config__field_descriptors[1] = +{ { - "smoothing", - 6, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, smoothing), + offsetof(RpcRespWifiStaTwtConfig, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__wifi_sta_twt_config__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__wifi_sta_twt_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__wifi_sta_twt_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_WifiStaTwtConfig", + "RpcRespWifiStaTwtConfig", + "RpcRespWifiStaTwtConfig", + "", + sizeof(RpcRespWifiStaTwtConfig), + 1, + rpc__resp__wifi_sta_twt_config__field_descriptors, + rpc__resp__wifi_sta_twt_config__field_indices_by_name, + 1, rpc__resp__wifi_sta_twt_config__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_sta_twt_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__get_coprocessor_fw_version__field_descriptors NULL +#define rpc__req__get_coprocessor_fw_version__field_indices_by_name NULL +#define rpc__req__get_coprocessor_fw_version__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__get_coprocessor_fw_version__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_GetCoprocessorFwVersion", + "RpcReqGetCoprocessorFwVersion", + "RpcReqGetCoprocessorFwVersion", + "", + sizeof(RpcReqGetCoprocessorFwVersion), + 0, + rpc__req__get_coprocessor_fw_version__field_descriptors, + rpc__req__get_coprocessor_fw_version__field_indices_by_name, + 0, rpc__req__get_coprocessor_fw_version__number_ranges, + (ProtobufCMessageInit) rpc__req__get_coprocessor_fw_version__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__get_coprocessor_fw_version__field_descriptors[4] = +{ { - "not_sounding", - 7, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, not_sounding), + offsetof(RpcRespGetCoprocessorFwVersion, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "aggregation", - 8, + "major1", + 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, aggregation), + offsetof(RpcRespGetCoprocessorFwVersion, major1), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "stbc", - 9, + "minor1", + 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, stbc), + offsetof(RpcRespGetCoprocessorFwVersion, minor1), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "fec_coding", - 10, + "patch1", + 4, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, fec_coding), + offsetof(RpcRespGetCoprocessorFwVersion, patch1), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__get_coprocessor_fw_version__field_indices_by_name[] = { + 1, /* field[1] = major1 */ + 2, /* field[2] = minor1 */ + 3, /* field[3] = patch1 */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__get_coprocessor_fw_version__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor rpc__resp__get_coprocessor_fw_version__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_GetCoprocessorFwVersion", + "RpcRespGetCoprocessorFwVersion", + "RpcRespGetCoprocessorFwVersion", + "", + sizeof(RpcRespGetCoprocessorFwVersion), + 4, + rpc__resp__get_coprocessor_fw_version__field_descriptors, + rpc__resp__get_coprocessor_fw_version__field_indices_by_name, + 1, rpc__resp__get_coprocessor_fw_version__number_ranges, + (ProtobufCMessageInit) rpc__resp__get_coprocessor_fw_version__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__set_dhcp_dns_status__field_descriptors[9] = +{ { - "sgi", - 11, + "iface", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, sgi), + offsetof(RpcReqSetDhcpDnsStatus, iface), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "noise_floor", - 12, + "net_link_up", + 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, noise_floor), + offsetof(RpcReqSetDhcpDnsStatus, net_link_up), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ampdu_cnt", - 13, + "dhcp_up", + 3, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, ampdu_cnt), + offsetof(RpcReqSetDhcpDnsStatus, dhcp_up), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "channel", - 14, + "dhcp_ip", + 4, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, channel), + offsetof(RpcReqSetDhcpDnsStatus, dhcp_ip), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "secondary_channel", - 15, + "dhcp_nm", + 5, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, secondary_channel), + offsetof(RpcReqSetDhcpDnsStatus, dhcp_nm), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "timestamp", - 16, + "dhcp_gw", + 6, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, timestamp), + offsetof(RpcReqSetDhcpDnsStatus, dhcp_gw), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ant", - 17, + "dns_up", + 7, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, ant), + offsetof(RpcReqSetDhcpDnsStatus, dns_up), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "sig_len", - 18, + "dns_ip", + 8, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, sig_len), + offsetof(RpcReqSetDhcpDnsStatus, dns_ip), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "rx_state", - 19, + "dns_type", + 9, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiPktRxCtrl, rx_state), + offsetof(RpcReqSetDhcpDnsStatus, dns_type), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_pkt_rx_ctrl__field_indices_by_name[] = { - 7, /* field[7] = aggregation */ - 12, /* field[12] = ampdu_cnt */ - 16, /* field[16] = ant */ - 13, /* field[13] = channel */ - 4, /* field[4] = cwb */ - 9, /* field[9] = fec_coding */ - 3, /* field[3] = mcs */ - 11, /* field[11] = noise_floor */ - 6, /* field[6] = not_sounding */ - 1, /* field[1] = rate */ - 0, /* field[0] = rssi */ - 18, /* field[18] = rx_state */ - 14, /* field[14] = secondary_channel */ - 10, /* field[10] = sgi */ - 17, /* field[17] = sig_len */ - 2, /* field[2] = sig_mode */ - 5, /* field[5] = smoothing */ - 8, /* field[8] = stbc */ - 15, /* field[15] = timestamp */ +static const unsigned rpc__req__set_dhcp_dns_status__field_indices_by_name[] = { + 5, /* field[5] = dhcp_gw */ + 3, /* field[3] = dhcp_ip */ + 4, /* field[4] = dhcp_nm */ + 2, /* field[2] = dhcp_up */ + 7, /* field[7] = dns_ip */ + 8, /* field[8] = dns_type */ + 6, /* field[6] = dns_up */ + 0, /* field[0] = iface */ + 1, /* field[1] = net_link_up */ }; -static const ProtobufCIntRange wifi_pkt_rx_ctrl__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__set_dhcp_dns_status__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 19 } + { 0, 9 } }; -const ProtobufCMessageDescriptor wifi_pkt_rx_ctrl__descriptor = +const ProtobufCMessageDescriptor rpc__req__set_dhcp_dns_status__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_pkt_rx_ctrl", - "WifiPktRxCtrl", - "WifiPktRxCtrl", + "Rpc_Req_SetDhcpDnsStatus", + "RpcReqSetDhcpDnsStatus", + "RpcReqSetDhcpDnsStatus", "", - sizeof(WifiPktRxCtrl), - 19, - wifi_pkt_rx_ctrl__field_descriptors, - wifi_pkt_rx_ctrl__field_indices_by_name, - 1, wifi_pkt_rx_ctrl__number_ranges, - (ProtobufCMessageInit) wifi_pkt_rx_ctrl__init, + sizeof(RpcReqSetDhcpDnsStatus), + 9, + rpc__req__set_dhcp_dns_status__field_descriptors, + rpc__req__set_dhcp_dns_status__field_indices_by_name, + 1, rpc__req__set_dhcp_dns_status__number_ranges, + (ProtobufCMessageInit) rpc__req__set_dhcp_dns_status__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_promiscuous_pkt__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__resp__set_dhcp_dns_status__field_descriptors[1] = { { - "rx_ctrl", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(WifiPromiscuousPkt, rx_ctrl), - &wifi_pkt_rx_ctrl__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "payload", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiPromiscuousPkt, payload), + offsetof(RpcRespSetDhcpDnsStatus, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_promiscuous_pkt__field_indices_by_name[] = { - 1, /* field[1] = payload */ - 0, /* field[0] = rx_ctrl */ +static const unsigned rpc__resp__set_dhcp_dns_status__field_indices_by_name[] = { + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_promiscuous_pkt__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__set_dhcp_dns_status__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } + { 0, 1 } }; -const ProtobufCMessageDescriptor wifi_promiscuous_pkt__descriptor = +const ProtobufCMessageDescriptor rpc__resp__set_dhcp_dns_status__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_promiscuous_pkt", - "WifiPromiscuousPkt", - "WifiPromiscuousPkt", + "Rpc_Resp_SetDhcpDnsStatus", + "RpcRespSetDhcpDnsStatus", + "RpcRespSetDhcpDnsStatus", "", - sizeof(WifiPromiscuousPkt), - 2, - wifi_promiscuous_pkt__field_descriptors, - wifi_promiscuous_pkt__field_indices_by_name, - 1, wifi_promiscuous_pkt__number_ranges, - (ProtobufCMessageInit) wifi_promiscuous_pkt__init, + sizeof(RpcRespSetDhcpDnsStatus), + 1, + rpc__resp__set_dhcp_dns_status__field_descriptors, + rpc__resp__set_dhcp_dns_status__field_indices_by_name, + 1, rpc__resp__set_dhcp_dns_status__number_ranges, + (ProtobufCMessageInit) rpc__resp__set_dhcp_dns_status__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_promiscuous_filter__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__req__get_dhcp_dns_status__field_descriptors[1] = { { - "filter_mask", + "iface", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiPromiscuousFilter, filter_mask), + offsetof(RpcReqGetDhcpDnsStatus, iface), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_promiscuous_filter__field_indices_by_name[] = { - 0, /* field[0] = filter_mask */ +static const unsigned rpc__req__get_dhcp_dns_status__field_indices_by_name[] = { + 0, /* field[0] = iface */ }; -static const ProtobufCIntRange wifi_promiscuous_filter__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__get_dhcp_dns_status__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor wifi_promiscuous_filter__descriptor = +const ProtobufCMessageDescriptor rpc__req__get_dhcp_dns_status__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_promiscuous_filter", - "WifiPromiscuousFilter", - "WifiPromiscuousFilter", + "Rpc_Req_GetDhcpDnsStatus", + "RpcReqGetDhcpDnsStatus", + "RpcReqGetDhcpDnsStatus", "", - sizeof(WifiPromiscuousFilter), + sizeof(RpcReqGetDhcpDnsStatus), 1, - wifi_promiscuous_filter__field_descriptors, - wifi_promiscuous_filter__field_indices_by_name, - 1, wifi_promiscuous_filter__number_ranges, - (ProtobufCMessageInit) wifi_promiscuous_filter__init, + rpc__req__get_dhcp_dns_status__field_descriptors, + rpc__req__get_dhcp_dns_status__field_indices_by_name, + 1, rpc__req__get_dhcp_dns_status__number_ranges, + (ProtobufCMessageInit) rpc__req__get_dhcp_dns_status__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_csi_config__field_descriptors[7] = +static const ProtobufCFieldDescriptor rpc__resp__get_dhcp_dns_status__field_descriptors[10] = { { - "lltf_en", + "iface", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiCsiConfig, lltf_en), + offsetof(RpcRespGetDhcpDnsStatus, iface), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "htltf_en", + "net_link_up", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiCsiConfig, htltf_en), + offsetof(RpcRespGetDhcpDnsStatus, net_link_up), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "stbc_htltf2_en", + "dhcp_up", 3, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiCsiConfig, stbc_htltf2_en), + offsetof(RpcRespGetDhcpDnsStatus, dhcp_up), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ltf_merge_en", + "dhcp_ip", 4, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiCsiConfig, ltf_merge_en), + offsetof(RpcRespGetDhcpDnsStatus, dhcp_ip), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "channel_filter_en", + "dhcp_nm", 5, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiCsiConfig, channel_filter_en), + offsetof(RpcRespGetDhcpDnsStatus, dhcp_nm), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "manu_scale", + "dhcp_gw", 6, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiCsiConfig, manu_scale), + offsetof(RpcRespGetDhcpDnsStatus, dhcp_gw), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "shift", + "dns_up", 7, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiCsiConfig, shift), + offsetof(RpcRespGetDhcpDnsStatus, dns_up), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned wifi_csi_config__field_indices_by_name[] = { - 4, /* field[4] = channel_filter_en */ - 1, /* field[1] = htltf_en */ - 0, /* field[0] = lltf_en */ - 3, /* field[3] = ltf_merge_en */ - 5, /* field[5] = manu_scale */ - 6, /* field[6] = shift */ - 2, /* field[2] = stbc_htltf2_en */ -}; -static const ProtobufCIntRange wifi_csi_config__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 7 } -}; -const ProtobufCMessageDescriptor wifi_csi_config__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_csi_config", - "WifiCsiConfig", - "WifiCsiConfig", - "", - sizeof(WifiCsiConfig), - 7, - wifi_csi_config__field_descriptors, - wifi_csi_config__field_indices_by_name, - 1, wifi_csi_config__number_ranges, - (ProtobufCMessageInit) wifi_csi_config__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor wifi_csi_info__field_descriptors[6] = -{ { - "rx_ctrl", - 1, + "dns_ip", + 8, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiCsiInfo, rx_ctrl), - &wifi_pkt_rx_ctrl__descriptor, + offsetof(RpcRespGetDhcpDnsStatus, dns_ip), + NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "mac", - 2, + "dns_type", + 9, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiCsiInfo, mac), + offsetof(RpcRespGetDhcpDnsStatus, dns_type), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "dmac", - 3, + "resp", + 10, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiCsiInfo, dmac), + offsetof(RpcRespGetDhcpDnsStatus, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__get_dhcp_dns_status__field_indices_by_name[] = { + 5, /* field[5] = dhcp_gw */ + 3, /* field[3] = dhcp_ip */ + 4, /* field[4] = dhcp_nm */ + 2, /* field[2] = dhcp_up */ + 7, /* field[7] = dns_ip */ + 8, /* field[8] = dns_type */ + 6, /* field[6] = dns_up */ + 0, /* field[0] = iface */ + 1, /* field[1] = net_link_up */ + 9, /* field[9] = resp */ +}; +static const ProtobufCIntRange rpc__resp__get_dhcp_dns_status__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 10 } +}; +const ProtobufCMessageDescriptor rpc__resp__get_dhcp_dns_status__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_GetDhcpDnsStatus", + "RpcRespGetDhcpDnsStatus", + "RpcRespGetDhcpDnsStatus", + "", + sizeof(RpcRespGetDhcpDnsStatus), + 10, + rpc__resp__get_dhcp_dns_status__field_descriptors, + rpc__resp__get_dhcp_dns_status__field_indices_by_name, + 1, rpc__resp__get_dhcp_dns_status__number_ranges, + (ProtobufCMessageInit) rpc__resp__get_dhcp_dns_status__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__supp_dpp_init__field_descriptors[1] = +{ { - "first_word_invalid", - 4, + "cb", + 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ - offsetof(WifiCsiInfo, first_word_invalid), + offsetof(RpcReqSuppDppInit, cb), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__supp_dpp_init__field_indices_by_name[] = { + 0, /* field[0] = cb */ +}; +static const ProtobufCIntRange rpc__req__supp_dpp_init__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__supp_dpp_init__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_SuppDppInit", + "RpcReqSuppDppInit", + "RpcReqSuppDppInit", + "", + sizeof(RpcReqSuppDppInit), + 1, + rpc__req__supp_dpp_init__field_descriptors, + rpc__req__supp_dpp_init__field_indices_by_name, + 1, rpc__req__supp_dpp_init__number_ranges, + (ProtobufCMessageInit) rpc__req__supp_dpp_init__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__supp_dpp_init__field_descriptors[1] = +{ { - "buf", - 5, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiCsiInfo, buf), + offsetof(RpcRespSuppDppInit, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__supp_dpp_init__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__supp_dpp_init__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__supp_dpp_init__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_SuppDppInit", + "RpcRespSuppDppInit", + "RpcRespSuppDppInit", + "", + sizeof(RpcRespSuppDppInit), + 1, + rpc__resp__supp_dpp_init__field_descriptors, + rpc__resp__supp_dpp_init__field_indices_by_name, + 1, rpc__resp__supp_dpp_init__number_ranges, + (ProtobufCMessageInit) rpc__resp__supp_dpp_init__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__supp_dpp_deinit__field_descriptors NULL +#define rpc__req__supp_dpp_deinit__field_indices_by_name NULL +#define rpc__req__supp_dpp_deinit__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__supp_dpp_deinit__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_SuppDppDeinit", + "RpcReqSuppDppDeinit", + "RpcReqSuppDppDeinit", + "", + sizeof(RpcReqSuppDppDeinit), + 0, + rpc__req__supp_dpp_deinit__field_descriptors, + rpc__req__supp_dpp_deinit__field_indices_by_name, + 0, rpc__req__supp_dpp_deinit__number_ranges, + (ProtobufCMessageInit) rpc__req__supp_dpp_deinit__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__supp_dpp_deinit__field_descriptors[1] = +{ { - "len", - 6, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiCsiInfo, len), + offsetof(RpcRespSuppDppDeinit, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_csi_info__field_indices_by_name[] = { - 4, /* field[4] = buf */ - 2, /* field[2] = dmac */ - 3, /* field[3] = first_word_invalid */ - 5, /* field[5] = len */ - 1, /* field[1] = mac */ - 0, /* field[0] = rx_ctrl */ +static const unsigned rpc__resp__supp_dpp_deinit__field_indices_by_name[] = { + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_csi_info__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__supp_dpp_deinit__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 6 } + { 0, 1 } }; -const ProtobufCMessageDescriptor wifi_csi_info__descriptor = +const ProtobufCMessageDescriptor rpc__resp__supp_dpp_deinit__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_csi_info", - "WifiCsiInfo", - "WifiCsiInfo", + "Rpc_Resp_SuppDppDeinit", + "RpcRespSuppDppDeinit", + "RpcRespSuppDppDeinit", "", - sizeof(WifiCsiInfo), - 6, - wifi_csi_info__field_descriptors, - wifi_csi_info__field_indices_by_name, - 1, wifi_csi_info__number_ranges, - (ProtobufCMessageInit) wifi_csi_info__init, + sizeof(RpcRespSuppDppDeinit), + 1, + rpc__resp__supp_dpp_deinit__field_descriptors, + rpc__resp__supp_dpp_deinit__field_indices_by_name, + 1, rpc__resp__supp_dpp_deinit__number_ranges, + (ProtobufCMessageInit) rpc__resp__supp_dpp_deinit__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_ant_gpio__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__req__supp_dpp_bootstrap_gen__field_descriptors[4] = { { - "gpio_select", + "chan_list", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiAntGpio, gpio_select), + offsetof(RpcReqSuppDppBootstrapGen, chan_list), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "gpio_num", + "type", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiAntGpio, gpio_num), + offsetof(RpcReqSuppDppBootstrapGen, type), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "key", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(RpcReqSuppDppBootstrapGen, key), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "info", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(RpcReqSuppDppBootstrapGen, info), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_ant_gpio__field_indices_by_name[] = { - 1, /* field[1] = gpio_num */ - 0, /* field[0] = gpio_select */ +static const unsigned rpc__req__supp_dpp_bootstrap_gen__field_indices_by_name[] = { + 0, /* field[0] = chan_list */ + 3, /* field[3] = info */ + 2, /* field[2] = key */ + 1, /* field[1] = type */ }; -static const ProtobufCIntRange wifi_ant_gpio__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__supp_dpp_bootstrap_gen__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor wifi_ant_gpio__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_ant_gpio", - "WifiAntGpio", - "WifiAntGpio", - "", - sizeof(WifiAntGpio), - 2, - wifi_ant_gpio__field_descriptors, - wifi_ant_gpio__field_indices_by_name, - 1, wifi_ant_gpio__number_ranges, - (ProtobufCMessageInit) wifi_ant_gpio__init, + { 0, 4 } +}; +const ProtobufCMessageDescriptor rpc__req__supp_dpp_bootstrap_gen__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_SuppDppBootstrapGen", + "RpcReqSuppDppBootstrapGen", + "RpcReqSuppDppBootstrapGen", + "", + sizeof(RpcReqSuppDppBootstrapGen), + 4, + rpc__req__supp_dpp_bootstrap_gen__field_descriptors, + rpc__req__supp_dpp_bootstrap_gen__field_indices_by_name, + 1, rpc__req__supp_dpp_bootstrap_gen__number_ranges, + (ProtobufCMessageInit) rpc__req__supp_dpp_bootstrap_gen__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_ant_gpio_config__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__supp_dpp_bootstrap_gen__field_descriptors[1] = { { - "gpio_cfgs", + "resp", 1, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(WifiAntGpioConfig, n_gpio_cfgs), - offsetof(WifiAntGpioConfig, gpio_cfgs), - &wifi_ant_gpio__descriptor, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespSuppDppBootstrapGen, resp), + NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_ant_gpio_config__field_indices_by_name[] = { - 0, /* field[0] = gpio_cfgs */ +static const unsigned rpc__resp__supp_dpp_bootstrap_gen__field_indices_by_name[] = { + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_ant_gpio_config__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__supp_dpp_bootstrap_gen__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor wifi_ant_gpio_config__descriptor = +const ProtobufCMessageDescriptor rpc__resp__supp_dpp_bootstrap_gen__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_ant_gpio_config", - "WifiAntGpioConfig", - "WifiAntGpioConfig", + "Rpc_Resp_SuppDppBootstrapGen", + "RpcRespSuppDppBootstrapGen", + "RpcRespSuppDppBootstrapGen", "", - sizeof(WifiAntGpioConfig), + sizeof(RpcRespSuppDppBootstrapGen), 1, - wifi_ant_gpio_config__field_descriptors, - wifi_ant_gpio_config__field_indices_by_name, - 1, wifi_ant_gpio_config__number_ranges, - (ProtobufCMessageInit) wifi_ant_gpio_config__init, + rpc__resp__supp_dpp_bootstrap_gen__field_descriptors, + rpc__resp__supp_dpp_bootstrap_gen__field_indices_by_name, + 1, rpc__resp__supp_dpp_bootstrap_gen__number_ranges, + (ProtobufCMessageInit) rpc__resp__supp_dpp_bootstrap_gen__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_ant_config__field_descriptors[5] = +#define rpc__req__supp_dpp_start_listen__field_descriptors NULL +#define rpc__req__supp_dpp_start_listen__field_indices_by_name NULL +#define rpc__req__supp_dpp_start_listen__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__supp_dpp_start_listen__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_SuppDppStartListen", + "RpcReqSuppDppStartListen", + "RpcReqSuppDppStartListen", + "", + sizeof(RpcReqSuppDppStartListen), + 0, + rpc__req__supp_dpp_start_listen__field_descriptors, + rpc__req__supp_dpp_start_listen__field_indices_by_name, + 0, rpc__req__supp_dpp_start_listen__number_ranges, + (ProtobufCMessageInit) rpc__req__supp_dpp_start_listen__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__supp_dpp_start_listen__field_descriptors[1] = { { - "rx_ant_mode", + "resp", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiAntConfig, rx_ant_mode), + offsetof(RpcRespSuppDppStartListen, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__supp_dpp_start_listen__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__supp_dpp_start_listen__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__supp_dpp_start_listen__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_SuppDppStartListen", + "RpcRespSuppDppStartListen", + "RpcRespSuppDppStartListen", + "", + sizeof(RpcRespSuppDppStartListen), + 1, + rpc__resp__supp_dpp_start_listen__field_descriptors, + rpc__resp__supp_dpp_start_listen__field_indices_by_name, + 1, rpc__resp__supp_dpp_start_listen__number_ranges, + (ProtobufCMessageInit) rpc__resp__supp_dpp_start_listen__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__supp_dpp_stop_listen__field_descriptors NULL +#define rpc__req__supp_dpp_stop_listen__field_indices_by_name NULL +#define rpc__req__supp_dpp_stop_listen__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__supp_dpp_stop_listen__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_SuppDppStopListen", + "RpcReqSuppDppStopListen", + "RpcReqSuppDppStopListen", + "", + sizeof(RpcReqSuppDppStopListen), + 0, + rpc__req__supp_dpp_stop_listen__field_descriptors, + rpc__req__supp_dpp_stop_listen__field_indices_by_name, + 0, rpc__req__supp_dpp_stop_listen__number_ranges, + (ProtobufCMessageInit) rpc__req__supp_dpp_stop_listen__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__supp_dpp_stop_listen__field_descriptors[1] = +{ { - "rx_ant_default", - 2, + "resp", + 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiAntConfig, rx_ant_default), + offsetof(RpcRespSuppDppStopListen, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__supp_dpp_stop_listen__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__supp_dpp_stop_listen__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__supp_dpp_stop_listen__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_SuppDppStopListen", + "RpcRespSuppDppStopListen", + "RpcRespSuppDppStopListen", + "", + sizeof(RpcRespSuppDppStopListen), + 1, + rpc__resp__supp_dpp_stop_listen__field_descriptors, + rpc__resp__supp_dpp_stop_listen__field_indices_by_name, + 1, rpc__resp__supp_dpp_stop_listen__number_ranges, + (ProtobufCMessageInit) rpc__resp__supp_dpp_stop_listen__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__iface_mac_addr_set_get__field_descriptors[3] = +{ { - "tx_ant_mode", - 3, + "set", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ - offsetof(WifiAntConfig, tx_ant_mode), + offsetof(RpcReqIfaceMacAddrSetGet, set), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "enabled_ant0", - 4, + "type", + 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiAntConfig, enabled_ant0), + offsetof(RpcReqIfaceMacAddrSetGet, type), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "enabled_ant1", - 5, + "mac", + 3, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiAntConfig, enabled_ant1), + offsetof(RpcReqIfaceMacAddrSetGet, mac), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_ant_config__field_indices_by_name[] = { - 3, /* field[3] = enabled_ant0 */ - 4, /* field[4] = enabled_ant1 */ - 1, /* field[1] = rx_ant_default */ - 0, /* field[0] = rx_ant_mode */ - 2, /* field[2] = tx_ant_mode */ +static const unsigned rpc__req__iface_mac_addr_set_get__field_indices_by_name[] = { + 2, /* field[2] = mac */ + 0, /* field[0] = set */ + 1, /* field[1] = type */ }; -static const ProtobufCIntRange wifi_ant_config__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__iface_mac_addr_set_get__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 5 } + { 0, 3 } }; -const ProtobufCMessageDescriptor wifi_ant_config__descriptor = +const ProtobufCMessageDescriptor rpc__req__iface_mac_addr_set_get__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_ant_config", - "WifiAntConfig", - "WifiAntConfig", + "Rpc_Req_IfaceMacAddrSetGet", + "RpcReqIfaceMacAddrSetGet", + "RpcReqIfaceMacAddrSetGet", "", - sizeof(WifiAntConfig), - 5, - wifi_ant_config__field_descriptors, - wifi_ant_config__field_indices_by_name, - 1, wifi_ant_config__number_ranges, - (ProtobufCMessageInit) wifi_ant_config__init, + sizeof(RpcReqIfaceMacAddrSetGet), + 3, + rpc__req__iface_mac_addr_set_get__field_descriptors, + rpc__req__iface_mac_addr_set_get__field_indices_by_name, + 1, rpc__req__iface_mac_addr_set_get__number_ranges, + (ProtobufCMessageInit) rpc__req__iface_mac_addr_set_get__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_action_tx_req__field_descriptors[5] = +static const ProtobufCFieldDescriptor rpc__resp__iface_mac_addr_set_get__field_descriptors[4] = { { - "ifx", + "resp", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiActionTxReq, ifx), + offsetof(RpcRespIfaceMacAddrSetGet, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "dest_mac", + "set", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ - offsetof(WifiActionTxReq, dest_mac), + offsetof(RpcRespIfaceMacAddrSetGet, set), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "no_ack", + "type", 3, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, + PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiActionTxReq, no_ack), + offsetof(RpcRespIfaceMacAddrSetGet, type), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "data_len", + "mac", 4, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiActionTxReq, data_len), + offsetof(RpcRespIfaceMacAddrSetGet, mac), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__iface_mac_addr_set_get__field_indices_by_name[] = { + 3, /* field[3] = mac */ + 0, /* field[0] = resp */ + 1, /* field[1] = set */ + 2, /* field[2] = type */ +}; +static const ProtobufCIntRange rpc__resp__iface_mac_addr_set_get__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor rpc__resp__iface_mac_addr_set_get__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_IfaceMacAddrSetGet", + "RpcRespIfaceMacAddrSetGet", + "RpcRespIfaceMacAddrSetGet", + "", + sizeof(RpcRespIfaceMacAddrSetGet), + 4, + rpc__resp__iface_mac_addr_set_get__field_descriptors, + rpc__resp__iface_mac_addr_set_get__field_indices_by_name, + 1, rpc__resp__iface_mac_addr_set_get__number_ranges, + (ProtobufCMessageInit) rpc__resp__iface_mac_addr_set_get__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__iface_mac_addr_len_get__field_descriptors[1] = +{ { - "data", - 5, + "type", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiActionTxReq, data), + offsetof(RpcReqIfaceMacAddrLenGet, type), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_action_tx_req__field_indices_by_name[] = { - 4, /* field[4] = data */ - 3, /* field[3] = data_len */ - 1, /* field[1] = dest_mac */ - 0, /* field[0] = ifx */ - 2, /* field[2] = no_ack */ +static const unsigned rpc__req__iface_mac_addr_len_get__field_indices_by_name[] = { + 0, /* field[0] = type */ }; -static const ProtobufCIntRange wifi_action_tx_req__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__iface_mac_addr_len_get__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 5 } + { 0, 1 } }; -const ProtobufCMessageDescriptor wifi_action_tx_req__descriptor = +const ProtobufCMessageDescriptor rpc__req__iface_mac_addr_len_get__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_action_tx_req", - "WifiActionTxReq", - "WifiActionTxReq", + "Rpc_Req_IfaceMacAddrLenGet", + "RpcReqIfaceMacAddrLenGet", + "RpcReqIfaceMacAddrLenGet", "", - sizeof(WifiActionTxReq), - 5, - wifi_action_tx_req__field_descriptors, - wifi_action_tx_req__field_indices_by_name, - 1, wifi_action_tx_req__number_ranges, - (ProtobufCMessageInit) wifi_action_tx_req__init, + sizeof(RpcReqIfaceMacAddrLenGet), + 1, + rpc__req__iface_mac_addr_len_get__field_descriptors, + rpc__req__iface_mac_addr_len_get__field_indices_by_name, + 1, rpc__req__iface_mac_addr_len_get__number_ranges, + (ProtobufCMessageInit) rpc__req__iface_mac_addr_len_get__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_ftm_initiator_cfg__field_descriptors[4] = +static const ProtobufCFieldDescriptor rpc__resp__iface_mac_addr_len_get__field_descriptors[3] = { { - "resp_mac", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiFtmInitiatorCfg, resp_mac), + offsetof(RpcRespIfaceMacAddrLenGet, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "channel", + "type", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiFtmInitiatorCfg, channel), + offsetof(RpcRespIfaceMacAddrLenGet, type), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "frm_count", + "len", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiFtmInitiatorCfg, frm_count), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "burst_period", - 4, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(WifiFtmInitiatorCfg, burst_period), + offsetof(RpcRespIfaceMacAddrLenGet, len), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_ftm_initiator_cfg__field_indices_by_name[] = { - 3, /* field[3] = burst_period */ - 1, /* field[1] = channel */ - 2, /* field[2] = frm_count */ - 0, /* field[0] = resp_mac */ +static const unsigned rpc__resp__iface_mac_addr_len_get__field_indices_by_name[] = { + 2, /* field[2] = len */ + 0, /* field[0] = resp */ + 1, /* field[1] = type */ }; -static const ProtobufCIntRange wifi_ftm_initiator_cfg__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__iface_mac_addr_len_get__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 4 } + { 0, 3 } }; -const ProtobufCMessageDescriptor wifi_ftm_initiator_cfg__descriptor = +const ProtobufCMessageDescriptor rpc__resp__iface_mac_addr_len_get__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_ftm_initiator_cfg", - "WifiFtmInitiatorCfg", - "WifiFtmInitiatorCfg", + "Rpc_Resp_IfaceMacAddrLenGet", + "RpcRespIfaceMacAddrLenGet", + "RpcRespIfaceMacAddrLenGet", "", - sizeof(WifiFtmInitiatorCfg), - 4, - wifi_ftm_initiator_cfg__field_descriptors, - wifi_ftm_initiator_cfg__field_indices_by_name, - 1, wifi_ftm_initiator_cfg__number_ranges, - (ProtobufCMessageInit) wifi_ftm_initiator_cfg__init, + sizeof(RpcRespIfaceMacAddrLenGet), + 3, + rpc__resp__iface_mac_addr_len_get__field_descriptors, + rpc__resp__iface_mac_addr_len_get__field_indices_by_name, + 1, rpc__resp__iface_mac_addr_len_get__number_ranges, + (ProtobufCMessageInit) rpc__resp__iface_mac_addr_len_get__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_event_sta_scan_done__field_descriptors[3] = +static const ProtobufCFieldDescriptor rpc__req__feature_control__field_descriptors[3] = { { - "status", + "feature", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ - offsetof(WifiEventStaScanDone, status), - NULL, + offsetof(RpcReqFeatureControl, feature), + &rpc_feature__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "number", + "command", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ - offsetof(WifiEventStaScanDone, number), - NULL, + offsetof(RpcReqFeatureControl, command), + &rpc_feature_command__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "scan_id", + "option", 3, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ - offsetof(WifiEventStaScanDone, scan_id), - NULL, + offsetof(RpcReqFeatureControl, option), + &rpc_feature_option__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_event_sta_scan_done__field_indices_by_name[] = { - 1, /* field[1] = number */ - 2, /* field[2] = scan_id */ - 0, /* field[0] = status */ +static const unsigned rpc__req__feature_control__field_indices_by_name[] = { + 1, /* field[1] = command */ + 0, /* field[0] = feature */ + 2, /* field[2] = option */ }; -static const ProtobufCIntRange wifi_event_sta_scan_done__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__feature_control__number_ranges[1 + 1] = { { 1, 0 }, { 0, 3 } }; -const ProtobufCMessageDescriptor wifi_event_sta_scan_done__descriptor = +const ProtobufCMessageDescriptor rpc__req__feature_control__descriptor = { - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_event_sta_scan_done", - "WifiEventStaScanDone", - "WifiEventStaScanDone", - "", - sizeof(WifiEventStaScanDone), - 3, - wifi_event_sta_scan_done__field_descriptors, - wifi_event_sta_scan_done__field_indices_by_name, - 1, wifi_event_sta_scan_done__number_ranges, - (ProtobufCMessageInit) wifi_event_sta_scan_done__init, + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_FeatureControl", + "RpcReqFeatureControl", + "RpcReqFeatureControl", + "", + sizeof(RpcReqFeatureControl), + 3, + rpc__req__feature_control__field_descriptors, + rpc__req__feature_control__field_indices_by_name, + 1, rpc__req__feature_control__number_ranges, + (ProtobufCMessageInit) rpc__req__feature_control__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_event_sta_connected__field_descriptors[6] = +static const ProtobufCFieldDescriptor rpc__resp__feature_control__field_descriptors[4] = { { - "ssid", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventStaConnected, ssid), + offsetof(RpcRespFeatureControl, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ssid_len", + "feature", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ - offsetof(WifiEventStaConnected, ssid_len), - NULL, + offsetof(RpcRespFeatureControl, feature), + &rpc_feature__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "bssid", + "command", 3, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ - offsetof(WifiEventStaConnected, bssid), - NULL, + offsetof(RpcRespFeatureControl, command), + &rpc_feature_command__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "channel", + "option", 4, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ - offsetof(WifiEventStaConnected, channel), - NULL, + offsetof(RpcRespFeatureControl, option), + &rpc_feature_option__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__feature_control__field_indices_by_name[] = { + 2, /* field[2] = command */ + 1, /* field[1] = feature */ + 3, /* field[3] = option */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__feature_control__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor rpc__resp__feature_control__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_FeatureControl", + "RpcRespFeatureControl", + "RpcRespFeatureControl", + "", + sizeof(RpcRespFeatureControl), + 4, + rpc__resp__feature_control__field_descriptors, + rpc__resp__feature_control__field_indices_by_name, + 1, rpc__resp__feature_control__number_ranges, + (ProtobufCMessageInit) rpc__resp__feature_control__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__event__wifi_event_no_args__field_descriptors[2] = +{ { - "authmode", - 5, + "resp", + 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventStaConnected, authmode), + offsetof(RpcEventWifiEventNoArgs, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "aid", - 6, + "event_id", + 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventStaConnected, aid), + offsetof(RpcEventWifiEventNoArgs, event_id), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_event_sta_connected__field_indices_by_name[] = { - 5, /* field[5] = aid */ - 4, /* field[4] = authmode */ - 2, /* field[2] = bssid */ - 3, /* field[3] = channel */ - 0, /* field[0] = ssid */ - 1, /* field[1] = ssid_len */ +static const unsigned rpc__event__wifi_event_no_args__field_indices_by_name[] = { + 1, /* field[1] = event_id */ + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_event_sta_connected__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__event__wifi_event_no_args__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 6 } + { 0, 2 } }; -const ProtobufCMessageDescriptor wifi_event_sta_connected__descriptor = +const ProtobufCMessageDescriptor rpc__event__wifi_event_no_args__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_event_sta_connected", - "WifiEventStaConnected", - "WifiEventStaConnected", + "Rpc_Event_WifiEventNoArgs", + "RpcEventWifiEventNoArgs", + "RpcEventWifiEventNoArgs", "", - sizeof(WifiEventStaConnected), - 6, - wifi_event_sta_connected__field_descriptors, - wifi_event_sta_connected__field_indices_by_name, - 1, wifi_event_sta_connected__number_ranges, - (ProtobufCMessageInit) wifi_event_sta_connected__init, + sizeof(RpcEventWifiEventNoArgs), + 2, + rpc__event__wifi_event_no_args__field_descriptors, + rpc__event__wifi_event_no_args__field_indices_by_name, + 1, rpc__event__wifi_event_no_args__number_ranges, + (ProtobufCMessageInit) rpc__event__wifi_event_no_args__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_event_sta_disconnected__field_descriptors[5] = +static const ProtobufCFieldDescriptor rpc__event__espinit__field_descriptors[1] = { { - "ssid", + "init_data", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiEventStaDisconnected, ssid), + offsetof(RpcEventESPInit, init_data), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__event__espinit__field_indices_by_name[] = { + 0, /* field[0] = init_data */ +}; +static const ProtobufCIntRange rpc__event__espinit__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__event__espinit__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Event_ESPInit", + "RpcEventESPInit", + "RpcEventESPInit", + "", + sizeof(RpcEventESPInit), + 1, + rpc__event__espinit__field_descriptors, + rpc__event__espinit__field_indices_by_name, + 1, rpc__event__espinit__number_ranges, + (ProtobufCMessageInit) rpc__event__espinit__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__event__heartbeat__field_descriptors[1] = +{ { - "ssid_len", + "hb_num", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcEventHeartbeat, hb_num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__event__heartbeat__field_indices_by_name[] = { + 0, /* field[0] = hb_num */ +}; +static const ProtobufCIntRange rpc__event__heartbeat__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__event__heartbeat__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Event_Heartbeat", + "RpcEventHeartbeat", + "RpcEventHeartbeat", + "", + sizeof(RpcEventHeartbeat), + 1, + rpc__event__heartbeat__field_descriptors, + rpc__event__heartbeat__field_indices_by_name, + 1, rpc__event__heartbeat__number_ranges, + (ProtobufCMessageInit) rpc__event__heartbeat__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__event__ap__sta_disconnected__field_descriptors[5] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcEventAPStaDisconnected, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "mac", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiEventStaDisconnected, ssid_len), + offsetof(RpcEventAPStaDisconnected, mac), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "bssid", + "aid", 3, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiEventStaDisconnected, bssid), + offsetof(RpcEventAPStaDisconnected, aid), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "reason", + "is_mesh_child", 4, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ - offsetof(WifiEventStaDisconnected, reason), + offsetof(RpcEventAPStaDisconnected, is_mesh_child), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "rssi", + "reason", 5, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiEventStaDisconnected, rssi), + offsetof(RpcEventAPStaDisconnected, reason), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_event_sta_disconnected__field_indices_by_name[] = { - 2, /* field[2] = bssid */ - 3, /* field[3] = reason */ - 4, /* field[4] = rssi */ - 0, /* field[0] = ssid */ - 1, /* field[1] = ssid_len */ +static const unsigned rpc__event__ap__sta_disconnected__field_indices_by_name[] = { + 2, /* field[2] = aid */ + 3, /* field[3] = is_mesh_child */ + 1, /* field[1] = mac */ + 4, /* field[4] = reason */ + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_event_sta_disconnected__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__event__ap__sta_disconnected__number_ranges[1 + 1] = { { 1, 0 }, { 0, 5 } }; -const ProtobufCMessageDescriptor wifi_event_sta_disconnected__descriptor = +const ProtobufCMessageDescriptor rpc__event__ap__sta_disconnected__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_event_sta_disconnected", - "WifiEventStaDisconnected", - "WifiEventStaDisconnected", + "Rpc_Event_AP_StaDisconnected", + "RpcEventAPStaDisconnected", + "RpcEventAPStaDisconnected", "", - sizeof(WifiEventStaDisconnected), + sizeof(RpcEventAPStaDisconnected), 5, - wifi_event_sta_disconnected__field_descriptors, - wifi_event_sta_disconnected__field_indices_by_name, - 1, wifi_event_sta_disconnected__number_ranges, - (ProtobufCMessageInit) wifi_event_sta_disconnected__init, + rpc__event__ap__sta_disconnected__field_descriptors, + rpc__event__ap__sta_disconnected__field_indices_by_name, + 1, rpc__event__ap__sta_disconnected__number_ranges, + (ProtobufCMessageInit) rpc__event__ap__sta_disconnected__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_event_sta_authmode_change__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__event__ap__sta_connected__field_descriptors[4] = { { - "old_mode", + "resp", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventStaAuthmodeChange, old_mode), + offsetof(RpcEventAPStaConnected, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "new_mode", + "mac", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(RpcEventAPStaConnected, mac), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "aid", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(RpcEventAPStaConnected, aid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "is_mesh_child", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ - offsetof(WifiEventStaAuthmodeChange, new_mode), + offsetof(RpcEventAPStaConnected, is_mesh_child), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_event_sta_authmode_change__field_indices_by_name[] = { - 1, /* field[1] = new_mode */ - 0, /* field[0] = old_mode */ +static const unsigned rpc__event__ap__sta_connected__field_indices_by_name[] = { + 2, /* field[2] = aid */ + 3, /* field[3] = is_mesh_child */ + 1, /* field[1] = mac */ + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_event_sta_authmode_change__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__event__ap__sta_connected__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } + { 0, 4 } }; -const ProtobufCMessageDescriptor wifi_event_sta_authmode_change__descriptor = +const ProtobufCMessageDescriptor rpc__event__ap__sta_connected__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_event_sta_authmode_change", - "WifiEventStaAuthmodeChange", - "WifiEventStaAuthmodeChange", + "Rpc_Event_AP_StaConnected", + "RpcEventAPStaConnected", + "RpcEventAPStaConnected", "", - sizeof(WifiEventStaAuthmodeChange), - 2, - wifi_event_sta_authmode_change__field_descriptors, - wifi_event_sta_authmode_change__field_indices_by_name, - 1, wifi_event_sta_authmode_change__number_ranges, - (ProtobufCMessageInit) wifi_event_sta_authmode_change__init, + sizeof(RpcEventAPStaConnected), + 4, + rpc__event__ap__sta_connected__field_descriptors, + rpc__event__ap__sta_connected__field_indices_by_name, + 1, rpc__event__ap__sta_connected__number_ranges, + (ProtobufCMessageInit) rpc__event__ap__sta_connected__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_event_sta_wps_er_pin__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__event__sta_scan_done__field_descriptors[2] = { { - "pin_code", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventStaWpsErPin, pin_code), + offsetof(RpcEventStaScanDone, resp), + NULL, NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "scan_done", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(RpcEventStaScanDone, scan_done), + &wifi_event_sta_scan_done__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_event_sta_wps_er_pin__field_indices_by_name[] = { - 0, /* field[0] = pin_code */ +static const unsigned rpc__event__sta_scan_done__field_indices_by_name[] = { + 0, /* field[0] = resp */ + 1, /* field[1] = scan_done */ }; -static const ProtobufCIntRange wifi_event_sta_wps_er_pin__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__event__sta_scan_done__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 1 } + { 0, 2 } }; -const ProtobufCMessageDescriptor wifi_event_sta_wps_er_pin__descriptor = +const ProtobufCMessageDescriptor rpc__event__sta_scan_done__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_event_sta_wps_er_pin", - "WifiEventStaWpsErPin", - "WifiEventStaWpsErPin", + "Rpc_Event_StaScanDone", + "RpcEventStaScanDone", + "RpcEventStaScanDone", "", - sizeof(WifiEventStaWpsErPin), - 1, - wifi_event_sta_wps_er_pin__field_descriptors, - wifi_event_sta_wps_er_pin__field_indices_by_name, - 1, wifi_event_sta_wps_er_pin__number_ranges, - (ProtobufCMessageInit) wifi_event_sta_wps_er_pin__init, + sizeof(RpcEventStaScanDone), + 2, + rpc__event__sta_scan_done__field_descriptors, + rpc__event__sta_scan_done__field_indices_by_name, + 1, rpc__event__sta_scan_done__number_ranges, + (ProtobufCMessageInit) rpc__event__sta_scan_done__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor ap_cred__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__event__sta_connected__field_descriptors[2] = { { - "ssid", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(ApCred, ssid), + offsetof(RpcEventStaConnected, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "passphrase", + "sta_connected", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ - offsetof(ApCred, passphrase), - NULL, + offsetof(RpcEventStaConnected, sta_connected), + &wifi_event_sta_connected__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned ap_cred__field_indices_by_name[] = { - 1, /* field[1] = passphrase */ - 0, /* field[0] = ssid */ +static const unsigned rpc__event__sta_connected__field_indices_by_name[] = { + 0, /* field[0] = resp */ + 1, /* field[1] = sta_connected */ }; -static const ProtobufCIntRange ap_cred__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__event__sta_connected__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor ap_cred__descriptor = +const ProtobufCMessageDescriptor rpc__event__sta_connected__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "ap_cred", - "ApCred", - "ApCred", + "Rpc_Event_StaConnected", + "RpcEventStaConnected", + "RpcEventStaConnected", "", - sizeof(ApCred), + sizeof(RpcEventStaConnected), 2, - ap_cred__field_descriptors, - ap_cred__field_indices_by_name, - 1, ap_cred__number_ranges, - (ProtobufCMessageInit) ap_cred__init, + rpc__event__sta_connected__field_descriptors, + rpc__event__sta_connected__field_indices_by_name, + 1, rpc__event__sta_connected__number_ranges, + (ProtobufCMessageInit) rpc__event__sta_connected__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_event_sta_wps_er_success__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__event__sta_disconnected__field_descriptors[2] = { { - "ap_cred_cnt", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventStaWpsErSuccess, ap_cred_cnt), + offsetof(RpcEventStaDisconnected, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ap_creds", + "sta_disconnected", 2, - PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, - offsetof(WifiEventStaWpsErSuccess, n_ap_creds), - offsetof(WifiEventStaWpsErSuccess, ap_creds), - &ap_cred__descriptor, + 0, /* quantifier_offset */ + offsetof(RpcEventStaDisconnected, sta_disconnected), + &wifi_event_sta_disconnected__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_event_sta_wps_er_success__field_indices_by_name[] = { - 0, /* field[0] = ap_cred_cnt */ - 1, /* field[1] = ap_creds */ +static const unsigned rpc__event__sta_disconnected__field_indices_by_name[] = { + 0, /* field[0] = resp */ + 1, /* field[1] = sta_disconnected */ }; -static const ProtobufCIntRange wifi_event_sta_wps_er_success__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__event__sta_disconnected__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor wifi_event_sta_wps_er_success__descriptor = +const ProtobufCMessageDescriptor rpc__event__sta_disconnected__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_event_sta_wps_er_success", - "WifiEventStaWpsErSuccess", - "WifiEventStaWpsErSuccess", + "Rpc_Event_StaDisconnected", + "RpcEventStaDisconnected", + "RpcEventStaDisconnected", "", - sizeof(WifiEventStaWpsErSuccess), + sizeof(RpcEventStaDisconnected), 2, - wifi_event_sta_wps_er_success__field_descriptors, - wifi_event_sta_wps_er_success__field_indices_by_name, - 1, wifi_event_sta_wps_er_success__number_ranges, - (ProtobufCMessageInit) wifi_event_sta_wps_er_success__init, + rpc__event__sta_disconnected__field_descriptors, + rpc__event__sta_disconnected__field_indices_by_name, + 1, rpc__event__sta_disconnected__number_ranges, + (ProtobufCMessageInit) rpc__event__sta_disconnected__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_event_ap_probe_req_rx__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__event__dhcp_dns_status__field_descriptors[10] = { { - "rssi", + "iface", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventApProbeReqRx, rssi), + offsetof(RpcEventDhcpDnsStatus, iface), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "mac", + "net_link_up", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventApProbeReqRx, mac), + offsetof(RpcEventDhcpDnsStatus, net_link_up), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned wifi_event_ap_probe_req_rx__field_indices_by_name[] = { - 1, /* field[1] = mac */ - 0, /* field[0] = rssi */ -}; -static const ProtobufCIntRange wifi_event_ap_probe_req_rx__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor wifi_event_ap_probe_req_rx__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_event_ap_probe_req_rx", - "WifiEventApProbeReqRx", - "WifiEventApProbeReqRx", - "", - sizeof(WifiEventApProbeReqRx), - 2, - wifi_event_ap_probe_req_rx__field_descriptors, - wifi_event_ap_probe_req_rx__field_indices_by_name, - 1, wifi_event_ap_probe_req_rx__number_ranges, - (ProtobufCMessageInit) wifi_event_ap_probe_req_rx__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor wifi_event_bss_rssi_low__field_descriptors[1] = -{ { - "rssi", - 1, + "dhcp_up", + 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventBssRssiLow, rssi), + offsetof(RpcEventDhcpDnsStatus, dhcp_up), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned wifi_event_bss_rssi_low__field_indices_by_name[] = { - 0, /* field[0] = rssi */ -}; -static const ProtobufCIntRange wifi_event_bss_rssi_low__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor wifi_event_bss_rssi_low__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_event_bss_rssi_low", - "WifiEventBssRssiLow", - "WifiEventBssRssiLow", - "", - sizeof(WifiEventBssRssiLow), - 1, - wifi_event_bss_rssi_low__field_descriptors, - wifi_event_bss_rssi_low__field_indices_by_name, - 1, wifi_event_bss_rssi_low__number_ranges, - (ProtobufCMessageInit) wifi_event_bss_rssi_low__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor wifi_ftm_report_entry__field_descriptors[7] = -{ { - "dlog_token", - 1, + "dhcp_ip", + 4, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiFtmReportEntry, dlog_token), + offsetof(RpcEventDhcpDnsStatus, dhcp_ip), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "rssi", - 2, + "dhcp_nm", + 5, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiFtmReportEntry, rssi), + offsetof(RpcEventDhcpDnsStatus, dhcp_nm), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "rtt", - 3, + "dhcp_gw", + 6, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiFtmReportEntry, rtt), + offsetof(RpcEventDhcpDnsStatus, dhcp_gw), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "t1", - 4, + "dns_up", + 7, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiFtmReportEntry, t1), + offsetof(RpcEventDhcpDnsStatus, dns_up), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "t2", - 5, + "dns_ip", + 8, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiFtmReportEntry, t2), + offsetof(RpcEventDhcpDnsStatus, dns_ip), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "t3", - 6, + "dns_type", + 9, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiFtmReportEntry, t3), + offsetof(RpcEventDhcpDnsStatus, dns_type), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "t4", - 7, + "resp", + 10, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiFtmReportEntry, t4), + offsetof(RpcEventDhcpDnsStatus, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_ftm_report_entry__field_indices_by_name[] = { - 0, /* field[0] = dlog_token */ - 1, /* field[1] = rssi */ - 2, /* field[2] = rtt */ - 3, /* field[3] = t1 */ - 4, /* field[4] = t2 */ - 5, /* field[5] = t3 */ - 6, /* field[6] = t4 */ +static const unsigned rpc__event__dhcp_dns_status__field_indices_by_name[] = { + 5, /* field[5] = dhcp_gw */ + 3, /* field[3] = dhcp_ip */ + 4, /* field[4] = dhcp_nm */ + 2, /* field[2] = dhcp_up */ + 7, /* field[7] = dns_ip */ + 8, /* field[8] = dns_type */ + 6, /* field[6] = dns_up */ + 0, /* field[0] = iface */ + 1, /* field[1] = net_link_up */ + 9, /* field[9] = resp */ }; -static const ProtobufCIntRange wifi_ftm_report_entry__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__event__dhcp_dns_status__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 7 } + { 0, 10 } }; -const ProtobufCMessageDescriptor wifi_ftm_report_entry__descriptor = +const ProtobufCMessageDescriptor rpc__event__dhcp_dns_status__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_ftm_report_entry", - "WifiFtmReportEntry", - "WifiFtmReportEntry", + "Rpc_Event_DhcpDnsStatus", + "RpcEventDhcpDnsStatus", + "RpcEventDhcpDnsStatus", "", - sizeof(WifiFtmReportEntry), - 7, - wifi_ftm_report_entry__field_descriptors, - wifi_ftm_report_entry__field_indices_by_name, - 1, wifi_ftm_report_entry__number_ranges, - (ProtobufCMessageInit) wifi_ftm_report_entry__init, + sizeof(RpcEventDhcpDnsStatus), + 10, + rpc__event__dhcp_dns_status__field_descriptors, + rpc__event__dhcp_dns_status__field_indices_by_name, + 1, rpc__event__dhcp_dns_status__number_ranges, + (ProtobufCMessageInit) rpc__event__dhcp_dns_status__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_event_ftm_report__field_descriptors[7] = +static const ProtobufCFieldDescriptor rpc__event__sta_itwt_setup__field_descriptors[5] = { { - "peer_mac", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventFtmReport, peer_mac), + offsetof(RpcEventStaItwtSetup, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "status", + "config", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ - offsetof(WifiEventFtmReport, status), - NULL, + offsetof(RpcEventStaItwtSetup, config), + &wifi_itwt_setup_config__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "rtt_raw", + "status", 3, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventFtmReport, rtt_raw), + offsetof(RpcEventStaItwtSetup, status), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "rtt_est", + "reason", 4, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiEventFtmReport, rtt_est), + offsetof(RpcEventStaItwtSetup, reason), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "dist_est", + "target_wake_time", 5, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ - offsetof(WifiEventFtmReport, dist_est), + offsetof(RpcEventStaItwtSetup, target_wake_time), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__event__sta_itwt_setup__field_indices_by_name[] = { + 1, /* field[1] = config */ + 3, /* field[3] = reason */ + 0, /* field[0] = resp */ + 2, /* field[2] = status */ + 4, /* field[4] = target_wake_time */ +}; +static const ProtobufCIntRange rpc__event__sta_itwt_setup__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 5 } +}; +const ProtobufCMessageDescriptor rpc__event__sta_itwt_setup__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Event_StaItwtSetup", + "RpcEventStaItwtSetup", + "RpcEventStaItwtSetup", + "", + sizeof(RpcEventStaItwtSetup), + 5, + rpc__event__sta_itwt_setup__field_descriptors, + rpc__event__sta_itwt_setup__field_indices_by_name, + 1, rpc__event__sta_itwt_setup__number_ranges, + (ProtobufCMessageInit) rpc__event__sta_itwt_setup__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__event__sta_itwt_teardown__field_descriptors[3] = +{ { - "ftm_report_data", - 6, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(WifiEventFtmReport, n_ftm_report_data), - offsetof(WifiEventFtmReport, ftm_report_data), - &wifi_ftm_report_entry__descriptor, + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcEventStaItwtTeardown, resp), + NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ftm_report_num_entries", - 7, + "flow_id", + 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiEventFtmReport, ftm_report_num_entries), + offsetof(RpcEventStaItwtTeardown, flow_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "status", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(RpcEventStaItwtTeardown, status), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_event_ftm_report__field_indices_by_name[] = { - 4, /* field[4] = dist_est */ - 5, /* field[5] = ftm_report_data */ - 6, /* field[6] = ftm_report_num_entries */ - 0, /* field[0] = peer_mac */ - 3, /* field[3] = rtt_est */ - 2, /* field[2] = rtt_raw */ - 1, /* field[1] = status */ +static const unsigned rpc__event__sta_itwt_teardown__field_indices_by_name[] = { + 1, /* field[1] = flow_id */ + 0, /* field[0] = resp */ + 2, /* field[2] = status */ }; -static const ProtobufCIntRange wifi_event_ftm_report__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__event__sta_itwt_teardown__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 7 } + { 0, 3 } }; -const ProtobufCMessageDescriptor wifi_event_ftm_report__descriptor = +const ProtobufCMessageDescriptor rpc__event__sta_itwt_teardown__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_event_ftm_report", - "WifiEventFtmReport", - "WifiEventFtmReport", + "Rpc_Event_StaItwtTeardown", + "RpcEventStaItwtTeardown", + "RpcEventStaItwtTeardown", "", - sizeof(WifiEventFtmReport), - 7, - wifi_event_ftm_report__field_descriptors, - wifi_event_ftm_report__field_indices_by_name, - 1, wifi_event_ftm_report__number_ranges, - (ProtobufCMessageInit) wifi_event_ftm_report__init, + sizeof(RpcEventStaItwtTeardown), + 3, + rpc__event__sta_itwt_teardown__field_descriptors, + rpc__event__sta_itwt_teardown__field_indices_by_name, + 1, rpc__event__sta_itwt_teardown__number_ranges, + (ProtobufCMessageInit) rpc__event__sta_itwt_teardown__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_event_action_tx_status__field_descriptors[4] = +static const ProtobufCFieldDescriptor rpc__event__sta_itwt_suspend__field_descriptors[4] = { { - "ifx", + "resp", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventActionTxStatus, ifx), + offsetof(RpcEventStaItwtSuspend, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "context", + "status", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventActionTxStatus, context), + offsetof(RpcEventStaItwtSuspend, status), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "da", + "flow_id_bitmap", 3, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(WifiEventActionTxStatus, da), + offsetof(RpcEventStaItwtSuspend, flow_id_bitmap), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "status", + "actual_suspend_time_ms", 4, - PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(WifiEventActionTxStatus, status), + offsetof(RpcEventStaItwtSuspend, n_actual_suspend_time_ms), + offsetof(RpcEventStaItwtSuspend, actual_suspend_time_ms), NULL, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_event_action_tx_status__field_indices_by_name[] = { - 1, /* field[1] = context */ - 2, /* field[2] = da */ - 0, /* field[0] = ifx */ - 3, /* field[3] = status */ +static const unsigned rpc__event__sta_itwt_suspend__field_indices_by_name[] = { + 3, /* field[3] = actual_suspend_time_ms */ + 2, /* field[2] = flow_id_bitmap */ + 0, /* field[0] = resp */ + 1, /* field[1] = status */ }; -static const ProtobufCIntRange wifi_event_action_tx_status__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__event__sta_itwt_suspend__number_ranges[1 + 1] = { { 1, 0 }, { 0, 4 } }; -const ProtobufCMessageDescriptor wifi_event_action_tx_status__descriptor = +const ProtobufCMessageDescriptor rpc__event__sta_itwt_suspend__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_event_action_tx_status", - "WifiEventActionTxStatus", - "WifiEventActionTxStatus", + "Rpc_Event_StaItwtSuspend", + "RpcEventStaItwtSuspend", + "RpcEventStaItwtSuspend", "", - sizeof(WifiEventActionTxStatus), + sizeof(RpcEventStaItwtSuspend), 4, - wifi_event_action_tx_status__field_descriptors, - wifi_event_action_tx_status__field_indices_by_name, - 1, wifi_event_action_tx_status__number_ranges, - (ProtobufCMessageInit) wifi_event_action_tx_status__init, + rpc__event__sta_itwt_suspend__field_descriptors, + rpc__event__sta_itwt_suspend__field_indices_by_name, + 1, rpc__event__sta_itwt_suspend__number_ranges, + (ProtobufCMessageInit) rpc__event__sta_itwt_suspend__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_event_roc_done__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__event__sta_itwt_probe__field_descriptors[3] = { { - "context", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventRocDone, context), + offsetof(RpcEventStaItwtProbe, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned wifi_event_roc_done__field_indices_by_name[] = { - 0, /* field[0] = context */ -}; -static const ProtobufCIntRange wifi_event_roc_done__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor wifi_event_roc_done__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_event_roc_done", - "WifiEventRocDone", - "WifiEventRocDone", - "", - sizeof(WifiEventRocDone), - 1, - wifi_event_roc_done__field_descriptors, - wifi_event_roc_done__field_indices_by_name, - 1, wifi_event_roc_done__number_ranges, - (ProtobufCMessageInit) wifi_event_roc_done__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor wifi_event_ap_wps_rg_pin__field_descriptors[1] = -{ { - "pin_code", - 1, + "status", + 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventApWpsRgPin, pin_code), + offsetof(RpcEventStaItwtProbe, status), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "reason", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(RpcEventStaItwtProbe, reason), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_event_ap_wps_rg_pin__field_indices_by_name[] = { - 0, /* field[0] = pin_code */ +static const unsigned rpc__event__sta_itwt_probe__field_indices_by_name[] = { + 2, /* field[2] = reason */ + 0, /* field[0] = resp */ + 1, /* field[1] = status */ }; -static const ProtobufCIntRange wifi_event_ap_wps_rg_pin__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__event__sta_itwt_probe__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 1 } + { 0, 3 } }; -const ProtobufCMessageDescriptor wifi_event_ap_wps_rg_pin__descriptor = +const ProtobufCMessageDescriptor rpc__event__sta_itwt_probe__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_event_ap_wps_rg_pin", - "WifiEventApWpsRgPin", - "WifiEventApWpsRgPin", + "Rpc_Event_StaItwtProbe", + "RpcEventStaItwtProbe", + "RpcEventStaItwtProbe", "", - sizeof(WifiEventApWpsRgPin), - 1, - wifi_event_ap_wps_rg_pin__field_descriptors, - wifi_event_ap_wps_rg_pin__field_indices_by_name, - 1, wifi_event_ap_wps_rg_pin__number_ranges, - (ProtobufCMessageInit) wifi_event_ap_wps_rg_pin__init, + sizeof(RpcEventStaItwtProbe), + 3, + rpc__event__sta_itwt_probe__field_descriptors, + rpc__event__sta_itwt_probe__field_indices_by_name, + 1, rpc__event__sta_itwt_probe__number_ranges, + (ProtobufCMessageInit) rpc__event__sta_itwt_probe__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_event_ap_wps_rg_fail_reason__field_descriptors[2] = +#define rpc__req__wifi_sta_enterprise_enable__field_descriptors NULL +#define rpc__req__wifi_sta_enterprise_enable__field_indices_by_name NULL +#define rpc__req__wifi_sta_enterprise_enable__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_sta_enterprise_enable__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiStaEnterpriseEnable", + "RpcReqWifiStaEnterpriseEnable", + "RpcReqWifiStaEnterpriseEnable", + "", + sizeof(RpcReqWifiStaEnterpriseEnable), + 0, + rpc__req__wifi_sta_enterprise_enable__field_descriptors, + rpc__req__wifi_sta_enterprise_enable__field_indices_by_name, + 0, rpc__req__wifi_sta_enterprise_enable__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_sta_enterprise_enable__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_enterprise_enable__field_descriptors[1] = { { - "reason", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(WifiEventApWpsRgFailReason, reason), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "peer_macaddr", - 2, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventApWpsRgFailReason, peer_macaddr), + offsetof(RpcRespWifiStaEnterpriseEnable, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_event_ap_wps_rg_fail_reason__field_indices_by_name[] = { - 1, /* field[1] = peer_macaddr */ - 0, /* field[0] = reason */ +static const unsigned rpc__resp__wifi_sta_enterprise_enable__field_indices_by_name[] = { + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_event_ap_wps_rg_fail_reason__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__wifi_sta_enterprise_enable__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } + { 0, 1 } }; -const ProtobufCMessageDescriptor wifi_event_ap_wps_rg_fail_reason__descriptor = +const ProtobufCMessageDescriptor rpc__resp__wifi_sta_enterprise_enable__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_event_ap_wps_rg_fail_reason", - "WifiEventApWpsRgFailReason", - "WifiEventApWpsRgFailReason", + "Rpc_Resp_WifiStaEnterpriseEnable", + "RpcRespWifiStaEnterpriseEnable", + "RpcRespWifiStaEnterpriseEnable", "", - sizeof(WifiEventApWpsRgFailReason), - 2, - wifi_event_ap_wps_rg_fail_reason__field_descriptors, - wifi_event_ap_wps_rg_fail_reason__field_indices_by_name, - 1, wifi_event_ap_wps_rg_fail_reason__number_ranges, - (ProtobufCMessageInit) wifi_event_ap_wps_rg_fail_reason__init, + sizeof(RpcRespWifiStaEnterpriseEnable), + 1, + rpc__resp__wifi_sta_enterprise_enable__field_descriptors, + rpc__resp__wifi_sta_enterprise_enable__field_indices_by_name, + 1, rpc__resp__wifi_sta_enterprise_enable__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_sta_enterprise_enable__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_event_ap_wps_rg_success__field_descriptors[1] = +#define rpc__req__wifi_sta_enterprise_disable__field_descriptors NULL +#define rpc__req__wifi_sta_enterprise_disable__field_indices_by_name NULL +#define rpc__req__wifi_sta_enterprise_disable__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__wifi_sta_enterprise_disable__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_WifiStaEnterpriseDisable", + "RpcReqWifiStaEnterpriseDisable", + "RpcReqWifiStaEnterpriseDisable", + "", + sizeof(RpcReqWifiStaEnterpriseDisable), + 0, + rpc__req__wifi_sta_enterprise_disable__field_descriptors, + rpc__req__wifi_sta_enterprise_disable__field_indices_by_name, + 0, rpc__req__wifi_sta_enterprise_disable__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_sta_enterprise_disable__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_enterprise_disable__field_descriptors[1] = { { - "peer_macaddr", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiEventApWpsRgSuccess, peer_macaddr), + offsetof(RpcRespWifiStaEnterpriseDisable, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_event_ap_wps_rg_success__field_indices_by_name[] = { - 0, /* field[0] = peer_macaddr */ +static const unsigned rpc__resp__wifi_sta_enterprise_disable__field_indices_by_name[] = { + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_event_ap_wps_rg_success__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__wifi_sta_enterprise_disable__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor wifi_event_ap_wps_rg_success__descriptor = +const ProtobufCMessageDescriptor rpc__resp__wifi_sta_enterprise_disable__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_event_ap_wps_rg_success", - "WifiEventApWpsRgSuccess", - "WifiEventApWpsRgSuccess", + "Rpc_Resp_WifiStaEnterpriseDisable", + "RpcRespWifiStaEnterpriseDisable", + "RpcRespWifiStaEnterpriseDisable", "", - sizeof(WifiEventApWpsRgSuccess), + sizeof(RpcRespWifiStaEnterpriseDisable), 1, - wifi_event_ap_wps_rg_success__field_descriptors, - wifi_event_ap_wps_rg_success__field_indices_by_name, - 1, wifi_event_ap_wps_rg_success__number_ranges, - (ProtobufCMessageInit) wifi_event_ap_wps_rg_success__init, + rpc__resp__wifi_sta_enterprise_disable__field_descriptors, + rpc__resp__wifi_sta_enterprise_disable__field_indices_by_name, + 1, rpc__resp__wifi_sta_enterprise_disable__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_sta_enterprise_disable__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_protocols__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__req__eap_set_identity__field_descriptors[2] = { { - "ghz_2g", + "identity", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(WifiProtocols, ghz_2g), + offsetof(RpcReqEapSetIdentity, identity), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ghz_5g", + "len", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiProtocols, ghz_5g), + offsetof(RpcReqEapSetIdentity, len), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_protocols__field_indices_by_name[] = { - 0, /* field[0] = ghz_2g */ - 1, /* field[1] = ghz_5g */ +static const unsigned rpc__req__eap_set_identity__field_indices_by_name[] = { + 0, /* field[0] = identity */ + 1, /* field[1] = len */ }; -static const ProtobufCIntRange wifi_protocols__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__eap_set_identity__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor wifi_protocols__descriptor = +const ProtobufCMessageDescriptor rpc__req__eap_set_identity__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_protocols", - "WifiProtocols", - "WifiProtocols", + "Rpc_Req_EapSetIdentity", + "RpcReqEapSetIdentity", + "RpcReqEapSetIdentity", "", - sizeof(WifiProtocols), + sizeof(RpcReqEapSetIdentity), 2, - wifi_protocols__field_descriptors, - wifi_protocols__field_indices_by_name, - 1, wifi_protocols__number_ranges, - (ProtobufCMessageInit) wifi_protocols__init, + rpc__req__eap_set_identity__field_descriptors, + rpc__req__eap_set_identity__field_indices_by_name, + 1, rpc__req__eap_set_identity__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_set_identity__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor wifi_bandwidths__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__resp__eap_set_identity__field_descriptors[1] = { { - "ghz_2g", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiBandwidths, ghz_2g), + offsetof(RpcRespEapSetIdentity, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__resp__eap_set_identity__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__eap_set_identity__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__eap_set_identity__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_EapSetIdentity", + "RpcRespEapSetIdentity", + "RpcRespEapSetIdentity", + "", + sizeof(RpcRespEapSetIdentity), + 1, + rpc__resp__eap_set_identity__field_descriptors, + rpc__resp__eap_set_identity__field_indices_by_name, + 1, rpc__resp__eap_set_identity__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_set_identity__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__eap_clear_identity__field_descriptors NULL +#define rpc__req__eap_clear_identity__field_indices_by_name NULL +#define rpc__req__eap_clear_identity__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__eap_clear_identity__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_EapClearIdentity", + "RpcReqEapClearIdentity", + "RpcReqEapClearIdentity", + "", + sizeof(RpcReqEapClearIdentity), + 0, + rpc__req__eap_clear_identity__field_descriptors, + rpc__req__eap_clear_identity__field_indices_by_name, + 0, rpc__req__eap_clear_identity__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_clear_identity__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__eap_clear_identity__field_descriptors[1] = +{ { - "ghz_5g", - 2, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(WifiBandwidths, ghz_5g), + offsetof(RpcRespEapClearIdentity, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned wifi_bandwidths__field_indices_by_name[] = { - 0, /* field[0] = ghz_2g */ - 1, /* field[1] = ghz_5g */ +static const unsigned rpc__resp__eap_clear_identity__field_indices_by_name[] = { + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange wifi_bandwidths__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_clear_identity__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } + { 0, 1 } }; -const ProtobufCMessageDescriptor wifi_bandwidths__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_clear_identity__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "wifi_bandwidths", - "WifiBandwidths", - "WifiBandwidths", + "Rpc_Resp_EapClearIdentity", + "RpcRespEapClearIdentity", + "RpcRespEapClearIdentity", "", - sizeof(WifiBandwidths), - 2, - wifi_bandwidths__field_descriptors, - wifi_bandwidths__field_indices_by_name, - 1, wifi_bandwidths__number_ranges, - (ProtobufCMessageInit) wifi_bandwidths__init, + sizeof(RpcRespEapClearIdentity), + 1, + rpc__resp__eap_clear_identity__field_descriptors, + rpc__resp__eap_clear_identity__field_indices_by_name, + 1, rpc__resp__eap_clear_identity__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_clear_identity__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor connected_stalist__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__req__eap_set_username__field_descriptors[2] = { { - "mac", + "username", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(ConnectedSTAList, mac), + offsetof(RpcReqEapSetUsername, username), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "rssi", + "len", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(ConnectedSTAList, rssi), + offsetof(RpcReqEapSetUsername, len), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned connected_stalist__field_indices_by_name[] = { - 0, /* field[0] = mac */ - 1, /* field[1] = rssi */ +static const unsigned rpc__req__eap_set_username__field_indices_by_name[] = { + 1, /* field[1] = len */ + 0, /* field[0] = username */ }; -static const ProtobufCIntRange connected_stalist__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__eap_set_username__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor connected_stalist__descriptor = +const ProtobufCMessageDescriptor rpc__req__eap_set_username__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "ConnectedSTAList", - "ConnectedSTAList", - "ConnectedSTAList", + "Rpc_Req_EapSetUsername", + "RpcReqEapSetUsername", + "RpcReqEapSetUsername", "", - sizeof(ConnectedSTAList), + sizeof(RpcReqEapSetUsername), 2, - connected_stalist__field_descriptors, - connected_stalist__field_indices_by_name, - 1, connected_stalist__number_ranges, - (ProtobufCMessageInit) connected_stalist__init, + rpc__req__eap_set_username__field_descriptors, + rpc__req__eap_set_username__field_indices_by_name, + 1, rpc__req__eap_set_username__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_set_username__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__req__get_mac_address__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__eap_set_username__field_descriptors[1] = { { - "mode", + "resp", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcReqGetMacAddress, mode), + offsetof(RpcRespEapSetUsername, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__req__get_mac_address__field_indices_by_name[] = { - 0, /* field[0] = mode */ +static const unsigned rpc__resp__eap_set_username__field_indices_by_name[] = { + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__req__get_mac_address__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_set_username__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__req__get_mac_address__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_set_username__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_GetMacAddress", - "RpcReqGetMacAddress", - "RpcReqGetMacAddress", + "Rpc_Resp_EapSetUsername", + "RpcRespEapSetUsername", + "RpcRespEapSetUsername", "", - sizeof(RpcReqGetMacAddress), + sizeof(RpcRespEapSetUsername), 1, - rpc__req__get_mac_address__field_descriptors, - rpc__req__get_mac_address__field_indices_by_name, - 1, rpc__req__get_mac_address__number_ranges, - (ProtobufCMessageInit) rpc__req__get_mac_address__init, + rpc__resp__eap_set_username__field_descriptors, + rpc__resp__eap_set_username__field_indices_by_name, + 1, rpc__resp__eap_set_username__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_set_username__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__get_mac_address__field_descriptors[2] = +#define rpc__req__eap_clear_username__field_descriptors NULL +#define rpc__req__eap_clear_username__field_indices_by_name NULL +#define rpc__req__eap_clear_username__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__eap_clear_username__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_EapClearUsername", + "RpcReqEapClearUsername", + "RpcReqEapClearUsername", + "", + sizeof(RpcReqEapClearUsername), + 0, + rpc__req__eap_clear_username__field_descriptors, + rpc__req__eap_clear_username__field_indices_by_name, + 0, rpc__req__eap_clear_username__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_clear_username__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__eap_clear_username__field_descriptors[1] = { - { - "mac", - 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, - 0, /* quantifier_offset */ - offsetof(RpcRespGetMacAddress, mac), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, { "resp", - 2, + 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespGetMacAddress, resp), + offsetof(RpcRespEapClearUsername, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__get_mac_address__field_indices_by_name[] = { - 0, /* field[0] = mac */ - 1, /* field[1] = resp */ +static const unsigned rpc__resp__eap_clear_username__field_indices_by_name[] = { + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__get_mac_address__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_clear_username__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__resp__get_mac_address__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_GetMacAddress", - "RpcRespGetMacAddress", - "RpcRespGetMacAddress", - "", - sizeof(RpcRespGetMacAddress), - 2, - rpc__resp__get_mac_address__field_descriptors, - rpc__resp__get_mac_address__field_indices_by_name, - 1, rpc__resp__get_mac_address__number_ranges, - (ProtobufCMessageInit) rpc__resp__get_mac_address__init, - NULL,NULL,NULL /* reserved[123] */ + { 0, 1 } }; -#define rpc__req__get_mode__field_descriptors NULL -#define rpc__req__get_mode__field_indices_by_name NULL -#define rpc__req__get_mode__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__get_mode__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_clear_username__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_GetMode", - "RpcReqGetMode", - "RpcReqGetMode", + "Rpc_Resp_EapClearUsername", + "RpcRespEapClearUsername", + "RpcRespEapClearUsername", "", - sizeof(RpcReqGetMode), - 0, - rpc__req__get_mode__field_descriptors, - rpc__req__get_mode__field_indices_by_name, - 0, rpc__req__get_mode__number_ranges, - (ProtobufCMessageInit) rpc__req__get_mode__init, + sizeof(RpcRespEapClearUsername), + 1, + rpc__resp__eap_clear_username__field_descriptors, + rpc__resp__eap_clear_username__field_indices_by_name, + 1, rpc__resp__eap_clear_username__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_clear_username__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__get_mode__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__req__eap_set_password__field_descriptors[2] = { { - "mode", + "password", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(RpcRespGetMode, mode), + offsetof(RpcReqEapSetPassword, password), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp", + "len", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespGetMode, resp), + offsetof(RpcReqEapSetPassword, len), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__get_mode__field_indices_by_name[] = { - 0, /* field[0] = mode */ - 1, /* field[1] = resp */ +static const unsigned rpc__req__eap_set_password__field_indices_by_name[] = { + 1, /* field[1] = len */ + 0, /* field[0] = password */ }; -static const ProtobufCIntRange rpc__resp__get_mode__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__eap_set_password__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor rpc__resp__get_mode__descriptor = +const ProtobufCMessageDescriptor rpc__req__eap_set_password__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_GetMode", - "RpcRespGetMode", - "RpcRespGetMode", + "Rpc_Req_EapSetPassword", + "RpcReqEapSetPassword", + "RpcReqEapSetPassword", "", - sizeof(RpcRespGetMode), + sizeof(RpcReqEapSetPassword), 2, - rpc__resp__get_mode__field_descriptors, - rpc__resp__get_mode__field_indices_by_name, - 1, rpc__resp__get_mode__number_ranges, - (ProtobufCMessageInit) rpc__resp__get_mode__init, + rpc__req__eap_set_password__field_descriptors, + rpc__req__eap_set_password__field_indices_by_name, + 1, rpc__req__eap_set_password__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_set_password__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__req__set_mode__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__eap_set_password__field_descriptors[1] = { { - "mode", + "resp", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcReqSetMode, mode), + offsetof(RpcRespEapSetPassword, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__req__set_mode__field_indices_by_name[] = { - 0, /* field[0] = mode */ +static const unsigned rpc__resp__eap_set_password__field_indices_by_name[] = { + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__req__set_mode__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_set_password__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__req__set_mode__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_set_password__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_SetMode", - "RpcReqSetMode", - "RpcReqSetMode", + "Rpc_Resp_EapSetPassword", + "RpcRespEapSetPassword", + "RpcRespEapSetPassword", + "", + sizeof(RpcRespEapSetPassword), + 1, + rpc__resp__eap_set_password__field_descriptors, + rpc__resp__eap_set_password__field_indices_by_name, + 1, rpc__resp__eap_set_password__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_set_password__init, + NULL,NULL,NULL /* reserved[123] */ +}; +#define rpc__req__eap_clear_password__field_descriptors NULL +#define rpc__req__eap_clear_password__field_indices_by_name NULL +#define rpc__req__eap_clear_password__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__eap_clear_password__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_EapClearPassword", + "RpcReqEapClearPassword", + "RpcReqEapClearPassword", "", - sizeof(RpcReqSetMode), - 1, - rpc__req__set_mode__field_descriptors, - rpc__req__set_mode__field_indices_by_name, - 1, rpc__req__set_mode__number_ranges, - (ProtobufCMessageInit) rpc__req__set_mode__init, + sizeof(RpcReqEapClearPassword), + 0, + rpc__req__eap_clear_password__field_descriptors, + rpc__req__eap_clear_password__field_indices_by_name, + 0, rpc__req__eap_clear_password__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_clear_password__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__set_mode__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__eap_clear_password__field_descriptors[1] = { { "resp", @@ -11124,144 +24291,144 @@ static const ProtobufCFieldDescriptor rpc__resp__set_mode__field_descriptors[1] PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespSetMode, resp), + offsetof(RpcRespEapClearPassword, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__set_mode__field_indices_by_name[] = { +static const unsigned rpc__resp__eap_clear_password__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__set_mode__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_clear_password__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__set_mode__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_clear_password__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_SetMode", - "RpcRespSetMode", - "RpcRespSetMode", + "Rpc_Resp_EapClearPassword", + "RpcRespEapClearPassword", + "RpcRespEapClearPassword", "", - sizeof(RpcRespSetMode), + sizeof(RpcRespEapClearPassword), 1, - rpc__resp__set_mode__field_descriptors, - rpc__resp__set_mode__field_indices_by_name, - 1, rpc__resp__set_mode__number_ranges, - (ProtobufCMessageInit) rpc__resp__set_mode__init, - NULL,NULL,NULL /* reserved[123] */ -}; -#define rpc__req__get_ps__field_descriptors NULL -#define rpc__req__get_ps__field_indices_by_name NULL -#define rpc__req__get_ps__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__get_ps__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_GetPs", - "RpcReqGetPs", - "RpcReqGetPs", - "", - sizeof(RpcReqGetPs), - 0, - rpc__req__get_ps__field_descriptors, - rpc__req__get_ps__field_indices_by_name, - 0, rpc__req__get_ps__number_ranges, - (ProtobufCMessageInit) rpc__req__get_ps__init, + rpc__resp__eap_clear_password__field_descriptors, + rpc__resp__eap_clear_password__field_indices_by_name, + 1, rpc__resp__eap_clear_password__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_clear_password__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__get_ps__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__req__eap_set_new_password__field_descriptors[2] = { { - "resp", + "new_password", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(RpcRespGetPs, resp), + offsetof(RpcReqEapSetNewPassword, new_password), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "type", + "len", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespGetPs, type), + offsetof(RpcReqEapSetNewPassword, len), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__get_ps__field_indices_by_name[] = { - 0, /* field[0] = resp */ - 1, /* field[1] = type */ +static const unsigned rpc__req__eap_set_new_password__field_indices_by_name[] = { + 1, /* field[1] = len */ + 0, /* field[0] = new_password */ }; -static const ProtobufCIntRange rpc__resp__get_ps__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__eap_set_new_password__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor rpc__resp__get_ps__descriptor = +const ProtobufCMessageDescriptor rpc__req__eap_set_new_password__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_GetPs", - "RpcRespGetPs", - "RpcRespGetPs", + "Rpc_Req_EapSetNewPassword", + "RpcReqEapSetNewPassword", + "RpcReqEapSetNewPassword", "", - sizeof(RpcRespGetPs), + sizeof(RpcReqEapSetNewPassword), 2, - rpc__resp__get_ps__field_descriptors, - rpc__resp__get_ps__field_indices_by_name, - 1, rpc__resp__get_ps__number_ranges, - (ProtobufCMessageInit) rpc__resp__get_ps__init, + rpc__req__eap_set_new_password__field_descriptors, + rpc__req__eap_set_new_password__field_indices_by_name, + 1, rpc__req__eap_set_new_password__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_set_new_password__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__req__set_ps__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__eap_set_new_password__field_descriptors[1] = { { - "type", + "resp", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcReqSetPs, type), + offsetof(RpcRespEapSetNewPassword, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__req__set_ps__field_indices_by_name[] = { - 0, /* field[0] = type */ +static const unsigned rpc__resp__eap_set_new_password__field_indices_by_name[] = { + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__req__set_ps__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_set_new_password__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__req__set_ps__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_set_new_password__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_SetPs", - "RpcReqSetPs", - "RpcReqSetPs", + "Rpc_Resp_EapSetNewPassword", + "RpcRespEapSetNewPassword", + "RpcRespEapSetNewPassword", "", - sizeof(RpcReqSetPs), + sizeof(RpcRespEapSetNewPassword), 1, - rpc__req__set_ps__field_descriptors, - rpc__req__set_ps__field_indices_by_name, - 1, rpc__req__set_ps__number_ranges, - (ProtobufCMessageInit) rpc__req__set_ps__init, + rpc__resp__eap_set_new_password__field_descriptors, + rpc__resp__eap_set_new_password__field_indices_by_name, + 1, rpc__resp__eap_set_new_password__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_set_new_password__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__set_ps__field_descriptors[1] = +#define rpc__req__eap_clear_new_password__field_descriptors NULL +#define rpc__req__eap_clear_new_password__field_indices_by_name NULL +#define rpc__req__eap_clear_new_password__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__eap_clear_new_password__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_EapClearNewPassword", + "RpcReqEapClearNewPassword", + "RpcReqEapClearNewPassword", + "", + sizeof(RpcReqEapClearNewPassword), + 0, + rpc__req__eap_clear_new_password__field_descriptors, + rpc__req__eap_clear_new_password__field_indices_by_name, + 0, rpc__req__eap_clear_new_password__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_clear_new_password__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__eap_clear_new_password__field_descriptors[1] = { { "resp", @@ -11269,88 +24436,88 @@ static const ProtobufCFieldDescriptor rpc__resp__set_ps__field_descriptors[1] = PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespSetPs, resp), + offsetof(RpcRespEapClearNewPassword, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__set_ps__field_indices_by_name[] = { +static const unsigned rpc__resp__eap_clear_new_password__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__set_ps__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_clear_new_password__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__set_ps__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_clear_new_password__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_SetPs", - "RpcRespSetPs", - "RpcRespSetPs", + "Rpc_Resp_EapClearNewPassword", + "RpcRespEapClearNewPassword", + "RpcRespEapClearNewPassword", "", - sizeof(RpcRespSetPs), + sizeof(RpcRespEapClearNewPassword), 1, - rpc__resp__set_ps__field_descriptors, - rpc__resp__set_ps__field_indices_by_name, - 1, rpc__resp__set_ps__number_ranges, - (ProtobufCMessageInit) rpc__resp__set_ps__init, + rpc__resp__eap_clear_new_password__field_descriptors, + rpc__resp__eap_clear_new_password__field_indices_by_name, + 1, rpc__resp__eap_clear_new_password__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_clear_new_password__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__req__set_mac_address__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__req__eap_set_ca_cert__field_descriptors[2] = { { - "mac", + "ca_cert", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(RpcReqSetMacAddress, mac), + offsetof(RpcReqEapSetCaCert, ca_cert), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "mode", + "ca_cert_len", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcReqSetMacAddress, mode), + offsetof(RpcReqEapSetCaCert, ca_cert_len), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__req__set_mac_address__field_indices_by_name[] = { - 0, /* field[0] = mac */ - 1, /* field[1] = mode */ +static const unsigned rpc__req__eap_set_ca_cert__field_indices_by_name[] = { + 0, /* field[0] = ca_cert */ + 1, /* field[1] = ca_cert_len */ }; -static const ProtobufCIntRange rpc__req__set_mac_address__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__eap_set_ca_cert__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor rpc__req__set_mac_address__descriptor = +const ProtobufCMessageDescriptor rpc__req__eap_set_ca_cert__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_SetMacAddress", - "RpcReqSetMacAddress", - "RpcReqSetMacAddress", + "Rpc_Req_EapSetCaCert", + "RpcReqEapSetCaCert", + "RpcReqEapSetCaCert", "", - sizeof(RpcReqSetMacAddress), + sizeof(RpcReqEapSetCaCert), 2, - rpc__req__set_mac_address__field_descriptors, - rpc__req__set_mac_address__field_indices_by_name, - 1, rpc__req__set_mac_address__number_ranges, - (ProtobufCMessageInit) rpc__req__set_mac_address__init, + rpc__req__eap_set_ca_cert__field_descriptors, + rpc__req__eap_set_ca_cert__field_indices_by_name, + 1, rpc__req__eap_set_ca_cert__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_set_ca_cert__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__set_mac_address__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__eap_set_ca_cert__field_descriptors[1] = { { "resp", @@ -11358,55 +24525,55 @@ static const ProtobufCFieldDescriptor rpc__resp__set_mac_address__field_descript PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespSetMacAddress, resp), + offsetof(RpcRespEapSetCaCert, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__set_mac_address__field_indices_by_name[] = { +static const unsigned rpc__resp__eap_set_ca_cert__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__set_mac_address__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_set_ca_cert__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__set_mac_address__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_set_ca_cert__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_SetMacAddress", - "RpcRespSetMacAddress", - "RpcRespSetMacAddress", + "Rpc_Resp_EapSetCaCert", + "RpcRespEapSetCaCert", + "RpcRespEapSetCaCert", "", - sizeof(RpcRespSetMacAddress), + sizeof(RpcRespEapSetCaCert), 1, - rpc__resp__set_mac_address__field_descriptors, - rpc__resp__set_mac_address__field_indices_by_name, - 1, rpc__resp__set_mac_address__number_ranges, - (ProtobufCMessageInit) rpc__resp__set_mac_address__init, + rpc__resp__eap_set_ca_cert__field_descriptors, + rpc__resp__eap_set_ca_cert__field_indices_by_name, + 1, rpc__resp__eap_set_ca_cert__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_set_ca_cert__init, NULL,NULL,NULL /* reserved[123] */ }; -#define rpc__req__otabegin__field_descriptors NULL -#define rpc__req__otabegin__field_indices_by_name NULL -#define rpc__req__otabegin__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__otabegin__descriptor = +#define rpc__req__eap_clear_ca_cert__field_descriptors NULL +#define rpc__req__eap_clear_ca_cert__field_indices_by_name NULL +#define rpc__req__eap_clear_ca_cert__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__eap_clear_ca_cert__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_OTABegin", - "RpcReqOTABegin", - "RpcReqOTABegin", + "Rpc_Req_EapClearCaCert", + "RpcReqEapClearCaCert", + "RpcReqEapClearCaCert", "", - sizeof(RpcReqOTABegin), + sizeof(RpcReqEapClearCaCert), 0, - rpc__req__otabegin__field_descriptors, - rpc__req__otabegin__field_indices_by_name, - 0, rpc__req__otabegin__number_ranges, - (ProtobufCMessageInit) rpc__req__otabegin__init, + rpc__req__eap_clear_ca_cert__field_descriptors, + rpc__req__eap_clear_ca_cert__field_indices_by_name, + 0, rpc__req__eap_clear_ca_cert__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_clear_ca_cert__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__otabegin__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__eap_clear_ca_cert__field_descriptors[1] = { { "resp", @@ -11414,75 +24581,140 @@ static const ProtobufCFieldDescriptor rpc__resp__otabegin__field_descriptors[1] PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespOTABegin, resp), + offsetof(RpcRespEapClearCaCert, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__otabegin__field_indices_by_name[] = { +static const unsigned rpc__resp__eap_clear_ca_cert__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__otabegin__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_clear_ca_cert__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__otabegin__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_clear_ca_cert__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_OTABegin", - "RpcRespOTABegin", - "RpcRespOTABegin", + "Rpc_Resp_EapClearCaCert", + "RpcRespEapClearCaCert", + "RpcRespEapClearCaCert", "", - sizeof(RpcRespOTABegin), + sizeof(RpcRespEapClearCaCert), 1, - rpc__resp__otabegin__field_descriptors, - rpc__resp__otabegin__field_indices_by_name, - 1, rpc__resp__otabegin__number_ranges, - (ProtobufCMessageInit) rpc__resp__otabegin__init, + rpc__resp__eap_clear_ca_cert__field_descriptors, + rpc__resp__eap_clear_ca_cert__field_indices_by_name, + 1, rpc__resp__eap_clear_ca_cert__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_clear_ca_cert__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__req__otawrite__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__req__eap_set_certificate_and_key__field_descriptors[6] = { { - "ota_data", + "client_cert", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(RpcReqOTAWrite, ota_data), + offsetof(RpcReqEapSetCertificateAndKey, client_cert), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "client_cert_len", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqEapSetCertificateAndKey, client_cert_len), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "private_key", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(RpcReqEapSetCertificateAndKey, private_key), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "private_key_len", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqEapSetCertificateAndKey, private_key_len), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "private_key_password", + 5, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(RpcReqEapSetCertificateAndKey, private_key_password), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "private_key_passwd_len", + 6, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqEapSetCertificateAndKey, private_key_passwd_len), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__req__otawrite__field_indices_by_name[] = { - 0, /* field[0] = ota_data */ +static const unsigned rpc__req__eap_set_certificate_and_key__field_indices_by_name[] = { + 0, /* field[0] = client_cert */ + 1, /* field[1] = client_cert_len */ + 2, /* field[2] = private_key */ + 3, /* field[3] = private_key_len */ + 5, /* field[5] = private_key_passwd_len */ + 4, /* field[4] = private_key_password */ }; -static const ProtobufCIntRange rpc__req__otawrite__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__eap_set_certificate_and_key__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 1 } + { 0, 6 } }; -const ProtobufCMessageDescriptor rpc__req__otawrite__descriptor = +const ProtobufCMessageDescriptor rpc__req__eap_set_certificate_and_key__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_OTAWrite", - "RpcReqOTAWrite", - "RpcReqOTAWrite", + "Rpc_Req_EapSetCertificateAndKey", + "RpcReqEapSetCertificateAndKey", + "RpcReqEapSetCertificateAndKey", "", - sizeof(RpcReqOTAWrite), - 1, - rpc__req__otawrite__field_descriptors, - rpc__req__otawrite__field_indices_by_name, - 1, rpc__req__otawrite__number_ranges, - (ProtobufCMessageInit) rpc__req__otawrite__init, + sizeof(RpcReqEapSetCertificateAndKey), + 6, + rpc__req__eap_set_certificate_and_key__field_descriptors, + rpc__req__eap_set_certificate_and_key__field_indices_by_name, + 1, rpc__req__eap_set_certificate_and_key__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_set_certificate_and_key__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__otawrite__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__eap_set_certificate_and_key__field_descriptors[1] = { { "resp", @@ -11490,55 +24722,55 @@ static const ProtobufCFieldDescriptor rpc__resp__otawrite__field_descriptors[1] PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespOTAWrite, resp), + offsetof(RpcRespEapSetCertificateAndKey, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__otawrite__field_indices_by_name[] = { +static const unsigned rpc__resp__eap_set_certificate_and_key__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__otawrite__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_set_certificate_and_key__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__otawrite__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_set_certificate_and_key__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_OTAWrite", - "RpcRespOTAWrite", - "RpcRespOTAWrite", + "Rpc_Resp_EapSetCertificateAndKey", + "RpcRespEapSetCertificateAndKey", + "RpcRespEapSetCertificateAndKey", "", - sizeof(RpcRespOTAWrite), + sizeof(RpcRespEapSetCertificateAndKey), 1, - rpc__resp__otawrite__field_descriptors, - rpc__resp__otawrite__field_indices_by_name, - 1, rpc__resp__otawrite__number_ranges, - (ProtobufCMessageInit) rpc__resp__otawrite__init, + rpc__resp__eap_set_certificate_and_key__field_descriptors, + rpc__resp__eap_set_certificate_and_key__field_indices_by_name, + 1, rpc__resp__eap_set_certificate_and_key__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_set_certificate_and_key__init, NULL,NULL,NULL /* reserved[123] */ }; -#define rpc__req__otaend__field_descriptors NULL -#define rpc__req__otaend__field_indices_by_name NULL -#define rpc__req__otaend__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__otaend__descriptor = +#define rpc__req__eap_clear_certificate_and_key__field_descriptors NULL +#define rpc__req__eap_clear_certificate_and_key__field_indices_by_name NULL +#define rpc__req__eap_clear_certificate_and_key__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__eap_clear_certificate_and_key__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_OTAEnd", - "RpcReqOTAEnd", - "RpcReqOTAEnd", + "Rpc_Req_EapClearCertificateAndKey", + "RpcReqEapClearCertificateAndKey", + "RpcReqEapClearCertificateAndKey", "", - sizeof(RpcReqOTAEnd), + sizeof(RpcReqEapClearCertificateAndKey), 0, - rpc__req__otaend__field_descriptors, - rpc__req__otaend__field_indices_by_name, - 0, rpc__req__otaend__number_ranges, - (ProtobufCMessageInit) rpc__req__otaend__init, + rpc__req__eap_clear_certificate_and_key__field_descriptors, + rpc__req__eap_clear_certificate_and_key__field_indices_by_name, + 0, rpc__req__eap_clear_certificate_and_key__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_clear_certificate_and_key__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__otaend__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__eap_clear_certificate_and_key__field_descriptors[1] = { { "resp", @@ -11546,75 +24778,75 @@ static const ProtobufCFieldDescriptor rpc__resp__otaend__field_descriptors[1] = PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespOTAEnd, resp), + offsetof(RpcRespEapClearCertificateAndKey, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__otaend__field_indices_by_name[] = { +static const unsigned rpc__resp__eap_clear_certificate_and_key__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__otaend__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_clear_certificate_and_key__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__otaend__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_clear_certificate_and_key__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_OTAEnd", - "RpcRespOTAEnd", - "RpcRespOTAEnd", + "Rpc_Resp_EapClearCertificateAndKey", + "RpcRespEapClearCertificateAndKey", + "RpcRespEapClearCertificateAndKey", "", - sizeof(RpcRespOTAEnd), + sizeof(RpcRespEapClearCertificateAndKey), 1, - rpc__resp__otaend__field_descriptors, - rpc__resp__otaend__field_indices_by_name, - 1, rpc__resp__otaend__number_ranges, - (ProtobufCMessageInit) rpc__resp__otaend__init, + rpc__resp__eap_clear_certificate_and_key__field_descriptors, + rpc__resp__eap_clear_certificate_and_key__field_indices_by_name, + 1, rpc__resp__eap_clear_certificate_and_key__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_clear_certificate_and_key__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__req__wifi_set_max_tx_power__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__req__eap_set_disable_time_check__field_descriptors[1] = { { - "power", + "disable", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetMaxTxPower, power), + offsetof(RpcReqEapSetDisableTimeCheck, disable), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__req__wifi_set_max_tx_power__field_indices_by_name[] = { - 0, /* field[0] = power */ +static const unsigned rpc__req__eap_set_disable_time_check__field_indices_by_name[] = { + 0, /* field[0] = disable */ }; -static const ProtobufCIntRange rpc__req__wifi_set_max_tx_power__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__eap_set_disable_time_check__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__req__wifi_set_max_tx_power__descriptor = +const ProtobufCMessageDescriptor rpc__req__eap_set_disable_time_check__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiSetMaxTxPower", - "RpcReqWifiSetMaxTxPower", - "RpcReqWifiSetMaxTxPower", + "Rpc_Req_EapSetDisableTimeCheck", + "RpcReqEapSetDisableTimeCheck", + "RpcReqEapSetDisableTimeCheck", "", - sizeof(RpcReqWifiSetMaxTxPower), + sizeof(RpcReqEapSetDisableTimeCheck), 1, - rpc__req__wifi_set_max_tx_power__field_descriptors, - rpc__req__wifi_set_max_tx_power__field_indices_by_name, - 1, rpc__req__wifi_set_max_tx_power__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_set_max_tx_power__init, + rpc__req__eap_set_disable_time_check__field_descriptors, + rpc__req__eap_set_disable_time_check__field_indices_by_name, + 1, rpc__req__eap_set_disable_time_check__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_set_disable_time_check__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_set_max_tx_power__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__eap_set_disable_time_check__field_descriptors[1] = { { "resp", @@ -11622,157 +24854,144 @@ static const ProtobufCFieldDescriptor rpc__resp__wifi_set_max_tx_power__field_de PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiSetMaxTxPower, resp), + offsetof(RpcRespEapSetDisableTimeCheck, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_set_max_tx_power__field_indices_by_name[] = { +static const unsigned rpc__resp__eap_set_disable_time_check__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_set_max_tx_power__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_set_disable_time_check__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_set_max_tx_power__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_set_disable_time_check__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiSetMaxTxPower", - "RpcRespWifiSetMaxTxPower", - "RpcRespWifiSetMaxTxPower", + "Rpc_Resp_EapSetDisableTimeCheck", + "RpcRespEapSetDisableTimeCheck", + "RpcRespEapSetDisableTimeCheck", "", - sizeof(RpcRespWifiSetMaxTxPower), + sizeof(RpcRespEapSetDisableTimeCheck), 1, - rpc__resp__wifi_set_max_tx_power__field_descriptors, - rpc__resp__wifi_set_max_tx_power__field_indices_by_name, - 1, rpc__resp__wifi_set_max_tx_power__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_set_max_tx_power__init, + rpc__resp__eap_set_disable_time_check__field_descriptors, + rpc__resp__eap_set_disable_time_check__field_indices_by_name, + 1, rpc__resp__eap_set_disable_time_check__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_set_disable_time_check__init, NULL,NULL,NULL /* reserved[123] */ }; -#define rpc__req__wifi_get_max_tx_power__field_descriptors NULL -#define rpc__req__wifi_get_max_tx_power__field_indices_by_name NULL -#define rpc__req__wifi_get_max_tx_power__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_get_max_tx_power__descriptor = +#define rpc__req__eap_get_disable_time_check__field_descriptors NULL +#define rpc__req__eap_get_disable_time_check__field_indices_by_name NULL +#define rpc__req__eap_get_disable_time_check__number_ranges NULL +const ProtobufCMessageDescriptor rpc__req__eap_get_disable_time_check__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiGetMaxTxPower", - "RpcReqWifiGetMaxTxPower", - "RpcReqWifiGetMaxTxPower", + "Rpc_Req_EapGetDisableTimeCheck", + "RpcReqEapGetDisableTimeCheck", + "RpcReqEapGetDisableTimeCheck", "", - sizeof(RpcReqWifiGetMaxTxPower), + sizeof(RpcReqEapGetDisableTimeCheck), 0, - rpc__req__wifi_get_max_tx_power__field_descriptors, - rpc__req__wifi_get_max_tx_power__field_indices_by_name, - 0, rpc__req__wifi_get_max_tx_power__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_get_max_tx_power__init, + rpc__req__eap_get_disable_time_check__field_descriptors, + rpc__req__eap_get_disable_time_check__field_indices_by_name, + 0, rpc__req__eap_get_disable_time_check__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_get_disable_time_check__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_get_max_tx_power__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__resp__eap_get_disable_time_check__field_descriptors[2] = { { - "power", + "resp", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetMaxTxPower, power), + offsetof(RpcRespEapGetDisableTimeCheck, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp", + "disable", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetMaxTxPower, resp), + offsetof(RpcRespEapGetDisableTimeCheck, disable), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_get_max_tx_power__field_indices_by_name[] = { - 0, /* field[0] = power */ - 1, /* field[1] = resp */ +static const unsigned rpc__resp__eap_get_disable_time_check__field_indices_by_name[] = { + 1, /* field[1] = disable */ + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_get_max_tx_power__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_get_disable_time_check__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_get_max_tx_power__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_get_disable_time_check__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiGetMaxTxPower", - "RpcRespWifiGetMaxTxPower", - "RpcRespWifiGetMaxTxPower", + "Rpc_Resp_EapGetDisableTimeCheck", + "RpcRespEapGetDisableTimeCheck", + "RpcRespEapGetDisableTimeCheck", "", - sizeof(RpcRespWifiGetMaxTxPower), + sizeof(RpcRespEapGetDisableTimeCheck), 2, - rpc__resp__wifi_get_max_tx_power__field_descriptors, - rpc__resp__wifi_get_max_tx_power__field_indices_by_name, - 1, rpc__resp__wifi_get_max_tx_power__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_get_max_tx_power__init, + rpc__resp__eap_get_disable_time_check__field_descriptors, + rpc__resp__eap_get_disable_time_check__field_indices_by_name, + 1, rpc__resp__eap_get_disable_time_check__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_get_disable_time_check__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__req__config_heartbeat__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__req__eap_set_ttls_phase2_method__field_descriptors[1] = { { - "enable", + "type", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(RpcReqConfigHeartbeat, enable), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "duration", - 2, - PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcReqConfigHeartbeat, duration), + offsetof(RpcReqEapSetTtlsPhase2Method, type), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__req__config_heartbeat__field_indices_by_name[] = { - 1, /* field[1] = duration */ - 0, /* field[0] = enable */ +static const unsigned rpc__req__eap_set_ttls_phase2_method__field_indices_by_name[] = { + 0, /* field[0] = type */ }; -static const ProtobufCIntRange rpc__req__config_heartbeat__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__eap_set_ttls_phase2_method__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } + { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__req__config_heartbeat__descriptor = +const ProtobufCMessageDescriptor rpc__req__eap_set_ttls_phase2_method__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_ConfigHeartbeat", - "RpcReqConfigHeartbeat", - "RpcReqConfigHeartbeat", + "Rpc_Req_EapSetTtlsPhase2Method", + "RpcReqEapSetTtlsPhase2Method", + "RpcReqEapSetTtlsPhase2Method", "", - sizeof(RpcReqConfigHeartbeat), - 2, - rpc__req__config_heartbeat__field_descriptors, - rpc__req__config_heartbeat__field_indices_by_name, - 1, rpc__req__config_heartbeat__number_ranges, - (ProtobufCMessageInit) rpc__req__config_heartbeat__init, + sizeof(RpcReqEapSetTtlsPhase2Method), + 1, + rpc__req__eap_set_ttls_phase2_method__field_descriptors, + rpc__req__eap_set_ttls_phase2_method__field_indices_by_name, + 1, rpc__req__eap_set_ttls_phase2_method__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_set_ttls_phase2_method__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__config_heartbeat__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__eap_set_ttls_phase2_method__field_descriptors[1] = { { "resp", @@ -11780,75 +24999,75 @@ static const ProtobufCFieldDescriptor rpc__resp__config_heartbeat__field_descrip PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespConfigHeartbeat, resp), + offsetof(RpcRespEapSetTtlsPhase2Method, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__config_heartbeat__field_indices_by_name[] = { +static const unsigned rpc__resp__eap_set_ttls_phase2_method__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__config_heartbeat__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_set_ttls_phase2_method__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__config_heartbeat__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_set_ttls_phase2_method__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_ConfigHeartbeat", - "RpcRespConfigHeartbeat", - "RpcRespConfigHeartbeat", + "Rpc_Resp_EapSetTtlsPhase2Method", + "RpcRespEapSetTtlsPhase2Method", + "RpcRespEapSetTtlsPhase2Method", "", - sizeof(RpcRespConfigHeartbeat), + sizeof(RpcRespEapSetTtlsPhase2Method), 1, - rpc__resp__config_heartbeat__field_descriptors, - rpc__resp__config_heartbeat__field_indices_by_name, - 1, rpc__resp__config_heartbeat__number_ranges, - (ProtobufCMessageInit) rpc__resp__config_heartbeat__init, + rpc__resp__eap_set_ttls_phase2_method__field_descriptors, + rpc__resp__eap_set_ttls_phase2_method__field_indices_by_name, + 1, rpc__resp__eap_set_ttls_phase2_method__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_set_ttls_phase2_method__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__req__wifi_init__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__req__eap_set_suiteb192bit_certification__field_descriptors[1] = { { - "cfg", + "enable", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, + PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ - offsetof(RpcReqWifiInit, cfg), - &wifi_init_config__descriptor, + offsetof(RpcReqEapSetSuiteb192bitCertification, enable), + NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__req__wifi_init__field_indices_by_name[] = { - 0, /* field[0] = cfg */ +static const unsigned rpc__req__eap_set_suiteb192bit_certification__field_indices_by_name[] = { + 0, /* field[0] = enable */ }; -static const ProtobufCIntRange rpc__req__wifi_init__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__eap_set_suiteb192bit_certification__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__req__wifi_init__descriptor = +const ProtobufCMessageDescriptor rpc__req__eap_set_suiteb192bit_certification__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiInit", - "RpcReqWifiInit", - "RpcReqWifiInit", + "Rpc_Req_EapSetSuiteb192bitCertification", + "RpcReqEapSetSuiteb192bitCertification", + "RpcReqEapSetSuiteb192bitCertification", "", - sizeof(RpcReqWifiInit), + sizeof(RpcReqEapSetSuiteb192bitCertification), 1, - rpc__req__wifi_init__field_descriptors, - rpc__req__wifi_init__field_indices_by_name, - 1, rpc__req__wifi_init__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_init__init, + rpc__req__eap_set_suiteb192bit_certification__field_descriptors, + rpc__req__eap_set_suiteb192bit_certification__field_indices_by_name, + 1, rpc__req__eap_set_suiteb192bit_certification__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_set_suiteb192bit_certification__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_init__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__eap_set_suiteb192bit_certification__field_descriptors[1] = { { "resp", @@ -11856,55 +25075,88 @@ static const ProtobufCFieldDescriptor rpc__resp__wifi_init__field_descriptors[1] PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiInit, resp), + offsetof(RpcRespEapSetSuiteb192bitCertification, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_init__field_indices_by_name[] = { +static const unsigned rpc__resp__eap_set_suiteb192bit_certification__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_init__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_set_suiteb192bit_certification__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_init__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_set_suiteb192bit_certification__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiInit", - "RpcRespWifiInit", - "RpcRespWifiInit", + "Rpc_Resp_EapSetSuiteb192bitCertification", + "RpcRespEapSetSuiteb192bitCertification", + "RpcRespEapSetSuiteb192bitCertification", "", - sizeof(RpcRespWifiInit), + sizeof(RpcRespEapSetSuiteb192bitCertification), 1, - rpc__resp__wifi_init__field_descriptors, - rpc__resp__wifi_init__field_indices_by_name, - 1, rpc__resp__wifi_init__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_init__init, + rpc__resp__eap_set_suiteb192bit_certification__field_descriptors, + rpc__resp__eap_set_suiteb192bit_certification__field_indices_by_name, + 1, rpc__resp__eap_set_suiteb192bit_certification__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_set_suiteb192bit_certification__init, NULL,NULL,NULL /* reserved[123] */ }; -#define rpc__req__wifi_deinit__field_descriptors NULL -#define rpc__req__wifi_deinit__field_indices_by_name NULL -#define rpc__req__wifi_deinit__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_deinit__descriptor = +static const ProtobufCFieldDescriptor rpc__req__eap_set_pac_file__field_descriptors[2] = +{ + { + "pac_file", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(RpcReqEapSetPacFile, pac_file), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "pac_file_len", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqEapSetPacFile, pac_file_len), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__eap_set_pac_file__field_indices_by_name[] = { + 0, /* field[0] = pac_file */ + 1, /* field[1] = pac_file_len */ +}; +static const ProtobufCIntRange rpc__req__eap_set_pac_file__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__req__eap_set_pac_file__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiDeinit", - "RpcReqWifiDeinit", - "RpcReqWifiDeinit", + "Rpc_Req_EapSetPacFile", + "RpcReqEapSetPacFile", + "RpcReqEapSetPacFile", "", - sizeof(RpcReqWifiDeinit), - 0, - rpc__req__wifi_deinit__field_descriptors, - rpc__req__wifi_deinit__field_indices_by_name, - 0, rpc__req__wifi_deinit__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_deinit__init, + sizeof(RpcReqEapSetPacFile), + 2, + rpc__req__eap_set_pac_file__field_descriptors, + rpc__req__eap_set_pac_file__field_indices_by_name, + 1, rpc__req__eap_set_pac_file__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_set_pac_file__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_deinit__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__eap_set_pac_file__field_descriptors[1] = { { "resp", @@ -11912,88 +25164,151 @@ static const ProtobufCFieldDescriptor rpc__resp__wifi_deinit__field_descriptors[ PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiDeinit, resp), + offsetof(RpcRespEapSetPacFile, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_deinit__field_indices_by_name[] = { +static const unsigned rpc__resp__eap_set_pac_file__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_deinit__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_set_pac_file__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_deinit__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_set_pac_file__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiDeinit", - "RpcRespWifiDeinit", - "RpcRespWifiDeinit", + "Rpc_Resp_EapSetPacFile", + "RpcRespEapSetPacFile", + "RpcRespEapSetPacFile", "", - sizeof(RpcRespWifiDeinit), + sizeof(RpcRespEapSetPacFile), 1, - rpc__resp__wifi_deinit__field_descriptors, - rpc__resp__wifi_deinit__field_indices_by_name, - 1, rpc__resp__wifi_deinit__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_deinit__init, + rpc__resp__eap_set_pac_file__field_descriptors, + rpc__resp__eap_set_pac_file__field_indices_by_name, + 1, rpc__resp__eap_set_pac_file__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_set_pac_file__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__req__wifi_set_config__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__req__eap_set_fast_params__field_descriptors[1] = { { - "iface", + "eap_fast_config", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetConfig, iface), - NULL, + offsetof(RpcReqEapSetFastParams, eap_fast_config), + &eap_fast_config__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__eap_set_fast_params__field_indices_by_name[] = { + 0, /* field[0] = eap_fast_config */ +}; +static const ProtobufCIntRange rpc__req__eap_set_fast_params__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__eap_set_fast_params__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_EapSetFastParams", + "RpcReqEapSetFastParams", + "RpcReqEapSetFastParams", + "", + sizeof(RpcReqEapSetFastParams), + 1, + rpc__req__eap_set_fast_params__field_descriptors, + rpc__req__eap_set_fast_params__field_indices_by_name, + 1, rpc__req__eap_set_fast_params__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_set_fast_params__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__eap_set_fast_params__field_descriptors[1] = +{ { - "cfg", - 2, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetConfig, cfg), - &wifi_config__descriptor, + offsetof(RpcRespEapSetFastParams, resp), + NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__req__wifi_set_config__field_indices_by_name[] = { - 1, /* field[1] = cfg */ - 0, /* field[0] = iface */ +static const unsigned rpc__resp__eap_set_fast_params__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__eap_set_fast_params__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__eap_set_fast_params__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Resp_EapSetFastParams", + "RpcRespEapSetFastParams", + "RpcRespEapSetFastParams", + "", + sizeof(RpcRespEapSetFastParams), + 1, + rpc__resp__eap_set_fast_params__field_descriptors, + rpc__resp__eap_set_fast_params__field_indices_by_name, + 1, rpc__resp__eap_set_fast_params__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_set_fast_params__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__eap_use_default_cert_bundle__field_descriptors[1] = +{ + { + "use_default_bundle", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(RpcReqEapUseDefaultCertBundle, use_default_bundle), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, }; -static const ProtobufCIntRange rpc__req__wifi_set_config__number_ranges[1 + 1] = +static const unsigned rpc__req__eap_use_default_cert_bundle__field_indices_by_name[] = { + 0, /* field[0] = use_default_bundle */ +}; +static const ProtobufCIntRange rpc__req__eap_use_default_cert_bundle__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } + { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__req__wifi_set_config__descriptor = +const ProtobufCMessageDescriptor rpc__req__eap_use_default_cert_bundle__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiSetConfig", - "RpcReqWifiSetConfig", - "RpcReqWifiSetConfig", + "Rpc_Req_EapUseDefaultCertBundle", + "RpcReqEapUseDefaultCertBundle", + "RpcReqEapUseDefaultCertBundle", "", - sizeof(RpcReqWifiSetConfig), - 2, - rpc__req__wifi_set_config__field_descriptors, - rpc__req__wifi_set_config__field_indices_by_name, - 1, rpc__req__wifi_set_config__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_set_config__init, + sizeof(RpcReqEapUseDefaultCertBundle), + 1, + rpc__req__eap_use_default_cert_bundle__field_descriptors, + rpc__req__eap_use_default_cert_bundle__field_indices_by_name, + 1, rpc__req__eap_use_default_cert_bundle__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_use_default_cert_bundle__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_set_config__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__eap_use_default_cert_bundle__field_descriptors[1] = { { "resp", @@ -12001,75 +25316,75 @@ static const ProtobufCFieldDescriptor rpc__resp__wifi_set_config__field_descript PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiSetConfig, resp), + offsetof(RpcRespEapUseDefaultCertBundle, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_set_config__field_indices_by_name[] = { +static const unsigned rpc__resp__eap_use_default_cert_bundle__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_set_config__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_use_default_cert_bundle__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_set_config__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_use_default_cert_bundle__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiSetConfig", - "RpcRespWifiSetConfig", - "RpcRespWifiSetConfig", + "Rpc_Resp_EapUseDefaultCertBundle", + "RpcRespEapUseDefaultCertBundle", + "RpcRespEapUseDefaultCertBundle", "", - sizeof(RpcRespWifiSetConfig), + sizeof(RpcRespEapUseDefaultCertBundle), 1, - rpc__resp__wifi_set_config__field_descriptors, - rpc__resp__wifi_set_config__field_indices_by_name, - 1, rpc__resp__wifi_set_config__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_set_config__init, + rpc__resp__eap_use_default_cert_bundle__field_descriptors, + rpc__resp__eap_use_default_cert_bundle__field_indices_by_name, + 1, rpc__resp__eap_use_default_cert_bundle__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_use_default_cert_bundle__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__req__wifi_get_config__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__req__wifi_set_okc_support__field_descriptors[1] = { { - "iface", + "enable", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ - offsetof(RpcReqWifiGetConfig, iface), + offsetof(RpcReqWifiSetOkcSupport, enable), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__req__wifi_get_config__field_indices_by_name[] = { - 0, /* field[0] = iface */ +static const unsigned rpc__req__wifi_set_okc_support__field_indices_by_name[] = { + 0, /* field[0] = enable */ }; -static const ProtobufCIntRange rpc__req__wifi_get_config__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__wifi_set_okc_support__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__req__wifi_get_config__descriptor = +const ProtobufCMessageDescriptor rpc__req__wifi_set_okc_support__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiGetConfig", - "RpcReqWifiGetConfig", - "RpcReqWifiGetConfig", + "Rpc_Req_WifiSetOkcSupport", + "RpcReqWifiSetOkcSupport", + "RpcReqWifiSetOkcSupport", "", - sizeof(RpcReqWifiGetConfig), + sizeof(RpcReqWifiSetOkcSupport), 1, - rpc__req__wifi_get_config__field_descriptors, - rpc__req__wifi_get_config__field_indices_by_name, - 1, rpc__req__wifi_get_config__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_get_config__init, + rpc__req__wifi_set_okc_support__field_descriptors, + rpc__req__wifi_set_okc_support__field_indices_by_name, + 1, rpc__req__wifi_set_okc_support__number_ranges, + (ProtobufCMessageInit) rpc__req__wifi_set_okc_support__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_get_config__field_descriptors[3] = +static const ProtobufCFieldDescriptor rpc__resp__wifi_set_okc_support__field_descriptors[1] = { { "resp", @@ -12077,137 +25392,75 @@ static const ProtobufCFieldDescriptor rpc__resp__wifi_get_config__field_descript PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetConfig, resp), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "iface", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetConfig, iface), + offsetof(RpcRespWifiSetOkcSupport, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, - { - "cfg", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetConfig, cfg), - &wifi_config__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, }; -static const unsigned rpc__resp__wifi_get_config__field_indices_by_name[] = { - 2, /* field[2] = cfg */ - 1, /* field[1] = iface */ +static const unsigned rpc__resp__wifi_set_okc_support__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_get_config__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__wifi_set_okc_support__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 3 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_get_config__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiGetConfig", - "RpcRespWifiGetConfig", - "RpcRespWifiGetConfig", - "", - sizeof(RpcRespWifiGetConfig), - 3, - rpc__resp__wifi_get_config__field_descriptors, - rpc__resp__wifi_get_config__field_indices_by_name, - 1, rpc__resp__wifi_get_config__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_get_config__init, - NULL,NULL,NULL /* reserved[123] */ + { 0, 1 } }; -#define rpc__req__wifi_connect__field_descriptors NULL -#define rpc__req__wifi_connect__field_indices_by_name NULL -#define rpc__req__wifi_connect__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_connect__descriptor = +const ProtobufCMessageDescriptor rpc__resp__wifi_set_okc_support__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiConnect", - "RpcReqWifiConnect", - "RpcReqWifiConnect", + "Rpc_Resp_WifiSetOkcSupport", + "RpcRespWifiSetOkcSupport", + "RpcRespWifiSetOkcSupport", "", - sizeof(RpcReqWifiConnect), - 0, - rpc__req__wifi_connect__field_descriptors, - rpc__req__wifi_connect__field_indices_by_name, - 0, rpc__req__wifi_connect__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_connect__init, + sizeof(RpcRespWifiSetOkcSupport), + 1, + rpc__resp__wifi_set_okc_support__field_descriptors, + rpc__resp__wifi_set_okc_support__field_indices_by_name, + 1, rpc__resp__wifi_set_okc_support__number_ranges, + (ProtobufCMessageInit) rpc__resp__wifi_set_okc_support__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_connect__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__req__eap_set_domain_name__field_descriptors[1] = { { - "resp", + "domain_name", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_BYTES, 0, /* quantifier_offset */ - offsetof(RpcRespWifiConnect, resp), + offsetof(RpcReqEapSetDomainName, domain_name), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_connect__field_indices_by_name[] = { - 0, /* field[0] = resp */ +static const unsigned rpc__req__eap_set_domain_name__field_indices_by_name[] = { + 0, /* field[0] = domain_name */ }; -static const ProtobufCIntRange rpc__resp__wifi_connect__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__eap_set_domain_name__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_connect__descriptor = +const ProtobufCMessageDescriptor rpc__req__eap_set_domain_name__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiConnect", - "RpcRespWifiConnect", - "RpcRespWifiConnect", + "Rpc_Req_EapSetDomainName", + "RpcReqEapSetDomainName", + "RpcReqEapSetDomainName", "", - sizeof(RpcRespWifiConnect), + sizeof(RpcReqEapSetDomainName), 1, - rpc__resp__wifi_connect__field_descriptors, - rpc__resp__wifi_connect__field_indices_by_name, - 1, rpc__resp__wifi_connect__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_connect__init, - NULL,NULL,NULL /* reserved[123] */ -}; -#define rpc__req__wifi_disconnect__field_descriptors NULL -#define rpc__req__wifi_disconnect__field_indices_by_name NULL -#define rpc__req__wifi_disconnect__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_disconnect__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiDisconnect", - "RpcReqWifiDisconnect", - "RpcReqWifiDisconnect", - "", - sizeof(RpcReqWifiDisconnect), - 0, - rpc__req__wifi_disconnect__field_descriptors, - rpc__req__wifi_disconnect__field_indices_by_name, - 0, rpc__req__wifi_disconnect__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_disconnect__init, + rpc__req__eap_set_domain_name__field_descriptors, + rpc__req__eap_set_domain_name__field_indices_by_name, + 1, rpc__req__eap_set_domain_name__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_set_domain_name__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_disconnect__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__eap_set_domain_name__field_descriptors[1] = { { "resp", @@ -12215,111 +25468,75 @@ static const ProtobufCFieldDescriptor rpc__resp__wifi_disconnect__field_descript PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiDisconnect, resp), + offsetof(RpcRespEapSetDomainName, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_disconnect__field_indices_by_name[] = { +static const unsigned rpc__resp__eap_set_domain_name__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_disconnect__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_set_domain_name__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_disconnect__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_set_domain_name__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiDisconnect", - "RpcRespWifiDisconnect", - "RpcRespWifiDisconnect", + "Rpc_Resp_EapSetDomainName", + "RpcRespEapSetDomainName", + "RpcRespEapSetDomainName", "", - sizeof(RpcRespWifiDisconnect), + sizeof(RpcRespEapSetDomainName), 1, - rpc__resp__wifi_disconnect__field_descriptors, - rpc__resp__wifi_disconnect__field_indices_by_name, - 1, rpc__resp__wifi_disconnect__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_disconnect__init, - NULL,NULL,NULL /* reserved[123] */ -}; -#define rpc__req__wifi_start__field_descriptors NULL -#define rpc__req__wifi_start__field_indices_by_name NULL -#define rpc__req__wifi_start__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_start__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiStart", - "RpcReqWifiStart", - "RpcReqWifiStart", - "", - sizeof(RpcReqWifiStart), - 0, - rpc__req__wifi_start__field_descriptors, - rpc__req__wifi_start__field_indices_by_name, - 0, rpc__req__wifi_start__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_start__init, + rpc__resp__eap_set_domain_name__field_descriptors, + rpc__resp__eap_set_domain_name__field_indices_by_name, + 1, rpc__resp__eap_set_domain_name__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_set_domain_name__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_start__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__req__eap_set_eap_methods__field_descriptors[1] = { { - "resp", + "methods", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiStart, resp), + offsetof(RpcReqEapSetEapMethods, methods), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_start__field_indices_by_name[] = { - 0, /* field[0] = resp */ +static const unsigned rpc__req__eap_set_eap_methods__field_indices_by_name[] = { + 0, /* field[0] = methods */ }; -static const ProtobufCIntRange rpc__resp__wifi_start__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__eap_set_eap_methods__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_start__descriptor = +const ProtobufCMessageDescriptor rpc__req__eap_set_eap_methods__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiStart", - "RpcRespWifiStart", - "RpcRespWifiStart", + "Rpc_Req_EapSetEapMethods", + "RpcReqEapSetEapMethods", + "RpcReqEapSetEapMethods", "", - sizeof(RpcRespWifiStart), + sizeof(RpcReqEapSetEapMethods), 1, - rpc__resp__wifi_start__field_descriptors, - rpc__resp__wifi_start__field_indices_by_name, - 1, rpc__resp__wifi_start__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_start__init, - NULL,NULL,NULL /* reserved[123] */ -}; -#define rpc__req__wifi_stop__field_descriptors NULL -#define rpc__req__wifi_stop__field_indices_by_name NULL -#define rpc__req__wifi_stop__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_stop__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiStop", - "RpcReqWifiStop", - "RpcReqWifiStop", - "", - sizeof(RpcReqWifiStop), - 0, - rpc__req__wifi_stop__field_descriptors, - rpc__req__wifi_stop__field_indices_by_name, - 0, rpc__req__wifi_stop__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_stop__init, + rpc__req__eap_set_eap_methods__field_descriptors, + rpc__req__eap_set_eap_methods__field_indices_by_name, + 1, rpc__req__eap_set_eap_methods__number_ranges, + (ProtobufCMessageInit) rpc__req__eap_set_eap_methods__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_stop__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__eap_set_eap_methods__field_descriptors[1] = { { "resp", @@ -12327,101 +25544,139 @@ static const ProtobufCFieldDescriptor rpc__resp__wifi_stop__field_descriptors[1] PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiStop, resp), + offsetof(RpcRespEapSetEapMethods, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_stop__field_indices_by_name[] = { +static const unsigned rpc__resp__eap_set_eap_methods__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_stop__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__eap_set_eap_methods__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_stop__descriptor = +const ProtobufCMessageDescriptor rpc__resp__eap_set_eap_methods__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiStop", - "RpcRespWifiStop", - "RpcRespWifiStop", + "Rpc_Resp_EapSetEapMethods", + "RpcRespEapSetEapMethods", + "RpcRespEapSetEapMethods", "", - sizeof(RpcRespWifiStop), + sizeof(RpcRespEapSetEapMethods), 1, - rpc__resp__wifi_stop__field_descriptors, - rpc__resp__wifi_stop__field_indices_by_name, - 1, rpc__resp__wifi_stop__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_stop__init, + rpc__resp__eap_set_eap_methods__field_descriptors, + rpc__resp__eap_set_eap_methods__field_indices_by_name, + 1, rpc__resp__eap_set_eap_methods__number_ranges, + (ProtobufCMessageInit) rpc__resp__eap_set_eap_methods__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__req__wifi_scan_start__field_descriptors[3] = +static const ProtobufCFieldDescriptor rpc__event__supp_dpp_uri_ready__field_descriptors[2] = { { - "config", + "resp", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcReqWifiScanStart, config), - &wifi_scan_config__descriptor, + offsetof(RpcEventSuppDppUriReady, resp), + NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "block", + "qrcode", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(RpcEventSuppDppUriReady, qrcode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__event__supp_dpp_uri_ready__field_indices_by_name[] = { + 1, /* field[1] = qrcode */ + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__event__supp_dpp_uri_ready__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__event__supp_dpp_uri_ready__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Event_SuppDppUriReady", + "RpcEventSuppDppUriReady", + "RpcEventSuppDppUriReady", + "", + sizeof(RpcEventSuppDppUriReady), + 2, + rpc__event__supp_dpp_uri_ready__field_descriptors, + rpc__event__supp_dpp_uri_ready__field_indices_by_name, + 1, rpc__event__supp_dpp_uri_ready__number_ranges, + (ProtobufCMessageInit) rpc__event__supp_dpp_uri_ready__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__event__supp_dpp_cfg_recvd__field_descriptors[2] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcReqWifiScanStart, block), + offsetof(RpcEventSuppDppCfgRecvd, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "config_set", - 3, + "cfg", + 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ - offsetof(RpcReqWifiScanStart, config_set), - NULL, + offsetof(RpcEventSuppDppCfgRecvd, cfg), + &wifi_config__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__req__wifi_scan_start__field_indices_by_name[] = { - 1, /* field[1] = block */ - 0, /* field[0] = config */ - 2, /* field[2] = config_set */ +static const unsigned rpc__event__supp_dpp_cfg_recvd__field_indices_by_name[] = { + 1, /* field[1] = cfg */ + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__req__wifi_scan_start__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__event__supp_dpp_cfg_recvd__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 3 } + { 0, 2 } }; -const ProtobufCMessageDescriptor rpc__req__wifi_scan_start__descriptor = +const ProtobufCMessageDescriptor rpc__event__supp_dpp_cfg_recvd__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiScanStart", - "RpcReqWifiScanStart", - "RpcReqWifiScanStart", + "Rpc_Event_SuppDppCfgRecvd", + "RpcEventSuppDppCfgRecvd", + "RpcEventSuppDppCfgRecvd", "", - sizeof(RpcReqWifiScanStart), - 3, - rpc__req__wifi_scan_start__field_descriptors, - rpc__req__wifi_scan_start__field_indices_by_name, - 1, rpc__req__wifi_scan_start__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_scan_start__init, + sizeof(RpcEventSuppDppCfgRecvd), + 2, + rpc__event__supp_dpp_cfg_recvd__field_descriptors, + rpc__event__supp_dpp_cfg_recvd__field_indices_by_name, + 1, rpc__event__supp_dpp_cfg_recvd__number_ranges, + (ProtobufCMessageInit) rpc__event__supp_dpp_cfg_recvd__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_scan_start__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__event__supp_dpp_fail__field_descriptors[2] = { { "resp", @@ -12429,55 +25684,50 @@ static const ProtobufCFieldDescriptor rpc__resp__wifi_scan_start__field_descript PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiScanStart, resp), + offsetof(RpcEventSuppDppFail, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "reason", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcEventSuppDppFail, reason), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_scan_start__field_indices_by_name[] = { +static const unsigned rpc__event__supp_dpp_fail__field_indices_by_name[] = { + 1, /* field[1] = reason */ 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_scan_start__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__event__supp_dpp_fail__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_scan_start__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiScanStart", - "RpcRespWifiScanStart", - "RpcRespWifiScanStart", - "", - sizeof(RpcRespWifiScanStart), - 1, - rpc__resp__wifi_scan_start__field_descriptors, - rpc__resp__wifi_scan_start__field_indices_by_name, - 1, rpc__resp__wifi_scan_start__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_scan_start__init, - NULL,NULL,NULL /* reserved[123] */ + { 0, 2 } }; -#define rpc__req__wifi_scan_stop__field_descriptors NULL -#define rpc__req__wifi_scan_stop__field_indices_by_name NULL -#define rpc__req__wifi_scan_stop__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_scan_stop__descriptor = +const ProtobufCMessageDescriptor rpc__event__supp_dpp_fail__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiScanStop", - "RpcReqWifiScanStop", - "RpcReqWifiScanStop", + "Rpc_Event_SuppDppFail", + "RpcEventSuppDppFail", + "RpcEventSuppDppFail", "", - sizeof(RpcReqWifiScanStop), - 0, - rpc__req__wifi_scan_stop__field_descriptors, - rpc__req__wifi_scan_stop__field_indices_by_name, - 0, rpc__req__wifi_scan_stop__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_scan_stop__init, + sizeof(RpcEventSuppDppFail), + 2, + rpc__event__supp_dpp_fail__field_descriptors, + rpc__event__supp_dpp_fail__field_indices_by_name, + 1, rpc__event__supp_dpp_fail__number_ranges, + (ProtobufCMessageInit) rpc__event__supp_dpp_fail__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_scan_stop__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__event__wifi_dpp_uri_ready__field_descriptors[2] = { { "resp", @@ -12485,55 +25735,50 @@ static const ProtobufCFieldDescriptor rpc__resp__wifi_scan_stop__field_descripto PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiScanStop, resp), + offsetof(RpcEventWifiDppUriReady, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "qrcode", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BYTES, + 0, /* quantifier_offset */ + offsetof(RpcEventWifiDppUriReady, qrcode), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_scan_stop__field_indices_by_name[] = { +static const unsigned rpc__event__wifi_dpp_uri_ready__field_indices_by_name[] = { + 1, /* field[1] = qrcode */ 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_scan_stop__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__event__wifi_dpp_uri_ready__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_scan_stop__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiScanStop", - "RpcRespWifiScanStop", - "RpcRespWifiScanStop", - "", - sizeof(RpcRespWifiScanStop), - 1, - rpc__resp__wifi_scan_stop__field_descriptors, - rpc__resp__wifi_scan_stop__field_indices_by_name, - 1, rpc__resp__wifi_scan_stop__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_scan_stop__init, - NULL,NULL,NULL /* reserved[123] */ + { 0, 2 } }; -#define rpc__req__wifi_scan_get_ap_num__field_descriptors NULL -#define rpc__req__wifi_scan_get_ap_num__field_indices_by_name NULL -#define rpc__req__wifi_scan_get_ap_num__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_scan_get_ap_num__descriptor = +const ProtobufCMessageDescriptor rpc__event__wifi_dpp_uri_ready__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiScanGetApNum", - "RpcReqWifiScanGetApNum", - "RpcReqWifiScanGetApNum", + "Rpc_Event_WifiDppUriReady", + "RpcEventWifiDppUriReady", + "RpcEventWifiDppUriReady", "", - sizeof(RpcReqWifiScanGetApNum), - 0, - rpc__req__wifi_scan_get_ap_num__field_descriptors, - rpc__req__wifi_scan_get_ap_num__field_indices_by_name, - 0, rpc__req__wifi_scan_get_ap_num__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_scan_get_ap_num__init, + sizeof(RpcEventWifiDppUriReady), + 2, + rpc__event__wifi_dpp_uri_ready__field_descriptors, + rpc__event__wifi_dpp_uri_ready__field_indices_by_name, + 1, rpc__event__wifi_dpp_uri_ready__number_ranges, + (ProtobufCMessageInit) rpc__event__wifi_dpp_uri_ready__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_scan_get_ap_num__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__event__wifi_dpp_cfg_recvd__field_descriptors[2] = { { "resp", @@ -12541,239 +25786,229 @@ static const ProtobufCFieldDescriptor rpc__resp__wifi_scan_get_ap_num__field_des PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiScanGetApNum, resp), + offsetof(RpcEventWifiDppCfgRecvd, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "number", + "cfg", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ - offsetof(RpcRespWifiScanGetApNum, number), - NULL, + offsetof(RpcEventWifiDppCfgRecvd, cfg), + &wifi_config__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_scan_get_ap_num__field_indices_by_name[] = { - 1, /* field[1] = number */ +static const unsigned rpc__event__wifi_dpp_cfg_recvd__field_indices_by_name[] = { + 1, /* field[1] = cfg */ 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_scan_get_ap_num__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__event__wifi_dpp_cfg_recvd__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_scan_get_ap_num__descriptor = +const ProtobufCMessageDescriptor rpc__event__wifi_dpp_cfg_recvd__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiScanGetApNum", - "RpcRespWifiScanGetApNum", - "RpcRespWifiScanGetApNum", + "Rpc_Event_WifiDppCfgRecvd", + "RpcEventWifiDppCfgRecvd", + "RpcEventWifiDppCfgRecvd", "", - sizeof(RpcRespWifiScanGetApNum), + sizeof(RpcEventWifiDppCfgRecvd), 2, - rpc__resp__wifi_scan_get_ap_num__field_descriptors, - rpc__resp__wifi_scan_get_ap_num__field_indices_by_name, - 1, rpc__resp__wifi_scan_get_ap_num__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_scan_get_ap_num__init, + rpc__event__wifi_dpp_cfg_recvd__field_descriptors, + rpc__event__wifi_dpp_cfg_recvd__field_indices_by_name, + 1, rpc__event__wifi_dpp_cfg_recvd__number_ranges, + (ProtobufCMessageInit) rpc__event__wifi_dpp_cfg_recvd__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__req__wifi_scan_get_ap_records__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__event__wifi_dpp_fail__field_descriptors[2] = { { - "number", + "resp", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcReqWifiScanGetApRecords, number), + offsetof(RpcEventWifiDppFail, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "reason", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcEventWifiDppFail, reason), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__req__wifi_scan_get_ap_records__field_indices_by_name[] = { - 0, /* field[0] = number */ +static const unsigned rpc__event__wifi_dpp_fail__field_indices_by_name[] = { + 1, /* field[1] = reason */ + 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__req__wifi_scan_get_ap_records__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__event__wifi_dpp_fail__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 1 } + { 0, 2 } }; -const ProtobufCMessageDescriptor rpc__req__wifi_scan_get_ap_records__descriptor = +const ProtobufCMessageDescriptor rpc__event__wifi_dpp_fail__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiScanGetApRecords", - "RpcReqWifiScanGetApRecords", - "RpcReqWifiScanGetApRecords", + "Rpc_Event_WifiDppFail", + "RpcEventWifiDppFail", + "RpcEventWifiDppFail", "", - sizeof(RpcReqWifiScanGetApRecords), - 1, - rpc__req__wifi_scan_get_ap_records__field_descriptors, - rpc__req__wifi_scan_get_ap_records__field_indices_by_name, - 1, rpc__req__wifi_scan_get_ap_records__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_scan_get_ap_records__init, + sizeof(RpcEventWifiDppFail), + 2, + rpc__event__wifi_dpp_fail__field_descriptors, + rpc__event__wifi_dpp_fail__field_indices_by_name, + 1, rpc__event__wifi_dpp_fail__number_ranges, + (ProtobufCMessageInit) rpc__event__wifi_dpp_fail__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_scan_get_ap_records__field_descriptors[3] = +static const ProtobufCFieldDescriptor rpc__gpio_config__field_descriptors[5] = { { - "resp", + "pin_bit_mask", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ - offsetof(RpcRespWifiScanGetApRecords, resp), + offsetof(RpcGpioConfig, pin_bit_mask), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "number", + "mode", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ - offsetof(RpcRespWifiScanGetApRecords, number), - NULL, + offsetof(RpcGpioConfig, mode), + &rpc__gpio_mode__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ap_records", + "pull_up_en", 3, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(RpcRespWifiScanGetApRecords, n_ap_records), - offsetof(RpcRespWifiScanGetApRecords, ap_records), - &wifi_ap_record__descriptor, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(RpcGpioConfig, pull_up_en), + NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_scan_get_ap_records__field_indices_by_name[] = { - 2, /* field[2] = ap_records */ - 1, /* field[1] = number */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_scan_get_ap_records__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 3 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_scan_get_ap_records__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiScanGetApRecords", - "RpcRespWifiScanGetApRecords", - "RpcRespWifiScanGetApRecords", - "", - sizeof(RpcRespWifiScanGetApRecords), - 3, - rpc__resp__wifi_scan_get_ap_records__field_descriptors, - rpc__resp__wifi_scan_get_ap_records__field_indices_by_name, - 1, rpc__resp__wifi_scan_get_ap_records__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_scan_get_ap_records__init, - NULL,NULL,NULL /* reserved[123] */ -}; -#define rpc__req__wifi_scan_get_ap_record__field_descriptors NULL -#define rpc__req__wifi_scan_get_ap_record__field_indices_by_name NULL -#define rpc__req__wifi_scan_get_ap_record__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_scan_get_ap_record__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiScanGetApRecord", - "RpcReqWifiScanGetApRecord", - "RpcReqWifiScanGetApRecord", - "", - sizeof(RpcReqWifiScanGetApRecord), - 0, - rpc__req__wifi_scan_get_ap_record__field_descriptors, - rpc__req__wifi_scan_get_ap_record__field_indices_by_name, - 0, rpc__req__wifi_scan_get_ap_record__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_scan_get_ap_record__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_scan_get_ap_record__field_descriptors[2] = -{ { - "resp", - 1, + "pull_down_en", + 4, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(RpcGpioConfig, pull_down_en), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "intr_type", + 5, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiScanGetApRecord, resp), + offsetof(RpcGpioConfig, intr_type), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__gpio_config__field_indices_by_name[] = { + 4, /* field[4] = intr_type */ + 1, /* field[1] = mode */ + 0, /* field[0] = pin_bit_mask */ + 3, /* field[3] = pull_down_en */ + 2, /* field[2] = pull_up_en */ +}; +static const ProtobufCIntRange rpc__gpio_config__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 5 } +}; +const ProtobufCMessageDescriptor rpc__gpio_config__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_GpioConfig", + "RpcGpioConfig", + "RpcGpioConfig", + "", + sizeof(RpcGpioConfig), + 5, + rpc__gpio_config__field_descriptors, + rpc__gpio_config__field_indices_by_name, + 1, rpc__gpio_config__number_ranges, + (ProtobufCMessageInit) rpc__gpio_config__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__gpio_config__field_descriptors[1] = +{ { - "ap_record", - 2, + "config", + 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ - offsetof(RpcRespWifiScanGetApRecord, ap_record), - &wifi_ap_record__descriptor, + offsetof(RpcReqGpioConfig, config), + &rpc__gpio_config__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_scan_get_ap_record__field_indices_by_name[] = { - 1, /* field[1] = ap_record */ - 0, /* field[0] = resp */ +static const unsigned rpc__req__gpio_config__field_indices_by_name[] = { + 0, /* field[0] = config */ }; -static const ProtobufCIntRange rpc__resp__wifi_scan_get_ap_record__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__gpio_config__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_scan_get_ap_record__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiScanGetApRecord", - "RpcRespWifiScanGetApRecord", - "RpcRespWifiScanGetApRecord", - "", - sizeof(RpcRespWifiScanGetApRecord), - 2, - rpc__resp__wifi_scan_get_ap_record__field_descriptors, - rpc__resp__wifi_scan_get_ap_record__field_indices_by_name, - 1, rpc__resp__wifi_scan_get_ap_record__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_scan_get_ap_record__init, - NULL,NULL,NULL /* reserved[123] */ + { 0, 1 } }; -#define rpc__req__wifi_clear_ap_list__field_descriptors NULL -#define rpc__req__wifi_clear_ap_list__field_indices_by_name NULL -#define rpc__req__wifi_clear_ap_list__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_clear_ap_list__descriptor = +const ProtobufCMessageDescriptor rpc__req__gpio_config__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiClearApList", - "RpcReqWifiClearApList", - "RpcReqWifiClearApList", + "Rpc_Req_GpioConfig", + "RpcReqGpioConfig", + "RpcReqGpioConfig", "", - sizeof(RpcReqWifiClearApList), - 0, - rpc__req__wifi_clear_ap_list__field_descriptors, - rpc__req__wifi_clear_ap_list__field_indices_by_name, - 0, rpc__req__wifi_clear_ap_list__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_clear_ap_list__init, + sizeof(RpcReqGpioConfig), + 1, + rpc__req__gpio_config__field_descriptors, + rpc__req__gpio_config__field_indices_by_name, + 1, rpc__req__gpio_config__number_ranges, + (ProtobufCMessageInit) rpc__req__gpio_config__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_clear_ap_list__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__gpio_config__field_descriptors[1] = { { "resp", @@ -12781,55 +26016,75 @@ static const ProtobufCFieldDescriptor rpc__resp__wifi_clear_ap_list__field_descr PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiClearApList, resp), + offsetof(RpcRespGpioConfig, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_clear_ap_list__field_indices_by_name[] = { +static const unsigned rpc__resp__gpio_config__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_clear_ap_list__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__gpio_config__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_clear_ap_list__descriptor = +const ProtobufCMessageDescriptor rpc__resp__gpio_config__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiClearApList", - "RpcRespWifiClearApList", - "RpcRespWifiClearApList", + "Rpc_Resp_GpioConfig", + "RpcRespGpioConfig", + "RpcRespGpioConfig", "", - sizeof(RpcRespWifiClearApList), + sizeof(RpcRespGpioConfig), 1, - rpc__resp__wifi_clear_ap_list__field_descriptors, - rpc__resp__wifi_clear_ap_list__field_indices_by_name, - 1, rpc__resp__wifi_clear_ap_list__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_clear_ap_list__init, + rpc__resp__gpio_config__field_descriptors, + rpc__resp__gpio_config__field_indices_by_name, + 1, rpc__resp__gpio_config__number_ranges, + (ProtobufCMessageInit) rpc__resp__gpio_config__init, NULL,NULL,NULL /* reserved[123] */ }; -#define rpc__req__wifi_restore__field_descriptors NULL -#define rpc__req__wifi_restore__field_indices_by_name NULL -#define rpc__req__wifi_restore__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_restore__descriptor = +static const ProtobufCFieldDescriptor rpc__req__gpio_reset__field_descriptors[1] = +{ + { + "gpio_num", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqGpioReset, gpio_num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__gpio_reset__field_indices_by_name[] = { + 0, /* field[0] = gpio_num */ +}; +static const ProtobufCIntRange rpc__req__gpio_reset__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__gpio_reset__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiRestore", - "RpcReqWifiRestore", - "RpcReqWifiRestore", + "Rpc_Req_GpioReset", + "RpcReqGpioReset", + "RpcReqGpioReset", "", - sizeof(RpcReqWifiRestore), - 0, - rpc__req__wifi_restore__field_descriptors, - rpc__req__wifi_restore__field_indices_by_name, - 0, rpc__req__wifi_restore__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_restore__init, + sizeof(RpcReqGpioReset), + 1, + rpc__req__gpio_reset__field_descriptors, + rpc__req__gpio_reset__field_indices_by_name, + 1, rpc__req__gpio_reset__number_ranges, + (ProtobufCMessageInit) rpc__req__gpio_reset__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_restore__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__gpio_reset_pin__field_descriptors[1] = { { "resp", @@ -12837,55 +26092,88 @@ static const ProtobufCFieldDescriptor rpc__resp__wifi_restore__field_descriptors PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiRestore, resp), + offsetof(RpcRespGpioResetPin, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_restore__field_indices_by_name[] = { +static const unsigned rpc__resp__gpio_reset_pin__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_restore__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__gpio_reset_pin__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_restore__descriptor = +const ProtobufCMessageDescriptor rpc__resp__gpio_reset_pin__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiRestore", - "RpcRespWifiRestore", - "RpcRespWifiRestore", + "Rpc_Resp_GpioResetPin", + "RpcRespGpioResetPin", + "RpcRespGpioResetPin", "", - sizeof(RpcRespWifiRestore), + sizeof(RpcRespGpioResetPin), 1, - rpc__resp__wifi_restore__field_descriptors, - rpc__resp__wifi_restore__field_indices_by_name, - 1, rpc__resp__wifi_restore__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_restore__init, + rpc__resp__gpio_reset_pin__field_descriptors, + rpc__resp__gpio_reset_pin__field_indices_by_name, + 1, rpc__resp__gpio_reset_pin__number_ranges, + (ProtobufCMessageInit) rpc__resp__gpio_reset_pin__init, NULL,NULL,NULL /* reserved[123] */ }; -#define rpc__req__wifi_clear_fast_connect__field_descriptors NULL -#define rpc__req__wifi_clear_fast_connect__field_indices_by_name NULL -#define rpc__req__wifi_clear_fast_connect__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_clear_fast_connect__descriptor = +static const ProtobufCFieldDescriptor rpc__req__gpio_set_level__field_descriptors[2] = +{ + { + "gpio_num", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqGpioSetLevel, gpio_num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "level", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(RpcReqGpioSetLevel, level), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__gpio_set_level__field_indices_by_name[] = { + 0, /* field[0] = gpio_num */ + 1, /* field[1] = level */ +}; +static const ProtobufCIntRange rpc__req__gpio_set_level__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__req__gpio_set_level__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiClearFastConnect", - "RpcReqWifiClearFastConnect", - "RpcReqWifiClearFastConnect", + "Rpc_Req_GpioSetLevel", + "RpcReqGpioSetLevel", + "RpcReqGpioSetLevel", "", - sizeof(RpcReqWifiClearFastConnect), - 0, - rpc__req__wifi_clear_fast_connect__field_descriptors, - rpc__req__wifi_clear_fast_connect__field_indices_by_name, - 0, rpc__req__wifi_clear_fast_connect__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_clear_fast_connect__init, + sizeof(RpcReqGpioSetLevel), + 2, + rpc__req__gpio_set_level__field_descriptors, + rpc__req__gpio_set_level__field_indices_by_name, + 1, rpc__req__gpio_set_level__number_ranges, + (ProtobufCMessageInit) rpc__req__gpio_set_level__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_clear_fast_connect__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__gpio_set_level__field_descriptors[1] = { { "resp", @@ -12893,75 +26181,75 @@ static const ProtobufCFieldDescriptor rpc__resp__wifi_clear_fast_connect__field_ PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiClearFastConnect, resp), + offsetof(RpcRespGpioSetLevel, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_clear_fast_connect__field_indices_by_name[] = { +static const unsigned rpc__resp__gpio_set_level__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_clear_fast_connect__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__gpio_set_level__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_clear_fast_connect__descriptor = +const ProtobufCMessageDescriptor rpc__resp__gpio_set_level__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiClearFastConnect", - "RpcRespWifiClearFastConnect", - "RpcRespWifiClearFastConnect", + "Rpc_Resp_GpioSetLevel", + "RpcRespGpioSetLevel", + "RpcRespGpioSetLevel", "", - sizeof(RpcRespWifiClearFastConnect), + sizeof(RpcRespGpioSetLevel), 1, - rpc__resp__wifi_clear_fast_connect__field_descriptors, - rpc__resp__wifi_clear_fast_connect__field_indices_by_name, - 1, rpc__resp__wifi_clear_fast_connect__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_clear_fast_connect__init, + rpc__resp__gpio_set_level__field_descriptors, + rpc__resp__gpio_set_level__field_indices_by_name, + 1, rpc__resp__gpio_set_level__number_ranges, + (ProtobufCMessageInit) rpc__resp__gpio_set_level__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__req__wifi_deauth_sta__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__req__gpio_get_level__field_descriptors[1] = { { - "aid", + "gpio_num", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcReqWifiDeauthSta, aid), + offsetof(RpcReqGpioGetLevel, gpio_num), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__req__wifi_deauth_sta__field_indices_by_name[] = { - 0, /* field[0] = aid */ +static const unsigned rpc__req__gpio_get_level__field_indices_by_name[] = { + 0, /* field[0] = gpio_num */ }; -static const ProtobufCIntRange rpc__req__wifi_deauth_sta__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__gpio_get_level__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__req__wifi_deauth_sta__descriptor = +const ProtobufCMessageDescriptor rpc__req__gpio_get_level__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiDeauthSta", - "RpcReqWifiDeauthSta", - "RpcReqWifiDeauthSta", + "Rpc_Req_GpioGetLevel", + "RpcReqGpioGetLevel", + "RpcReqGpioGetLevel", "", - sizeof(RpcReqWifiDeauthSta), + sizeof(RpcReqGpioGetLevel), 1, - rpc__req__wifi_deauth_sta__field_descriptors, - rpc__req__wifi_deauth_sta__field_indices_by_name, - 1, rpc__req__wifi_deauth_sta__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_deauth_sta__init, + rpc__req__gpio_get_level__field_descriptors, + rpc__req__gpio_get_level__field_indices_by_name, + 1, rpc__req__gpio_get_level__number_ranges, + (ProtobufCMessageInit) rpc__req__gpio_get_level__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_deauth_sta__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__resp__gpio_get_level__field_descriptors[2] = { { "resp", @@ -12969,170 +26257,266 @@ static const ProtobufCFieldDescriptor rpc__resp__wifi_deauth_sta__field_descript PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiDeauthSta, resp), + offsetof(RpcRespGpioGetLevel, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "aid", + "level", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiDeauthSta, aid), + offsetof(RpcRespGpioGetLevel, level), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_deauth_sta__field_indices_by_name[] = { - 1, /* field[1] = aid */ +static const unsigned rpc__resp__gpio_get_level__field_indices_by_name[] = { + 1, /* field[1] = level */ 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_deauth_sta__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__gpio_get_level__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_deauth_sta__descriptor = +const ProtobufCMessageDescriptor rpc__resp__gpio_get_level__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiDeauthSta", - "RpcRespWifiDeauthSta", - "RpcRespWifiDeauthSta", + "Rpc_Resp_GpioGetLevel", + "RpcRespGpioGetLevel", + "RpcRespGpioGetLevel", "", - sizeof(RpcRespWifiDeauthSta), + sizeof(RpcRespGpioGetLevel), 2, - rpc__resp__wifi_deauth_sta__field_descriptors, - rpc__resp__wifi_deauth_sta__field_indices_by_name, - 1, rpc__resp__wifi_deauth_sta__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_deauth_sta__init, + rpc__resp__gpio_get_level__field_descriptors, + rpc__resp__gpio_get_level__field_indices_by_name, + 1, rpc__resp__gpio_get_level__number_ranges, + (ProtobufCMessageInit) rpc__resp__gpio_get_level__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__req__gpio_set_direction__field_descriptors[2] = +{ + { + "gpio_num", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcReqGpioSetDirection, gpio_num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "mode", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_ENUM, + 0, /* quantifier_offset */ + offsetof(RpcReqGpioSetDirection, mode), + &rpc__gpio_mode__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__req__gpio_set_direction__field_indices_by_name[] = { + 0, /* field[0] = gpio_num */ + 1, /* field[1] = mode */ +}; +static const ProtobufCIntRange rpc__req__gpio_set_direction__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor rpc__req__gpio_set_direction__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_GpioSetDirection", + "RpcReqGpioSetDirection", + "RpcReqGpioSetDirection", + "", + sizeof(RpcReqGpioSetDirection), + 2, + rpc__req__gpio_set_direction__field_descriptors, + rpc__req__gpio_set_direction__field_indices_by_name, + 1, rpc__req__gpio_set_direction__number_ranges, + (ProtobufCMessageInit) rpc__req__gpio_set_direction__init, NULL,NULL,NULL /* reserved[123] */ }; -#define rpc__req__wifi_sta_get_ap_info__field_descriptors NULL -#define rpc__req__wifi_sta_get_ap_info__field_indices_by_name NULL -#define rpc__req__wifi_sta_get_ap_info__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_sta_get_ap_info__descriptor = +static const ProtobufCFieldDescriptor rpc__resp__gpio_set_direction__field_descriptors[1] = +{ + { + "resp", + 1, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_INT32, + 0, /* quantifier_offset */ + offsetof(RpcRespGpioSetDirection, resp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned rpc__resp__gpio_set_direction__field_indices_by_name[] = { + 0, /* field[0] = resp */ +}; +static const ProtobufCIntRange rpc__resp__gpio_set_direction__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__resp__gpio_set_direction__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiStaGetApInfo", - "RpcReqWifiStaGetApInfo", - "RpcReqWifiStaGetApInfo", + "Rpc_Resp_GpioSetDirection", + "RpcRespGpioSetDirection", + "RpcRespGpioSetDirection", "", - sizeof(RpcReqWifiStaGetApInfo), - 0, - rpc__req__wifi_sta_get_ap_info__field_descriptors, - rpc__req__wifi_sta_get_ap_info__field_indices_by_name, - 0, rpc__req__wifi_sta_get_ap_info__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_sta_get_ap_info__init, + sizeof(RpcRespGpioSetDirection), + 1, + rpc__resp__gpio_set_direction__field_descriptors, + rpc__resp__gpio_set_direction__field_indices_by_name, + 1, rpc__resp__gpio_set_direction__number_ranges, + (ProtobufCMessageInit) rpc__resp__gpio_set_direction__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_get_ap_info__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__req__gpio_input_enable__field_descriptors[1] = { { - "resp", + "gpio_num", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiStaGetApInfo, resp), + offsetof(RpcReqGpioInputEnable, gpio_num), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, +}; +static const unsigned rpc__req__gpio_input_enable__field_indices_by_name[] = { + 0, /* field[0] = gpio_num */ +}; +static const ProtobufCIntRange rpc__req__gpio_input_enable__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor rpc__req__gpio_input_enable__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Rpc_Req_GpioInputEnable", + "RpcReqGpioInputEnable", + "RpcReqGpioInputEnable", + "", + sizeof(RpcReqGpioInputEnable), + 1, + rpc__req__gpio_input_enable__field_descriptors, + rpc__req__gpio_input_enable__field_indices_by_name, + 1, rpc__req__gpio_input_enable__number_ranges, + (ProtobufCMessageInit) rpc__req__gpio_input_enable__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor rpc__resp__gpio_input_enable__field_descriptors[1] = +{ { - "ap_record", - 2, + "resp", + 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, + PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiStaGetApInfo, ap_record), - &wifi_ap_record__descriptor, + offsetof(RpcRespGpioInputEnable, resp), + NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_sta_get_ap_info__field_indices_by_name[] = { - 1, /* field[1] = ap_record */ +static const unsigned rpc__resp__gpio_input_enable__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_sta_get_ap_info__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__gpio_input_enable__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } + { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_sta_get_ap_info__descriptor = +const ProtobufCMessageDescriptor rpc__resp__gpio_input_enable__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiStaGetApInfo", - "RpcRespWifiStaGetApInfo", - "RpcRespWifiStaGetApInfo", + "Rpc_Resp_GpioInputEnable", + "RpcRespGpioInputEnable", + "RpcRespGpioInputEnable", "", - sizeof(RpcRespWifiStaGetApInfo), - 2, - rpc__resp__wifi_sta_get_ap_info__field_descriptors, - rpc__resp__wifi_sta_get_ap_info__field_indices_by_name, - 1, rpc__resp__wifi_sta_get_ap_info__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_sta_get_ap_info__init, + sizeof(RpcRespGpioInputEnable), + 1, + rpc__resp__gpio_input_enable__field_descriptors, + rpc__resp__gpio_input_enable__field_indices_by_name, + 1, rpc__resp__gpio_input_enable__number_ranges, + (ProtobufCMessageInit) rpc__resp__gpio_input_enable__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__req__wifi_set_protocol__field_descriptors[2] = +static const ProtobufCFieldDescriptor rpc__req__gpio_set_pull_mode__field_descriptors[2] = { { - "ifx", + "gpio_num", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetProtocol, ifx), + offsetof(RpcReqGpioSetPullMode, gpio_num), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "protocol_bitmap", + "pull", 2, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetProtocol, protocol_bitmap), - NULL, + offsetof(RpcReqGpioSetPullMode, pull), + &rpc__gpio_pull_mode__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__req__wifi_set_protocol__field_indices_by_name[] = { - 0, /* field[0] = ifx */ - 1, /* field[1] = protocol_bitmap */ +static const unsigned rpc__req__gpio_set_pull_mode__field_indices_by_name[] = { + 0, /* field[0] = gpio_num */ + 1, /* field[1] = pull */ }; -static const ProtobufCIntRange rpc__req__wifi_set_protocol__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__req__gpio_set_pull_mode__number_ranges[1 + 1] = { { 1, 0 }, { 0, 2 } }; -const ProtobufCMessageDescriptor rpc__req__wifi_set_protocol__descriptor = +const ProtobufCMessageDescriptor rpc__req__gpio_set_pull_mode__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiSetProtocol", - "RpcReqWifiSetProtocol", - "RpcReqWifiSetProtocol", + "Rpc_Req_GpioSetPullMode", + "RpcReqGpioSetPullMode", + "RpcReqGpioSetPullMode", "", - sizeof(RpcReqWifiSetProtocol), + sizeof(RpcReqGpioSetPullMode), 2, - rpc__req__wifi_set_protocol__field_descriptors, - rpc__req__wifi_set_protocol__field_indices_by_name, - 1, rpc__req__wifi_set_protocol__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_set_protocol__init, + rpc__req__gpio_set_pull_mode__field_descriptors, + rpc__req__gpio_set_pull_mode__field_indices_by_name, + 1, rpc__req__gpio_set_pull_mode__number_ranges, + (ProtobufCMessageInit) rpc__req__gpio_set_pull_mode__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__resp__wifi_set_protocol__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__resp__gpio_set_pull_mode__field_descriptors[1] = { { "resp", @@ -13140,4055 +26524,3104 @@ static const ProtobufCFieldDescriptor rpc__resp__wifi_set_protocol__field_descri PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ - offsetof(RpcRespWifiSetProtocol, resp), + offsetof(RpcRespGpioSetPullMode, resp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; -static const unsigned rpc__resp__wifi_set_protocol__field_indices_by_name[] = { +static const unsigned rpc__resp__gpio_set_pull_mode__field_indices_by_name[] = { 0, /* field[0] = resp */ }; -static const ProtobufCIntRange rpc__resp__wifi_set_protocol__number_ranges[1 + 1] = +static const ProtobufCIntRange rpc__resp__gpio_set_pull_mode__number_ranges[1 + 1] = { { 1, 0 }, { 0, 1 } }; -const ProtobufCMessageDescriptor rpc__resp__wifi_set_protocol__descriptor = +const ProtobufCMessageDescriptor rpc__resp__gpio_set_pull_mode__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiSetProtocol", - "RpcRespWifiSetProtocol", - "RpcRespWifiSetProtocol", + "Rpc_Resp_GpioSetPullMode", + "RpcRespGpioSetPullMode", + "RpcRespGpioSetPullMode", "", - sizeof(RpcRespWifiSetProtocol), + sizeof(RpcRespGpioSetPullMode), 1, - rpc__resp__wifi_set_protocol__field_descriptors, - rpc__resp__wifi_set_protocol__field_indices_by_name, - 1, rpc__resp__wifi_set_protocol__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_set_protocol__init, + rpc__resp__gpio_set_pull_mode__field_descriptors, + rpc__resp__gpio_set_pull_mode__field_indices_by_name, + 1, rpc__resp__gpio_set_pull_mode__number_ranges, + (ProtobufCMessageInit) rpc__resp__gpio_set_pull_mode__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor rpc__req__wifi_get_protocol__field_descriptors[1] = +static const ProtobufCFieldDescriptor rpc__field_descriptors[234] = { { - "ifx", + "msg_type", 1, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ - offsetof(RpcReqWifiGetProtocol, ifx), + offsetof(Rpc, msg_type), + &rpc_type__descriptor, NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "msg_id", + 2, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_ENUM, + 0, /* quantifier_offset */ + offsetof(Rpc, msg_id), + &rpc_id__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__req__wifi_get_protocol__field_indices_by_name[] = { - 0, /* field[0] = ifx */ -}; -static const ProtobufCIntRange rpc__req__wifi_get_protocol__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__req__wifi_get_protocol__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiGetProtocol", - "RpcReqWifiGetProtocol", - "RpcReqWifiGetProtocol", - "", - sizeof(RpcReqWifiGetProtocol), - 1, - rpc__req__wifi_get_protocol__field_descriptors, - rpc__req__wifi_get_protocol__field_indices_by_name, - 1, rpc__req__wifi_get_protocol__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_get_protocol__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_get_protocol__field_descriptors[2] = -{ { - "resp", - 1, + "uid", + 3, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Rpc, uid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_get_mac_address", + 257, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_get_mac_address), + &rpc__req__get_mac_address__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_set_mac_address", + 258, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_set_mac_address), + &rpc__req__set_mac_address__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_get_wifi_mode", + 259, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_get_wifi_mode), + &rpc__req__get_mode__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_set_wifi_mode", + 260, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_set_wifi_mode), + &rpc__req__set_mode__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_supp_dpp_init", + 261, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_supp_dpp_init), + &rpc__req__supp_dpp_init__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_supp_dpp_deinit", + 262, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_supp_dpp_deinit), + &rpc__req__supp_dpp_deinit__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_supp_dpp_bootstrap_gen", + 263, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_supp_dpp_bootstrap_gen), + &rpc__req__supp_dpp_bootstrap_gen__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_supp_dpp_start_listen", + 264, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_supp_dpp_start_listen), + &rpc__req__supp_dpp_start_listen__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_supp_dpp_stop_listen", + 265, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_supp_dpp_stop_listen), + &rpc__req__supp_dpp_stop_listen__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_ota_activate", + 266, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_ota_activate), + &rpc__req__otaactivate__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_wifi_set_ps", + 270, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_set_ps), + &rpc__req__set_ps__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_wifi_get_ps", + 271, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetProtocol, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_get_ps), + &rpc__req__get_ps__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "protocol_bitmap", - 2, + "req_ota_begin", + 272, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetProtocol, protocol_bitmap), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_ota_begin), + &rpc__req__otabegin__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_get_protocol__field_indices_by_name[] = { - 1, /* field[1] = protocol_bitmap */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_get_protocol__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_get_protocol__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiGetProtocol", - "RpcRespWifiGetProtocol", - "RpcRespWifiGetProtocol", - "", - sizeof(RpcRespWifiGetProtocol), - 2, - rpc__resp__wifi_get_protocol__field_descriptors, - rpc__resp__wifi_get_protocol__field_indices_by_name, - 1, rpc__resp__wifi_get_protocol__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_get_protocol__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__req__wifi_set_bandwidth__field_descriptors[2] = -{ { - "ifx", - 1, + "req_ota_write", + 273, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetBandwidth, ifx), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_ota_write), + &rpc__req__otawrite__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "bw", - 2, + "req_ota_end", + 274, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetBandwidth, bw), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_ota_end), + &rpc__req__otaend__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__req__wifi_set_bandwidth__field_indices_by_name[] = { - 1, /* field[1] = bw */ - 0, /* field[0] = ifx */ -}; -static const ProtobufCIntRange rpc__req__wifi_set_bandwidth__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__req__wifi_set_bandwidth__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiSetBandwidth", - "RpcReqWifiSetBandwidth", - "RpcReqWifiSetBandwidth", - "", - sizeof(RpcReqWifiSetBandwidth), - 2, - rpc__req__wifi_set_bandwidth__field_descriptors, - rpc__req__wifi_set_bandwidth__field_indices_by_name, - 1, rpc__req__wifi_set_bandwidth__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_set_bandwidth__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_set_bandwidth__field_descriptors[1] = -{ { - "resp", - 1, + "req_set_wifi_max_tx_power", + 275, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiSetBandwidth, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_set_wifi_max_tx_power), + &rpc__req__wifi_set_max_tx_power__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_set_bandwidth__field_indices_by_name[] = { - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_set_bandwidth__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_set_bandwidth__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiSetBandwidth", - "RpcRespWifiSetBandwidth", - "RpcRespWifiSetBandwidth", - "", - sizeof(RpcRespWifiSetBandwidth), - 1, - rpc__resp__wifi_set_bandwidth__field_descriptors, - rpc__resp__wifi_set_bandwidth__field_indices_by_name, - 1, rpc__resp__wifi_set_bandwidth__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_set_bandwidth__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__req__wifi_get_bandwidth__field_descriptors[1] = -{ { - "ifx", - 1, + "req_get_wifi_max_tx_power", + 276, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiGetBandwidth, ifx), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_get_wifi_max_tx_power), + &rpc__req__wifi_get_max_tx_power__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__req__wifi_get_bandwidth__field_indices_by_name[] = { - 0, /* field[0] = ifx */ -}; -static const ProtobufCIntRange rpc__req__wifi_get_bandwidth__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__req__wifi_get_bandwidth__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiGetBandwidth", - "RpcReqWifiGetBandwidth", - "RpcReqWifiGetBandwidth", - "", - sizeof(RpcReqWifiGetBandwidth), - 1, - rpc__req__wifi_get_bandwidth__field_descriptors, - rpc__req__wifi_get_bandwidth__field_indices_by_name, - 1, rpc__req__wifi_get_bandwidth__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_get_bandwidth__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_get_bandwidth__field_descriptors[2] = -{ { - "resp", - 1, + "req_config_heartbeat", + 277, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetBandwidth, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_config_heartbeat), + &rpc__req__config_heartbeat__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "bw", - 2, + "req_wifi_init", + 278, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetBandwidth, bw), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_init), + &rpc__req__wifi_init__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_wifi_deinit", + 279, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_deinit), + &rpc__req__wifi_deinit__descriptor, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_get_bandwidth__field_indices_by_name[] = { - 1, /* field[1] = bw */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_get_bandwidth__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_get_bandwidth__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiGetBandwidth", - "RpcRespWifiGetBandwidth", - "RpcRespWifiGetBandwidth", - "", - sizeof(RpcRespWifiGetBandwidth), - 2, - rpc__resp__wifi_get_bandwidth__field_descriptors, - rpc__resp__wifi_get_bandwidth__field_indices_by_name, - 1, rpc__resp__wifi_get_bandwidth__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_get_bandwidth__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__req__wifi_set_channel__field_descriptors[2] = -{ { - "primary", - 1, + "req_wifi_start", + 280, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetChannel, primary), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_start), + &rpc__req__wifi_start__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "second", - 2, + "req_wifi_stop", + 281, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetChannel, second), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_stop), + &rpc__req__wifi_stop__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__req__wifi_set_channel__field_indices_by_name[] = { - 0, /* field[0] = primary */ - 1, /* field[1] = second */ -}; -static const ProtobufCIntRange rpc__req__wifi_set_channel__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__req__wifi_set_channel__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiSetChannel", - "RpcReqWifiSetChannel", - "RpcReqWifiSetChannel", - "", - sizeof(RpcReqWifiSetChannel), - 2, - rpc__req__wifi_set_channel__field_descriptors, - rpc__req__wifi_set_channel__field_indices_by_name, - 1, rpc__req__wifi_set_channel__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_set_channel__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_set_channel__field_descriptors[1] = -{ { - "resp", - 1, + "req_wifi_connect", + 282, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiSetChannel, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_connect), + &rpc__req__wifi_connect__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_set_channel__field_indices_by_name[] = { - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_set_channel__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_set_channel__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiSetChannel", - "RpcRespWifiSetChannel", - "RpcRespWifiSetChannel", - "", - sizeof(RpcRespWifiSetChannel), - 1, - rpc__resp__wifi_set_channel__field_descriptors, - rpc__resp__wifi_set_channel__field_indices_by_name, - 1, rpc__resp__wifi_set_channel__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_set_channel__init, - NULL,NULL,NULL /* reserved[123] */ -}; -#define rpc__req__wifi_get_channel__field_descriptors NULL -#define rpc__req__wifi_get_channel__field_indices_by_name NULL -#define rpc__req__wifi_get_channel__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_get_channel__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiGetChannel", - "RpcReqWifiGetChannel", - "RpcReqWifiGetChannel", - "", - sizeof(RpcReqWifiGetChannel), - 0, - rpc__req__wifi_get_channel__field_descriptors, - rpc__req__wifi_get_channel__field_indices_by_name, - 0, rpc__req__wifi_get_channel__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_get_channel__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_get_channel__field_descriptors[3] = -{ { - "resp", - 1, + "req_wifi_disconnect", + 283, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetChannel, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_disconnect), + &rpc__req__wifi_disconnect__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "primary", - 2, + "req_wifi_set_config", + 284, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetChannel, primary), + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_set_config), + &rpc__req__wifi_set_config__descriptor, NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_wifi_get_config", + 285, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_get_config), + &rpc__req__wifi_get_config__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "second", - 3, + "req_wifi_scan_start", + 286, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetChannel, second), + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_scan_start), + &rpc__req__wifi_scan_start__descriptor, NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_wifi_scan_stop", + 287, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_scan_stop), + &rpc__req__wifi_scan_stop__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_get_channel__field_indices_by_name[] = { - 1, /* field[1] = primary */ - 0, /* field[0] = resp */ - 2, /* field[2] = second */ -}; -static const ProtobufCIntRange rpc__resp__wifi_get_channel__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 3 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_get_channel__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiGetChannel", - "RpcRespWifiGetChannel", - "RpcRespWifiGetChannel", - "", - sizeof(RpcRespWifiGetChannel), - 3, - rpc__resp__wifi_get_channel__field_descriptors, - rpc__resp__wifi_get_channel__field_indices_by_name, - 1, rpc__resp__wifi_get_channel__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_get_channel__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__req__wifi_set_storage__field_descriptors[1] = -{ { - "storage", - 1, + "req_wifi_scan_get_ap_num", + 288, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetStorage, storage), + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_scan_get_ap_num), + &rpc__req__wifi_scan_get_ap_num__descriptor, NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_wifi_scan_get_ap_records", + 289, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_scan_get_ap_records), + &rpc__req__wifi_scan_get_ap_records__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__req__wifi_set_storage__field_indices_by_name[] = { - 0, /* field[0] = storage */ -}; -static const ProtobufCIntRange rpc__req__wifi_set_storage__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__req__wifi_set_storage__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiSetStorage", - "RpcReqWifiSetStorage", - "RpcReqWifiSetStorage", - "", - sizeof(RpcReqWifiSetStorage), - 1, - rpc__req__wifi_set_storage__field_descriptors, - rpc__req__wifi_set_storage__field_indices_by_name, - 1, rpc__req__wifi_set_storage__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_set_storage__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_set_storage__field_descriptors[1] = -{ { - "resp", - 1, + "req_wifi_clear_ap_list", + 290, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiSetStorage, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_clear_ap_list), + &rpc__req__wifi_clear_ap_list__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_set_storage__field_indices_by_name[] = { - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_set_storage__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_set_storage__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiSetStorage", - "RpcRespWifiSetStorage", - "RpcRespWifiSetStorage", - "", - sizeof(RpcRespWifiSetStorage), - 1, - rpc__resp__wifi_set_storage__field_descriptors, - rpc__resp__wifi_set_storage__field_indices_by_name, - 1, rpc__resp__wifi_set_storage__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_set_storage__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__req__wifi_set_country_code__field_descriptors[2] = -{ { - "country", - 1, + "req_wifi_restore", + 291, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetCountryCode, country), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_restore), + &rpc__req__wifi_restore__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ieee80211d_enabled", - 2, + "req_wifi_clear_fast_connect", + 292, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetCountryCode, ieee80211d_enabled), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_clear_fast_connect), + &rpc__req__wifi_clear_fast_connect__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__req__wifi_set_country_code__field_indices_by_name[] = { - 0, /* field[0] = country */ - 1, /* field[1] = ieee80211d_enabled */ -}; -static const ProtobufCIntRange rpc__req__wifi_set_country_code__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__req__wifi_set_country_code__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiSetCountryCode", - "RpcReqWifiSetCountryCode", - "RpcReqWifiSetCountryCode", - "", - sizeof(RpcReqWifiSetCountryCode), - 2, - rpc__req__wifi_set_country_code__field_descriptors, - rpc__req__wifi_set_country_code__field_indices_by_name, - 1, rpc__req__wifi_set_country_code__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_set_country_code__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_set_country_code__field_descriptors[1] = -{ { - "resp", - 1, + "req_wifi_deauth_sta", + 293, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiSetCountryCode, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_deauth_sta), + &rpc__req__wifi_deauth_sta__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_set_country_code__field_indices_by_name[] = { - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_set_country_code__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_set_country_code__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiSetCountryCode", - "RpcRespWifiSetCountryCode", - "RpcRespWifiSetCountryCode", - "", - sizeof(RpcRespWifiSetCountryCode), - 1, - rpc__resp__wifi_set_country_code__field_descriptors, - rpc__resp__wifi_set_country_code__field_indices_by_name, - 1, rpc__resp__wifi_set_country_code__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_set_country_code__init, - NULL,NULL,NULL /* reserved[123] */ -}; -#define rpc__req__wifi_get_country_code__field_descriptors NULL -#define rpc__req__wifi_get_country_code__field_indices_by_name NULL -#define rpc__req__wifi_get_country_code__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_get_country_code__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiGetCountryCode", - "RpcReqWifiGetCountryCode", - "RpcReqWifiGetCountryCode", - "", - sizeof(RpcReqWifiGetCountryCode), - 0, - rpc__req__wifi_get_country_code__field_descriptors, - rpc__req__wifi_get_country_code__field_indices_by_name, - 0, rpc__req__wifi_get_country_code__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_get_country_code__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_get_country_code__field_descriptors[2] = -{ { - "resp", - 1, + "req_wifi_sta_get_ap_info", + 294, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetCountryCode, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_sta_get_ap_info), + &rpc__req__wifi_sta_get_ap_info__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "country", - 2, + "req_wifi_set_protocol", + 297, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetCountryCode, country), + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_set_protocol), + &rpc__req__wifi_set_protocol__descriptor, NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_wifi_get_protocol", + 298, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_get_protocol), + &rpc__req__wifi_get_protocol__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_get_country_code__field_indices_by_name[] = { - 1, /* field[1] = country */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_get_country_code__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_get_country_code__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiGetCountryCode", - "RpcRespWifiGetCountryCode", - "RpcRespWifiGetCountryCode", - "", - sizeof(RpcRespWifiGetCountryCode), - 2, - rpc__resp__wifi_get_country_code__field_descriptors, - rpc__resp__wifi_get_country_code__field_indices_by_name, - 1, rpc__resp__wifi_get_country_code__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_get_country_code__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__req__wifi_set_country__field_descriptors[1] = -{ { - "country", - 1, + "req_wifi_set_bandwidth", + 299, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetCountry, country), - &wifi_country__descriptor, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_set_bandwidth), + &rpc__req__wifi_set_bandwidth__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__req__wifi_set_country__field_indices_by_name[] = { - 0, /* field[0] = country */ -}; -static const ProtobufCIntRange rpc__req__wifi_set_country__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__req__wifi_set_country__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiSetCountry", - "RpcReqWifiSetCountry", - "RpcReqWifiSetCountry", - "", - sizeof(RpcReqWifiSetCountry), - 1, - rpc__req__wifi_set_country__field_descriptors, - rpc__req__wifi_set_country__field_indices_by_name, - 1, rpc__req__wifi_set_country__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_set_country__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_set_country__field_descriptors[1] = -{ { - "resp", - 1, + "req_wifi_get_bandwidth", + 300, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiSetCountry, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_get_bandwidth), + &rpc__req__wifi_get_bandwidth__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_set_country__field_indices_by_name[] = { - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_set_country__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_set_country__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiSetCountry", - "RpcRespWifiSetCountry", - "RpcRespWifiSetCountry", - "", - sizeof(RpcRespWifiSetCountry), - 1, - rpc__resp__wifi_set_country__field_descriptors, - rpc__resp__wifi_set_country__field_indices_by_name, - 1, rpc__resp__wifi_set_country__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_set_country__init, - NULL,NULL,NULL /* reserved[123] */ -}; -#define rpc__req__wifi_get_country__field_descriptors NULL -#define rpc__req__wifi_get_country__field_indices_by_name NULL -#define rpc__req__wifi_get_country__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_get_country__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiGetCountry", - "RpcReqWifiGetCountry", - "RpcReqWifiGetCountry", - "", - sizeof(RpcReqWifiGetCountry), - 0, - rpc__req__wifi_get_country__field_descriptors, - rpc__req__wifi_get_country__field_indices_by_name, - 0, rpc__req__wifi_get_country__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_get_country__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_get_country__field_descriptors[2] = -{ { - "resp", - 1, + "req_wifi_set_channel", + 301, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetCountry, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_set_channel), + &rpc__req__wifi_set_channel__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "country", - 2, + "req_wifi_get_channel", + 302, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetCountry, country), - &wifi_country__descriptor, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_get_channel), + &rpc__req__wifi_get_channel__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_get_country__field_indices_by_name[] = { - 1, /* field[1] = country */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_get_country__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_get_country__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiGetCountry", - "RpcRespWifiGetCountry", - "RpcRespWifiGetCountry", - "", - sizeof(RpcRespWifiGetCountry), - 2, - rpc__resp__wifi_get_country__field_descriptors, - rpc__resp__wifi_get_country__field_indices_by_name, - 1, rpc__resp__wifi_get_country__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_get_country__init, - NULL,NULL,NULL /* reserved[123] */ -}; -#define rpc__req__wifi_ap_get_sta_list__field_descriptors NULL -#define rpc__req__wifi_ap_get_sta_list__field_indices_by_name NULL -#define rpc__req__wifi_ap_get_sta_list__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_ap_get_sta_list__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiApGetStaList", - "RpcReqWifiApGetStaList", - "RpcReqWifiApGetStaList", - "", - sizeof(RpcReqWifiApGetStaList), - 0, - rpc__req__wifi_ap_get_sta_list__field_descriptors, - rpc__req__wifi_ap_get_sta_list__field_indices_by_name, - 0, rpc__req__wifi_ap_get_sta_list__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_ap_get_sta_list__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_ap_get_sta_list__field_descriptors[2] = -{ { - "resp", - 1, + "req_wifi_set_country", + 303, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiApGetStaList, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_set_country), + &rpc__req__wifi_set_country__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "sta_list", - 2, + "req_wifi_get_country", + 304, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiApGetStaList, sta_list), - &wifi_sta_list__descriptor, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_get_country), + &rpc__req__wifi_get_country__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_ap_get_sta_list__field_indices_by_name[] = { - 0, /* field[0] = resp */ - 1, /* field[1] = sta_list */ -}; -static const ProtobufCIntRange rpc__resp__wifi_ap_get_sta_list__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_ap_get_sta_list__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiApGetStaList", - "RpcRespWifiApGetStaList", - "RpcRespWifiApGetStaList", - "", - sizeof(RpcRespWifiApGetStaList), - 2, - rpc__resp__wifi_ap_get_sta_list__field_descriptors, - rpc__resp__wifi_ap_get_sta_list__field_indices_by_name, - 1, rpc__resp__wifi_ap_get_sta_list__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_ap_get_sta_list__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__req__wifi_ap_get_sta_aid__field_descriptors[1] = -{ { - "mac", - 1, + "req_wifi_ap_get_sta_list", + 311, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiApGetStaAid, mac), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_ap_get_sta_list), + &rpc__req__wifi_ap_get_sta_list__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__req__wifi_ap_get_sta_aid__field_indices_by_name[] = { - 0, /* field[0] = mac */ -}; -static const ProtobufCIntRange rpc__req__wifi_ap_get_sta_aid__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__req__wifi_ap_get_sta_aid__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiApGetStaAid", - "RpcReqWifiApGetStaAid", - "RpcReqWifiApGetStaAid", - "", - sizeof(RpcReqWifiApGetStaAid), - 1, - rpc__req__wifi_ap_get_sta_aid__field_descriptors, - rpc__req__wifi_ap_get_sta_aid__field_indices_by_name, - 1, rpc__req__wifi_ap_get_sta_aid__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_ap_get_sta_aid__init, - NULL,NULL,NULL /* reserved[123] */ -}; -#define rpc__req__wifi_sta_get_negotiated_phymode__field_descriptors NULL -#define rpc__req__wifi_sta_get_negotiated_phymode__field_indices_by_name NULL -#define rpc__req__wifi_sta_get_negotiated_phymode__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_sta_get_negotiated_phymode__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiStaGetNegotiatedPhymode", - "RpcReqWifiStaGetNegotiatedPhymode", - "RpcReqWifiStaGetNegotiatedPhymode", - "", - sizeof(RpcReqWifiStaGetNegotiatedPhymode), - 0, - rpc__req__wifi_sta_get_negotiated_phymode__field_descriptors, - rpc__req__wifi_sta_get_negotiated_phymode__field_indices_by_name, - 0, rpc__req__wifi_sta_get_negotiated_phymode__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_sta_get_negotiated_phymode__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_get_negotiated_phymode__field_descriptors[2] = -{ { - "resp", - 1, + "req_wifi_ap_get_sta_aid", + 312, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiStaGetNegotiatedPhymode, resp), + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_ap_get_sta_aid), + &rpc__req__wifi_ap_get_sta_aid__descriptor, NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_wifi_set_storage", + 313, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_set_storage), + &rpc__req__wifi_set_storage__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "phymode", - 2, + "req_wifi_set_inactive_time", + 325, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiStaGetNegotiatedPhymode, phymode), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_set_inactive_time), + &rpc__req__wifi_set_inactive_time__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_sta_get_negotiated_phymode__field_indices_by_name[] = { - 1, /* field[1] = phymode */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_sta_get_negotiated_phymode__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_sta_get_negotiated_phymode__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiStaGetNegotiatedPhymode", - "RpcRespWifiStaGetNegotiatedPhymode", - "RpcRespWifiStaGetNegotiatedPhymode", - "", - sizeof(RpcRespWifiStaGetNegotiatedPhymode), - 2, - rpc__resp__wifi_sta_get_negotiated_phymode__field_descriptors, - rpc__resp__wifi_sta_get_negotiated_phymode__field_indices_by_name, - 1, rpc__resp__wifi_sta_get_negotiated_phymode__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_sta_get_negotiated_phymode__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_ap_get_sta_aid__field_descriptors[2] = -{ { - "resp", - 1, + "req_wifi_get_inactive_time", + 326, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiApGetStaAid, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_get_inactive_time), + &rpc__req__wifi_get_inactive_time__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "aid", - 2, + "req_wifi_set_country_code", + 334, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiApGetStaAid, aid), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_set_country_code), + &rpc__req__wifi_set_country_code__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_ap_get_sta_aid__field_indices_by_name[] = { - 1, /* field[1] = aid */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_ap_get_sta_aid__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_ap_get_sta_aid__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiApGetStaAid", - "RpcRespWifiApGetStaAid", - "RpcRespWifiApGetStaAid", - "", - sizeof(RpcRespWifiApGetStaAid), - 2, - rpc__resp__wifi_ap_get_sta_aid__field_descriptors, - rpc__resp__wifi_ap_get_sta_aid__field_indices_by_name, - 1, rpc__resp__wifi_ap_get_sta_aid__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_ap_get_sta_aid__init, - NULL,NULL,NULL /* reserved[123] */ -}; -#define rpc__req__wifi_sta_get_rssi__field_descriptors NULL -#define rpc__req__wifi_sta_get_rssi__field_indices_by_name NULL -#define rpc__req__wifi_sta_get_rssi__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_sta_get_rssi__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiStaGetRssi", - "RpcReqWifiStaGetRssi", - "RpcReqWifiStaGetRssi", - "", - sizeof(RpcReqWifiStaGetRssi), - 0, - rpc__req__wifi_sta_get_rssi__field_descriptors, - rpc__req__wifi_sta_get_rssi__field_indices_by_name, - 0, rpc__req__wifi_sta_get_rssi__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_sta_get_rssi__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_get_rssi__field_descriptors[2] = -{ { - "resp", - 1, + "req_wifi_get_country_code", + 335, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiStaGetRssi, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_get_country_code), + &rpc__req__wifi_get_country_code__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "rssi", - 2, + "req_wifi_sta_get_aid", + 338, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiStaGetRssi, rssi), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_sta_get_aid), + &rpc__req__wifi_sta_get_aid__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_sta_get_rssi__field_indices_by_name[] = { - 0, /* field[0] = resp */ - 1, /* field[1] = rssi */ -}; -static const ProtobufCIntRange rpc__resp__wifi_sta_get_rssi__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_sta_get_rssi__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiStaGetRssi", - "RpcRespWifiStaGetRssi", - "RpcRespWifiStaGetRssi", - "", - sizeof(RpcRespWifiStaGetRssi), - 2, - rpc__resp__wifi_sta_get_rssi__field_descriptors, - rpc__resp__wifi_sta_get_rssi__field_indices_by_name, - 1, rpc__resp__wifi_sta_get_rssi__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_sta_get_rssi__init, - NULL,NULL,NULL /* reserved[123] */ -}; -#define rpc__req__wifi_sta_get_aid__field_descriptors NULL -#define rpc__req__wifi_sta_get_aid__field_indices_by_name NULL -#define rpc__req__wifi_sta_get_aid__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_sta_get_aid__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiStaGetAid", - "RpcReqWifiStaGetAid", - "RpcReqWifiStaGetAid", - "", - sizeof(RpcReqWifiStaGetAid), - 0, - rpc__req__wifi_sta_get_aid__field_descriptors, - rpc__req__wifi_sta_get_aid__field_indices_by_name, - 0, rpc__req__wifi_sta_get_aid__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_sta_get_aid__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_sta_get_aid__field_descriptors[2] = -{ { - "resp", - 1, + "req_wifi_sta_get_negotiated_phymode", + 339, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiStaGetAid, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_sta_get_negotiated_phymode), + &rpc__req__wifi_sta_get_negotiated_phymode__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "aid", - 2, + "req_wifi_sta_get_rssi", + 341, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiStaGetAid, aid), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_sta_get_rssi), + &rpc__req__wifi_sta_get_rssi__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_sta_get_aid__field_indices_by_name[] = { - 1, /* field[1] = aid */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_sta_get_aid__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_sta_get_aid__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiStaGetAid", - "RpcRespWifiStaGetAid", - "RpcRespWifiStaGetAid", - "", - sizeof(RpcRespWifiStaGetAid), - 2, - rpc__resp__wifi_sta_get_aid__field_descriptors, - rpc__resp__wifi_sta_get_aid__field_indices_by_name, - 1, rpc__resp__wifi_sta_get_aid__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_sta_get_aid__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__req__wifi_set_protocols__field_descriptors[2] = -{ { - "ifx", - 1, + "req_wifi_set_protocols", + 342, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetProtocols, ifx), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_set_protocols), + &rpc__req__wifi_set_protocols__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "protocols", - 2, + "req_wifi_get_protocols", + 343, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetProtocols, protocols), - &wifi_protocols__descriptor, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_get_protocols), + &rpc__req__wifi_get_protocols__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__req__wifi_set_protocols__field_indices_by_name[] = { - 0, /* field[0] = ifx */ - 1, /* field[1] = protocols */ -}; -static const ProtobufCIntRange rpc__req__wifi_set_protocols__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__req__wifi_set_protocols__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiSetProtocols", - "RpcReqWifiSetProtocols", - "RpcReqWifiSetProtocols", - "", - sizeof(RpcReqWifiSetProtocols), - 2, - rpc__req__wifi_set_protocols__field_descriptors, - rpc__req__wifi_set_protocols__field_indices_by_name, - 1, rpc__req__wifi_set_protocols__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_set_protocols__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_set_protocols__field_descriptors[2] = -{ { - "resp", - 1, + "req_wifi_set_bandwidths", + 344, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiSetProtocols, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_set_bandwidths), + &rpc__req__wifi_set_bandwidths__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ifx", - 2, + "req_wifi_get_bandwidths", + 345, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiSetProtocols, ifx), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_get_bandwidths), + &rpc__req__wifi_get_bandwidths__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_set_protocols__field_indices_by_name[] = { - 1, /* field[1] = ifx */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_set_protocols__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_set_protocols__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiSetProtocols", - "RpcRespWifiSetProtocols", - "RpcRespWifiSetProtocols", - "", - sizeof(RpcRespWifiSetProtocols), - 2, - rpc__resp__wifi_set_protocols__field_descriptors, - rpc__resp__wifi_set_protocols__field_indices_by_name, - 1, rpc__resp__wifi_set_protocols__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_set_protocols__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__req__wifi_get_protocols__field_descriptors[1] = -{ { - "ifx", - 1, + "req_wifi_set_band", + 346, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiGetProtocols, ifx), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_set_band), + &rpc__req__wifi_set_band__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__req__wifi_get_protocols__field_indices_by_name[] = { - 0, /* field[0] = ifx */ -}; -static const ProtobufCIntRange rpc__req__wifi_get_protocols__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__req__wifi_get_protocols__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiGetProtocols", - "RpcReqWifiGetProtocols", - "RpcReqWifiGetProtocols", - "", - sizeof(RpcReqWifiGetProtocols), - 1, - rpc__req__wifi_get_protocols__field_descriptors, - rpc__req__wifi_get_protocols__field_indices_by_name, - 1, rpc__req__wifi_get_protocols__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_get_protocols__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_get_protocols__field_descriptors[3] = -{ { - "resp", - 1, + "req_wifi_get_band", + 347, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetProtocols, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_get_band), + &rpc__req__wifi_get_band__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ifx", - 2, + "req_wifi_set_bandmode", + 348, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetProtocols, ifx), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_set_bandmode), + &rpc__req__wifi_set_band_mode__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "protocols", - 3, + "req_wifi_get_bandmode", + 349, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetProtocols, protocols), - &wifi_protocols__descriptor, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_get_bandmode), + &rpc__req__wifi_get_band_mode__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_get_protocols__field_indices_by_name[] = { - 1, /* field[1] = ifx */ - 2, /* field[2] = protocols */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_get_protocols__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 3 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_get_protocols__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiGetProtocols", - "RpcRespWifiGetProtocols", - "RpcRespWifiGetProtocols", - "", - sizeof(RpcRespWifiGetProtocols), - 3, - rpc__resp__wifi_get_protocols__field_descriptors, - rpc__resp__wifi_get_protocols__field_indices_by_name, - 1, rpc__resp__wifi_get_protocols__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_get_protocols__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__req__wifi_set_bandwidths__field_descriptors[2] = -{ { - "ifx", - 1, + "req_get_coprocessor_fwversion", + 350, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetBandwidths, ifx), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_get_coprocessor_fwversion), + &rpc__req__get_coprocessor_fw_version__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "bandwidths", - 2, + "req_wifi_scan_get_ap_record", + 351, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetBandwidths, bandwidths), - &wifi_bandwidths__descriptor, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_scan_get_ap_record), + &rpc__req__wifi_scan_get_ap_record__descriptor, NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned rpc__req__wifi_set_bandwidths__field_indices_by_name[] = { - 1, /* field[1] = bandwidths */ - 0, /* field[0] = ifx */ -}; -static const ProtobufCIntRange rpc__req__wifi_set_bandwidths__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__req__wifi_set_bandwidths__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiSetBandwidths", - "RpcReqWifiSetBandwidths", - "RpcReqWifiSetBandwidths", - "", - sizeof(RpcReqWifiSetBandwidths), - 2, - rpc__req__wifi_set_bandwidths__field_descriptors, - rpc__req__wifi_set_bandwidths__field_indices_by_name, - 1, rpc__req__wifi_set_bandwidths__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_set_bandwidths__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_set_bandwidths__field_descriptors[2] = -{ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, { - "resp", - 1, + "req_set_dhcp_dns", + 352, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiSetBandwidths, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_set_dhcp_dns), + &rpc__req__set_dhcp_dns_status__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ifx", - 2, + "req_get_dhcp_dns", + 353, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiSetBandwidths, ifx), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_get_dhcp_dns), + &rpc__req__get_dhcp_dns_status__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_set_bandwidths__field_indices_by_name[] = { - 1, /* field[1] = ifx */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_set_bandwidths__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_set_bandwidths__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiSetBandwidths", - "RpcRespWifiSetBandwidths", - "RpcRespWifiSetBandwidths", - "", - sizeof(RpcRespWifiSetBandwidths), - 2, - rpc__resp__wifi_set_bandwidths__field_descriptors, - rpc__resp__wifi_set_bandwidths__field_indices_by_name, - 1, rpc__resp__wifi_set_bandwidths__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_set_bandwidths__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__req__wifi_get_bandwidths__field_descriptors[1] = -{ { - "ifx", - 1, + "req_wifi_sta_twt_config", + 354, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiGetBandwidths, ifx), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_sta_twt_config), + &rpc__req__wifi_sta_twt_config__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__req__wifi_get_bandwidths__field_indices_by_name[] = { - 0, /* field[0] = ifx */ -}; -static const ProtobufCIntRange rpc__req__wifi_get_bandwidths__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__req__wifi_get_bandwidths__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiGetBandwidths", - "RpcReqWifiGetBandwidths", - "RpcReqWifiGetBandwidths", - "", - sizeof(RpcReqWifiGetBandwidths), - 1, - rpc__req__wifi_get_bandwidths__field_descriptors, - rpc__req__wifi_get_bandwidths__field_indices_by_name, - 1, rpc__req__wifi_get_bandwidths__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_get_bandwidths__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_get_bandwidths__field_descriptors[3] = -{ { - "resp", - 1, + "req_wifi_sta_itwt_setup", + 355, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetBandwidths, resp), + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_sta_itwt_setup), + &rpc__req__wifi_sta_itwt_setup__descriptor, NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_wifi_sta_itwt_teardown", + 356, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_sta_itwt_teardown), + &rpc__req__wifi_sta_itwt_teardown__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "ifx", - 2, + "req_wifi_sta_itwt_suspend", + 357, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetBandwidths, ifx), + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_sta_itwt_suspend), + &rpc__req__wifi_sta_itwt_suspend__descriptor, NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_wifi_sta_itwt_get_flow_id_status", + 358, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_sta_itwt_get_flow_id_status), + &rpc__req__wifi_sta_itwt_get_flow_id_status__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "bandwidths", - 3, + "req_wifi_sta_itwt_send_probe_req", + 359, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetBandwidths, bandwidths), - &wifi_bandwidths__descriptor, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_sta_itwt_send_probe_req), + &rpc__req__wifi_sta_itwt_send_probe_req__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_get_bandwidths__field_indices_by_name[] = { - 2, /* field[2] = bandwidths */ - 1, /* field[1] = ifx */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_get_bandwidths__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 3 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_get_bandwidths__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiGetBandwidths", - "RpcRespWifiGetBandwidths", - "RpcRespWifiGetBandwidths", - "", - sizeof(RpcRespWifiGetBandwidths), - 3, - rpc__resp__wifi_get_bandwidths__field_descriptors, - rpc__resp__wifi_get_bandwidths__field_indices_by_name, - 1, rpc__resp__wifi_get_bandwidths__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_get_bandwidths__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__req__wifi_set_band__field_descriptors[1] = -{ { - "band", - 1, + "req_wifi_sta_itwt_set_target_wake_time_offset", + 360, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetBand, band), + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_sta_itwt_set_target_wake_time_offset), + &rpc__req__wifi_sta_itwt_set_target_wake_time_offset__descriptor, NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_wifi_sta_enterprise_enable", + 361, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_sta_enterprise_enable), + &rpc__req__wifi_sta_enterprise_enable__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__req__wifi_set_band__field_indices_by_name[] = { - 0, /* field[0] = band */ -}; -static const ProtobufCIntRange rpc__req__wifi_set_band__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__req__wifi_set_band__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiSetBand", - "RpcReqWifiSetBand", - "RpcReqWifiSetBand", - "", - sizeof(RpcReqWifiSetBand), - 1, - rpc__req__wifi_set_band__field_descriptors, - rpc__req__wifi_set_band__field_indices_by_name, - 1, rpc__req__wifi_set_band__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_set_band__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_set_band__field_descriptors[1] = -{ { - "resp", - 1, + "req_wifi_sta_enterprise_disable", + 362, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiSetBand, resp), + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_sta_enterprise_disable), + &rpc__req__wifi_sta_enterprise_disable__descriptor, NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_eap_set_identity", + 363, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_set_identity), + &rpc__req__eap_set_identity__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_set_band__field_indices_by_name[] = { - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_set_band__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_set_band__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiSetBand", - "RpcRespWifiSetBand", - "RpcRespWifiSetBand", - "", - sizeof(RpcRespWifiSetBand), - 1, - rpc__resp__wifi_set_band__field_descriptors, - rpc__resp__wifi_set_band__field_indices_by_name, - 1, rpc__resp__wifi_set_band__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_set_band__init, - NULL,NULL,NULL /* reserved[123] */ -}; -#define rpc__req__wifi_get_band__field_descriptors NULL -#define rpc__req__wifi_get_band__field_indices_by_name NULL -#define rpc__req__wifi_get_band__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_get_band__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiGetBand", - "RpcReqWifiGetBand", - "RpcReqWifiGetBand", - "", - sizeof(RpcReqWifiGetBand), - 0, - rpc__req__wifi_get_band__field_descriptors, - rpc__req__wifi_get_band__field_indices_by_name, - 0, rpc__req__wifi_get_band__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_get_band__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_get_band__field_descriptors[2] = -{ { - "resp", - 1, + "req_eap_clear_identity", + 364, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetBand, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_clear_identity), + &rpc__req__eap_clear_identity__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "band", - 2, + "req_eap_set_username", + 365, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetBand, band), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_set_username), + &rpc__req__eap_set_username__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_get_band__field_indices_by_name[] = { - 1, /* field[1] = band */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_get_band__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_get_band__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiGetBand", - "RpcRespWifiGetBand", - "RpcRespWifiGetBand", - "", - sizeof(RpcRespWifiGetBand), - 2, - rpc__resp__wifi_get_band__field_descriptors, - rpc__resp__wifi_get_band__field_indices_by_name, - 1, rpc__resp__wifi_get_band__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_get_band__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__req__wifi_set_band_mode__field_descriptors[1] = -{ { - "bandmode", - 1, + "req_eap_clear_username", + 366, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(RpcReqWifiSetBandMode, bandmode), + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_clear_username), + &rpc__req__eap_clear_username__descriptor, NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_eap_set_password", + 367, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_set_password), + &rpc__req__eap_set_password__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__req__wifi_set_band_mode__field_indices_by_name[] = { - 0, /* field[0] = bandmode */ -}; -static const ProtobufCIntRange rpc__req__wifi_set_band_mode__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__req__wifi_set_band_mode__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiSetBandMode", - "RpcReqWifiSetBandMode", - "RpcReqWifiSetBandMode", - "", - sizeof(RpcReqWifiSetBandMode), - 1, - rpc__req__wifi_set_band_mode__field_descriptors, - rpc__req__wifi_set_band_mode__field_indices_by_name, - 1, rpc__req__wifi_set_band_mode__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_set_band_mode__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_set_band_mode__field_descriptors[1] = -{ { - "resp", - 1, + "req_eap_clear_password", + 368, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiSetBandMode, resp), + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_clear_password), + &rpc__req__eap_clear_password__descriptor, NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_eap_set_new_password", + 369, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_set_new_password), + &rpc__req__eap_set_new_password__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_set_band_mode__field_indices_by_name[] = { - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_set_band_mode__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_set_band_mode__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiSetBandMode", - "RpcRespWifiSetBandMode", - "RpcRespWifiSetBandMode", - "", - sizeof(RpcRespWifiSetBandMode), - 1, - rpc__resp__wifi_set_band_mode__field_descriptors, - rpc__resp__wifi_set_band_mode__field_indices_by_name, - 1, rpc__resp__wifi_set_band_mode__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_set_band_mode__init, - NULL,NULL,NULL /* reserved[123] */ -}; -#define rpc__req__wifi_get_band_mode__field_descriptors NULL -#define rpc__req__wifi_get_band_mode__field_indices_by_name NULL -#define rpc__req__wifi_get_band_mode__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__wifi_get_band_mode__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_WifiGetBandMode", - "RpcReqWifiGetBandMode", - "RpcReqWifiGetBandMode", - "", - sizeof(RpcReqWifiGetBandMode), - 0, - rpc__req__wifi_get_band_mode__field_descriptors, - rpc__req__wifi_get_band_mode__field_indices_by_name, - 0, rpc__req__wifi_get_band_mode__number_ranges, - (ProtobufCMessageInit) rpc__req__wifi_get_band_mode__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__wifi_get_band_mode__field_descriptors[2] = -{ { - "resp", - 1, + "req_eap_clear_new_password", + 370, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetBandMode, resp), + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_clear_new_password), + &rpc__req__eap_clear_new_password__descriptor, NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_eap_set_ca_cert", + 371, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_set_ca_cert), + &rpc__req__eap_set_ca_cert__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "bandmode", - 2, + "req_eap_clear_ca_cert", + 372, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(RpcRespWifiGetBandMode, bandmode), + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_clear_ca_cert), + &rpc__req__eap_clear_ca_cert__descriptor, NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_eap_set_certificate_and_key", + 373, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_set_certificate_and_key), + &rpc__req__eap_set_certificate_and_key__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__wifi_get_band_mode__field_indices_by_name[] = { - 1, /* field[1] = bandmode */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__wifi_get_band_mode__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__resp__wifi_get_band_mode__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_WifiGetBandMode", - "RpcRespWifiGetBandMode", - "RpcRespWifiGetBandMode", - "", - sizeof(RpcRespWifiGetBandMode), - 2, - rpc__resp__wifi_get_band_mode__field_descriptors, - rpc__resp__wifi_get_band_mode__field_indices_by_name, - 1, rpc__resp__wifi_get_band_mode__number_ranges, - (ProtobufCMessageInit) rpc__resp__wifi_get_band_mode__init, - NULL,NULL,NULL /* reserved[123] */ -}; -#define rpc__req__get_coprocessor_fw_version__field_descriptors NULL -#define rpc__req__get_coprocessor_fw_version__field_indices_by_name NULL -#define rpc__req__get_coprocessor_fw_version__number_ranges NULL -const ProtobufCMessageDescriptor rpc__req__get_coprocessor_fw_version__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Req_GetCoprocessorFwVersion", - "RpcReqGetCoprocessorFwVersion", - "RpcReqGetCoprocessorFwVersion", - "", - sizeof(RpcReqGetCoprocessorFwVersion), - 0, - rpc__req__get_coprocessor_fw_version__field_descriptors, - rpc__req__get_coprocessor_fw_version__field_indices_by_name, - 0, rpc__req__get_coprocessor_fw_version__number_ranges, - (ProtobufCMessageInit) rpc__req__get_coprocessor_fw_version__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__resp__get_coprocessor_fw_version__field_descriptors[4] = -{ { - "resp", - 1, + "req_eap_clear_certificate_and_key", + 374, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcRespGetCoprocessorFwVersion, resp), + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_clear_certificate_and_key), + &rpc__req__eap_clear_certificate_and_key__descriptor, NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_eap_get_disable_time_check", + 375, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_get_disable_time_check), + &rpc__req__eap_get_disable_time_check__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "major1", - 2, + "req_eap_set_ttls_phase2_method", + 376, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(RpcRespGetCoprocessorFwVersion, major1), + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_set_ttls_phase2_method), + &rpc__req__eap_set_ttls_phase2_method__descriptor, NULL, + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "req_eap_set_suiteb_certification", + 377, + PROTOBUF_C_LABEL_NONE, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_set_suiteb_certification), + &rpc__req__eap_set_suiteb192bit_certification__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "minor1", - 3, + "req_eap_set_pac_file", + 378, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(RpcRespGetCoprocessorFwVersion, minor1), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_set_pac_file), + &rpc__req__eap_set_pac_file__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "patch1", - 4, + "req_eap_set_fast_params", + 379, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(RpcRespGetCoprocessorFwVersion, patch1), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_set_fast_params), + &rpc__req__eap_set_fast_params__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__resp__get_coprocessor_fw_version__field_indices_by_name[] = { - 1, /* field[1] = major1 */ - 2, /* field[2] = minor1 */ - 3, /* field[3] = patch1 */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__resp__get_coprocessor_fw_version__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 4 } -}; -const ProtobufCMessageDescriptor rpc__resp__get_coprocessor_fw_version__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Resp_GetCoprocessorFwVersion", - "RpcRespGetCoprocessorFwVersion", - "RpcRespGetCoprocessorFwVersion", - "", - sizeof(RpcRespGetCoprocessorFwVersion), - 4, - rpc__resp__get_coprocessor_fw_version__field_descriptors, - rpc__resp__get_coprocessor_fw_version__field_indices_by_name, - 1, rpc__resp__get_coprocessor_fw_version__number_ranges, - (ProtobufCMessageInit) rpc__resp__get_coprocessor_fw_version__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__event__wifi_event_no_args__field_descriptors[2] = -{ { - "resp", - 1, + "req_eap_use_default_cert_bundle", + 380, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcEventWifiEventNoArgs, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_use_default_cert_bundle), + &rpc__req__eap_use_default_cert_bundle__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "event_id", - 2, + "req_wifi_set_okc_support", + 381, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcEventWifiEventNoArgs, event_id), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_wifi_set_okc_support), + &rpc__req__wifi_set_okc_support__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__event__wifi_event_no_args__field_indices_by_name[] = { - 1, /* field[1] = event_id */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__event__wifi_event_no_args__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__event__wifi_event_no_args__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Event_WifiEventNoArgs", - "RpcEventWifiEventNoArgs", - "RpcEventWifiEventNoArgs", - "", - sizeof(RpcEventWifiEventNoArgs), - 2, - rpc__event__wifi_event_no_args__field_descriptors, - rpc__event__wifi_event_no_args__field_indices_by_name, - 1, rpc__event__wifi_event_no_args__number_ranges, - (ProtobufCMessageInit) rpc__event__wifi_event_no_args__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__event__espinit__field_descriptors[1] = -{ { - "init_data", - 1, + "req_eap_set_domain_name", + 382, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, - 0, /* quantifier_offset */ - offsetof(RpcEventESPInit, init_data), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_set_domain_name), + &rpc__req__eap_set_domain_name__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__event__espinit__field_indices_by_name[] = { - 0, /* field[0] = init_data */ -}; -static const ProtobufCIntRange rpc__event__espinit__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__event__espinit__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Event_ESPInit", - "RpcEventESPInit", - "RpcEventESPInit", - "", - sizeof(RpcEventESPInit), - 1, - rpc__event__espinit__field_descriptors, - rpc__event__espinit__field_indices_by_name, - 1, rpc__event__espinit__number_ranges, - (ProtobufCMessageInit) rpc__event__espinit__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__event__heartbeat__field_descriptors[1] = -{ { - "hb_num", - 1, + "req_eap_set_disable_time_check", + 383, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcEventHeartbeat, hb_num), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_set_disable_time_check), + &rpc__req__eap_set_disable_time_check__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__event__heartbeat__field_indices_by_name[] = { - 0, /* field[0] = hb_num */ -}; -static const ProtobufCIntRange rpc__event__heartbeat__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 1 } -}; -const ProtobufCMessageDescriptor rpc__event__heartbeat__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Event_Heartbeat", - "RpcEventHeartbeat", - "RpcEventHeartbeat", - "", - sizeof(RpcEventHeartbeat), - 1, - rpc__event__heartbeat__field_descriptors, - rpc__event__heartbeat__field_indices_by_name, - 1, rpc__event__heartbeat__number_ranges, - (ProtobufCMessageInit) rpc__event__heartbeat__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__event__ap__sta_disconnected__field_descriptors[5] = -{ { - "resp", - 1, + "req_eap_set_eap_methods", + 384, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcEventAPStaDisconnected, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_eap_set_eap_methods), + &rpc__req__eap_set_eap_methods__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "mac", - 2, + "req_iface_mac_addr_set_get", + 385, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, - 0, /* quantifier_offset */ - offsetof(RpcEventAPStaDisconnected, mac), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_iface_mac_addr_set_get), + &rpc__req__iface_mac_addr_set_get__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "aid", - 3, + "req_iface_mac_addr_len_get", + 386, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(RpcEventAPStaDisconnected, aid), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_iface_mac_addr_len_get), + &rpc__req__iface_mac_addr_len_get__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "is_mesh_child", - 4, + "req_feature_control", + 387, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(RpcEventAPStaDisconnected, is_mesh_child), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_feature_control), + &rpc__req__feature_control__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "reason", - 5, + "req_gpio_config", + 388, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(RpcEventAPStaDisconnected, reason), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_gpio_config), + &rpc__req__gpio_config__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__event__ap__sta_disconnected__field_indices_by_name[] = { - 2, /* field[2] = aid */ - 3, /* field[3] = is_mesh_child */ - 1, /* field[1] = mac */ - 4, /* field[4] = reason */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__event__ap__sta_disconnected__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 5 } -}; -const ProtobufCMessageDescriptor rpc__event__ap__sta_disconnected__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Event_AP_StaDisconnected", - "RpcEventAPStaDisconnected", - "RpcEventAPStaDisconnected", - "", - sizeof(RpcEventAPStaDisconnected), - 5, - rpc__event__ap__sta_disconnected__field_descriptors, - rpc__event__ap__sta_disconnected__field_indices_by_name, - 1, rpc__event__ap__sta_disconnected__number_ranges, - (ProtobufCMessageInit) rpc__event__ap__sta_disconnected__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__event__ap__sta_connected__field_descriptors[4] = -{ { - "resp", - 1, + "req_gpio_reset", + 389, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcEventAPStaConnected, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_gpio_reset), + &rpc__req__gpio_reset__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "mac", - 2, + "req_gpio_set_level", + 390, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BYTES, - 0, /* quantifier_offset */ - offsetof(RpcEventAPStaConnected, mac), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_gpio_set_level), + &rpc__req__gpio_set_level__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "aid", - 3, + "req_gpio_get_level", + 391, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(RpcEventAPStaConnected, aid), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_gpio_get_level), + &rpc__req__gpio_get_level__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "is_mesh_child", - 4, + "req_gpio_set_direction", + 392, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(RpcEventAPStaConnected, is_mesh_child), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_gpio_set_direction), + &rpc__req__gpio_set_direction__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__event__ap__sta_connected__field_indices_by_name[] = { - 2, /* field[2] = aid */ - 3, /* field[3] = is_mesh_child */ - 1, /* field[1] = mac */ - 0, /* field[0] = resp */ -}; -static const ProtobufCIntRange rpc__event__ap__sta_connected__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 4 } -}; -const ProtobufCMessageDescriptor rpc__event__ap__sta_connected__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Event_AP_StaConnected", - "RpcEventAPStaConnected", - "RpcEventAPStaConnected", - "", - sizeof(RpcEventAPStaConnected), - 4, - rpc__event__ap__sta_connected__field_descriptors, - rpc__event__ap__sta_connected__field_indices_by_name, - 1, rpc__event__ap__sta_connected__number_ranges, - (ProtobufCMessageInit) rpc__event__ap__sta_connected__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__event__sta_scan_done__field_descriptors[2] = -{ { - "resp", - 1, + "req_gpio_input_enable", + 393, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcEventStaScanDone, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_gpio_input_enable), + &rpc__req__gpio_input_enable__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "scan_done", - 2, + "req_gpio_set_pull_mode", + 394, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(RpcEventStaScanDone, scan_done), - &wifi_event_sta_scan_done__descriptor, + offsetof(Rpc, payload_case), + offsetof(Rpc, req_gpio_set_pull_mode), + &rpc__req__gpio_set_pull_mode__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__event__sta_scan_done__field_indices_by_name[] = { - 0, /* field[0] = resp */ - 1, /* field[1] = scan_done */ -}; -static const ProtobufCIntRange rpc__event__sta_scan_done__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__event__sta_scan_done__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Event_StaScanDone", - "RpcEventStaScanDone", - "RpcEventStaScanDone", - "", - sizeof(RpcEventStaScanDone), - 2, - rpc__event__sta_scan_done__field_descriptors, - rpc__event__sta_scan_done__field_indices_by_name, - 1, rpc__event__sta_scan_done__number_ranges, - (ProtobufCMessageInit) rpc__event__sta_scan_done__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__event__sta_connected__field_descriptors[2] = -{ { - "resp", - 1, + "resp_get_mac_address", + 513, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcEventStaConnected, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, resp_get_mac_address), + &rpc__resp__get_mac_address__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "sta_connected", - 2, + "resp_set_mac_address", + 514, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(RpcEventStaConnected, sta_connected), - &wifi_event_sta_connected__descriptor, + offsetof(Rpc, payload_case), + offsetof(Rpc, resp_set_mac_address), + &rpc__resp__set_mac_address__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__event__sta_connected__field_indices_by_name[] = { - 0, /* field[0] = resp */ - 1, /* field[1] = sta_connected */ -}; -static const ProtobufCIntRange rpc__event__sta_connected__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__event__sta_connected__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Event_StaConnected", - "RpcEventStaConnected", - "RpcEventStaConnected", - "", - sizeof(RpcEventStaConnected), - 2, - rpc__event__sta_connected__field_descriptors, - rpc__event__sta_connected__field_indices_by_name, - 1, rpc__event__sta_connected__number_ranges, - (ProtobufCMessageInit) rpc__event__sta_connected__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__event__sta_disconnected__field_descriptors[2] = -{ { - "resp", - 1, + "resp_get_wifi_mode", + 515, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(RpcEventStaDisconnected, resp), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, resp_get_wifi_mode), + &rpc__resp__get_mode__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "sta_disconnected", - 2, + "resp_set_wifi_mode", + 516, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(RpcEventStaDisconnected, sta_disconnected), - &wifi_event_sta_disconnected__descriptor, + offsetof(Rpc, payload_case), + offsetof(Rpc, resp_set_wifi_mode), + &rpc__resp__set_mode__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, -}; -static const unsigned rpc__event__sta_disconnected__field_indices_by_name[] = { - 0, /* field[0] = resp */ - 1, /* field[1] = sta_disconnected */ -}; -static const ProtobufCIntRange rpc__event__sta_disconnected__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; -const ProtobufCMessageDescriptor rpc__event__sta_disconnected__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "Rpc_Event_StaDisconnected", - "RpcEventStaDisconnected", - "RpcEventStaDisconnected", - "", - sizeof(RpcEventStaDisconnected), - 2, - rpc__event__sta_disconnected__field_descriptors, - rpc__event__sta_disconnected__field_indices_by_name, - 1, rpc__event__sta_disconnected__number_ranges, - (ProtobufCMessageInit) rpc__event__sta_disconnected__init, - NULL,NULL,NULL /* reserved[123] */ -}; -static const ProtobufCFieldDescriptor rpc__field_descriptors[121] = -{ { - "msg_type", - 1, + "resp_supp_dpp_init", + 517, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_ENUM, - 0, /* quantifier_offset */ - offsetof(Rpc, msg_type), - &rpc_type__descriptor, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, resp_supp_dpp_init), + &rpc__resp__supp_dpp_init__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "msg_id", - 2, + "resp_supp_dpp_deinit", + 518, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_ENUM, - 0, /* quantifier_offset */ - offsetof(Rpc, msg_id), - &rpc_id__descriptor, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, resp_supp_dpp_deinit), + &rpc__resp__supp_dpp_deinit__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "uid", - 3, + "resp_supp_dpp_bootstrap_gen", + 519, PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Rpc, uid), - NULL, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(Rpc, payload_case), + offsetof(Rpc, resp_supp_dpp_bootstrap_gen), + &rpc__resp__supp_dpp_bootstrap_gen__descriptor, NULL, - 0, /* flags */ + 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_get_mac_address", - 257, + "resp_supp_dpp_start_listen", + 520, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_get_mac_address), - &rpc__req__get_mac_address__descriptor, + offsetof(Rpc, resp_supp_dpp_start_listen), + &rpc__resp__supp_dpp_start_listen__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_set_mac_address", - 258, + "resp_supp_dpp_stop_listen", + 521, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_set_mac_address), - &rpc__req__set_mac_address__descriptor, + offsetof(Rpc, resp_supp_dpp_stop_listen), + &rpc__resp__supp_dpp_stop_listen__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_get_wifi_mode", - 259, + "resp_ota_activate", + 522, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, - offsetof(Rpc, payload_case), - offsetof(Rpc, req_get_wifi_mode), - &rpc__req__get_mode__descriptor, + offsetof(Rpc, payload_case), + offsetof(Rpc, resp_ota_activate), + &rpc__resp__otaactivate__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_set_wifi_mode", - 260, + "resp_wifi_set_ps", + 526, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_set_wifi_mode), - &rpc__req__set_mode__descriptor, + offsetof(Rpc, resp_wifi_set_ps), + &rpc__resp__set_ps__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_set_ps", - 270, + "resp_wifi_get_ps", + 527, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_set_ps), - &rpc__req__set_ps__descriptor, + offsetof(Rpc, resp_wifi_get_ps), + &rpc__resp__get_ps__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_get_ps", - 271, + "resp_ota_begin", + 528, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_get_ps), - &rpc__req__get_ps__descriptor, + offsetof(Rpc, resp_ota_begin), + &rpc__resp__otabegin__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_ota_begin", - 272, + "resp_ota_write", + 529, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_ota_begin), - &rpc__req__otabegin__descriptor, + offsetof(Rpc, resp_ota_write), + &rpc__resp__otawrite__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_ota_write", - 273, + "resp_ota_end", + 530, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_ota_write), - &rpc__req__otawrite__descriptor, + offsetof(Rpc, resp_ota_end), + &rpc__resp__otaend__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_ota_end", - 274, + "resp_set_wifi_max_tx_power", + 531, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_ota_end), - &rpc__req__otaend__descriptor, + offsetof(Rpc, resp_set_wifi_max_tx_power), + &rpc__resp__wifi_set_max_tx_power__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_set_wifi_max_tx_power", - 275, + "resp_get_wifi_max_tx_power", + 532, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_set_wifi_max_tx_power), - &rpc__req__wifi_set_max_tx_power__descriptor, + offsetof(Rpc, resp_get_wifi_max_tx_power), + &rpc__resp__wifi_get_max_tx_power__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_get_wifi_max_tx_power", - 276, + "resp_config_heartbeat", + 533, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_get_wifi_max_tx_power), - &rpc__req__wifi_get_max_tx_power__descriptor, + offsetof(Rpc, resp_config_heartbeat), + &rpc__resp__config_heartbeat__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_config_heartbeat", - 277, + "resp_wifi_init", + 534, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_config_heartbeat), - &rpc__req__config_heartbeat__descriptor, + offsetof(Rpc, resp_wifi_init), + &rpc__resp__wifi_init__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_init", - 278, + "resp_wifi_deinit", + 535, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_init), - &rpc__req__wifi_init__descriptor, + offsetof(Rpc, resp_wifi_deinit), + &rpc__resp__wifi_deinit__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_deinit", - 279, + "resp_wifi_start", + 536, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_deinit), - &rpc__req__wifi_deinit__descriptor, + offsetof(Rpc, resp_wifi_start), + &rpc__resp__wifi_start__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_start", - 280, + "resp_wifi_stop", + 537, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_start), - &rpc__req__wifi_start__descriptor, + offsetof(Rpc, resp_wifi_stop), + &rpc__resp__wifi_stop__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_stop", - 281, + "resp_wifi_connect", + 538, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_stop), - &rpc__req__wifi_stop__descriptor, + offsetof(Rpc, resp_wifi_connect), + &rpc__resp__wifi_connect__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_connect", - 282, + "resp_wifi_disconnect", + 539, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_connect), - &rpc__req__wifi_connect__descriptor, + offsetof(Rpc, resp_wifi_disconnect), + &rpc__resp__wifi_disconnect__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_disconnect", - 283, + "resp_wifi_set_config", + 540, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_disconnect), - &rpc__req__wifi_disconnect__descriptor, + offsetof(Rpc, resp_wifi_set_config), + &rpc__resp__wifi_set_config__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_set_config", - 284, + "resp_wifi_get_config", + 541, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_set_config), - &rpc__req__wifi_set_config__descriptor, + offsetof(Rpc, resp_wifi_get_config), + &rpc__resp__wifi_get_config__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_get_config", - 285, + "resp_wifi_scan_start", + 542, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_get_config), - &rpc__req__wifi_get_config__descriptor, + offsetof(Rpc, resp_wifi_scan_start), + &rpc__resp__wifi_scan_start__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_scan_start", - 286, + "resp_wifi_scan_stop", + 543, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_scan_start), - &rpc__req__wifi_scan_start__descriptor, + offsetof(Rpc, resp_wifi_scan_stop), + &rpc__resp__wifi_scan_stop__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_scan_stop", - 287, + "resp_wifi_scan_get_ap_num", + 544, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_scan_stop), - &rpc__req__wifi_scan_stop__descriptor, + offsetof(Rpc, resp_wifi_scan_get_ap_num), + &rpc__resp__wifi_scan_get_ap_num__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_scan_get_ap_num", - 288, + "resp_wifi_scan_get_ap_records", + 545, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_scan_get_ap_num), - &rpc__req__wifi_scan_get_ap_num__descriptor, + offsetof(Rpc, resp_wifi_scan_get_ap_records), + &rpc__resp__wifi_scan_get_ap_records__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_scan_get_ap_records", - 289, + "resp_wifi_clear_ap_list", + 546, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_scan_get_ap_records), - &rpc__req__wifi_scan_get_ap_records__descriptor, + offsetof(Rpc, resp_wifi_clear_ap_list), + &rpc__resp__wifi_clear_ap_list__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_clear_ap_list", - 290, + "resp_wifi_restore", + 547, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_clear_ap_list), - &rpc__req__wifi_clear_ap_list__descriptor, + offsetof(Rpc, resp_wifi_restore), + &rpc__resp__wifi_restore__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_restore", - 291, + "resp_wifi_clear_fast_connect", + 548, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_restore), - &rpc__req__wifi_restore__descriptor, + offsetof(Rpc, resp_wifi_clear_fast_connect), + &rpc__resp__wifi_clear_fast_connect__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_clear_fast_connect", - 292, + "resp_wifi_deauth_sta", + 549, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_clear_fast_connect), - &rpc__req__wifi_clear_fast_connect__descriptor, + offsetof(Rpc, resp_wifi_deauth_sta), + &rpc__resp__wifi_deauth_sta__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_deauth_sta", - 293, + "resp_wifi_sta_get_ap_info", + 550, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_deauth_sta), - &rpc__req__wifi_deauth_sta__descriptor, + offsetof(Rpc, resp_wifi_sta_get_ap_info), + &rpc__resp__wifi_sta_get_ap_info__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_sta_get_ap_info", - 294, + "resp_wifi_set_protocol", + 553, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_sta_get_ap_info), - &rpc__req__wifi_sta_get_ap_info__descriptor, + offsetof(Rpc, resp_wifi_set_protocol), + &rpc__resp__wifi_set_protocol__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_set_protocol", - 297, + "resp_wifi_get_protocol", + 554, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_set_protocol), - &rpc__req__wifi_set_protocol__descriptor, + offsetof(Rpc, resp_wifi_get_protocol), + &rpc__resp__wifi_get_protocol__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_get_protocol", - 298, + "resp_wifi_set_bandwidth", + 555, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_get_protocol), - &rpc__req__wifi_get_protocol__descriptor, + offsetof(Rpc, resp_wifi_set_bandwidth), + &rpc__resp__wifi_set_bandwidth__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_set_bandwidth", - 299, + "resp_wifi_get_bandwidth", + 556, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_set_bandwidth), - &rpc__req__wifi_set_bandwidth__descriptor, + offsetof(Rpc, resp_wifi_get_bandwidth), + &rpc__resp__wifi_get_bandwidth__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_get_bandwidth", - 300, + "resp_wifi_set_channel", + 557, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_get_bandwidth), - &rpc__req__wifi_get_bandwidth__descriptor, + offsetof(Rpc, resp_wifi_set_channel), + &rpc__resp__wifi_set_channel__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_set_channel", - 301, + "resp_wifi_get_channel", + 558, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_set_channel), - &rpc__req__wifi_set_channel__descriptor, + offsetof(Rpc, resp_wifi_get_channel), + &rpc__resp__wifi_get_channel__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_get_channel", - 302, + "resp_wifi_set_country", + 559, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, - offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_get_channel), - &rpc__req__wifi_get_channel__descriptor, + offsetof(Rpc, payload_case), + offsetof(Rpc, resp_wifi_set_country), + &rpc__resp__wifi_set_country__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_set_country", - 303, + "resp_wifi_get_country", + 560, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_set_country), - &rpc__req__wifi_set_country__descriptor, + offsetof(Rpc, resp_wifi_get_country), + &rpc__resp__wifi_get_country__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_get_country", - 304, + "resp_wifi_ap_get_sta_list", + 567, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_get_country), - &rpc__req__wifi_get_country__descriptor, + offsetof(Rpc, resp_wifi_ap_get_sta_list), + &rpc__resp__wifi_ap_get_sta_list__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_ap_get_sta_list", - 311, + "resp_wifi_ap_get_sta_aid", + 568, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_ap_get_sta_list), - &rpc__req__wifi_ap_get_sta_list__descriptor, + offsetof(Rpc, resp_wifi_ap_get_sta_aid), + &rpc__resp__wifi_ap_get_sta_aid__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_ap_get_sta_aid", - 312, + "resp_wifi_set_storage", + 569, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_ap_get_sta_aid), - &rpc__req__wifi_ap_get_sta_aid__descriptor, + offsetof(Rpc, resp_wifi_set_storage), + &rpc__resp__wifi_set_storage__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_set_storage", - 313, + "resp_wifi_set_inactive_time", + 581, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_set_storage), - &rpc__req__wifi_set_storage__descriptor, + offsetof(Rpc, resp_wifi_set_inactive_time), + &rpc__resp__wifi_set_inactive_time__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_set_country_code", - 334, + "resp_wifi_get_inactive_time", + 582, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_set_country_code), - &rpc__req__wifi_set_country_code__descriptor, + offsetof(Rpc, resp_wifi_get_inactive_time), + &rpc__resp__wifi_get_inactive_time__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_get_country_code", - 335, + "resp_wifi_set_country_code", + 590, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_get_country_code), - &rpc__req__wifi_get_country_code__descriptor, + offsetof(Rpc, resp_wifi_set_country_code), + &rpc__resp__wifi_set_country_code__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_sta_get_aid", - 338, + "resp_wifi_get_country_code", + 591, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_sta_get_aid), - &rpc__req__wifi_sta_get_aid__descriptor, + offsetof(Rpc, resp_wifi_get_country_code), + &rpc__resp__wifi_get_country_code__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_sta_get_negotiated_phymode", - 339, + "resp_wifi_sta_get_aid", + 594, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_sta_get_negotiated_phymode), - &rpc__req__wifi_sta_get_negotiated_phymode__descriptor, + offsetof(Rpc, resp_wifi_sta_get_aid), + &rpc__resp__wifi_sta_get_aid__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_sta_get_rssi", - 341, + "resp_wifi_sta_get_negotiated_phymode", + 595, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_sta_get_rssi), - &rpc__req__wifi_sta_get_rssi__descriptor, + offsetof(Rpc, resp_wifi_sta_get_negotiated_phymode), + &rpc__resp__wifi_sta_get_negotiated_phymode__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_set_protocols", - 342, + "resp_wifi_sta_get_rssi", + 597, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_set_protocols), - &rpc__req__wifi_set_protocols__descriptor, + offsetof(Rpc, resp_wifi_sta_get_rssi), + &rpc__resp__wifi_sta_get_rssi__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_get_protocols", - 343, + "resp_wifi_set_protocols", + 598, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_get_protocols), - &rpc__req__wifi_get_protocols__descriptor, + offsetof(Rpc, resp_wifi_set_protocols), + &rpc__resp__wifi_set_protocols__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_set_bandwidths", - 344, + "resp_wifi_get_protocols", + 599, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_set_bandwidths), - &rpc__req__wifi_set_bandwidths__descriptor, + offsetof(Rpc, resp_wifi_get_protocols), + &rpc__resp__wifi_get_protocols__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_get_bandwidths", - 345, + "resp_wifi_set_bandwidths", + 600, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_get_bandwidths), - &rpc__req__wifi_get_bandwidths__descriptor, + offsetof(Rpc, resp_wifi_set_bandwidths), + &rpc__resp__wifi_set_bandwidths__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_set_band", - 346, + "resp_wifi_get_bandwidths", + 601, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_set_band), - &rpc__req__wifi_set_band__descriptor, + offsetof(Rpc, resp_wifi_get_bandwidths), + &rpc__resp__wifi_get_bandwidths__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_get_band", - 347, + "resp_wifi_set_band", + 602, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_get_band), - &rpc__req__wifi_get_band__descriptor, + offsetof(Rpc, resp_wifi_set_band), + &rpc__resp__wifi_set_band__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_set_bandmode", - 348, + "resp_wifi_get_band", + 603, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_set_bandmode), - &rpc__req__wifi_set_band_mode__descriptor, + offsetof(Rpc, resp_wifi_get_band), + &rpc__resp__wifi_get_band__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_get_bandmode", - 349, + "resp_wifi_set_bandmode", + 604, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_get_bandmode), - &rpc__req__wifi_get_band_mode__descriptor, + offsetof(Rpc, resp_wifi_set_bandmode), + &rpc__resp__wifi_set_band_mode__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_get_coprocessor_fwversion", - 350, + "resp_wifi_get_bandmode", + 605, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_get_coprocessor_fwversion), - &rpc__req__get_coprocessor_fw_version__descriptor, + offsetof(Rpc, resp_wifi_get_bandmode), + &rpc__resp__wifi_get_band_mode__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "req_wifi_scan_get_ap_record", - 351, + "resp_get_coprocessor_fwversion", + 606, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, req_wifi_scan_get_ap_record), - &rpc__req__wifi_scan_get_ap_record__descriptor, + offsetof(Rpc, resp_get_coprocessor_fwversion), + &rpc__resp__get_coprocessor_fw_version__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_get_mac_address", - 513, + "resp_wifi_scan_get_ap_record", + 607, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_get_mac_address), - &rpc__resp__get_mac_address__descriptor, + offsetof(Rpc, resp_wifi_scan_get_ap_record), + &rpc__resp__wifi_scan_get_ap_record__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_set_mac_address", - 514, + "resp_set_dhcp_dns", + 608, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_set_mac_address), - &rpc__resp__set_mac_address__descriptor, + offsetof(Rpc, resp_set_dhcp_dns), + &rpc__resp__set_dhcp_dns_status__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_get_wifi_mode", - 515, + "resp_get_dhcp_dns", + 609, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_get_wifi_mode), - &rpc__resp__get_mode__descriptor, + offsetof(Rpc, resp_get_dhcp_dns), + &rpc__resp__get_dhcp_dns_status__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_set_wifi_mode", - 516, + "resp_wifi_sta_twt_config", + 610, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_set_wifi_mode), - &rpc__resp__set_mode__descriptor, + offsetof(Rpc, resp_wifi_sta_twt_config), + &rpc__resp__wifi_sta_twt_config__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_set_ps", - 526, + "resp_wifi_sta_itwt_setup", + 611, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_set_ps), - &rpc__resp__set_ps__descriptor, + offsetof(Rpc, resp_wifi_sta_itwt_setup), + &rpc__resp__wifi_sta_itwt_setup__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_get_ps", - 527, + "resp_wifi_sta_itwt_teardown", + 612, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_get_ps), - &rpc__resp__get_ps__descriptor, + offsetof(Rpc, resp_wifi_sta_itwt_teardown), + &rpc__resp__wifi_sta_itwt_teardown__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_ota_begin", - 528, + "resp_wifi_sta_itwt_suspend", + 613, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_ota_begin), - &rpc__resp__otabegin__descriptor, + offsetof(Rpc, resp_wifi_sta_itwt_suspend), + &rpc__resp__wifi_sta_itwt_suspend__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_ota_write", - 529, + "resp_wifi_sta_itwt_get_flow_id_status", + 614, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_ota_write), - &rpc__resp__otawrite__descriptor, + offsetof(Rpc, resp_wifi_sta_itwt_get_flow_id_status), + &rpc__resp__wifi_sta_itwt_get_flow_id_status__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_ota_end", - 530, + "resp_wifi_sta_itwt_send_probe_req", + 615, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_ota_end), - &rpc__resp__otaend__descriptor, + offsetof(Rpc, resp_wifi_sta_itwt_send_probe_req), + &rpc__resp__wifi_sta_itwt_send_probe_req__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_set_wifi_max_tx_power", - 531, + "resp_wifi_sta_itwt_set_target_wake_time_offset", + 616, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_set_wifi_max_tx_power), - &rpc__resp__wifi_set_max_tx_power__descriptor, + offsetof(Rpc, resp_wifi_sta_itwt_set_target_wake_time_offset), + &rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_get_wifi_max_tx_power", - 532, + "resp_wifi_sta_enterprise_enable", + 617, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_get_wifi_max_tx_power), - &rpc__resp__wifi_get_max_tx_power__descriptor, + offsetof(Rpc, resp_wifi_sta_enterprise_enable), + &rpc__resp__wifi_sta_enterprise_enable__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_config_heartbeat", - 533, + "resp_wifi_sta_enterprise_disable", + 618, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_config_heartbeat), - &rpc__resp__config_heartbeat__descriptor, + offsetof(Rpc, resp_wifi_sta_enterprise_disable), + &rpc__resp__wifi_sta_enterprise_disable__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_init", - 534, + "resp_eap_set_identity", + 619, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_init), - &rpc__resp__wifi_init__descriptor, + offsetof(Rpc, resp_eap_set_identity), + &rpc__resp__eap_set_identity__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_deinit", - 535, + "resp_eap_clear_identity", + 620, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_deinit), - &rpc__resp__wifi_deinit__descriptor, + offsetof(Rpc, resp_eap_clear_identity), + &rpc__resp__eap_clear_identity__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_start", - 536, + "resp_eap_set_username", + 621, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_start), - &rpc__resp__wifi_start__descriptor, + offsetof(Rpc, resp_eap_set_username), + &rpc__resp__eap_set_username__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_stop", - 537, + "resp_eap_clear_username", + 622, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_stop), - &rpc__resp__wifi_stop__descriptor, + offsetof(Rpc, resp_eap_clear_username), + &rpc__resp__eap_clear_username__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_connect", - 538, + "resp_eap_set_password", + 623, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_connect), - &rpc__resp__wifi_connect__descriptor, + offsetof(Rpc, resp_eap_set_password), + &rpc__resp__eap_set_password__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_disconnect", - 539, + "resp_eap_clear_password", + 624, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_disconnect), - &rpc__resp__wifi_disconnect__descriptor, + offsetof(Rpc, resp_eap_clear_password), + &rpc__resp__eap_clear_password__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_set_config", - 540, + "resp_eap_set_new_password", + 625, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_set_config), - &rpc__resp__wifi_set_config__descriptor, + offsetof(Rpc, resp_eap_set_new_password), + &rpc__resp__eap_set_new_password__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_get_config", - 541, + "resp_eap_clear_new_password", + 626, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_get_config), - &rpc__resp__wifi_get_config__descriptor, + offsetof(Rpc, resp_eap_clear_new_password), + &rpc__resp__eap_clear_new_password__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_scan_start", - 542, + "resp_eap_set_ca_cert", + 627, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_scan_start), - &rpc__resp__wifi_scan_start__descriptor, + offsetof(Rpc, resp_eap_set_ca_cert), + &rpc__resp__eap_set_ca_cert__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_scan_stop", - 543, + "resp_eap_clear_ca_cert", + 628, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_scan_stop), - &rpc__resp__wifi_scan_stop__descriptor, + offsetof(Rpc, resp_eap_clear_ca_cert), + &rpc__resp__eap_clear_ca_cert__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_scan_get_ap_num", - 544, + "resp_eap_set_certificate_and_key", + 629, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_scan_get_ap_num), - &rpc__resp__wifi_scan_get_ap_num__descriptor, + offsetof(Rpc, resp_eap_set_certificate_and_key), + &rpc__resp__eap_set_certificate_and_key__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_scan_get_ap_records", - 545, + "resp_eap_clear_certificate_and_key", + 630, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, - offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_scan_get_ap_records), - &rpc__resp__wifi_scan_get_ap_records__descriptor, + offsetof(Rpc, payload_case), + offsetof(Rpc, resp_eap_clear_certificate_and_key), + &rpc__resp__eap_clear_certificate_and_key__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_clear_ap_list", - 546, + "resp_eap_get_disable_time_check", + 631, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_clear_ap_list), - &rpc__resp__wifi_clear_ap_list__descriptor, + offsetof(Rpc, resp_eap_get_disable_time_check), + &rpc__resp__eap_get_disable_time_check__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_restore", - 547, + "resp_eap_set_ttls_phase2_method", + 632, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_restore), - &rpc__resp__wifi_restore__descriptor, + offsetof(Rpc, resp_eap_set_ttls_phase2_method), + &rpc__resp__eap_set_ttls_phase2_method__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_clear_fast_connect", - 548, + "resp_eap_set_suiteb_certification", + 633, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_clear_fast_connect), - &rpc__resp__wifi_clear_fast_connect__descriptor, + offsetof(Rpc, resp_eap_set_suiteb_certification), + &rpc__resp__eap_set_suiteb192bit_certification__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_deauth_sta", - 549, + "resp_eap_set_pac_file", + 634, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_deauth_sta), - &rpc__resp__wifi_deauth_sta__descriptor, + offsetof(Rpc, resp_eap_set_pac_file), + &rpc__resp__eap_set_pac_file__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_sta_get_ap_info", - 550, + "resp_eap_set_fast_params", + 635, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_sta_get_ap_info), - &rpc__resp__wifi_sta_get_ap_info__descriptor, + offsetof(Rpc, resp_eap_set_fast_params), + &rpc__resp__eap_set_fast_params__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_set_protocol", - 553, + "resp_eap_use_default_cert_bundle", + 636, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_set_protocol), - &rpc__resp__wifi_set_protocol__descriptor, + offsetof(Rpc, resp_eap_use_default_cert_bundle), + &rpc__resp__eap_use_default_cert_bundle__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_get_protocol", - 554, + "resp_wifi_set_okc_support", + 637, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_get_protocol), - &rpc__resp__wifi_get_protocol__descriptor, + offsetof(Rpc, resp_wifi_set_okc_support), + &rpc__resp__wifi_set_okc_support__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_set_bandwidth", - 555, + "resp_eap_set_domain_name", + 638, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_set_bandwidth), - &rpc__resp__wifi_set_bandwidth__descriptor, + offsetof(Rpc, resp_eap_set_domain_name), + &rpc__resp__eap_set_domain_name__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_get_bandwidth", - 556, + "resp_eap_set_disable_time_check", + 639, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_get_bandwidth), - &rpc__resp__wifi_get_bandwidth__descriptor, + offsetof(Rpc, resp_eap_set_disable_time_check), + &rpc__resp__eap_set_disable_time_check__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_set_channel", - 557, + "resp_eap_set_eap_methods", + 640, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_set_channel), - &rpc__resp__wifi_set_channel__descriptor, + offsetof(Rpc, resp_eap_set_eap_methods), + &rpc__resp__eap_set_eap_methods__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_get_channel", - 558, + "resp_iface_mac_addr_set_get", + 641, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_get_channel), - &rpc__resp__wifi_get_channel__descriptor, + offsetof(Rpc, resp_iface_mac_addr_set_get), + &rpc__resp__iface_mac_addr_set_get__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_set_country", - 559, + "resp_iface_mac_addr_len_get", + 642, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_set_country), - &rpc__resp__wifi_set_country__descriptor, + offsetof(Rpc, resp_iface_mac_addr_len_get), + &rpc__resp__iface_mac_addr_len_get__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_get_country", - 560, + "resp_feature_control", + 643, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_get_country), - &rpc__resp__wifi_get_country__descriptor, + offsetof(Rpc, resp_feature_control), + &rpc__resp__feature_control__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_ap_get_sta_list", - 567, + "resp_gpio_config", + 644, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_ap_get_sta_list), - &rpc__resp__wifi_ap_get_sta_list__descriptor, + offsetof(Rpc, resp_gpio_config), + &rpc__resp__gpio_config__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_ap_get_sta_aid", - 568, + "resp_gpio_reset", + 645, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_ap_get_sta_aid), - &rpc__resp__wifi_ap_get_sta_aid__descriptor, + offsetof(Rpc, resp_gpio_reset), + &rpc__resp__gpio_reset_pin__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_set_storage", - 569, + "resp_gpio_set_level", + 646, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_set_storage), - &rpc__resp__wifi_set_storage__descriptor, + offsetof(Rpc, resp_gpio_set_level), + &rpc__resp__gpio_set_level__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_set_country_code", - 590, + "resp_gpio_get_level", + 647, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_set_country_code), - &rpc__resp__wifi_set_country_code__descriptor, + offsetof(Rpc, resp_gpio_get_level), + &rpc__resp__gpio_get_level__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_get_country_code", - 591, + "resp_gpio_set_direction", + 648, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_get_country_code), - &rpc__resp__wifi_get_country_code__descriptor, + offsetof(Rpc, resp_gpio_set_direction), + &rpc__resp__gpio_set_direction__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_sta_get_aid", - 594, + "resp_gpio_input_enable", + 649, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_sta_get_aid), - &rpc__resp__wifi_sta_get_aid__descriptor, + offsetof(Rpc, resp_gpio_input_enable), + &rpc__resp__gpio_input_enable__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_sta_get_negotiated_phymode", - 595, + "resp_gpio_set_pull_mode", + 650, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_sta_get_negotiated_phymode), - &rpc__resp__wifi_sta_get_negotiated_phymode__descriptor, + offsetof(Rpc, resp_gpio_set_pull_mode), + &rpc__resp__gpio_set_pull_mode__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_sta_get_rssi", - 597, + "event_esp_init", + 769, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_sta_get_rssi), - &rpc__resp__wifi_sta_get_rssi__descriptor, + offsetof(Rpc, event_esp_init), + &rpc__event__espinit__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_set_protocols", - 598, + "event_heartbeat", + 770, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_set_protocols), - &rpc__resp__wifi_set_protocols__descriptor, + offsetof(Rpc, event_heartbeat), + &rpc__event__heartbeat__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_get_protocols", - 599, + "event_ap_sta_connected", + 771, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_get_protocols), - &rpc__resp__wifi_get_protocols__descriptor, + offsetof(Rpc, event_ap_sta_connected), + &rpc__event__ap__sta_connected__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_set_bandwidths", - 600, + "event_ap_sta_disconnected", + 772, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_set_bandwidths), - &rpc__resp__wifi_set_bandwidths__descriptor, + offsetof(Rpc, event_ap_sta_disconnected), + &rpc__event__ap__sta_disconnected__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_get_bandwidths", - 601, + "event_wifi_event_no_args", + 773, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_get_bandwidths), - &rpc__resp__wifi_get_bandwidths__descriptor, + offsetof(Rpc, event_wifi_event_no_args), + &rpc__event__wifi_event_no_args__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_set_band", - 602, + "event_sta_scan_done", + 774, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_set_band), - &rpc__resp__wifi_set_band__descriptor, + offsetof(Rpc, event_sta_scan_done), + &rpc__event__sta_scan_done__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_get_band", - 603, + "event_sta_connected", + 775, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_get_band), - &rpc__resp__wifi_get_band__descriptor, + offsetof(Rpc, event_sta_connected), + &rpc__event__sta_connected__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_set_bandmode", - 604, + "event_sta_disconnected", + 776, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_set_bandmode), - &rpc__resp__wifi_set_band_mode__descriptor, + offsetof(Rpc, event_sta_disconnected), + &rpc__event__sta_disconnected__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_get_bandmode", - 605, + "event_dhcp_dns", + 777, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_get_bandmode), - &rpc__resp__wifi_get_band_mode__descriptor, + offsetof(Rpc, event_dhcp_dns), + &rpc__event__dhcp_dns_status__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_get_coprocessor_fwversion", - 606, + "event_sta_itwt_setup", + 778, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_get_coprocessor_fwversion), - &rpc__resp__get_coprocessor_fw_version__descriptor, + offsetof(Rpc, event_sta_itwt_setup), + &rpc__event__sta_itwt_setup__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "resp_wifi_scan_get_ap_record", - 607, + "event_sta_itwt_teardown", + 779, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, resp_wifi_scan_get_ap_record), - &rpc__resp__wifi_scan_get_ap_record__descriptor, + offsetof(Rpc, event_sta_itwt_teardown), + &rpc__event__sta_itwt_teardown__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "event_esp_init", - 769, + "event_sta_itwt_suspend", + 780, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, event_esp_init), - &rpc__event__espinit__descriptor, + offsetof(Rpc, event_sta_itwt_suspend), + &rpc__event__sta_itwt_suspend__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "event_heartbeat", - 770, + "event_sta_itwt_probe", + 781, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, event_heartbeat), - &rpc__event__heartbeat__descriptor, + offsetof(Rpc, event_sta_itwt_probe), + &rpc__event__sta_itwt_probe__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "event_ap_sta_connected", - 771, + "event_supp_dpp_uri_ready", + 782, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, event_ap_sta_connected), - &rpc__event__ap__sta_connected__descriptor, + offsetof(Rpc, event_supp_dpp_uri_ready), + &rpc__event__supp_dpp_uri_ready__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "event_ap_sta_disconnected", - 772, + "event_supp_dpp_cfg_recvd", + 783, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, event_ap_sta_disconnected), - &rpc__event__ap__sta_disconnected__descriptor, + offsetof(Rpc, event_supp_dpp_cfg_recvd), + &rpc__event__supp_dpp_cfg_recvd__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "event_wifi_event_no_args", - 773, + "event_supp_dpp_fail", + 784, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, event_wifi_event_no_args), - &rpc__event__wifi_event_no_args__descriptor, + offsetof(Rpc, event_supp_dpp_fail), + &rpc__event__supp_dpp_fail__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "event_sta_scan_done", - 774, + "event_wifi_dpp_uri_ready", + 785, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, event_sta_scan_done), - &rpc__event__sta_scan_done__descriptor, + offsetof(Rpc, event_wifi_dpp_uri_ready), + &rpc__event__wifi_dpp_uri_ready__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "event_sta_connected", - 775, + "event_wifi_dpp_cfg_recvd", + 786, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, event_sta_connected), - &rpc__event__sta_connected__descriptor, + offsetof(Rpc, event_wifi_dpp_cfg_recvd), + &rpc__event__wifi_dpp_cfg_recvd__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "event_sta_disconnected", - 776, + "event_wifi_dpp_fail", + 787, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, offsetof(Rpc, payload_case), - offsetof(Rpc, event_sta_disconnected), - &rpc__event__sta_disconnected__descriptor, + offsetof(Rpc, event_wifi_dpp_fail), + &rpc__event__wifi_dpp_fail__descriptor, NULL, 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; static const unsigned rpc__field_indices_by_name[] = { - 115, /* field[115] = event_ap_sta_connected */ - 116, /* field[116] = event_ap_sta_disconnected */ - 113, /* field[113] = event_esp_init */ - 114, /* field[114] = event_heartbeat */ - 119, /* field[119] = event_sta_connected */ - 120, /* field[120] = event_sta_disconnected */ - 118, /* field[118] = event_sta_scan_done */ - 117, /* field[117] = event_wifi_event_no_args */ + 217, /* field[217] = event_ap_sta_connected */ + 218, /* field[218] = event_ap_sta_disconnected */ + 223, /* field[223] = event_dhcp_dns */ + 215, /* field[215] = event_esp_init */ + 216, /* field[216] = event_heartbeat */ + 221, /* field[221] = event_sta_connected */ + 222, /* field[222] = event_sta_disconnected */ + 227, /* field[227] = event_sta_itwt_probe */ + 224, /* field[224] = event_sta_itwt_setup */ + 226, /* field[226] = event_sta_itwt_suspend */ + 225, /* field[225] = event_sta_itwt_teardown */ + 220, /* field[220] = event_sta_scan_done */ + 229, /* field[229] = event_supp_dpp_cfg_recvd */ + 230, /* field[230] = event_supp_dpp_fail */ + 228, /* field[228] = event_supp_dpp_uri_ready */ + 232, /* field[232] = event_wifi_dpp_cfg_recvd */ + 233, /* field[233] = event_wifi_dpp_fail */ + 231, /* field[231] = event_wifi_dpp_uri_ready */ + 219, /* field[219] = event_wifi_event_no_args */ 1, /* field[1] = msg_id */ 0, /* field[0] = msg_type */ - 14, /* field[14] = req_config_heartbeat */ - 56, /* field[56] = req_get_coprocessor_fwversion */ + 20, /* field[20] = req_config_heartbeat */ + 86, /* field[86] = req_eap_clear_ca_cert */ + 88, /* field[88] = req_eap_clear_certificate_and_key */ + 78, /* field[78] = req_eap_clear_identity */ + 84, /* field[84] = req_eap_clear_new_password */ + 82, /* field[82] = req_eap_clear_password */ + 80, /* field[80] = req_eap_clear_username */ + 89, /* field[89] = req_eap_get_disable_time_check */ + 85, /* field[85] = req_eap_set_ca_cert */ + 87, /* field[87] = req_eap_set_certificate_and_key */ + 97, /* field[97] = req_eap_set_disable_time_check */ + 96, /* field[96] = req_eap_set_domain_name */ + 98, /* field[98] = req_eap_set_eap_methods */ + 93, /* field[93] = req_eap_set_fast_params */ + 77, /* field[77] = req_eap_set_identity */ + 83, /* field[83] = req_eap_set_new_password */ + 92, /* field[92] = req_eap_set_pac_file */ + 81, /* field[81] = req_eap_set_password */ + 91, /* field[91] = req_eap_set_suiteb_certification */ + 90, /* field[90] = req_eap_set_ttls_phase2_method */ + 79, /* field[79] = req_eap_set_username */ + 94, /* field[94] = req_eap_use_default_cert_bundle */ + 101, /* field[101] = req_feature_control */ + 64, /* field[64] = req_get_coprocessor_fwversion */ + 67, /* field[67] = req_get_dhcp_dns */ 3, /* field[3] = req_get_mac_address */ - 13, /* field[13] = req_get_wifi_max_tx_power */ + 19, /* field[19] = req_get_wifi_max_tx_power */ 5, /* field[5] = req_get_wifi_mode */ - 9, /* field[9] = req_ota_begin */ - 11, /* field[11] = req_ota_end */ - 10, /* field[10] = req_ota_write */ + 102, /* field[102] = req_gpio_config */ + 105, /* field[105] = req_gpio_get_level */ + 107, /* field[107] = req_gpio_input_enable */ + 103, /* field[103] = req_gpio_reset */ + 106, /* field[106] = req_gpio_set_direction */ + 104, /* field[104] = req_gpio_set_level */ + 108, /* field[108] = req_gpio_set_pull_mode */ + 100, /* field[100] = req_iface_mac_addr_len_get */ + 99, /* field[99] = req_iface_mac_addr_set_get */ + 12, /* field[12] = req_ota_activate */ + 15, /* field[15] = req_ota_begin */ + 17, /* field[17] = req_ota_end */ + 16, /* field[16] = req_ota_write */ + 66, /* field[66] = req_set_dhcp_dns */ 4, /* field[4] = req_set_mac_address */ - 12, /* field[12] = req_set_wifi_max_tx_power */ + 18, /* field[18] = req_set_wifi_max_tx_power */ 6, /* field[6] = req_set_wifi_mode */ - 41, /* field[41] = req_wifi_ap_get_sta_aid */ - 40, /* field[40] = req_wifi_ap_get_sta_list */ - 27, /* field[27] = req_wifi_clear_ap_list */ - 29, /* field[29] = req_wifi_clear_fast_connect */ - 19, /* field[19] = req_wifi_connect */ - 30, /* field[30] = req_wifi_deauth_sta */ - 16, /* field[16] = req_wifi_deinit */ - 20, /* field[20] = req_wifi_disconnect */ - 53, /* field[53] = req_wifi_get_band */ - 55, /* field[55] = req_wifi_get_bandmode */ - 35, /* field[35] = req_wifi_get_bandwidth */ - 51, /* field[51] = req_wifi_get_bandwidths */ - 37, /* field[37] = req_wifi_get_channel */ - 22, /* field[22] = req_wifi_get_config */ - 39, /* field[39] = req_wifi_get_country */ - 44, /* field[44] = req_wifi_get_country_code */ - 33, /* field[33] = req_wifi_get_protocol */ - 49, /* field[49] = req_wifi_get_protocols */ - 8, /* field[8] = req_wifi_get_ps */ - 15, /* field[15] = req_wifi_init */ - 28, /* field[28] = req_wifi_restore */ - 25, /* field[25] = req_wifi_scan_get_ap_num */ - 57, /* field[57] = req_wifi_scan_get_ap_record */ - 26, /* field[26] = req_wifi_scan_get_ap_records */ - 23, /* field[23] = req_wifi_scan_start */ - 24, /* field[24] = req_wifi_scan_stop */ - 52, /* field[52] = req_wifi_set_band */ - 54, /* field[54] = req_wifi_set_bandmode */ - 34, /* field[34] = req_wifi_set_bandwidth */ - 50, /* field[50] = req_wifi_set_bandwidths */ - 36, /* field[36] = req_wifi_set_channel */ - 21, /* field[21] = req_wifi_set_config */ - 38, /* field[38] = req_wifi_set_country */ - 43, /* field[43] = req_wifi_set_country_code */ - 32, /* field[32] = req_wifi_set_protocol */ - 48, /* field[48] = req_wifi_set_protocols */ - 7, /* field[7] = req_wifi_set_ps */ - 42, /* field[42] = req_wifi_set_storage */ - 45, /* field[45] = req_wifi_sta_get_aid */ - 31, /* field[31] = req_wifi_sta_get_ap_info */ - 46, /* field[46] = req_wifi_sta_get_negotiated_phymode */ - 47, /* field[47] = req_wifi_sta_get_rssi */ - 17, /* field[17] = req_wifi_start */ - 18, /* field[18] = req_wifi_stop */ - 69, /* field[69] = resp_config_heartbeat */ - 111, /* field[111] = resp_get_coprocessor_fwversion */ - 58, /* field[58] = resp_get_mac_address */ - 68, /* field[68] = resp_get_wifi_max_tx_power */ - 60, /* field[60] = resp_get_wifi_mode */ - 64, /* field[64] = resp_ota_begin */ - 66, /* field[66] = resp_ota_end */ - 65, /* field[65] = resp_ota_write */ - 59, /* field[59] = resp_set_mac_address */ - 67, /* field[67] = resp_set_wifi_max_tx_power */ - 61, /* field[61] = resp_set_wifi_mode */ - 96, /* field[96] = resp_wifi_ap_get_sta_aid */ - 95, /* field[95] = resp_wifi_ap_get_sta_list */ - 82, /* field[82] = resp_wifi_clear_ap_list */ - 84, /* field[84] = resp_wifi_clear_fast_connect */ - 74, /* field[74] = resp_wifi_connect */ - 85, /* field[85] = resp_wifi_deauth_sta */ - 71, /* field[71] = resp_wifi_deinit */ - 75, /* field[75] = resp_wifi_disconnect */ - 108, /* field[108] = resp_wifi_get_band */ - 110, /* field[110] = resp_wifi_get_bandmode */ - 90, /* field[90] = resp_wifi_get_bandwidth */ - 106, /* field[106] = resp_wifi_get_bandwidths */ - 92, /* field[92] = resp_wifi_get_channel */ - 77, /* field[77] = resp_wifi_get_config */ - 94, /* field[94] = resp_wifi_get_country */ - 99, /* field[99] = resp_wifi_get_country_code */ - 88, /* field[88] = resp_wifi_get_protocol */ - 104, /* field[104] = resp_wifi_get_protocols */ - 63, /* field[63] = resp_wifi_get_ps */ - 70, /* field[70] = resp_wifi_init */ - 83, /* field[83] = resp_wifi_restore */ - 80, /* field[80] = resp_wifi_scan_get_ap_num */ - 112, /* field[112] = resp_wifi_scan_get_ap_record */ - 81, /* field[81] = resp_wifi_scan_get_ap_records */ - 78, /* field[78] = resp_wifi_scan_start */ - 79, /* field[79] = resp_wifi_scan_stop */ - 107, /* field[107] = resp_wifi_set_band */ - 109, /* field[109] = resp_wifi_set_bandmode */ - 89, /* field[89] = resp_wifi_set_bandwidth */ - 105, /* field[105] = resp_wifi_set_bandwidths */ - 91, /* field[91] = resp_wifi_set_channel */ - 76, /* field[76] = resp_wifi_set_config */ - 93, /* field[93] = resp_wifi_set_country */ - 98, /* field[98] = resp_wifi_set_country_code */ - 87, /* field[87] = resp_wifi_set_protocol */ - 103, /* field[103] = resp_wifi_set_protocols */ - 62, /* field[62] = resp_wifi_set_ps */ - 97, /* field[97] = resp_wifi_set_storage */ - 100, /* field[100] = resp_wifi_sta_get_aid */ - 86, /* field[86] = resp_wifi_sta_get_ap_info */ - 101, /* field[101] = resp_wifi_sta_get_negotiated_phymode */ - 102, /* field[102] = resp_wifi_sta_get_rssi */ - 72, /* field[72] = resp_wifi_start */ - 73, /* field[73] = resp_wifi_stop */ + 9, /* field[9] = req_supp_dpp_bootstrap_gen */ + 8, /* field[8] = req_supp_dpp_deinit */ + 7, /* field[7] = req_supp_dpp_init */ + 10, /* field[10] = req_supp_dpp_start_listen */ + 11, /* field[11] = req_supp_dpp_stop_listen */ + 47, /* field[47] = req_wifi_ap_get_sta_aid */ + 46, /* field[46] = req_wifi_ap_get_sta_list */ + 33, /* field[33] = req_wifi_clear_ap_list */ + 35, /* field[35] = req_wifi_clear_fast_connect */ + 25, /* field[25] = req_wifi_connect */ + 36, /* field[36] = req_wifi_deauth_sta */ + 22, /* field[22] = req_wifi_deinit */ + 26, /* field[26] = req_wifi_disconnect */ + 61, /* field[61] = req_wifi_get_band */ + 63, /* field[63] = req_wifi_get_bandmode */ + 41, /* field[41] = req_wifi_get_bandwidth */ + 59, /* field[59] = req_wifi_get_bandwidths */ + 43, /* field[43] = req_wifi_get_channel */ + 28, /* field[28] = req_wifi_get_config */ + 45, /* field[45] = req_wifi_get_country */ + 52, /* field[52] = req_wifi_get_country_code */ + 50, /* field[50] = req_wifi_get_inactive_time */ + 39, /* field[39] = req_wifi_get_protocol */ + 57, /* field[57] = req_wifi_get_protocols */ + 14, /* field[14] = req_wifi_get_ps */ + 21, /* field[21] = req_wifi_init */ + 34, /* field[34] = req_wifi_restore */ + 31, /* field[31] = req_wifi_scan_get_ap_num */ + 65, /* field[65] = req_wifi_scan_get_ap_record */ + 32, /* field[32] = req_wifi_scan_get_ap_records */ + 29, /* field[29] = req_wifi_scan_start */ + 30, /* field[30] = req_wifi_scan_stop */ + 60, /* field[60] = req_wifi_set_band */ + 62, /* field[62] = req_wifi_set_bandmode */ + 40, /* field[40] = req_wifi_set_bandwidth */ + 58, /* field[58] = req_wifi_set_bandwidths */ + 42, /* field[42] = req_wifi_set_channel */ + 27, /* field[27] = req_wifi_set_config */ + 44, /* field[44] = req_wifi_set_country */ + 51, /* field[51] = req_wifi_set_country_code */ + 49, /* field[49] = req_wifi_set_inactive_time */ + 95, /* field[95] = req_wifi_set_okc_support */ + 38, /* field[38] = req_wifi_set_protocol */ + 56, /* field[56] = req_wifi_set_protocols */ + 13, /* field[13] = req_wifi_set_ps */ + 48, /* field[48] = req_wifi_set_storage */ + 76, /* field[76] = req_wifi_sta_enterprise_disable */ + 75, /* field[75] = req_wifi_sta_enterprise_enable */ + 53, /* field[53] = req_wifi_sta_get_aid */ + 37, /* field[37] = req_wifi_sta_get_ap_info */ + 54, /* field[54] = req_wifi_sta_get_negotiated_phymode */ + 55, /* field[55] = req_wifi_sta_get_rssi */ + 72, /* field[72] = req_wifi_sta_itwt_get_flow_id_status */ + 73, /* field[73] = req_wifi_sta_itwt_send_probe_req */ + 74, /* field[74] = req_wifi_sta_itwt_set_target_wake_time_offset */ + 69, /* field[69] = req_wifi_sta_itwt_setup */ + 71, /* field[71] = req_wifi_sta_itwt_suspend */ + 70, /* field[70] = req_wifi_sta_itwt_teardown */ + 68, /* field[68] = req_wifi_sta_twt_config */ + 23, /* field[23] = req_wifi_start */ + 24, /* field[24] = req_wifi_stop */ + 126, /* field[126] = resp_config_heartbeat */ + 192, /* field[192] = resp_eap_clear_ca_cert */ + 194, /* field[194] = resp_eap_clear_certificate_and_key */ + 184, /* field[184] = resp_eap_clear_identity */ + 190, /* field[190] = resp_eap_clear_new_password */ + 188, /* field[188] = resp_eap_clear_password */ + 186, /* field[186] = resp_eap_clear_username */ + 195, /* field[195] = resp_eap_get_disable_time_check */ + 191, /* field[191] = resp_eap_set_ca_cert */ + 193, /* field[193] = resp_eap_set_certificate_and_key */ + 203, /* field[203] = resp_eap_set_disable_time_check */ + 202, /* field[202] = resp_eap_set_domain_name */ + 204, /* field[204] = resp_eap_set_eap_methods */ + 199, /* field[199] = resp_eap_set_fast_params */ + 183, /* field[183] = resp_eap_set_identity */ + 189, /* field[189] = resp_eap_set_new_password */ + 198, /* field[198] = resp_eap_set_pac_file */ + 187, /* field[187] = resp_eap_set_password */ + 197, /* field[197] = resp_eap_set_suiteb_certification */ + 196, /* field[196] = resp_eap_set_ttls_phase2_method */ + 185, /* field[185] = resp_eap_set_username */ + 200, /* field[200] = resp_eap_use_default_cert_bundle */ + 207, /* field[207] = resp_feature_control */ + 170, /* field[170] = resp_get_coprocessor_fwversion */ + 173, /* field[173] = resp_get_dhcp_dns */ + 109, /* field[109] = resp_get_mac_address */ + 125, /* field[125] = resp_get_wifi_max_tx_power */ + 111, /* field[111] = resp_get_wifi_mode */ + 208, /* field[208] = resp_gpio_config */ + 211, /* field[211] = resp_gpio_get_level */ + 213, /* field[213] = resp_gpio_input_enable */ + 209, /* field[209] = resp_gpio_reset */ + 212, /* field[212] = resp_gpio_set_direction */ + 210, /* field[210] = resp_gpio_set_level */ + 214, /* field[214] = resp_gpio_set_pull_mode */ + 206, /* field[206] = resp_iface_mac_addr_len_get */ + 205, /* field[205] = resp_iface_mac_addr_set_get */ + 118, /* field[118] = resp_ota_activate */ + 121, /* field[121] = resp_ota_begin */ + 123, /* field[123] = resp_ota_end */ + 122, /* field[122] = resp_ota_write */ + 172, /* field[172] = resp_set_dhcp_dns */ + 110, /* field[110] = resp_set_mac_address */ + 124, /* field[124] = resp_set_wifi_max_tx_power */ + 112, /* field[112] = resp_set_wifi_mode */ + 115, /* field[115] = resp_supp_dpp_bootstrap_gen */ + 114, /* field[114] = resp_supp_dpp_deinit */ + 113, /* field[113] = resp_supp_dpp_init */ + 116, /* field[116] = resp_supp_dpp_start_listen */ + 117, /* field[117] = resp_supp_dpp_stop_listen */ + 153, /* field[153] = resp_wifi_ap_get_sta_aid */ + 152, /* field[152] = resp_wifi_ap_get_sta_list */ + 139, /* field[139] = resp_wifi_clear_ap_list */ + 141, /* field[141] = resp_wifi_clear_fast_connect */ + 131, /* field[131] = resp_wifi_connect */ + 142, /* field[142] = resp_wifi_deauth_sta */ + 128, /* field[128] = resp_wifi_deinit */ + 132, /* field[132] = resp_wifi_disconnect */ + 167, /* field[167] = resp_wifi_get_band */ + 169, /* field[169] = resp_wifi_get_bandmode */ + 147, /* field[147] = resp_wifi_get_bandwidth */ + 165, /* field[165] = resp_wifi_get_bandwidths */ + 149, /* field[149] = resp_wifi_get_channel */ + 134, /* field[134] = resp_wifi_get_config */ + 151, /* field[151] = resp_wifi_get_country */ + 158, /* field[158] = resp_wifi_get_country_code */ + 156, /* field[156] = resp_wifi_get_inactive_time */ + 145, /* field[145] = resp_wifi_get_protocol */ + 163, /* field[163] = resp_wifi_get_protocols */ + 120, /* field[120] = resp_wifi_get_ps */ + 127, /* field[127] = resp_wifi_init */ + 140, /* field[140] = resp_wifi_restore */ + 137, /* field[137] = resp_wifi_scan_get_ap_num */ + 171, /* field[171] = resp_wifi_scan_get_ap_record */ + 138, /* field[138] = resp_wifi_scan_get_ap_records */ + 135, /* field[135] = resp_wifi_scan_start */ + 136, /* field[136] = resp_wifi_scan_stop */ + 166, /* field[166] = resp_wifi_set_band */ + 168, /* field[168] = resp_wifi_set_bandmode */ + 146, /* field[146] = resp_wifi_set_bandwidth */ + 164, /* field[164] = resp_wifi_set_bandwidths */ + 148, /* field[148] = resp_wifi_set_channel */ + 133, /* field[133] = resp_wifi_set_config */ + 150, /* field[150] = resp_wifi_set_country */ + 157, /* field[157] = resp_wifi_set_country_code */ + 155, /* field[155] = resp_wifi_set_inactive_time */ + 201, /* field[201] = resp_wifi_set_okc_support */ + 144, /* field[144] = resp_wifi_set_protocol */ + 162, /* field[162] = resp_wifi_set_protocols */ + 119, /* field[119] = resp_wifi_set_ps */ + 154, /* field[154] = resp_wifi_set_storage */ + 182, /* field[182] = resp_wifi_sta_enterprise_disable */ + 181, /* field[181] = resp_wifi_sta_enterprise_enable */ + 159, /* field[159] = resp_wifi_sta_get_aid */ + 143, /* field[143] = resp_wifi_sta_get_ap_info */ + 160, /* field[160] = resp_wifi_sta_get_negotiated_phymode */ + 161, /* field[161] = resp_wifi_sta_get_rssi */ + 178, /* field[178] = resp_wifi_sta_itwt_get_flow_id_status */ + 179, /* field[179] = resp_wifi_sta_itwt_send_probe_req */ + 180, /* field[180] = resp_wifi_sta_itwt_set_target_wake_time_offset */ + 175, /* field[175] = resp_wifi_sta_itwt_setup */ + 177, /* field[177] = resp_wifi_sta_itwt_suspend */ + 176, /* field[176] = resp_wifi_sta_itwt_teardown */ + 174, /* field[174] = resp_wifi_sta_twt_config */ + 129, /* field[129] = resp_wifi_start */ + 130, /* field[130] = resp_wifi_stop */ 2, /* field[2] = uid */ }; -static const ProtobufCIntRange rpc__number_ranges[16 + 1] = +static const ProtobufCIntRange rpc__number_ranges[18 + 1] = { { 1, 0 }, { 257, 3 }, - { 270, 7 }, - { 297, 32 }, - { 311, 40 }, - { 334, 43 }, - { 338, 45 }, - { 341, 47 }, - { 513, 58 }, - { 526, 62 }, - { 553, 87 }, - { 567, 95 }, - { 590, 98 }, - { 594, 100 }, - { 597, 102 }, - { 769, 113 }, - { 0, 121 } + { 270, 13 }, + { 297, 38 }, + { 311, 46 }, + { 325, 49 }, + { 334, 51 }, + { 338, 53 }, + { 341, 55 }, + { 513, 109 }, + { 526, 119 }, + { 553, 144 }, + { 567, 152 }, + { 581, 155 }, + { 590, 157 }, + { 594, 159 }, + { 597, 161 }, + { 769, 215 }, + { 0, 234 } }; const ProtobufCMessageDescriptor rpc__descriptor = { @@ -17198,10 +29631,10 @@ const ProtobufCMessageDescriptor rpc__descriptor = "Rpc", "", sizeof(Rpc), - 121, + 234, rpc__field_descriptors, rpc__field_indices_by_name, - 16, rpc__number_ranges, + 18, rpc__number_ranges, (ProtobufCMessageInit) rpc__init, NULL,NULL,NULL /* reserved[123] */ }; @@ -17375,7 +29808,97 @@ const ProtobufCEnumDescriptor rpc_type__descriptor = rpc_type__value_ranges, NULL,NULL,NULL,NULL /* reserved[1234] */ }; -static const ProtobufCEnumValue rpc_id__enum_values_by_number[183] = +static const ProtobufCEnumValue rpc_feature__enum_values_by_number[2] = +{ + { "Feature_None", "RPC_FEATURE__Feature_None", 0 }, + { "Feature_Bluetooth", "RPC_FEATURE__Feature_Bluetooth", 1 }, +}; +static const ProtobufCIntRange rpc_feature__value_ranges[] = { +{0, 0},{0, 2} +}; +static const ProtobufCEnumValueIndex rpc_feature__enum_values_by_name[2] = +{ + { "Feature_Bluetooth", 1 }, + { "Feature_None", 0 }, +}; +const ProtobufCEnumDescriptor rpc_feature__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "RpcFeature", + "RpcFeature", + "RpcFeature", + "", + 2, + rpc_feature__enum_values_by_number, + 2, + rpc_feature__enum_values_by_name, + 1, + rpc_feature__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; +static const ProtobufCEnumValue rpc_feature_command__enum_values_by_number[5] = +{ + { "Feature_Command_None", "RPC_FEATURE_COMMAND__Feature_Command_None", 0 }, + { "Feature_Command_BT_Init", "RPC_FEATURE_COMMAND__Feature_Command_BT_Init", 1 }, + { "Feature_Command_BT_Deinit", "RPC_FEATURE_COMMAND__Feature_Command_BT_Deinit", 2 }, + { "Feature_Command_BT_Enable", "RPC_FEATURE_COMMAND__Feature_Command_BT_Enable", 3 }, + { "Feature_Command_BT_Disable", "RPC_FEATURE_COMMAND__Feature_Command_BT_Disable", 4 }, +}; +static const ProtobufCIntRange rpc_feature_command__value_ranges[] = { +{0, 0},{0, 5} +}; +static const ProtobufCEnumValueIndex rpc_feature_command__enum_values_by_name[5] = +{ + { "Feature_Command_BT_Deinit", 2 }, + { "Feature_Command_BT_Disable", 4 }, + { "Feature_Command_BT_Enable", 3 }, + { "Feature_Command_BT_Init", 1 }, + { "Feature_Command_None", 0 }, +}; +const ProtobufCEnumDescriptor rpc_feature_command__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "RpcFeatureCommand", + "RpcFeatureCommand", + "RpcFeatureCommand", + "", + 5, + rpc_feature_command__enum_values_by_number, + 5, + rpc_feature_command__enum_values_by_name, + 1, + rpc_feature_command__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; +static const ProtobufCEnumValue rpc_feature_option__enum_values_by_number[2] = +{ + { "Feature_Option_None", "RPC_FEATURE_OPTION__Feature_Option_None", 0 }, + { "Feature_Option_BT_Deinit_Release_Memory", "RPC_FEATURE_OPTION__Feature_Option_BT_Deinit_Release_Memory", 1 }, +}; +static const ProtobufCIntRange rpc_feature_option__value_ranges[] = { +{0, 0},{0, 2} +}; +static const ProtobufCEnumValueIndex rpc_feature_option__enum_values_by_name[2] = +{ + { "Feature_Option_BT_Deinit_Release_Memory", 1 }, + { "Feature_Option_None", 0 }, +}; +const ProtobufCEnumDescriptor rpc_feature_option__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "RpcFeatureOption", + "RpcFeatureOption", + "RpcFeatureOption", + "", + 2, + rpc_feature_option__enum_values_by_number, + 2, + rpc_feature_option__enum_values_by_name, + 1, + rpc_feature_option__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; +static const ProtobufCEnumValue rpc_id__enum_values_by_number[292] = { { "MsgId_Invalid", "RPC_ID__MsgId_Invalid", 0 }, { "Req_Base", "RPC_ID__Req_Base", 256 }, @@ -17383,6 +29906,12 @@ static const ProtobufCEnumValue rpc_id__enum_values_by_number[183] = { "Req_SetMacAddress", "RPC_ID__Req_SetMacAddress", 258 }, { "Req_GetWifiMode", "RPC_ID__Req_GetWifiMode", 259 }, { "Req_SetWifiMode", "RPC_ID__Req_SetWifiMode", 260 }, + { "Req_SuppDppInit", "RPC_ID__Req_SuppDppInit", 261 }, + { "Req_SuppDppDeinit", "RPC_ID__Req_SuppDppDeinit", 262 }, + { "Req_SuppDppBootstrapGen", "RPC_ID__Req_SuppDppBootstrapGen", 263 }, + { "Req_SuppDppStartListen", "RPC_ID__Req_SuppDppStartListen", 264 }, + { "Req_SuppDppStopListen", "RPC_ID__Req_SuppDppStopListen", 265 }, + { "Req_OTAActivate", "RPC_ID__Req_OTAActivate", 266 }, { "Req_WifiSetPs", "RPC_ID__Req_WifiSetPs", 270 }, { "Req_WifiGetPs", "RPC_ID__Req_WifiGetPs", 271 }, { "Req_OTABegin", "RPC_ID__Req_OTABegin", 272 }, @@ -17463,12 +29992,61 @@ static const ProtobufCEnumValue rpc_id__enum_values_by_number[183] = { "Req_WifiGetBandMode", "RPC_ID__Req_WifiGetBandMode", 349 }, { "Req_GetCoprocessorFwVersion", "RPC_ID__Req_GetCoprocessorFwVersion", 350 }, { "Req_WifiScanGetApRecord", "RPC_ID__Req_WifiScanGetApRecord", 351 }, - { "Req_Max", "RPC_ID__Req_Max", 352 }, + { "Req_SetDhcpDnsStatus", "RPC_ID__Req_SetDhcpDnsStatus", 352 }, + { "Req_GetDhcpDnsStatus", "RPC_ID__Req_GetDhcpDnsStatus", 353 }, + { "Req_WifiStaTwtConfig", "RPC_ID__Req_WifiStaTwtConfig", 354 }, + { "Req_WifiStaItwtSetup", "RPC_ID__Req_WifiStaItwtSetup", 355 }, + { "Req_WifiStaItwtTeardown", "RPC_ID__Req_WifiStaItwtTeardown", 356 }, + { "Req_WifiStaItwtSuspend", "RPC_ID__Req_WifiStaItwtSuspend", 357 }, + { "Req_WifiStaItwtGetFlowIdStatus", "RPC_ID__Req_WifiStaItwtGetFlowIdStatus", 358 }, + { "Req_WifiStaItwtSendProbeReq", "RPC_ID__Req_WifiStaItwtSendProbeReq", 359 }, + { "Req_WifiStaItwtSetTargetWakeTimeOffset", "RPC_ID__Req_WifiStaItwtSetTargetWakeTimeOffset", 360 }, + { "Req_WifiStaEnterpriseEnable", "RPC_ID__Req_WifiStaEnterpriseEnable", 361 }, + { "Req_WifiStaEnterpriseDisable", "RPC_ID__Req_WifiStaEnterpriseDisable", 362 }, + { "Req_EapSetIdentity", "RPC_ID__Req_EapSetIdentity", 363 }, + { "Req_EapClearIdentity", "RPC_ID__Req_EapClearIdentity", 364 }, + { "Req_EapSetUsername", "RPC_ID__Req_EapSetUsername", 365 }, + { "Req_EapClearUsername", "RPC_ID__Req_EapClearUsername", 366 }, + { "Req_EapSetPassword", "RPC_ID__Req_EapSetPassword", 367 }, + { "Req_EapClearPassword", "RPC_ID__Req_EapClearPassword", 368 }, + { "Req_EapSetNewPassword", "RPC_ID__Req_EapSetNewPassword", 369 }, + { "Req_EapClearNewPassword", "RPC_ID__Req_EapClearNewPassword", 370 }, + { "Req_EapSetCaCert", "RPC_ID__Req_EapSetCaCert", 371 }, + { "Req_EapClearCaCert", "RPC_ID__Req_EapClearCaCert", 372 }, + { "Req_EapSetCertificateAndKey", "RPC_ID__Req_EapSetCertificateAndKey", 373 }, + { "Req_EapClearCertificateAndKey", "RPC_ID__Req_EapClearCertificateAndKey", 374 }, + { "Req_EapGetDisableTimeCheck", "RPC_ID__Req_EapGetDisableTimeCheck", 375 }, + { "Req_EapSetTtlsPhase2Method", "RPC_ID__Req_EapSetTtlsPhase2Method", 376 }, + { "Req_EapSetSuitebCertification", "RPC_ID__Req_EapSetSuitebCertification", 377 }, + { "Req_EapSetPacFile", "RPC_ID__Req_EapSetPacFile", 378 }, + { "Req_EapSetFastParams", "RPC_ID__Req_EapSetFastParams", 379 }, + { "Req_EapUseDefaultCertBundle", "RPC_ID__Req_EapUseDefaultCertBundle", 380 }, + { "Req_WifiSetOkcSupport", "RPC_ID__Req_WifiSetOkcSupport", 381 }, + { "Req_EapSetDomainName", "RPC_ID__Req_EapSetDomainName", 382 }, + { "Req_EapSetDisableTimeCheck", "RPC_ID__Req_EapSetDisableTimeCheck", 383 }, + { "Req_EapSetEapMethods", "RPC_ID__Req_EapSetEapMethods", 384 }, + { "Req_IfaceMacAddrSetGet", "RPC_ID__Req_IfaceMacAddrSetGet", 385 }, + { "Req_IfaceMacAddrLenGet", "RPC_ID__Req_IfaceMacAddrLenGet", 386 }, + { "Req_FeatureControl", "RPC_ID__Req_FeatureControl", 387 }, + { "Req_GpioConfig", "RPC_ID__Req_GpioConfig", 388 }, + { "Req_GpioResetPin", "RPC_ID__Req_GpioResetPin", 389 }, + { "Req_GpioSetLevel", "RPC_ID__Req_GpioSetLevel", 390 }, + { "Req_GpioGetLevel", "RPC_ID__Req_GpioGetLevel", 391 }, + { "Req_GpioSetDirection", "RPC_ID__Req_GpioSetDirection", 392 }, + { "Req_GpioInputEnable", "RPC_ID__Req_GpioInputEnable", 393 }, + { "Req_GpioSetPullMode", "RPC_ID__Req_GpioSetPullMode", 394 }, + { "Req_Max", "RPC_ID__Req_Max", 395 }, { "Resp_Base", "RPC_ID__Resp_Base", 512 }, { "Resp_GetMACAddress", "RPC_ID__Resp_GetMACAddress", 513 }, { "Resp_SetMacAddress", "RPC_ID__Resp_SetMacAddress", 514 }, { "Resp_GetWifiMode", "RPC_ID__Resp_GetWifiMode", 515 }, { "Resp_SetWifiMode", "RPC_ID__Resp_SetWifiMode", 516 }, + { "Resp_SuppDppInit", "RPC_ID__Resp_SuppDppInit", 517 }, + { "Resp_SuppDppDeinit", "RPC_ID__Resp_SuppDppDeinit", 518 }, + { "Resp_SuppDppBootstrapGen", "RPC_ID__Resp_SuppDppBootstrapGen", 519 }, + { "Resp_SuppDppStartListen", "RPC_ID__Resp_SuppDppStartListen", 520 }, + { "Resp_SuppDppStopListen", "RPC_ID__Resp_SuppDppStopListen", 521 }, + { "Resp_OTAActivate", "RPC_ID__Resp_OTAActivate", 522 }, { "Resp_WifiSetPs", "RPC_ID__Resp_WifiSetPs", 526 }, { "Resp_WifiGetPs", "RPC_ID__Resp_WifiGetPs", 527 }, { "Resp_OTABegin", "RPC_ID__Resp_OTABegin", 528 }, @@ -17549,7 +30127,50 @@ static const ProtobufCEnumValue rpc_id__enum_values_by_number[183] = { "Resp_WifiGetBandMode", "RPC_ID__Resp_WifiGetBandMode", 605 }, { "Resp_GetCoprocessorFwVersion", "RPC_ID__Resp_GetCoprocessorFwVersion", 606 }, { "Resp_WifiScanGetApRecord", "RPC_ID__Resp_WifiScanGetApRecord", 607 }, - { "Resp_Max", "RPC_ID__Resp_Max", 608 }, + { "Resp_SetDhcpDnsStatus", "RPC_ID__Resp_SetDhcpDnsStatus", 608 }, + { "Resp_GetDhcpDnsStatus", "RPC_ID__Resp_GetDhcpDnsStatus", 609 }, + { "Resp_WifiStaTwtConfig", "RPC_ID__Resp_WifiStaTwtConfig", 610 }, + { "Resp_WifiStaItwtSetup", "RPC_ID__Resp_WifiStaItwtSetup", 611 }, + { "Resp_WifiStaItwtTeardown", "RPC_ID__Resp_WifiStaItwtTeardown", 612 }, + { "Resp_WifiStaItwtSuspend", "RPC_ID__Resp_WifiStaItwtSuspend", 613 }, + { "Resp_WifiStaItwtGetFlowIdStatus", "RPC_ID__Resp_WifiStaItwtGetFlowIdStatus", 614 }, + { "Resp_WifiStaItwtSendProbeReq", "RPC_ID__Resp_WifiStaItwtSendProbeReq", 615 }, + { "Resp_WifiStaItwtSetTargetWakeTimeOffset", "RPC_ID__Resp_WifiStaItwtSetTargetWakeTimeOffset", 616 }, + { "Resp_WifiStaEnterpriseEnable", "RPC_ID__Resp_WifiStaEnterpriseEnable", 617 }, + { "Resp_WifiStaEnterpriseDisable", "RPC_ID__Resp_WifiStaEnterpriseDisable", 618 }, + { "Resp_EapSetIdentity", "RPC_ID__Resp_EapSetIdentity", 619 }, + { "Resp_EapClearIdentity", "RPC_ID__Resp_EapClearIdentity", 620 }, + { "Resp_EapSetUsername", "RPC_ID__Resp_EapSetUsername", 621 }, + { "Resp_EapClearUsername", "RPC_ID__Resp_EapClearUsername", 622 }, + { "Resp_EapSetPassword", "RPC_ID__Resp_EapSetPassword", 623 }, + { "Resp_EapClearPassword", "RPC_ID__Resp_EapClearPassword", 624 }, + { "Resp_EapSetNewPassword", "RPC_ID__Resp_EapSetNewPassword", 625 }, + { "Resp_EapClearNewPassword", "RPC_ID__Resp_EapClearNewPassword", 626 }, + { "Resp_EapSetCaCert", "RPC_ID__Resp_EapSetCaCert", 627 }, + { "Resp_EapClearCaCert", "RPC_ID__Resp_EapClearCaCert", 628 }, + { "Resp_EapSetCertificateAndKey", "RPC_ID__Resp_EapSetCertificateAndKey", 629 }, + { "Resp_EapClearCertificateAndKey", "RPC_ID__Resp_EapClearCertificateAndKey", 630 }, + { "Resp_EapGetDisableTimeCheck", "RPC_ID__Resp_EapGetDisableTimeCheck", 631 }, + { "Resp_EapSetTtlsPhase2Method", "RPC_ID__Resp_EapSetTtlsPhase2Method", 632 }, + { "Resp_EapSetSuitebCertification", "RPC_ID__Resp_EapSetSuitebCertification", 633 }, + { "Resp_EapSetPacFile", "RPC_ID__Resp_EapSetPacFile", 634 }, + { "Resp_EapSetFastParams", "RPC_ID__Resp_EapSetFastParams", 635 }, + { "Resp_EapUseDefaultCertBundle", "RPC_ID__Resp_EapUseDefaultCertBundle", 636 }, + { "Resp_WifiSetOkcSupport", "RPC_ID__Resp_WifiSetOkcSupport", 637 }, + { "Resp_EapSetDomainName", "RPC_ID__Resp_EapSetDomainName", 638 }, + { "Resp_EapSetDisableTimeCheck", "RPC_ID__Resp_EapSetDisableTimeCheck", 639 }, + { "Resp_EapSetEapMethods", "RPC_ID__Resp_EapSetEapMethods", 640 }, + { "Resp_IfaceMacAddrSetGet", "RPC_ID__Resp_IfaceMacAddrSetGet", 641 }, + { "Resp_IfaceMacAddrLenGet", "RPC_ID__Resp_IfaceMacAddrLenGet", 642 }, + { "Resp_FeatureControl", "RPC_ID__Resp_FeatureControl", 643 }, + { "Resp_GpioConfig", "RPC_ID__Resp_GpioConfig", 644 }, + { "Resp_GpioResetPin", "RPC_ID__Resp_GpioResetPin", 645 }, + { "Resp_GpioSetLevel", "RPC_ID__Resp_GpioSetLevel", 646 }, + { "Resp_GpioGetLevel", "RPC_ID__Resp_GpioGetLevel", 647 }, + { "Resp_GpioSetDirection", "RPC_ID__Resp_GpioSetDirection", 648 }, + { "Resp_GpioInputEnable", "RPC_ID__Resp_GpioInputEnable", 649 }, + { "Resp_GpioSetPullMode", "RPC_ID__Resp_GpioSetPullMode", 650 }, + { "Resp_Max", "RPC_ID__Resp_Max", 651 }, { "Event_Base", "RPC_ID__Event_Base", 768 }, { "Event_ESPInit", "RPC_ID__Event_ESPInit", 769 }, { "Event_Heartbeat", "RPC_ID__Event_Heartbeat", 770 }, @@ -17559,196 +30180,316 @@ static const ProtobufCEnumValue rpc_id__enum_values_by_number[183] = { "Event_StaScanDone", "RPC_ID__Event_StaScanDone", 774 }, { "Event_StaConnected", "RPC_ID__Event_StaConnected", 775 }, { "Event_StaDisconnected", "RPC_ID__Event_StaDisconnected", 776 }, - { "Event_Max", "RPC_ID__Event_Max", 777 }, + { "Event_DhcpDnsStatus", "RPC_ID__Event_DhcpDnsStatus", 777 }, + { "Event_StaItwtSetup", "RPC_ID__Event_StaItwtSetup", 778 }, + { "Event_StaItwtTeardown", "RPC_ID__Event_StaItwtTeardown", 779 }, + { "Event_StaItwtSuspend", "RPC_ID__Event_StaItwtSuspend", 780 }, + { "Event_StaItwtProbe", "RPC_ID__Event_StaItwtProbe", 781 }, + { "Event_SuppDppUriReady", "RPC_ID__Event_SuppDppUriReady", 782 }, + { "Event_SuppDppCfgRecvd", "RPC_ID__Event_SuppDppCfgRecvd", 783 }, + { "Event_SuppDppFail", "RPC_ID__Event_SuppDppFail", 784 }, + { "Event_WifiDppUriReady", "RPC_ID__Event_WifiDppUriReady", 785 }, + { "Event_WifiDppCfgRecvd", "RPC_ID__Event_WifiDppCfgRecvd", 786 }, + { "Event_WifiDppFail", "RPC_ID__Event_WifiDppFail", 787 }, + { "Event_Max", "RPC_ID__Event_Max", 788 }, }; static const ProtobufCIntRange rpc_id__value_ranges[] = { -{0, 0},{256, 1},{270, 6},{297, 31},{512, 87},{526, 92},{553, 117},{768, 173},{0, 183} -}; -static const ProtobufCEnumValueIndex rpc_id__enum_values_by_name[183] = -{ - { "Event_AP_StaConnected", 176 }, - { "Event_AP_StaDisconnected", 177 }, - { "Event_Base", 173 }, - { "Event_ESPInit", 174 }, - { "Event_Heartbeat", 175 }, - { "Event_Max", 182 }, - { "Event_StaConnected", 180 }, - { "Event_StaDisconnected", 181 }, - { "Event_StaScanDone", 179 }, - { "Event_WifiEventNoArgs", 178 }, +{0, 0},{256, 1},{270, 12},{297, 37},{512, 136},{526, 147},{553, 172},{768, 271},{0, 292} +}; +static const ProtobufCEnumValueIndex rpc_id__enum_values_by_name[292] = +{ + { "Event_AP_StaConnected", 274 }, + { "Event_AP_StaDisconnected", 275 }, + { "Event_Base", 271 }, + { "Event_DhcpDnsStatus", 280 }, + { "Event_ESPInit", 272 }, + { "Event_Heartbeat", 273 }, + { "Event_Max", 291 }, + { "Event_StaConnected", 278 }, + { "Event_StaDisconnected", 279 }, + { "Event_StaItwtProbe", 284 }, + { "Event_StaItwtSetup", 281 }, + { "Event_StaItwtSuspend", 283 }, + { "Event_StaItwtTeardown", 282 }, + { "Event_StaScanDone", 277 }, + { "Event_SuppDppCfgRecvd", 286 }, + { "Event_SuppDppFail", 287 }, + { "Event_SuppDppUriReady", 285 }, + { "Event_WifiDppCfgRecvd", 289 }, + { "Event_WifiDppFail", 290 }, + { "Event_WifiDppUriReady", 288 }, + { "Event_WifiEventNoArgs", 276 }, { "MsgId_Invalid", 0 }, { "Req_Base", 1 }, - { "Req_ConfigHeartbeat", 13 }, - { "Req_GetCoprocessorFwVersion", 84 }, + { "Req_ConfigHeartbeat", 19 }, + { "Req_EapClearCaCert", 112 }, + { "Req_EapClearCertificateAndKey", 114 }, + { "Req_EapClearIdentity", 104 }, + { "Req_EapClearNewPassword", 110 }, + { "Req_EapClearPassword", 108 }, + { "Req_EapClearUsername", 106 }, + { "Req_EapGetDisableTimeCheck", 115 }, + { "Req_EapSetCaCert", 111 }, + { "Req_EapSetCertificateAndKey", 113 }, + { "Req_EapSetDisableTimeCheck", 123 }, + { "Req_EapSetDomainName", 122 }, + { "Req_EapSetEapMethods", 124 }, + { "Req_EapSetFastParams", 119 }, + { "Req_EapSetIdentity", 103 }, + { "Req_EapSetNewPassword", 109 }, + { "Req_EapSetPacFile", 118 }, + { "Req_EapSetPassword", 107 }, + { "Req_EapSetSuitebCertification", 117 }, + { "Req_EapSetTtlsPhase2Method", 116 }, + { "Req_EapSetUsername", 105 }, + { "Req_EapUseDefaultCertBundle", 120 }, + { "Req_FeatureControl", 127 }, + { "Req_GetCoprocessorFwVersion", 90 }, + { "Req_GetDhcpDnsStatus", 93 }, { "Req_GetMACAddress", 2 }, { "Req_GetWifiMode", 4 }, - { "Req_Max", 86 }, - { "Req_OTABegin", 8 }, - { "Req_OTAEnd", 10 }, - { "Req_OTAWrite", 9 }, + { "Req_GpioConfig", 128 }, + { "Req_GpioGetLevel", 131 }, + { "Req_GpioInputEnable", 133 }, + { "Req_GpioResetPin", 129 }, + { "Req_GpioSetDirection", 132 }, + { "Req_GpioSetLevel", 130 }, + { "Req_GpioSetPullMode", 134 }, + { "Req_IfaceMacAddrLenGet", 126 }, + { "Req_IfaceMacAddrSetGet", 125 }, + { "Req_Max", 135 }, + { "Req_OTAActivate", 11 }, + { "Req_OTABegin", 14 }, + { "Req_OTAEnd", 16 }, + { "Req_OTAWrite", 15 }, + { "Req_SetDhcpDnsStatus", 92 }, { "Req_SetMacAddress", 3 }, { "Req_SetWifiMode", 5 }, - { "Req_Wifi80211Tx", 51 }, - { "Req_WifiApGetStaAid", 46 }, - { "Req_WifiApGetStaList", 45 }, - { "Req_WifiClearApList", 26 }, - { "Req_WifiClearFastConnect", 28 }, - { "Req_WifiConfig11bRate", 66 }, - { "Req_WifiConfig80211TxRate", 70 }, - { "Req_WifiConnect", 18 }, - { "Req_WifiConnectionlessModuleSetWakeInterval", 67 }, - { "Req_WifiDeauthSta", 29 }, - { "Req_WifiDeinit", 15 }, - { "Req_WifiDisablePmfConfig", 71 }, - { "Req_WifiDisconnect", 19 }, - { "Req_WifiFtmEndSession", 64 }, - { "Req_WifiFtmInitiateSession", 63 }, - { "Req_WifiFtmRespSetOffset", 65 }, - { "Req_WifiGetAnt", 57 }, - { "Req_WifiGetAntGpio", 55 }, - { "Req_WifiGetBand", 81 }, - { "Req_WifiGetBandMode", 83 }, - { "Req_WifiGetBandwidth", 34 }, - { "Req_WifiGetBandwidths", 79 }, - { "Req_WifiGetChannel", 36 }, - { "Req_WifiGetConfig", 21 }, - { "Req_WifiGetCountry", 38 }, - { "Req_WifiGetCountryCode", 69 }, - { "Req_WifiGetEventMask", 50 }, - { "Req_WifiGetInactiveTime", 60 }, - { "Req_WifiGetMaxTxPower", 12 }, - { "Req_WifiGetPromiscuous", 40 }, - { "Req_WifiGetPromiscuousCtrlFilter", 44 }, - { "Req_WifiGetPromiscuousFilter", 42 }, - { "Req_WifiGetProtocol", 32 }, - { "Req_WifiGetProtocols", 77 }, - { "Req_WifiGetPs", 7 }, - { "Req_WifiGetTsfTime", 58 }, - { "Req_WifiInit", 14 }, - { "Req_WifiRestore", 27 }, - { "Req_WifiScanGetApNum", 24 }, - { "Req_WifiScanGetApRecord", 85 }, - { "Req_WifiScanGetApRecords", 25 }, - { "Req_WifiScanStart", 22 }, - { "Req_WifiScanStop", 23 }, - { "Req_WifiSetAnt", 56 }, - { "Req_WifiSetAntGpio", 54 }, - { "Req_WifiSetBand", 80 }, - { "Req_WifiSetBandMode", 82 }, - { "Req_WifiSetBandwidth", 33 }, - { "Req_WifiSetBandwidths", 78 }, - { "Req_WifiSetChannel", 35 }, - { "Req_WifiSetConfig", 20 }, - { "Req_WifiSetCountry", 37 }, - { "Req_WifiSetCountryCode", 68 }, - { "Req_WifiSetCsi", 53 }, - { "Req_WifiSetCsiConfig", 52 }, - { "Req_WifiSetDynamicCs", 74 }, - { "Req_WifiSetEventMask", 49 }, - { "Req_WifiSetInactiveTime", 59 }, - { "Req_WifiSetMaxTxPower", 11 }, - { "Req_WifiSetPromiscuous", 39 }, - { "Req_WifiSetPromiscuousCtrlFilter", 43 }, - { "Req_WifiSetPromiscuousFilter", 41 }, - { "Req_WifiSetProtocol", 31 }, - { "Req_WifiSetProtocols", 76 }, - { "Req_WifiSetPs", 6 }, - { "Req_WifiSetRssiThreshold", 62 }, - { "Req_WifiSetStorage", 47 }, - { "Req_WifiSetVendorIe", 48 }, - { "Req_WifiStaGetAid", 72 }, - { "Req_WifiStaGetApInfo", 30 }, - { "Req_WifiStaGetNegotiatedPhymode", 73 }, - { "Req_WifiStaGetRssi", 75 }, - { "Req_WifiStart", 16 }, - { "Req_WifiStatisDump", 61 }, - { "Req_WifiStop", 17 }, - { "Resp_Base", 87 }, - { "Resp_ConfigHeartbeat", 99 }, - { "Resp_GetCoprocessorFwVersion", 170 }, - { "Resp_GetMACAddress", 88 }, - { "Resp_GetWifiMode", 90 }, - { "Resp_Max", 172 }, - { "Resp_OTABegin", 94 }, - { "Resp_OTAEnd", 96 }, - { "Resp_OTAWrite", 95 }, - { "Resp_SetMacAddress", 89 }, - { "Resp_SetWifiMode", 91 }, - { "Resp_Wifi80211Tx", 137 }, - { "Resp_WifiApGetStaAid", 132 }, - { "Resp_WifiApGetStaList", 131 }, - { "Resp_WifiClearApList", 112 }, - { "Resp_WifiClearFastConnect", 114 }, - { "Resp_WifiConfig11bRate", 152 }, - { "Resp_WifiConfig80211TxRate", 156 }, - { "Resp_WifiConnect", 104 }, - { "Resp_WifiConnectionlessModuleSetWakeInterval", 153 }, - { "Resp_WifiDeauthSta", 115 }, - { "Resp_WifiDeinit", 101 }, - { "Resp_WifiDisablePmfConfig", 157 }, - { "Resp_WifiDisconnect", 105 }, - { "Resp_WifiFtmEndSession", 150 }, - { "Resp_WifiFtmInitiateSession", 149 }, - { "Resp_WifiFtmRespSetOffset", 151 }, - { "Resp_WifiGetAnt", 143 }, - { "Resp_WifiGetAntGpio", 141 }, - { "Resp_WifiGetBand", 167 }, - { "Resp_WifiGetBandMode", 169 }, - { "Resp_WifiGetBandwidth", 120 }, - { "Resp_WifiGetBandwidths", 165 }, - { "Resp_WifiGetChannel", 122 }, - { "Resp_WifiGetConfig", 107 }, - { "Resp_WifiGetCountry", 124 }, - { "Resp_WifiGetCountryCode", 155 }, - { "Resp_WifiGetEventMask", 136 }, - { "Resp_WifiGetInactiveTime", 146 }, - { "Resp_WifiGetMaxTxPower", 98 }, - { "Resp_WifiGetPromiscuous", 126 }, - { "Resp_WifiGetPromiscuousCtrlFilter", 130 }, - { "Resp_WifiGetPromiscuousFilter", 128 }, - { "Resp_WifiGetProtocol", 118 }, - { "Resp_WifiGetProtocols", 163 }, - { "Resp_WifiGetPs", 93 }, - { "Resp_WifiGetTsfTime", 144 }, - { "Resp_WifiInit", 100 }, - { "Resp_WifiRestore", 113 }, - { "Resp_WifiScanGetApNum", 110 }, - { "Resp_WifiScanGetApRecord", 171 }, - { "Resp_WifiScanGetApRecords", 111 }, - { "Resp_WifiScanStart", 108 }, - { "Resp_WifiScanStop", 109 }, - { "Resp_WifiSetAnt", 142 }, - { "Resp_WifiSetAntGpio", 140 }, - { "Resp_WifiSetBand", 166 }, - { "Resp_WifiSetBandMode", 168 }, - { "Resp_WifiSetBandwidth", 119 }, - { "Resp_WifiSetBandwidths", 164 }, - { "Resp_WifiSetChannel", 121 }, - { "Resp_WifiSetConfig", 106 }, - { "Resp_WifiSetCountry", 123 }, - { "Resp_WifiSetCountryCode", 154 }, - { "Resp_WifiSetCsi", 139 }, - { "Resp_WifiSetCsiConfig", 138 }, - { "Resp_WifiSetDynamicCs", 160 }, - { "Resp_WifiSetEventMask", 135 }, - { "Resp_WifiSetInactiveTime", 145 }, - { "Resp_WifiSetMaxTxPower", 97 }, - { "Resp_WifiSetPromiscuous", 125 }, - { "Resp_WifiSetPromiscuousCtrlFilter", 129 }, - { "Resp_WifiSetPromiscuousFilter", 127 }, - { "Resp_WifiSetProtocol", 117 }, - { "Resp_WifiSetProtocols", 162 }, - { "Resp_WifiSetPs", 92 }, - { "Resp_WifiSetRssiThreshold", 148 }, - { "Resp_WifiSetStorage", 133 }, - { "Resp_WifiSetVendorIe", 134 }, - { "Resp_WifiStaGetAid", 158 }, - { "Resp_WifiStaGetApInfo", 116 }, - { "Resp_WifiStaGetNegotiatedPhymode", 159 }, - { "Resp_WifiStaGetRssi", 161 }, - { "Resp_WifiStart", 102 }, - { "Resp_WifiStatisDump", 147 }, - { "Resp_WifiStop", 103 }, + { "Req_SuppDppBootstrapGen", 8 }, + { "Req_SuppDppDeinit", 7 }, + { "Req_SuppDppInit", 6 }, + { "Req_SuppDppStartListen", 9 }, + { "Req_SuppDppStopListen", 10 }, + { "Req_Wifi80211Tx", 57 }, + { "Req_WifiApGetStaAid", 52 }, + { "Req_WifiApGetStaList", 51 }, + { "Req_WifiClearApList", 32 }, + { "Req_WifiClearFastConnect", 34 }, + { "Req_WifiConfig11bRate", 72 }, + { "Req_WifiConfig80211TxRate", 76 }, + { "Req_WifiConnect", 24 }, + { "Req_WifiConnectionlessModuleSetWakeInterval", 73 }, + { "Req_WifiDeauthSta", 35 }, + { "Req_WifiDeinit", 21 }, + { "Req_WifiDisablePmfConfig", 77 }, + { "Req_WifiDisconnect", 25 }, + { "Req_WifiFtmEndSession", 70 }, + { "Req_WifiFtmInitiateSession", 69 }, + { "Req_WifiFtmRespSetOffset", 71 }, + { "Req_WifiGetAnt", 63 }, + { "Req_WifiGetAntGpio", 61 }, + { "Req_WifiGetBand", 87 }, + { "Req_WifiGetBandMode", 89 }, + { "Req_WifiGetBandwidth", 40 }, + { "Req_WifiGetBandwidths", 85 }, + { "Req_WifiGetChannel", 42 }, + { "Req_WifiGetConfig", 27 }, + { "Req_WifiGetCountry", 44 }, + { "Req_WifiGetCountryCode", 75 }, + { "Req_WifiGetEventMask", 56 }, + { "Req_WifiGetInactiveTime", 66 }, + { "Req_WifiGetMaxTxPower", 18 }, + { "Req_WifiGetPromiscuous", 46 }, + { "Req_WifiGetPromiscuousCtrlFilter", 50 }, + { "Req_WifiGetPromiscuousFilter", 48 }, + { "Req_WifiGetProtocol", 38 }, + { "Req_WifiGetProtocols", 83 }, + { "Req_WifiGetPs", 13 }, + { "Req_WifiGetTsfTime", 64 }, + { "Req_WifiInit", 20 }, + { "Req_WifiRestore", 33 }, + { "Req_WifiScanGetApNum", 30 }, + { "Req_WifiScanGetApRecord", 91 }, + { "Req_WifiScanGetApRecords", 31 }, + { "Req_WifiScanStart", 28 }, + { "Req_WifiScanStop", 29 }, + { "Req_WifiSetAnt", 62 }, + { "Req_WifiSetAntGpio", 60 }, + { "Req_WifiSetBand", 86 }, + { "Req_WifiSetBandMode", 88 }, + { "Req_WifiSetBandwidth", 39 }, + { "Req_WifiSetBandwidths", 84 }, + { "Req_WifiSetChannel", 41 }, + { "Req_WifiSetConfig", 26 }, + { "Req_WifiSetCountry", 43 }, + { "Req_WifiSetCountryCode", 74 }, + { "Req_WifiSetCsi", 59 }, + { "Req_WifiSetCsiConfig", 58 }, + { "Req_WifiSetDynamicCs", 80 }, + { "Req_WifiSetEventMask", 55 }, + { "Req_WifiSetInactiveTime", 65 }, + { "Req_WifiSetMaxTxPower", 17 }, + { "Req_WifiSetOkcSupport", 121 }, + { "Req_WifiSetPromiscuous", 45 }, + { "Req_WifiSetPromiscuousCtrlFilter", 49 }, + { "Req_WifiSetPromiscuousFilter", 47 }, + { "Req_WifiSetProtocol", 37 }, + { "Req_WifiSetProtocols", 82 }, + { "Req_WifiSetPs", 12 }, + { "Req_WifiSetRssiThreshold", 68 }, + { "Req_WifiSetStorage", 53 }, + { "Req_WifiSetVendorIe", 54 }, + { "Req_WifiStaEnterpriseDisable", 102 }, + { "Req_WifiStaEnterpriseEnable", 101 }, + { "Req_WifiStaGetAid", 78 }, + { "Req_WifiStaGetApInfo", 36 }, + { "Req_WifiStaGetNegotiatedPhymode", 79 }, + { "Req_WifiStaGetRssi", 81 }, + { "Req_WifiStaItwtGetFlowIdStatus", 98 }, + { "Req_WifiStaItwtSendProbeReq", 99 }, + { "Req_WifiStaItwtSetTargetWakeTimeOffset", 100 }, + { "Req_WifiStaItwtSetup", 95 }, + { "Req_WifiStaItwtSuspend", 97 }, + { "Req_WifiStaItwtTeardown", 96 }, + { "Req_WifiStaTwtConfig", 94 }, + { "Req_WifiStart", 22 }, + { "Req_WifiStatisDump", 67 }, + { "Req_WifiStop", 23 }, + { "Resp_Base", 136 }, + { "Resp_ConfigHeartbeat", 154 }, + { "Resp_EapClearCaCert", 247 }, + { "Resp_EapClearCertificateAndKey", 249 }, + { "Resp_EapClearIdentity", 239 }, + { "Resp_EapClearNewPassword", 245 }, + { "Resp_EapClearPassword", 243 }, + { "Resp_EapClearUsername", 241 }, + { "Resp_EapGetDisableTimeCheck", 250 }, + { "Resp_EapSetCaCert", 246 }, + { "Resp_EapSetCertificateAndKey", 248 }, + { "Resp_EapSetDisableTimeCheck", 258 }, + { "Resp_EapSetDomainName", 257 }, + { "Resp_EapSetEapMethods", 259 }, + { "Resp_EapSetFastParams", 254 }, + { "Resp_EapSetIdentity", 238 }, + { "Resp_EapSetNewPassword", 244 }, + { "Resp_EapSetPacFile", 253 }, + { "Resp_EapSetPassword", 242 }, + { "Resp_EapSetSuitebCertification", 252 }, + { "Resp_EapSetTtlsPhase2Method", 251 }, + { "Resp_EapSetUsername", 240 }, + { "Resp_EapUseDefaultCertBundle", 255 }, + { "Resp_FeatureControl", 262 }, + { "Resp_GetCoprocessorFwVersion", 225 }, + { "Resp_GetDhcpDnsStatus", 228 }, + { "Resp_GetMACAddress", 137 }, + { "Resp_GetWifiMode", 139 }, + { "Resp_GpioConfig", 263 }, + { "Resp_GpioGetLevel", 266 }, + { "Resp_GpioInputEnable", 268 }, + { "Resp_GpioResetPin", 264 }, + { "Resp_GpioSetDirection", 267 }, + { "Resp_GpioSetLevel", 265 }, + { "Resp_GpioSetPullMode", 269 }, + { "Resp_IfaceMacAddrLenGet", 261 }, + { "Resp_IfaceMacAddrSetGet", 260 }, + { "Resp_Max", 270 }, + { "Resp_OTAActivate", 146 }, + { "Resp_OTABegin", 149 }, + { "Resp_OTAEnd", 151 }, + { "Resp_OTAWrite", 150 }, + { "Resp_SetDhcpDnsStatus", 227 }, + { "Resp_SetMacAddress", 138 }, + { "Resp_SetWifiMode", 140 }, + { "Resp_SuppDppBootstrapGen", 143 }, + { "Resp_SuppDppDeinit", 142 }, + { "Resp_SuppDppInit", 141 }, + { "Resp_SuppDppStartListen", 144 }, + { "Resp_SuppDppStopListen", 145 }, + { "Resp_Wifi80211Tx", 192 }, + { "Resp_WifiApGetStaAid", 187 }, + { "Resp_WifiApGetStaList", 186 }, + { "Resp_WifiClearApList", 167 }, + { "Resp_WifiClearFastConnect", 169 }, + { "Resp_WifiConfig11bRate", 207 }, + { "Resp_WifiConfig80211TxRate", 211 }, + { "Resp_WifiConnect", 159 }, + { "Resp_WifiConnectionlessModuleSetWakeInterval", 208 }, + { "Resp_WifiDeauthSta", 170 }, + { "Resp_WifiDeinit", 156 }, + { "Resp_WifiDisablePmfConfig", 212 }, + { "Resp_WifiDisconnect", 160 }, + { "Resp_WifiFtmEndSession", 205 }, + { "Resp_WifiFtmInitiateSession", 204 }, + { "Resp_WifiFtmRespSetOffset", 206 }, + { "Resp_WifiGetAnt", 198 }, + { "Resp_WifiGetAntGpio", 196 }, + { "Resp_WifiGetBand", 222 }, + { "Resp_WifiGetBandMode", 224 }, + { "Resp_WifiGetBandwidth", 175 }, + { "Resp_WifiGetBandwidths", 220 }, + { "Resp_WifiGetChannel", 177 }, + { "Resp_WifiGetConfig", 162 }, + { "Resp_WifiGetCountry", 179 }, + { "Resp_WifiGetCountryCode", 210 }, + { "Resp_WifiGetEventMask", 191 }, + { "Resp_WifiGetInactiveTime", 201 }, + { "Resp_WifiGetMaxTxPower", 153 }, + { "Resp_WifiGetPromiscuous", 181 }, + { "Resp_WifiGetPromiscuousCtrlFilter", 185 }, + { "Resp_WifiGetPromiscuousFilter", 183 }, + { "Resp_WifiGetProtocol", 173 }, + { "Resp_WifiGetProtocols", 218 }, + { "Resp_WifiGetPs", 148 }, + { "Resp_WifiGetTsfTime", 199 }, + { "Resp_WifiInit", 155 }, + { "Resp_WifiRestore", 168 }, + { "Resp_WifiScanGetApNum", 165 }, + { "Resp_WifiScanGetApRecord", 226 }, + { "Resp_WifiScanGetApRecords", 166 }, + { "Resp_WifiScanStart", 163 }, + { "Resp_WifiScanStop", 164 }, + { "Resp_WifiSetAnt", 197 }, + { "Resp_WifiSetAntGpio", 195 }, + { "Resp_WifiSetBand", 221 }, + { "Resp_WifiSetBandMode", 223 }, + { "Resp_WifiSetBandwidth", 174 }, + { "Resp_WifiSetBandwidths", 219 }, + { "Resp_WifiSetChannel", 176 }, + { "Resp_WifiSetConfig", 161 }, + { "Resp_WifiSetCountry", 178 }, + { "Resp_WifiSetCountryCode", 209 }, + { "Resp_WifiSetCsi", 194 }, + { "Resp_WifiSetCsiConfig", 193 }, + { "Resp_WifiSetDynamicCs", 215 }, + { "Resp_WifiSetEventMask", 190 }, + { "Resp_WifiSetInactiveTime", 200 }, + { "Resp_WifiSetMaxTxPower", 152 }, + { "Resp_WifiSetOkcSupport", 256 }, + { "Resp_WifiSetPromiscuous", 180 }, + { "Resp_WifiSetPromiscuousCtrlFilter", 184 }, + { "Resp_WifiSetPromiscuousFilter", 182 }, + { "Resp_WifiSetProtocol", 172 }, + { "Resp_WifiSetProtocols", 217 }, + { "Resp_WifiSetPs", 147 }, + { "Resp_WifiSetRssiThreshold", 203 }, + { "Resp_WifiSetStorage", 188 }, + { "Resp_WifiSetVendorIe", 189 }, + { "Resp_WifiStaEnterpriseDisable", 237 }, + { "Resp_WifiStaEnterpriseEnable", 236 }, + { "Resp_WifiStaGetAid", 213 }, + { "Resp_WifiStaGetApInfo", 171 }, + { "Resp_WifiStaGetNegotiatedPhymode", 214 }, + { "Resp_WifiStaGetRssi", 216 }, + { "Resp_WifiStaItwtGetFlowIdStatus", 233 }, + { "Resp_WifiStaItwtSendProbeReq", 234 }, + { "Resp_WifiStaItwtSetTargetWakeTimeOffset", 235 }, + { "Resp_WifiStaItwtSetup", 230 }, + { "Resp_WifiStaItwtSuspend", 232 }, + { "Resp_WifiStaItwtTeardown", 231 }, + { "Resp_WifiStaTwtConfig", 229 }, + { "Resp_WifiStart", 157 }, + { "Resp_WifiStatisDump", 202 }, + { "Resp_WifiStop", 158 }, }; const ProtobufCEnumDescriptor rpc_id__descriptor = { @@ -17757,11 +30498,73 @@ const ProtobufCEnumDescriptor rpc_id__descriptor = "RpcId", "RpcId", "", - 183, + 292, rpc_id__enum_values_by_number, - 183, + 292, rpc_id__enum_values_by_name, 8, rpc_id__value_ranges, NULL,NULL,NULL,NULL /* reserved[1234] */ }; +static const ProtobufCEnumValue rpc__gpio_mode__enum_values_by_number[4] = +{ + { "GPIO_MODE_DISABLE", "RPC__GPIO_MODE__GPIO_MODE_DISABLE", 0 }, + { "GPIO_MODE_INPUT", "RPC__GPIO_MODE__GPIO_MODE_INPUT", 1 }, + { "GPIO_MODE_OUTPUT", "RPC__GPIO_MODE__GPIO_MODE_OUTPUT", 2 }, + { "GPIO_MODE_INPUT_OUTPUT", "RPC__GPIO_MODE__GPIO_MODE_INPUT_OUTPUT", 3 }, +}; +static const ProtobufCIntRange rpc__gpio_mode__value_ranges[] = { +{0, 0},{0, 4} +}; +static const ProtobufCEnumValueIndex rpc__gpio_mode__enum_values_by_name[4] = +{ + { "GPIO_MODE_DISABLE", 0 }, + { "GPIO_MODE_INPUT", 1 }, + { "GPIO_MODE_INPUT_OUTPUT", 3 }, + { "GPIO_MODE_OUTPUT", 2 }, +}; +const ProtobufCEnumDescriptor rpc__gpio_mode__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "Rpc_GpioMode", + "Rpc_GpioMode", + "RpcGpioMode", + "", + 4, + rpc__gpio_mode__enum_values_by_number, + 4, + rpc__gpio_mode__enum_values_by_name, + 1, + rpc__gpio_mode__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; +static const ProtobufCEnumValue rpc__gpio_pull_mode__enum_values_by_number[3] = +{ + { "GPIO_PULL_NONE", "RPC__GPIO_PULL_MODE__GPIO_PULL_NONE", 0 }, + { "GPIO_PULL_UP", "RPC__GPIO_PULL_MODE__GPIO_PULL_UP", 1 }, + { "GPIO_PULL_DOWN", "RPC__GPIO_PULL_MODE__GPIO_PULL_DOWN", 2 }, +}; +static const ProtobufCIntRange rpc__gpio_pull_mode__value_ranges[] = { +{0, 0},{0, 3} +}; +static const ProtobufCEnumValueIndex rpc__gpio_pull_mode__enum_values_by_name[3] = +{ + { "GPIO_PULL_DOWN", 2 }, + { "GPIO_PULL_NONE", 0 }, + { "GPIO_PULL_UP", 1 }, +}; +const ProtobufCEnumDescriptor rpc__gpio_pull_mode__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "Rpc_GpioPullMode", + "Rpc_GpioPullMode", + "RpcGpioPullMode", + "", + 3, + rpc__gpio_pull_mode__enum_values_by_number, + 3, + rpc__gpio_pull_mode__enum_values_by_name, + 1, + rpc__gpio_pull_mode__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/common/proto/esp_hosted_rpc.pb-c.h b/common/proto/esp_hosted_rpc.pb-c.h index 03a11fc5..860ef686 100644 --- a/common/proto/esp_hosted_rpc.pb-c.h +++ b/common/proto/esp_hosted_rpc.pb-c.h @@ -19,11 +19,13 @@ typedef struct WifiInitConfig WifiInitConfig; typedef struct WifiCountry WifiCountry; typedef struct WifiActiveScanTime WifiActiveScanTime; typedef struct WifiScanTime WifiScanTime; +typedef struct WifiScanChannelBitmap WifiScanChannelBitmap; typedef struct WifiScanConfig WifiScanConfig; typedef struct WifiHeApInfo WifiHeApInfo; typedef struct WifiApRecord WifiApRecord; typedef struct WifiScanThreshold WifiScanThreshold; typedef struct WifiPmfConfig WifiPmfConfig; +typedef struct WifiBssMaxIdleConfig WifiBssMaxIdleConfig; typedef struct WifiApConfig WifiApConfig; typedef struct WifiStaConfig WifiStaConfig; typedef struct WifiConfig WifiConfig; @@ -57,7 +59,10 @@ typedef struct WifiEventApWpsRgFailReason WifiEventApWpsRgFailReason; typedef struct WifiEventApWpsRgSuccess WifiEventApWpsRgSuccess; typedef struct WifiProtocols WifiProtocols; typedef struct WifiBandwidths WifiBandwidths; +typedef struct WifiItwtSetupConfig WifiItwtSetupConfig; +typedef struct WifiTwtConfig WifiTwtConfig; typedef struct ConnectedSTAList ConnectedSTAList; +typedef struct EapFastConfig EapFastConfig; typedef struct RpcReqGetMacAddress RpcReqGetMacAddress; typedef struct RpcRespGetMacAddress RpcRespGetMacAddress; typedef struct RpcReqGetMode RpcReqGetMode; @@ -76,6 +81,8 @@ typedef struct RpcReqOTAWrite RpcReqOTAWrite; typedef struct RpcRespOTAWrite RpcRespOTAWrite; typedef struct RpcReqOTAEnd RpcReqOTAEnd; typedef struct RpcRespOTAEnd RpcRespOTAEnd; +typedef struct RpcReqOTAActivate RpcReqOTAActivate; +typedef struct RpcRespOTAActivate RpcRespOTAActivate; typedef struct RpcReqWifiSetMaxTxPower RpcReqWifiSetMaxTxPower; typedef struct RpcRespWifiSetMaxTxPower RpcRespWifiSetMaxTxPower; typedef struct RpcReqWifiGetMaxTxPower RpcReqWifiGetMaxTxPower; @@ -166,8 +173,46 @@ typedef struct RpcReqWifiSetBandMode RpcReqWifiSetBandMode; typedef struct RpcRespWifiSetBandMode RpcRespWifiSetBandMode; typedef struct RpcReqWifiGetBandMode RpcReqWifiGetBandMode; typedef struct RpcRespWifiGetBandMode RpcRespWifiGetBandMode; +typedef struct RpcReqWifiSetInactiveTime RpcReqWifiSetInactiveTime; +typedef struct RpcRespWifiSetInactiveTime RpcRespWifiSetInactiveTime; +typedef struct RpcReqWifiGetInactiveTime RpcReqWifiGetInactiveTime; +typedef struct RpcRespWifiGetInactiveTime RpcRespWifiGetInactiveTime; +typedef struct RpcReqWifiStaItwtSetup RpcReqWifiStaItwtSetup; +typedef struct RpcRespWifiStaItwtSetup RpcRespWifiStaItwtSetup; +typedef struct RpcReqWifiStaItwtTeardown RpcReqWifiStaItwtTeardown; +typedef struct RpcRespWifiStaItwtTeardown RpcRespWifiStaItwtTeardown; +typedef struct RpcReqWifiStaItwtSuspend RpcReqWifiStaItwtSuspend; +typedef struct RpcRespWifiStaItwtSuspend RpcRespWifiStaItwtSuspend; +typedef struct RpcReqWifiStaItwtGetFlowIdStatus RpcReqWifiStaItwtGetFlowIdStatus; +typedef struct RpcRespWifiStaItwtGetFlowIdStatus RpcRespWifiStaItwtGetFlowIdStatus; +typedef struct RpcReqWifiStaItwtSendProbeReq RpcReqWifiStaItwtSendProbeReq; +typedef struct RpcRespWifiStaItwtSendProbeReq RpcRespWifiStaItwtSendProbeReq; +typedef struct RpcReqWifiStaItwtSetTargetWakeTimeOffset RpcReqWifiStaItwtSetTargetWakeTimeOffset; +typedef struct RpcRespWifiStaItwtSetTargetWakeTimeOffset RpcRespWifiStaItwtSetTargetWakeTimeOffset; +typedef struct RpcReqWifiStaTwtConfig RpcReqWifiStaTwtConfig; +typedef struct RpcRespWifiStaTwtConfig RpcRespWifiStaTwtConfig; typedef struct RpcReqGetCoprocessorFwVersion RpcReqGetCoprocessorFwVersion; typedef struct RpcRespGetCoprocessorFwVersion RpcRespGetCoprocessorFwVersion; +typedef struct RpcReqSetDhcpDnsStatus RpcReqSetDhcpDnsStatus; +typedef struct RpcRespSetDhcpDnsStatus RpcRespSetDhcpDnsStatus; +typedef struct RpcReqGetDhcpDnsStatus RpcReqGetDhcpDnsStatus; +typedef struct RpcRespGetDhcpDnsStatus RpcRespGetDhcpDnsStatus; +typedef struct RpcReqSuppDppInit RpcReqSuppDppInit; +typedef struct RpcRespSuppDppInit RpcRespSuppDppInit; +typedef struct RpcReqSuppDppDeinit RpcReqSuppDppDeinit; +typedef struct RpcRespSuppDppDeinit RpcRespSuppDppDeinit; +typedef struct RpcReqSuppDppBootstrapGen RpcReqSuppDppBootstrapGen; +typedef struct RpcRespSuppDppBootstrapGen RpcRespSuppDppBootstrapGen; +typedef struct RpcReqSuppDppStartListen RpcReqSuppDppStartListen; +typedef struct RpcRespSuppDppStartListen RpcRespSuppDppStartListen; +typedef struct RpcReqSuppDppStopListen RpcReqSuppDppStopListen; +typedef struct RpcRespSuppDppStopListen RpcRespSuppDppStopListen; +typedef struct RpcReqIfaceMacAddrSetGet RpcReqIfaceMacAddrSetGet; +typedef struct RpcRespIfaceMacAddrSetGet RpcRespIfaceMacAddrSetGet; +typedef struct RpcReqIfaceMacAddrLenGet RpcReqIfaceMacAddrLenGet; +typedef struct RpcRespIfaceMacAddrLenGet RpcRespIfaceMacAddrLenGet; +typedef struct RpcReqFeatureControl RpcReqFeatureControl; +typedef struct RpcRespFeatureControl RpcRespFeatureControl; typedef struct RpcEventWifiEventNoArgs RpcEventWifiEventNoArgs; typedef struct RpcEventESPInit RpcEventESPInit; typedef struct RpcEventHeartbeat RpcEventHeartbeat; @@ -176,6 +221,80 @@ typedef struct RpcEventAPStaConnected RpcEventAPStaConnected; typedef struct RpcEventStaScanDone RpcEventStaScanDone; typedef struct RpcEventStaConnected RpcEventStaConnected; typedef struct RpcEventStaDisconnected RpcEventStaDisconnected; +typedef struct RpcEventDhcpDnsStatus RpcEventDhcpDnsStatus; +typedef struct RpcEventStaItwtSetup RpcEventStaItwtSetup; +typedef struct RpcEventStaItwtTeardown RpcEventStaItwtTeardown; +typedef struct RpcEventStaItwtSuspend RpcEventStaItwtSuspend; +typedef struct RpcEventStaItwtProbe RpcEventStaItwtProbe; +typedef struct RpcReqWifiStaEnterpriseEnable RpcReqWifiStaEnterpriseEnable; +typedef struct RpcRespWifiStaEnterpriseEnable RpcRespWifiStaEnterpriseEnable; +typedef struct RpcReqWifiStaEnterpriseDisable RpcReqWifiStaEnterpriseDisable; +typedef struct RpcRespWifiStaEnterpriseDisable RpcRespWifiStaEnterpriseDisable; +typedef struct RpcReqEapSetIdentity RpcReqEapSetIdentity; +typedef struct RpcRespEapSetIdentity RpcRespEapSetIdentity; +typedef struct RpcReqEapClearIdentity RpcReqEapClearIdentity; +typedef struct RpcRespEapClearIdentity RpcRespEapClearIdentity; +typedef struct RpcReqEapSetUsername RpcReqEapSetUsername; +typedef struct RpcRespEapSetUsername RpcRespEapSetUsername; +typedef struct RpcReqEapClearUsername RpcReqEapClearUsername; +typedef struct RpcRespEapClearUsername RpcRespEapClearUsername; +typedef struct RpcReqEapSetPassword RpcReqEapSetPassword; +typedef struct RpcRespEapSetPassword RpcRespEapSetPassword; +typedef struct RpcReqEapClearPassword RpcReqEapClearPassword; +typedef struct RpcRespEapClearPassword RpcRespEapClearPassword; +typedef struct RpcReqEapSetNewPassword RpcReqEapSetNewPassword; +typedef struct RpcRespEapSetNewPassword RpcRespEapSetNewPassword; +typedef struct RpcReqEapClearNewPassword RpcReqEapClearNewPassword; +typedef struct RpcRespEapClearNewPassword RpcRespEapClearNewPassword; +typedef struct RpcReqEapSetCaCert RpcReqEapSetCaCert; +typedef struct RpcRespEapSetCaCert RpcRespEapSetCaCert; +typedef struct RpcReqEapClearCaCert RpcReqEapClearCaCert; +typedef struct RpcRespEapClearCaCert RpcRespEapClearCaCert; +typedef struct RpcReqEapSetCertificateAndKey RpcReqEapSetCertificateAndKey; +typedef struct RpcRespEapSetCertificateAndKey RpcRespEapSetCertificateAndKey; +typedef struct RpcReqEapClearCertificateAndKey RpcReqEapClearCertificateAndKey; +typedef struct RpcRespEapClearCertificateAndKey RpcRespEapClearCertificateAndKey; +typedef struct RpcReqEapSetDisableTimeCheck RpcReqEapSetDisableTimeCheck; +typedef struct RpcRespEapSetDisableTimeCheck RpcRespEapSetDisableTimeCheck; +typedef struct RpcReqEapGetDisableTimeCheck RpcReqEapGetDisableTimeCheck; +typedef struct RpcRespEapGetDisableTimeCheck RpcRespEapGetDisableTimeCheck; +typedef struct RpcReqEapSetTtlsPhase2Method RpcReqEapSetTtlsPhase2Method; +typedef struct RpcRespEapSetTtlsPhase2Method RpcRespEapSetTtlsPhase2Method; +typedef struct RpcReqEapSetSuiteb192bitCertification RpcReqEapSetSuiteb192bitCertification; +typedef struct RpcRespEapSetSuiteb192bitCertification RpcRespEapSetSuiteb192bitCertification; +typedef struct RpcReqEapSetPacFile RpcReqEapSetPacFile; +typedef struct RpcRespEapSetPacFile RpcRespEapSetPacFile; +typedef struct RpcReqEapSetFastParams RpcReqEapSetFastParams; +typedef struct RpcRespEapSetFastParams RpcRespEapSetFastParams; +typedef struct RpcReqEapUseDefaultCertBundle RpcReqEapUseDefaultCertBundle; +typedef struct RpcRespEapUseDefaultCertBundle RpcRespEapUseDefaultCertBundle; +typedef struct RpcReqWifiSetOkcSupport RpcReqWifiSetOkcSupport; +typedef struct RpcRespWifiSetOkcSupport RpcRespWifiSetOkcSupport; +typedef struct RpcReqEapSetDomainName RpcReqEapSetDomainName; +typedef struct RpcRespEapSetDomainName RpcRespEapSetDomainName; +typedef struct RpcReqEapSetEapMethods RpcReqEapSetEapMethods; +typedef struct RpcRespEapSetEapMethods RpcRespEapSetEapMethods; +typedef struct RpcEventSuppDppUriReady RpcEventSuppDppUriReady; +typedef struct RpcEventSuppDppCfgRecvd RpcEventSuppDppCfgRecvd; +typedef struct RpcEventSuppDppFail RpcEventSuppDppFail; +typedef struct RpcEventWifiDppUriReady RpcEventWifiDppUriReady; +typedef struct RpcEventWifiDppCfgRecvd RpcEventWifiDppCfgRecvd; +typedef struct RpcEventWifiDppFail RpcEventWifiDppFail; +typedef struct RpcGpioConfig RpcGpioConfig; +typedef struct RpcReqGpioConfig RpcReqGpioConfig; +typedef struct RpcRespGpioConfig RpcRespGpioConfig; +typedef struct RpcReqGpioReset RpcReqGpioReset; +typedef struct RpcRespGpioResetPin RpcRespGpioResetPin; +typedef struct RpcReqGpioSetLevel RpcReqGpioSetLevel; +typedef struct RpcRespGpioSetLevel RpcRespGpioSetLevel; +typedef struct RpcReqGpioGetLevel RpcReqGpioGetLevel; +typedef struct RpcRespGpioGetLevel RpcRespGpioGetLevel; +typedef struct RpcReqGpioSetDirection RpcReqGpioSetDirection; +typedef struct RpcRespGpioSetDirection RpcRespGpioSetDirection; +typedef struct RpcReqGpioInputEnable RpcReqGpioInputEnable; +typedef struct RpcRespGpioInputEnable RpcRespGpioInputEnable; +typedef struct RpcReqGpioSetPullMode RpcReqGpioSetPullMode; +typedef struct RpcRespGpioSetPullMode RpcRespGpioSetPullMode; typedef struct Rpc Rpc; @@ -224,6 +343,42 @@ typedef enum _RpcType { RPC_TYPE__MsgType_Max = 4 PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(RPC_TYPE) } RpcType; +typedef enum _RpcFeature { + RPC_FEATURE__Feature_None = 0, + /* + * Bluetooth (BT) Feature + */ + /* + * add additional features here + */ + RPC_FEATURE__Feature_Bluetooth = 1 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(RPC_FEATURE) +} RpcFeature; +typedef enum _RpcFeatureCommand { + RPC_FEATURE_COMMAND__Feature_Command_None = 0, + /* + * Bluetooth (BT) Feature Commands + */ + RPC_FEATURE_COMMAND__Feature_Command_BT_Init = 1, + RPC_FEATURE_COMMAND__Feature_Command_BT_Deinit = 2, + RPC_FEATURE_COMMAND__Feature_Command_BT_Enable = 3, + /* + * add additional feature commands here + */ + RPC_FEATURE_COMMAND__Feature_Command_BT_Disable = 4 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(RPC_FEATURE_COMMAND) +} RpcFeatureCommand; +typedef enum _RpcFeatureOption { + RPC_FEATURE_OPTION__Feature_Option_None = 0, + /* + * Bluetooth (BT) Feature Options + */ + /* + * release memory when deinit BT + */ + RPC_FEATURE_OPTION__Feature_Option_BT_Deinit_Release_Memory = 1 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(RPC_FEATURE_OPTION) +} RpcFeatureOption; typedef enum _RpcId { RPC_ID__MsgId_Invalid = 0, /* @@ -249,6 +404,36 @@ typedef enum _RpcId { *0x104 */ RPC_ID__Req_SetWifiMode = 260, + /* + *0x105 + */ + RPC_ID__Req_SuppDppInit = 261, + /* + *0x106 + */ + RPC_ID__Req_SuppDppDeinit = 262, + /* + *0x107 + */ + RPC_ID__Req_SuppDppBootstrapGen = 263, + /* + *0x108 + */ + RPC_ID__Req_SuppDppStartListen = 264, + /* + *0x109 + */ + RPC_ID__Req_SuppDppStopListen = 265, + /* + *Req_SetSoftAPVendorSpecificIE = 266; //0x10a + *Req_StartSoftAP = 267; //0x10b + *Req_GetSoftAPConnectedSTAList = 268; //0x10c + *Req_StopSoftAP = 269; //0x10d + */ + /* + *0x112 + */ + RPC_ID__Req_OTAActivate = 266, /* *0x10e */ @@ -582,14 +767,191 @@ typedef enum _RpcId { *0x15f */ RPC_ID__Req_WifiScanGetApRecord = 351, + /* + *0x160 + */ + RPC_ID__Req_SetDhcpDnsStatus = 352, + /* + *0x161 + */ + RPC_ID__Req_GetDhcpDnsStatus = 353, + /* + *0x162 + */ + RPC_ID__Req_WifiStaTwtConfig = 354, + /* + *0x163 + */ + RPC_ID__Req_WifiStaItwtSetup = 355, + /* + *0x164 + */ + RPC_ID__Req_WifiStaItwtTeardown = 356, + /* + *0x165 + */ + RPC_ID__Req_WifiStaItwtSuspend = 357, + /* + *0x166 + */ + RPC_ID__Req_WifiStaItwtGetFlowIdStatus = 358, + /* + *0x167 + */ + RPC_ID__Req_WifiStaItwtSendProbeReq = 359, + /* + *0x168 + */ + RPC_ID__Req_WifiStaItwtSetTargetWakeTimeOffset = 360, + /* + *0x169 + */ + RPC_ID__Req_WifiStaEnterpriseEnable = 361, + /* + *0x16A + */ + RPC_ID__Req_WifiStaEnterpriseDisable = 362, + /* + *0x16B + */ + RPC_ID__Req_EapSetIdentity = 363, + /* + *0x16C + */ + RPC_ID__Req_EapClearIdentity = 364, + /* + *0x16D + */ + RPC_ID__Req_EapSetUsername = 365, + /* + *0x16E + */ + RPC_ID__Req_EapClearUsername = 366, + /* + *0x16F + */ + RPC_ID__Req_EapSetPassword = 367, + /* + *0x170 + */ + RPC_ID__Req_EapClearPassword = 368, + /* + *0x171 + */ + RPC_ID__Req_EapSetNewPassword = 369, + /* + *0x172 + */ + RPC_ID__Req_EapClearNewPassword = 370, + /* + *0x173 + */ + RPC_ID__Req_EapSetCaCert = 371, + /* + *0x174 + */ + RPC_ID__Req_EapClearCaCert = 372, + /* + *0x175 + */ + RPC_ID__Req_EapSetCertificateAndKey = 373, + /* + *0x176 + */ + RPC_ID__Req_EapClearCertificateAndKey = 374, + /* + *0x177 + */ + RPC_ID__Req_EapGetDisableTimeCheck = 375, + /* + *0x178 + */ + RPC_ID__Req_EapSetTtlsPhase2Method = 376, + /* + *0x179 + */ + RPC_ID__Req_EapSetSuitebCertification = 377, + /* + *0x17A + */ + RPC_ID__Req_EapSetPacFile = 378, + /* + *0x17B + */ + RPC_ID__Req_EapSetFastParams = 379, + /* + *0x17C + */ + RPC_ID__Req_EapUseDefaultCertBundle = 380, + /* + *0x17D + */ + RPC_ID__Req_WifiSetOkcSupport = 381, + /* + *0x17E + */ + RPC_ID__Req_EapSetDomainName = 382, + /* + *0x17F + */ + RPC_ID__Req_EapSetDisableTimeCheck = 383, + /* + *0x180 + */ + RPC_ID__Req_EapSetEapMethods = 384, + /* + *0x181 + */ + RPC_ID__Req_IfaceMacAddrSetGet = 385, + /* + *0x182 + */ + RPC_ID__Req_IfaceMacAddrLenGet = 386, + /* + * Common RPC to handle simple feature control with one optional parameter + * Supported Features: + * - BT Init/Deinit/Enable/Disable + */ + /* + *0x183 + */ + RPC_ID__Req_FeatureControl = 387, + /* + * 0x184 + */ + RPC_ID__Req_GpioConfig = 388, + /* + * 0x185 + */ + RPC_ID__Req_GpioResetPin = 389, + /* + * 0x186 + */ + RPC_ID__Req_GpioSetLevel = 390, + /* + * 0x187 + */ + RPC_ID__Req_GpioGetLevel = 391, + /* + * 0x188 + */ + RPC_ID__Req_GpioSetDirection = 392, + /* + * 0x189 + */ + RPC_ID__Req_GpioInputEnable = 393, + /* + * 0x18A + */ + RPC_ID__Req_GpioSetPullMode = 394, /* * Add new control path command response before Req_Max * and update Req_Max */ /* - *0x160 + *0x18B */ - RPC_ID__Req_Max = 352, + RPC_ID__Req_Max = 395, /* ** Response Msgs * */ @@ -598,6 +960,18 @@ typedef enum _RpcId { RPC_ID__Resp_SetMacAddress = 514, RPC_ID__Resp_GetWifiMode = 515, RPC_ID__Resp_SetWifiMode = 516, + RPC_ID__Resp_SuppDppInit = 517, + RPC_ID__Resp_SuppDppDeinit = 518, + RPC_ID__Resp_SuppDppBootstrapGen = 519, + RPC_ID__Resp_SuppDppStartListen = 520, + RPC_ID__Resp_SuppDppStopListen = 521, + /* + *Resp_SetSoftAPVendorSpecificIE = 522; + *Resp_StartSoftAP = 523; + *Resp_GetSoftAPConnectedSTAList = 524; + *Resp_StopSoftAP = 525; + */ + RPC_ID__Resp_OTAActivate = 522, RPC_ID__Resp_WifiSetPs = 526, RPC_ID__Resp_WifiGetPs = 527, RPC_ID__Resp_OTABegin = 528, @@ -691,11 +1065,54 @@ typedef enum _RpcId { RPC_ID__Resp_WifiGetBandMode = 605, RPC_ID__Resp_GetCoprocessorFwVersion = 606, RPC_ID__Resp_WifiScanGetApRecord = 607, + RPC_ID__Resp_SetDhcpDnsStatus = 608, + RPC_ID__Resp_GetDhcpDnsStatus = 609, + RPC_ID__Resp_WifiStaTwtConfig = 610, + RPC_ID__Resp_WifiStaItwtSetup = 611, + RPC_ID__Resp_WifiStaItwtTeardown = 612, + RPC_ID__Resp_WifiStaItwtSuspend = 613, + RPC_ID__Resp_WifiStaItwtGetFlowIdStatus = 614, + RPC_ID__Resp_WifiStaItwtSendProbeReq = 615, + RPC_ID__Resp_WifiStaItwtSetTargetWakeTimeOffset = 616, + RPC_ID__Resp_WifiStaEnterpriseEnable = 617, + RPC_ID__Resp_WifiStaEnterpriseDisable = 618, + RPC_ID__Resp_EapSetIdentity = 619, + RPC_ID__Resp_EapClearIdentity = 620, + RPC_ID__Resp_EapSetUsername = 621, + RPC_ID__Resp_EapClearUsername = 622, + RPC_ID__Resp_EapSetPassword = 623, + RPC_ID__Resp_EapClearPassword = 624, + RPC_ID__Resp_EapSetNewPassword = 625, + RPC_ID__Resp_EapClearNewPassword = 626, + RPC_ID__Resp_EapSetCaCert = 627, + RPC_ID__Resp_EapClearCaCert = 628, + RPC_ID__Resp_EapSetCertificateAndKey = 629, + RPC_ID__Resp_EapClearCertificateAndKey = 630, + RPC_ID__Resp_EapGetDisableTimeCheck = 631, + RPC_ID__Resp_EapSetTtlsPhase2Method = 632, + RPC_ID__Resp_EapSetSuitebCertification = 633, + RPC_ID__Resp_EapSetPacFile = 634, + RPC_ID__Resp_EapSetFastParams = 635, + RPC_ID__Resp_EapUseDefaultCertBundle = 636, + RPC_ID__Resp_WifiSetOkcSupport = 637, + RPC_ID__Resp_EapSetDomainName = 638, + RPC_ID__Resp_EapSetDisableTimeCheck = 639, + RPC_ID__Resp_EapSetEapMethods = 640, + RPC_ID__Resp_IfaceMacAddrSetGet = 641, + RPC_ID__Resp_IfaceMacAddrLenGet = 642, + RPC_ID__Resp_FeatureControl = 643, + RPC_ID__Resp_GpioConfig = 644, + RPC_ID__Resp_GpioResetPin = 645, + RPC_ID__Resp_GpioSetLevel = 646, + RPC_ID__Resp_GpioGetLevel = 647, + RPC_ID__Resp_GpioSetDirection = 648, + RPC_ID__Resp_GpioInputEnable = 649, + RPC_ID__Resp_GpioSetPullMode = 650, /* * Add new control path command response before Resp_Max * and update Resp_Max */ - RPC_ID__Resp_Max = 608, + RPC_ID__Resp_Max = 651, /* ** Event Msgs * */ @@ -708,13 +1125,43 @@ typedef enum _RpcId { RPC_ID__Event_StaScanDone = 774, RPC_ID__Event_StaConnected = 775, RPC_ID__Event_StaDisconnected = 776, + RPC_ID__Event_DhcpDnsStatus = 777, + RPC_ID__Event_StaItwtSetup = 778, + RPC_ID__Event_StaItwtTeardown = 779, + RPC_ID__Event_StaItwtSuspend = 780, + RPC_ID__Event_StaItwtProbe = 781, + /* + * Supplicant DPP Events received by dpp callback on host + */ + RPC_ID__Event_SuppDppUriReady = 782, + RPC_ID__Event_SuppDppCfgRecvd = 783, + RPC_ID__Event_SuppDppFail = 784, + /* + * Wifi DPP Events + */ + RPC_ID__Event_WifiDppUriReady = 785, + RPC_ID__Event_WifiDppCfgRecvd = 786, + RPC_ID__Event_WifiDppFail = 787, /* * Add new control path command notification before Event_Max * and update Event_Max */ - RPC_ID__Event_Max = 777 + RPC_ID__Event_Max = 788 PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(RPC_ID) } RpcId; +typedef enum _RpcGpioMode { + RPC__GPIO_MODE__GPIO_MODE_DISABLE = 0, + RPC__GPIO_MODE__GPIO_MODE_INPUT = 1, + RPC__GPIO_MODE__GPIO_MODE_OUTPUT = 2, + RPC__GPIO_MODE__GPIO_MODE_INPUT_OUTPUT = 3 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(RPC__GPIO_MODE) +} RpcGpioMode; +typedef enum _RpcGpioPullMode { + RPC__GPIO_PULL_MODE__GPIO_PULL_NONE = 0, + RPC__GPIO_PULL_MODE__GPIO_PULL_UP = 1, + RPC__GPIO_PULL_MODE__GPIO_PULL_DOWN = 2 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(RPC__GPIO_PULL_MODE) +} RpcGpioPullMode; /* --- messages --- */ @@ -801,10 +1248,26 @@ struct WifiInitConfig **< WiFi init magic number, it should be the last field */ int32_t magic; + /* + **< WiFi RX MGMT buffer type + */ + int32_t rx_mgmt_buf_type; + /* + **< WiFi RX MGMT buffer number + */ + int32_t rx_mgmt_buf_num; + /* + **< WiFi TX HE TB QUEUE number for STA HE TB PPDU transmission + */ + int32_t tx_hetb_queue_num; + /* + **< enable dump sigb field + */ + int32_t dump_hesigb_enable; }; #define WIFI_INIT_CONFIG__INIT \ { PROTOBUF_C_MESSAGE_INIT (&wifi_init_config__descriptor) \ - , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } struct WifiCountry @@ -873,6 +1336,23 @@ struct WifiScanTime , NULL, 0 } +struct WifiScanChannelBitmap +{ + ProtobufCMessage base; + /* + **< Represents 2.4 GHz channels, that bits can be set as wifi_2g_channel_bit_t shown. + */ + uint32_t ghz_2_channels; + /* + **< Represents 5 GHz channels, that bits can be set as wifi_5g_channel_bit_t shown. + */ + uint32_t ghz_5_channels; +}; +#define WIFI_SCAN_CHANNEL_BITMAP__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&wifi_scan_channel_bitmap__descriptor) \ + , 0, 0 } + + struct WifiScanConfig { ProtobufCMessage base; @@ -904,10 +1384,16 @@ struct WifiScanConfig **< time spent at home channel between scanning consecutive channels. */ uint32_t home_chan_dwell_time; + /* + **< Channel bitmap for setting specific channels to be scanned. + *Please note that the 'channel' parameter above needs to be set to 0 to allow scanning by bitmap. + *Also, note that only allowed channels configured by wifi_country_t can be scanned. + */ + WifiScanChannelBitmap *channel_bitmap; }; #define WIFI_SCAN_CONFIG__INIT \ { PROTOBUF_C_MESSAGE_INIT (&wifi_scan_config__descriptor) \ - , {0,NULL}, {0,NULL}, 0, 0, 0, NULL, 0 } + , {0,NULL}, {0,NULL}, 0, 0, 0, NULL, 0, NULL } struct WifiHeApInfo @@ -1027,10 +1513,14 @@ struct WifiScanThreshold *Please set authmode threshold as WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK to connect to WEP/WPA networks */ int32_t authmode; + /* + **< The RSSI value of the 5G AP is within the rssi_5g_adjustment range compared to the 2G AP, the 5G AP will be given priority for connection. + */ + uint32_t rssi_5g_adjustment; }; #define WIFI_SCAN_THRESHOLD__INIT \ { PROTOBUF_C_MESSAGE_INIT (&wifi_scan_threshold__descriptor) \ - , 0, 0 } + , 0, 0, 0 } struct WifiPmfConfig @@ -1050,6 +1540,23 @@ struct WifiPmfConfig , 0, 0 } +struct WifiBssMaxIdleConfig +{ + ProtobufCMessage base; + /* + **< Sets BSS Max idle period (1 Unit = 1000TUs OR 1.024 Seconds). If there are no frames for this period from a STA, SoftAP will disassociate due to inactivity. Setting it to 0 disables the feature + */ + uint32_t period; + /* + **< Requires clients to use protected keep alive frames for BSS Max Idle period + */ + protobuf_c_boolean protected_keep_alive; +}; +#define WIFI_BSS_MAX_IDLE_CONFIG__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&wifi_bss_max_idle_config__descriptor) \ + , 0, 0 } + + struct WifiApConfig { ProtobufCMessage base; @@ -1103,10 +1610,34 @@ struct WifiApConfig **< Configuration for SAE PWE derivation method */ int32_t sae_pwe_h2e; + /* + **< Channel Switch Announcement Count. Notify the station that the channel will switch after the csa_count beacon intervals. Default value: 3 + */ + uint32_t csa_count; + /* + **< Dtim period of soft-AP. Range: 1 ~ 10. Default value: 1 + */ + uint32_t dtim_period; + /* + **< Whether to enable transition disable feature + */ + uint32_t transition_disable; + /* + **< Enable SAE EXT feature. SOC_GCMP_SUPPORT is required for this feature. + */ + uint32_t sae_ext; + /* + **< Configuration for bss max idle, effective if CONFIG_WIFI_BSS_MAX_IDLE_SUPPORT is enabled + */ + WifiBssMaxIdleConfig *bss_max_idle_cfg; + /* + **< GTK rekeying interval in seconds. If set to 0, GTK rekeying is disabled. Range: 60 ~ 65535 including 0. + */ + uint32_t gtk_rekey_interval; }; #define WIFI_AP_CONFIG__INIT \ { PROTOBUF_C_MESSAGE_INIT (&wifi_ap_config__descriptor) \ - , {0,NULL}, {0,NULL}, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0 } + , {0,NULL}, {0,NULL}, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0, NULL, 0 } struct WifiStaConfig @@ -1185,17 +1716,24 @@ struct WifiStaConfig *uint32_t he_trig_su_bmforming_feedback_disabled:1; **< Whether to disable support the transmission of SU feedback in an HE TB sounding sequence. * *uint32_t he_trig_mu_bmforming_partial_feedback_disabled:1; **< Whether to disable support the transmission of partial-bandwidth MU feedback in an HE TB sounding sequence. * * uint32_t he_trig_cqi_feedback_disabled:1; **< Whether to disable support the transmission of CQI feedback in an HE TB sounding sequence. * - * uint32_t he_reserved:22; **< Reserved for future feature set * + * uint32_t vht_su_beamformee_disabled: 1; **< Whether to disable support for operation as an VHT SU beamformee. * + * uint32_t vht_mu_beamformee_disabled: 1; **< Whether to disable support for operation as an VHT MU beamformee. * + * uint32_t vht_mcs8_enabled: 1; **< Whether to support VHT-MCS8. The default value is 0. * + * uint32_t he_reserved:19; **< Reserved for future feature set * */ uint32_t he_bitmask; /* **< Password identifier for H2E. this needs to be null terminated string. SAE_H2E_IDENTIFIER_LEN chars */ ProtobufCBinaryData sae_h2e_identifier; + /* + **< Configuration for SAE-PK (Public Key) Authentication method + */ + uint32_t sae_pk_mode; }; #define WIFI_STA_CONFIG__INIT \ { PROTOBUF_C_MESSAGE_INIT (&wifi_sta_config__descriptor) \ - , {0,NULL}, {0,NULL}, 0, 0, {0,NULL}, 0, 0, 0, NULL, NULL, 0, 0, 0, 0, {0,NULL} } + , {0,NULL}, {0,NULL}, 0, 0, {0,NULL}, 0, 0, 0, NULL, NULL, 0, 0, 0, 0, {0,NULL}, 0 } typedef enum { @@ -1974,6 +2512,48 @@ struct WifiBandwidths , 0, 0 } +struct WifiItwtSetupConfig +{ + ProtobufCMessage base; + uint32_t setup_cmd; + /* + * uint16_t trigger : 1; **< 1: a trigger-enabled individual TWT, 0: a non-trigger-enabled individual TWT * + * uint16_t flow_type : 1; **< 0: an announced individual TWT, 1: an unannounced individual TWT * + * uint16_t flow_id : 3; **< When set up an individual TWT agreement, the flow id will be assigned by AP after a successful agreement setup. + * flow_id could be specified to a value in the range of [0, 7], but it might be changed by AP in the response. + * When change TWT parameters of the existing TWT agreement, flow_id should be an existing one. The value range is [0, 7]. * + * uint16_t wake_invl_expn : 5; **< Individual TWT Wake Interval Exponent. The value range is [0, 31]. * + * uint16_t wake_duration_unit : 1; **< Individual TWT Wake duration unit, 0: 256us 1: TU (TU = 1024us)* + * uint16_t reserved : 5; **< bit: 11.15 reserved * + */ + uint32_t bitmask_1; + uint32_t min_wake_dura; + uint32_t wake_invl_mant; + uint32_t twt_id; + uint32_t timeout_time_ms; +}; +#define WIFI_ITWT_SETUP_CONFIG__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&wifi_itwt_setup_config__descriptor) \ + , 0, 0, 0, 0, 0, 0 } + + +struct WifiTwtConfig +{ + ProtobufCMessage base; + /* + **< post twt wakeup event + */ + protobuf_c_boolean post_wakeup_event; + /* + **< twt enable send qos null to keep alive + */ + protobuf_c_boolean twt_enable_keep_alive; +}; +#define WIFI_TWT_CONFIG__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&wifi_twt_config__descriptor) \ + , 0, 0 } + + struct ConnectedSTAList { ProtobufCMessage base; @@ -1985,6 +2565,27 @@ struct ConnectedSTAList , {0,NULL}, 0 } +struct EapFastConfig +{ + ProtobufCMessage base; + /* + * Enable or disable Fast Provisioning in EAP-FAST (0 = disabled, 1 = enabled) + */ + int32_t fast_provisioning; + /* + * Maximum length of the PAC (Protected Access Credential) list + */ + int32_t fast_max_pac_list_len; + /* + * Set to true for binary format PAC, false for ASCII format PAC + */ + protobuf_c_boolean fast_pac_format_binary; +}; +#define EAP_FAST_CONFIG__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&eap_fast_config__descriptor) \ + , 0, 0, 0 } + + /* ** Req/Resp structure * */ @@ -2168,6 +2769,25 @@ struct RpcRespOTAEnd , 0 } +struct RpcReqOTAActivate +{ + ProtobufCMessage base; +}; +#define RPC__REQ__OTAACTIVATE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__otaactivate__descriptor) \ + } + + +struct RpcRespOTAActivate +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__OTAACTIVATE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__otaactivate__descriptor) \ + , 0 } + + struct RpcReqWifiSetMaxTxPower { ProtobufCMessage base; @@ -3085,3451 +3705,7175 @@ struct RpcRespWifiGetBandMode , 0, 0 } -struct RpcReqGetCoprocessorFwVersion +struct RpcReqWifiSetInactiveTime { ProtobufCMessage base; + uint32_t ifx; + uint32_t sec; }; -#define RPC__REQ__GET_COPROCESSOR_FW_VERSION__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&rpc__req__get_coprocessor_fw_version__descriptor) \ - } +#define RPC__REQ__WIFI_SET_INACTIVE_TIME__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__wifi_set_inactive_time__descriptor) \ + , 0, 0 } -struct RpcRespGetCoprocessorFwVersion +struct RpcRespWifiSetInactiveTime { ProtobufCMessage base; int32_t resp; - uint32_t major1; - uint32_t minor1; - uint32_t patch1; }; -#define RPC__RESP__GET_COPROCESSOR_FW_VERSION__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__get_coprocessor_fw_version__descriptor) \ - , 0, 0, 0, 0 } +#define RPC__RESP__WIFI_SET_INACTIVE_TIME__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__wifi_set_inactive_time__descriptor) \ + , 0 } -struct RpcEventWifiEventNoArgs +struct RpcReqWifiGetInactiveTime { ProtobufCMessage base; - int32_t resp; - int32_t event_id; + uint32_t ifx; }; -#define RPC__EVENT__WIFI_EVENT_NO_ARGS__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&rpc__event__wifi_event_no_args__descriptor) \ - , 0, 0 } +#define RPC__REQ__WIFI_GET_INACTIVE_TIME__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__wifi_get_inactive_time__descriptor) \ + , 0 } -struct RpcEventESPInit +struct RpcRespWifiGetInactiveTime { ProtobufCMessage base; - ProtobufCBinaryData init_data; + int32_t resp; + uint32_t sec; }; -#define RPC__EVENT__ESPINIT__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&rpc__event__espinit__descriptor) \ - , {0,NULL} } +#define RPC__RESP__WIFI_GET_INACTIVE_TIME__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__wifi_get_inactive_time__descriptor) \ + , 0, 0 } -struct RpcEventHeartbeat +struct RpcReqWifiStaItwtSetup { ProtobufCMessage base; - int32_t hb_num; + WifiItwtSetupConfig *setup_config; }; -#define RPC__EVENT__HEARTBEAT__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&rpc__event__heartbeat__descriptor) \ - , 0 } +#define RPC__REQ__WIFI_STA_ITWT_SETUP__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__wifi_sta_itwt_setup__descriptor) \ + , NULL } -struct RpcEventAPStaDisconnected +struct RpcRespWifiStaItwtSetup { ProtobufCMessage base; int32_t resp; - ProtobufCBinaryData mac; - uint32_t aid; - protobuf_c_boolean is_mesh_child; - uint32_t reason; }; -#define RPC__EVENT__AP__STA_DISCONNECTED__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&rpc__event__ap__sta_disconnected__descriptor) \ - , 0, {0,NULL}, 0, 0, 0 } +#define RPC__RESP__WIFI_STA_ITWT_SETUP__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__wifi_sta_itwt_setup__descriptor) \ + , 0 } -struct RpcEventAPStaConnected +struct RpcReqWifiStaItwtTeardown +{ + ProtobufCMessage base; + int32_t flow_id; +}; +#define RPC__REQ__WIFI_STA_ITWT_TEARDOWN__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__wifi_sta_itwt_teardown__descriptor) \ + , 0 } + + +struct RpcRespWifiStaItwtTeardown { ProtobufCMessage base; int32_t resp; - ProtobufCBinaryData mac; - uint32_t aid; - protobuf_c_boolean is_mesh_child; }; -#define RPC__EVENT__AP__STA_CONNECTED__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&rpc__event__ap__sta_connected__descriptor) \ - , 0, {0,NULL}, 0, 0 } +#define RPC__RESP__WIFI_STA_ITWT_TEARDOWN__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__wifi_sta_itwt_teardown__descriptor) \ + , 0 } -struct RpcEventStaScanDone +struct RpcReqWifiStaItwtSuspend +{ + ProtobufCMessage base; + int32_t flow_id; + int32_t suspend_time_ms; +}; +#define RPC__REQ__WIFI_STA_ITWT_SUSPEND__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__wifi_sta_itwt_suspend__descriptor) \ + , 0, 0 } + + +struct RpcRespWifiStaItwtSuspend { ProtobufCMessage base; int32_t resp; - WifiEventStaScanDone *scan_done; }; -#define RPC__EVENT__STA_SCAN_DONE__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&rpc__event__sta_scan_done__descriptor) \ - , 0, NULL } +#define RPC__RESP__WIFI_STA_ITWT_SUSPEND__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__wifi_sta_itwt_suspend__descriptor) \ + , 0 } -struct RpcEventStaConnected +struct RpcReqWifiStaItwtGetFlowIdStatus +{ + ProtobufCMessage base; +}; +#define RPC__REQ__WIFI_STA_ITWT_GET_FLOW_ID_STATUS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__wifi_sta_itwt_get_flow_id_status__descriptor) \ + } + + +struct RpcRespWifiStaItwtGetFlowIdStatus { ProtobufCMessage base; int32_t resp; - WifiEventStaConnected *sta_connected; + int32_t flow_id_bitmap; }; -#define RPC__EVENT__STA_CONNECTED__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&rpc__event__sta_connected__descriptor) \ - , 0, NULL } +#define RPC__RESP__WIFI_STA_ITWT_GET_FLOW_ID_STATUS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__wifi_sta_itwt_get_flow_id_status__descriptor) \ + , 0, 0 } -struct RpcEventStaDisconnected +struct RpcReqWifiStaItwtSendProbeReq +{ + ProtobufCMessage base; + int32_t timeout_ms; +}; +#define RPC__REQ__WIFI_STA_ITWT_SEND_PROBE_REQ__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__wifi_sta_itwt_send_probe_req__descriptor) \ + , 0 } + + +struct RpcRespWifiStaItwtSendProbeReq { ProtobufCMessage base; int32_t resp; - WifiEventStaDisconnected *sta_disconnected; }; -#define RPC__EVENT__STA_DISCONNECTED__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&rpc__event__sta_disconnected__descriptor) \ - , 0, NULL } +#define RPC__RESP__WIFI_STA_ITWT_SEND_PROBE_REQ__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__wifi_sta_itwt_send_probe_req__descriptor) \ + , 0 } -typedef enum { - RPC__PAYLOAD__NOT_SET = 0, - RPC__PAYLOAD_REQ_GET_MAC_ADDRESS = 257, - RPC__PAYLOAD_REQ_SET_MAC_ADDRESS = 258, - RPC__PAYLOAD_REQ_GET_WIFI_MODE = 259, - RPC__PAYLOAD_REQ_SET_WIFI_MODE = 260, - RPC__PAYLOAD_REQ_WIFI_SET_PS = 270, - RPC__PAYLOAD_REQ_WIFI_GET_PS = 271, - RPC__PAYLOAD_REQ_OTA_BEGIN = 272, - RPC__PAYLOAD_REQ_OTA_WRITE = 273, - RPC__PAYLOAD_REQ_OTA_END = 274, - RPC__PAYLOAD_REQ_SET_WIFI_MAX_TX_POWER = 275, - RPC__PAYLOAD_REQ_GET_WIFI_MAX_TX_POWER = 276, - RPC__PAYLOAD_REQ_CONFIG_HEARTBEAT = 277, - RPC__PAYLOAD_REQ_WIFI_INIT = 278, - RPC__PAYLOAD_REQ_WIFI_DEINIT = 279, - RPC__PAYLOAD_REQ_WIFI_START = 280, - RPC__PAYLOAD_REQ_WIFI_STOP = 281, - RPC__PAYLOAD_REQ_WIFI_CONNECT = 282, - RPC__PAYLOAD_REQ_WIFI_DISCONNECT = 283, - RPC__PAYLOAD_REQ_WIFI_SET_CONFIG = 284, - RPC__PAYLOAD_REQ_WIFI_GET_CONFIG = 285, - RPC__PAYLOAD_REQ_WIFI_SCAN_START = 286, - RPC__PAYLOAD_REQ_WIFI_SCAN_STOP = 287, - RPC__PAYLOAD_REQ_WIFI_SCAN_GET_AP_NUM = 288, - RPC__PAYLOAD_REQ_WIFI_SCAN_GET_AP_RECORDS = 289, - RPC__PAYLOAD_REQ_WIFI_CLEAR_AP_LIST = 290, - RPC__PAYLOAD_REQ_WIFI_RESTORE = 291, - RPC__PAYLOAD_REQ_WIFI_CLEAR_FAST_CONNECT = 292, - RPC__PAYLOAD_REQ_WIFI_DEAUTH_STA = 293, - RPC__PAYLOAD_REQ_WIFI_STA_GET_AP_INFO = 294, - RPC__PAYLOAD_REQ_WIFI_SET_PROTOCOL = 297, - RPC__PAYLOAD_REQ_WIFI_GET_PROTOCOL = 298, - RPC__PAYLOAD_REQ_WIFI_SET_BANDWIDTH = 299, - RPC__PAYLOAD_REQ_WIFI_GET_BANDWIDTH = 300, - RPC__PAYLOAD_REQ_WIFI_SET_CHANNEL = 301, - RPC__PAYLOAD_REQ_WIFI_GET_CHANNEL = 302, - RPC__PAYLOAD_REQ_WIFI_SET_COUNTRY = 303, - RPC__PAYLOAD_REQ_WIFI_GET_COUNTRY = 304, - RPC__PAYLOAD_REQ_WIFI_AP_GET_STA_LIST = 311, - RPC__PAYLOAD_REQ_WIFI_AP_GET_STA_AID = 312, - RPC__PAYLOAD_REQ_WIFI_SET_STORAGE = 313, - RPC__PAYLOAD_REQ_WIFI_SET_COUNTRY_CODE = 334, - RPC__PAYLOAD_REQ_WIFI_GET_COUNTRY_CODE = 335, - RPC__PAYLOAD_REQ_WIFI_STA_GET_AID = 338, - RPC__PAYLOAD_REQ_WIFI_STA_GET_NEGOTIATED_PHYMODE = 339, - RPC__PAYLOAD_REQ_WIFI_STA_GET_RSSI = 341, - RPC__PAYLOAD_REQ_WIFI_SET_PROTOCOLS = 342, - RPC__PAYLOAD_REQ_WIFI_GET_PROTOCOLS = 343, - RPC__PAYLOAD_REQ_WIFI_SET_BANDWIDTHS = 344, - RPC__PAYLOAD_REQ_WIFI_GET_BANDWIDTHS = 345, - RPC__PAYLOAD_REQ_WIFI_SET_BAND = 346, - RPC__PAYLOAD_REQ_WIFI_GET_BAND = 347, - RPC__PAYLOAD_REQ_WIFI_SET_BANDMODE = 348, - RPC__PAYLOAD_REQ_WIFI_GET_BANDMODE = 349, - RPC__PAYLOAD_REQ_GET_COPROCESSOR_FWVERSION = 350, - RPC__PAYLOAD_REQ_WIFI_SCAN_GET_AP_RECORD = 351, - RPC__PAYLOAD_RESP_GET_MAC_ADDRESS = 513, - RPC__PAYLOAD_RESP_SET_MAC_ADDRESS = 514, - RPC__PAYLOAD_RESP_GET_WIFI_MODE = 515, - RPC__PAYLOAD_RESP_SET_WIFI_MODE = 516, - RPC__PAYLOAD_RESP_WIFI_SET_PS = 526, - RPC__PAYLOAD_RESP_WIFI_GET_PS = 527, - RPC__PAYLOAD_RESP_OTA_BEGIN = 528, - RPC__PAYLOAD_RESP_OTA_WRITE = 529, - RPC__PAYLOAD_RESP_OTA_END = 530, - RPC__PAYLOAD_RESP_SET_WIFI_MAX_TX_POWER = 531, - RPC__PAYLOAD_RESP_GET_WIFI_MAX_TX_POWER = 532, - RPC__PAYLOAD_RESP_CONFIG_HEARTBEAT = 533, - RPC__PAYLOAD_RESP_WIFI_INIT = 534, - RPC__PAYLOAD_RESP_WIFI_DEINIT = 535, - RPC__PAYLOAD_RESP_WIFI_START = 536, - RPC__PAYLOAD_RESP_WIFI_STOP = 537, - RPC__PAYLOAD_RESP_WIFI_CONNECT = 538, - RPC__PAYLOAD_RESP_WIFI_DISCONNECT = 539, - RPC__PAYLOAD_RESP_WIFI_SET_CONFIG = 540, - RPC__PAYLOAD_RESP_WIFI_GET_CONFIG = 541, - RPC__PAYLOAD_RESP_WIFI_SCAN_START = 542, - RPC__PAYLOAD_RESP_WIFI_SCAN_STOP = 543, - RPC__PAYLOAD_RESP_WIFI_SCAN_GET_AP_NUM = 544, - RPC__PAYLOAD_RESP_WIFI_SCAN_GET_AP_RECORDS = 545, - RPC__PAYLOAD_RESP_WIFI_CLEAR_AP_LIST = 546, - RPC__PAYLOAD_RESP_WIFI_RESTORE = 547, - RPC__PAYLOAD_RESP_WIFI_CLEAR_FAST_CONNECT = 548, - RPC__PAYLOAD_RESP_WIFI_DEAUTH_STA = 549, - RPC__PAYLOAD_RESP_WIFI_STA_GET_AP_INFO = 550, - RPC__PAYLOAD_RESP_WIFI_SET_PROTOCOL = 553, - RPC__PAYLOAD_RESP_WIFI_GET_PROTOCOL = 554, - RPC__PAYLOAD_RESP_WIFI_SET_BANDWIDTH = 555, - RPC__PAYLOAD_RESP_WIFI_GET_BANDWIDTH = 556, - RPC__PAYLOAD_RESP_WIFI_SET_CHANNEL = 557, - RPC__PAYLOAD_RESP_WIFI_GET_CHANNEL = 558, - RPC__PAYLOAD_RESP_WIFI_SET_COUNTRY = 559, - RPC__PAYLOAD_RESP_WIFI_GET_COUNTRY = 560, - RPC__PAYLOAD_RESP_WIFI_AP_GET_STA_LIST = 567, - RPC__PAYLOAD_RESP_WIFI_AP_GET_STA_AID = 568, - RPC__PAYLOAD_RESP_WIFI_SET_STORAGE = 569, - RPC__PAYLOAD_RESP_WIFI_SET_COUNTRY_CODE = 590, - RPC__PAYLOAD_RESP_WIFI_GET_COUNTRY_CODE = 591, - RPC__PAYLOAD_RESP_WIFI_STA_GET_AID = 594, - RPC__PAYLOAD_RESP_WIFI_STA_GET_NEGOTIATED_PHYMODE = 595, - RPC__PAYLOAD_RESP_WIFI_STA_GET_RSSI = 597, - RPC__PAYLOAD_RESP_WIFI_SET_PROTOCOLS = 598, - RPC__PAYLOAD_RESP_WIFI_GET_PROTOCOLS = 599, - RPC__PAYLOAD_RESP_WIFI_SET_BANDWIDTHS = 600, - RPC__PAYLOAD_RESP_WIFI_GET_BANDWIDTHS = 601, - RPC__PAYLOAD_RESP_WIFI_SET_BAND = 602, - RPC__PAYLOAD_RESP_WIFI_GET_BAND = 603, - RPC__PAYLOAD_RESP_WIFI_SET_BANDMODE = 604, - RPC__PAYLOAD_RESP_WIFI_GET_BANDMODE = 605, - RPC__PAYLOAD_RESP_GET_COPROCESSOR_FWVERSION = 606, - RPC__PAYLOAD_RESP_WIFI_SCAN_GET_AP_RECORD = 607, - RPC__PAYLOAD_EVENT_ESP_INIT = 769, - RPC__PAYLOAD_EVENT_HEARTBEAT = 770, - RPC__PAYLOAD_EVENT_AP_STA_CONNECTED = 771, - RPC__PAYLOAD_EVENT_AP_STA_DISCONNECTED = 772, - RPC__PAYLOAD_EVENT_WIFI_EVENT_NO_ARGS = 773, - RPC__PAYLOAD_EVENT_STA_SCAN_DONE = 774, - RPC__PAYLOAD_EVENT_STA_CONNECTED = 775, - RPC__PAYLOAD_EVENT_STA_DISCONNECTED = 776 - PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(RPC__PAYLOAD__CASE) -} Rpc__PayloadCase; +struct RpcReqWifiStaItwtSetTargetWakeTimeOffset +{ + ProtobufCMessage base; + int32_t offset_us; +}; +#define RPC__REQ__WIFI_STA_ITWT_SET_TARGET_WAKE_TIME_OFFSET__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__wifi_sta_itwt_set_target_wake_time_offset__descriptor) \ + , 0 } -struct Rpc + +struct RpcRespWifiStaItwtSetTargetWakeTimeOffset +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__WIFI_STA_ITWT_SET_TARGET_WAKE_TIME_OFFSET__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__descriptor) \ + , 0 } + + +struct RpcReqWifiStaTwtConfig +{ + ProtobufCMessage base; + WifiTwtConfig *config; +}; +#define RPC__REQ__WIFI_STA_TWT_CONFIG__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__wifi_sta_twt_config__descriptor) \ + , NULL } + + +struct RpcRespWifiStaTwtConfig +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__WIFI_STA_TWT_CONFIG__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__wifi_sta_twt_config__descriptor) \ + , 0 } + + +struct RpcReqGetCoprocessorFwVersion +{ + ProtobufCMessage base; +}; +#define RPC__REQ__GET_COPROCESSOR_FW_VERSION__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__get_coprocessor_fw_version__descriptor) \ + } + + +struct RpcRespGetCoprocessorFwVersion +{ + ProtobufCMessage base; + int32_t resp; + uint32_t major1; + uint32_t minor1; + uint32_t patch1; +}; +#define RPC__RESP__GET_COPROCESSOR_FW_VERSION__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__get_coprocessor_fw_version__descriptor) \ + , 0, 0, 0, 0 } + + +struct RpcReqSetDhcpDnsStatus +{ + ProtobufCMessage base; + int32_t iface; + int32_t net_link_up; + int32_t dhcp_up; + ProtobufCBinaryData dhcp_ip; + ProtobufCBinaryData dhcp_nm; + ProtobufCBinaryData dhcp_gw; + int32_t dns_up; + ProtobufCBinaryData dns_ip; + int32_t dns_type; +}; +#define RPC__REQ__SET_DHCP_DNS_STATUS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__set_dhcp_dns_status__descriptor) \ + , 0, 0, 0, {0,NULL}, {0,NULL}, {0,NULL}, 0, {0,NULL}, 0 } + + +struct RpcRespSetDhcpDnsStatus +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__SET_DHCP_DNS_STATUS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__set_dhcp_dns_status__descriptor) \ + , 0 } + + +struct RpcReqGetDhcpDnsStatus +{ + ProtobufCMessage base; + int32_t iface; +}; +#define RPC__REQ__GET_DHCP_DNS_STATUS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__get_dhcp_dns_status__descriptor) \ + , 0 } + + +struct RpcRespGetDhcpDnsStatus +{ + ProtobufCMessage base; + int32_t iface; + int32_t net_link_up; + int32_t dhcp_up; + ProtobufCBinaryData dhcp_ip; + ProtobufCBinaryData dhcp_nm; + ProtobufCBinaryData dhcp_gw; + int32_t dns_up; + ProtobufCBinaryData dns_ip; + int32_t dns_type; + int32_t resp; +}; +#define RPC__RESP__GET_DHCP_DNS_STATUS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__get_dhcp_dns_status__descriptor) \ + , 0, 0, 0, {0,NULL}, {0,NULL}, {0,NULL}, 0, {0,NULL}, 0, 0 } + + +struct RpcReqSuppDppInit { ProtobufCMessage base; /* - * msg_type could be req, resp or Event - */ - RpcType msg_type; - /* - * msg id - */ - RpcId msg_id; - /* - * UID of message + * enables sending of Event_SuppDpp to host via callback */ - uint32_t uid; - Rpc__PayloadCase payload_case; - union { - /* - ** Requests * - */ - RpcReqGetMacAddress *req_get_mac_address; - RpcReqSetMacAddress *req_set_mac_address; - RpcReqGetMode *req_get_wifi_mode; - RpcReqSetMode *req_set_wifi_mode; - RpcReqSetPs *req_wifi_set_ps; - RpcReqGetPs *req_wifi_get_ps; - RpcReqOTABegin *req_ota_begin; - RpcReqOTAWrite *req_ota_write; - RpcReqOTAEnd *req_ota_end; - RpcReqWifiSetMaxTxPower *req_set_wifi_max_tx_power; - RpcReqWifiGetMaxTxPower *req_get_wifi_max_tx_power; - RpcReqConfigHeartbeat *req_config_heartbeat; - RpcReqWifiInit *req_wifi_init; - RpcReqWifiDeinit *req_wifi_deinit; - RpcReqWifiStart *req_wifi_start; - RpcReqWifiStop *req_wifi_stop; - RpcReqWifiConnect *req_wifi_connect; - RpcReqWifiDisconnect *req_wifi_disconnect; - RpcReqWifiSetConfig *req_wifi_set_config; - RpcReqWifiGetConfig *req_wifi_get_config; - RpcReqWifiScanStart *req_wifi_scan_start; - RpcReqWifiScanStop *req_wifi_scan_stop; - RpcReqWifiScanGetApNum *req_wifi_scan_get_ap_num; - RpcReqWifiScanGetApRecords *req_wifi_scan_get_ap_records; - RpcReqWifiClearApList *req_wifi_clear_ap_list; - RpcReqWifiRestore *req_wifi_restore; - RpcReqWifiClearFastConnect *req_wifi_clear_fast_connect; - RpcReqWifiDeauthSta *req_wifi_deauth_sta; - RpcReqWifiStaGetApInfo *req_wifi_sta_get_ap_info; - RpcReqWifiSetProtocol *req_wifi_set_protocol; - RpcReqWifiGetProtocol *req_wifi_get_protocol; - RpcReqWifiSetBandwidth *req_wifi_set_bandwidth; - RpcReqWifiGetBandwidth *req_wifi_get_bandwidth; - RpcReqWifiSetChannel *req_wifi_set_channel; - RpcReqWifiGetChannel *req_wifi_get_channel; - RpcReqWifiSetCountry *req_wifi_set_country; - RpcReqWifiGetCountry *req_wifi_get_country; - RpcReqWifiApGetStaList *req_wifi_ap_get_sta_list; - RpcReqWifiApGetStaAid *req_wifi_ap_get_sta_aid; - RpcReqWifiSetStorage *req_wifi_set_storage; - RpcReqWifiSetCountryCode *req_wifi_set_country_code; - RpcReqWifiGetCountryCode *req_wifi_get_country_code; - RpcReqWifiStaGetAid *req_wifi_sta_get_aid; - RpcReqWifiStaGetNegotiatedPhymode *req_wifi_sta_get_negotiated_phymode; - RpcReqWifiStaGetRssi *req_wifi_sta_get_rssi; - RpcReqWifiSetProtocols *req_wifi_set_protocols; - RpcReqWifiGetProtocols *req_wifi_get_protocols; - RpcReqWifiSetBandwidths *req_wifi_set_bandwidths; - RpcReqWifiGetBandwidths *req_wifi_get_bandwidths; - RpcReqWifiSetBand *req_wifi_set_band; - RpcReqWifiGetBand *req_wifi_get_band; - RpcReqWifiSetBandMode *req_wifi_set_bandmode; - RpcReqWifiGetBandMode *req_wifi_get_bandmode; - RpcReqGetCoprocessorFwVersion *req_get_coprocessor_fwversion; - RpcReqWifiScanGetApRecord *req_wifi_scan_get_ap_record; - /* - ** Responses * - */ - RpcRespGetMacAddress *resp_get_mac_address; - RpcRespSetMacAddress *resp_set_mac_address; - RpcRespGetMode *resp_get_wifi_mode; - RpcRespSetMode *resp_set_wifi_mode; - RpcRespSetPs *resp_wifi_set_ps; - RpcRespGetPs *resp_wifi_get_ps; - RpcRespOTABegin *resp_ota_begin; - RpcRespOTAWrite *resp_ota_write; - RpcRespOTAEnd *resp_ota_end; - RpcRespWifiSetMaxTxPower *resp_set_wifi_max_tx_power; - RpcRespWifiGetMaxTxPower *resp_get_wifi_max_tx_power; - RpcRespConfigHeartbeat *resp_config_heartbeat; - RpcRespWifiInit *resp_wifi_init; - RpcRespWifiDeinit *resp_wifi_deinit; - RpcRespWifiStart *resp_wifi_start; - RpcRespWifiStop *resp_wifi_stop; - RpcRespWifiConnect *resp_wifi_connect; - RpcRespWifiDisconnect *resp_wifi_disconnect; - RpcRespWifiSetConfig *resp_wifi_set_config; - RpcRespWifiGetConfig *resp_wifi_get_config; - RpcRespWifiScanStart *resp_wifi_scan_start; - RpcRespWifiScanStop *resp_wifi_scan_stop; - RpcRespWifiScanGetApNum *resp_wifi_scan_get_ap_num; - RpcRespWifiScanGetApRecords *resp_wifi_scan_get_ap_records; - RpcRespWifiClearApList *resp_wifi_clear_ap_list; - RpcRespWifiRestore *resp_wifi_restore; - RpcRespWifiClearFastConnect *resp_wifi_clear_fast_connect; - RpcRespWifiDeauthSta *resp_wifi_deauth_sta; - RpcRespWifiStaGetApInfo *resp_wifi_sta_get_ap_info; - RpcRespWifiSetProtocol *resp_wifi_set_protocol; - RpcRespWifiGetProtocol *resp_wifi_get_protocol; - RpcRespWifiSetBandwidth *resp_wifi_set_bandwidth; - RpcRespWifiGetBandwidth *resp_wifi_get_bandwidth; - RpcRespWifiSetChannel *resp_wifi_set_channel; - RpcRespWifiGetChannel *resp_wifi_get_channel; - RpcRespWifiSetCountry *resp_wifi_set_country; - RpcRespWifiGetCountry *resp_wifi_get_country; - RpcRespWifiApGetStaList *resp_wifi_ap_get_sta_list; - RpcRespWifiApGetStaAid *resp_wifi_ap_get_sta_aid; - RpcRespWifiSetStorage *resp_wifi_set_storage; - RpcRespWifiSetCountryCode *resp_wifi_set_country_code; - RpcRespWifiGetCountryCode *resp_wifi_get_country_code; - RpcRespWifiStaGetAid *resp_wifi_sta_get_aid; - RpcRespWifiStaGetNegotiatedPhymode *resp_wifi_sta_get_negotiated_phymode; - RpcRespWifiStaGetRssi *resp_wifi_sta_get_rssi; - RpcRespWifiSetProtocols *resp_wifi_set_protocols; - RpcRespWifiGetProtocols *resp_wifi_get_protocols; - RpcRespWifiSetBandwidths *resp_wifi_set_bandwidths; - RpcRespWifiGetBandwidths *resp_wifi_get_bandwidths; - RpcRespWifiSetBand *resp_wifi_set_band; - RpcRespWifiGetBand *resp_wifi_get_band; - RpcRespWifiSetBandMode *resp_wifi_set_bandmode; - RpcRespWifiGetBandMode *resp_wifi_get_bandmode; - RpcRespGetCoprocessorFwVersion *resp_get_coprocessor_fwversion; - RpcRespWifiScanGetApRecord *resp_wifi_scan_get_ap_record; - /* - ** Notifications * - */ - RpcEventESPInit *event_esp_init; - RpcEventHeartbeat *event_heartbeat; - RpcEventAPStaConnected *event_ap_sta_connected; - RpcEventAPStaDisconnected *event_ap_sta_disconnected; - RpcEventWifiEventNoArgs *event_wifi_event_no_args; - RpcEventStaScanDone *event_sta_scan_done; - RpcEventStaConnected *event_sta_connected; - RpcEventStaDisconnected *event_sta_disconnected; - }; + protobuf_c_boolean cb; }; -#define RPC__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&rpc__descriptor) \ - , RPC_TYPE__MsgType_Invalid, RPC_ID__MsgId_Invalid, 0, RPC__PAYLOAD__NOT_SET, {0} } +#define RPC__REQ__SUPP_DPP_INIT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__supp_dpp_init__descriptor) \ + , 0 } -/* WifiInitConfig methods */ -void wifi_init_config__init - (WifiInitConfig *message); -size_t wifi_init_config__get_packed_size - (const WifiInitConfig *message); -size_t wifi_init_config__pack - (const WifiInitConfig *message, +struct RpcRespSuppDppInit +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__SUPP_DPP_INIT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__supp_dpp_init__descriptor) \ + , 0 } + + +struct RpcReqSuppDppDeinit +{ + ProtobufCMessage base; +}; +#define RPC__REQ__SUPP_DPP_DEINIT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__supp_dpp_deinit__descriptor) \ + } + + +struct RpcRespSuppDppDeinit +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__SUPP_DPP_DEINIT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__supp_dpp_deinit__descriptor) \ + , 0 } + + +struct RpcReqSuppDppBootstrapGen +{ + ProtobufCMessage base; + /* + * DPP Bootstrapping listen channels separated by commas + */ + ProtobufCBinaryData chan_list; + /* + * Bootstrap method type, only QR Code method is supported for now. + */ + int32_t type; + /* + * (Optional) 32 byte Raw Private Key for generating a Bootstrapping Public Key + */ + ProtobufCBinaryData key; + /* + * (Optional) Ancillary Device Information like Serial Number + */ + ProtobufCBinaryData info; +}; +#define RPC__REQ__SUPP_DPP_BOOTSTRAP_GEN__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__supp_dpp_bootstrap_gen__descriptor) \ + , {0,NULL}, 0, {0,NULL}, {0,NULL} } + + +struct RpcRespSuppDppBootstrapGen +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__SUPP_DPP_BOOTSTRAP_GEN__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__supp_dpp_bootstrap_gen__descriptor) \ + , 0 } + + +struct RpcReqSuppDppStartListen +{ + ProtobufCMessage base; +}; +#define RPC__REQ__SUPP_DPP_START_LISTEN__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__supp_dpp_start_listen__descriptor) \ + } + + +struct RpcRespSuppDppStartListen +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__SUPP_DPP_START_LISTEN__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__supp_dpp_start_listen__descriptor) \ + , 0 } + + +struct RpcReqSuppDppStopListen +{ + ProtobufCMessage base; +}; +#define RPC__REQ__SUPP_DPP_STOP_LISTEN__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__supp_dpp_stop_listen__descriptor) \ + } + + +struct RpcRespSuppDppStopListen +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__SUPP_DPP_STOP_LISTEN__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__supp_dpp_stop_listen__descriptor) \ + , 0 } + + +struct RpcReqIfaceMacAddrSetGet +{ + ProtobufCMessage base; + protobuf_c_boolean set; + uint32_t type; + /* + * only valid for set + */ + ProtobufCBinaryData mac; +}; +#define RPC__REQ__IFACE_MAC_ADDR_SET_GET__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__iface_mac_addr_set_get__descriptor) \ + , 0, 0, {0,NULL} } + + +struct RpcRespIfaceMacAddrSetGet +{ + ProtobufCMessage base; + int32_t resp; + protobuf_c_boolean set; + uint32_t type; + ProtobufCBinaryData mac; +}; +#define RPC__RESP__IFACE_MAC_ADDR_SET_GET__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__iface_mac_addr_set_get__descriptor) \ + , 0, 0, 0, {0,NULL} } + + +struct RpcReqIfaceMacAddrLenGet +{ + ProtobufCMessage base; + uint32_t type; +}; +#define RPC__REQ__IFACE_MAC_ADDR_LEN_GET__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__iface_mac_addr_len_get__descriptor) \ + , 0 } + + +struct RpcRespIfaceMacAddrLenGet +{ + ProtobufCMessage base; + int32_t resp; + uint32_t type; + uint32_t len; +}; +#define RPC__RESP__IFACE_MAC_ADDR_LEN_GET__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__iface_mac_addr_len_get__descriptor) \ + , 0, 0, 0 } + + +struct RpcReqFeatureControl +{ + ProtobufCMessage base; + RpcFeature feature; + RpcFeatureCommand command; + RpcFeatureOption option; +}; +#define RPC__REQ__FEATURE_CONTROL__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__feature_control__descriptor) \ + , RPC_FEATURE__Feature_None, RPC_FEATURE_COMMAND__Feature_Command_None, RPC_FEATURE_OPTION__Feature_Option_None } + + +struct RpcRespFeatureControl +{ + ProtobufCMessage base; + int32_t resp; + RpcFeature feature; + RpcFeatureCommand command; + RpcFeatureOption option; +}; +#define RPC__RESP__FEATURE_CONTROL__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__feature_control__descriptor) \ + , 0, RPC_FEATURE__Feature_None, RPC_FEATURE_COMMAND__Feature_Command_None, RPC_FEATURE_OPTION__Feature_Option_None } + + +struct RpcEventWifiEventNoArgs +{ + ProtobufCMessage base; + int32_t resp; + int32_t event_id; +}; +#define RPC__EVENT__WIFI_EVENT_NO_ARGS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__wifi_event_no_args__descriptor) \ + , 0, 0 } + + +struct RpcEventESPInit +{ + ProtobufCMessage base; + ProtobufCBinaryData init_data; +}; +#define RPC__EVENT__ESPINIT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__espinit__descriptor) \ + , {0,NULL} } + + +struct RpcEventHeartbeat +{ + ProtobufCMessage base; + int32_t hb_num; +}; +#define RPC__EVENT__HEARTBEAT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__heartbeat__descriptor) \ + , 0 } + + +struct RpcEventAPStaDisconnected +{ + ProtobufCMessage base; + int32_t resp; + ProtobufCBinaryData mac; + uint32_t aid; + protobuf_c_boolean is_mesh_child; + uint32_t reason; +}; +#define RPC__EVENT__AP__STA_DISCONNECTED__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__ap__sta_disconnected__descriptor) \ + , 0, {0,NULL}, 0, 0, 0 } + + +struct RpcEventAPStaConnected +{ + ProtobufCMessage base; + int32_t resp; + ProtobufCBinaryData mac; + uint32_t aid; + protobuf_c_boolean is_mesh_child; +}; +#define RPC__EVENT__AP__STA_CONNECTED__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__ap__sta_connected__descriptor) \ + , 0, {0,NULL}, 0, 0 } + + +struct RpcEventStaScanDone +{ + ProtobufCMessage base; + int32_t resp; + WifiEventStaScanDone *scan_done; +}; +#define RPC__EVENT__STA_SCAN_DONE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__sta_scan_done__descriptor) \ + , 0, NULL } + + +struct RpcEventStaConnected +{ + ProtobufCMessage base; + int32_t resp; + WifiEventStaConnected *sta_connected; +}; +#define RPC__EVENT__STA_CONNECTED__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__sta_connected__descriptor) \ + , 0, NULL } + + +struct RpcEventStaDisconnected +{ + ProtobufCMessage base; + int32_t resp; + WifiEventStaDisconnected *sta_disconnected; +}; +#define RPC__EVENT__STA_DISCONNECTED__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__sta_disconnected__descriptor) \ + , 0, NULL } + + +struct RpcEventDhcpDnsStatus +{ + ProtobufCMessage base; + int32_t iface; + int32_t net_link_up; + int32_t dhcp_up; + ProtobufCBinaryData dhcp_ip; + ProtobufCBinaryData dhcp_nm; + ProtobufCBinaryData dhcp_gw; + int32_t dns_up; + ProtobufCBinaryData dns_ip; + int32_t dns_type; + int32_t resp; +}; +#define RPC__EVENT__DHCP_DNS_STATUS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__dhcp_dns_status__descriptor) \ + , 0, 0, 0, {0,NULL}, {0,NULL}, {0,NULL}, 0, {0,NULL}, 0, 0 } + + +struct RpcEventStaItwtSetup +{ + ProtobufCMessage base; + int32_t resp; + WifiItwtSetupConfig *config; + int32_t status; + uint32_t reason; + uint64_t target_wake_time; +}; +#define RPC__EVENT__STA_ITWT_SETUP__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__sta_itwt_setup__descriptor) \ + , 0, NULL, 0, 0, 0 } + + +struct RpcEventStaItwtTeardown +{ + ProtobufCMessage base; + int32_t resp; + uint32_t flow_id; + uint32_t status; +}; +#define RPC__EVENT__STA_ITWT_TEARDOWN__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__sta_itwt_teardown__descriptor) \ + , 0, 0, 0 } + + +struct RpcEventStaItwtSuspend +{ + ProtobufCMessage base; + int32_t resp; + int32_t status; + uint32_t flow_id_bitmap; + /* + * represents uint32_t actual_suspend_time_ms[] + */ + size_t n_actual_suspend_time_ms; + uint32_t *actual_suspend_time_ms; +}; +#define RPC__EVENT__STA_ITWT_SUSPEND__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__sta_itwt_suspend__descriptor) \ + , 0, 0, 0, 0,NULL } + + +struct RpcEventStaItwtProbe +{ + ProtobufCMessage base; + int32_t resp; + int32_t status; + uint32_t reason; +}; +#define RPC__EVENT__STA_ITWT_PROBE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__sta_itwt_probe__descriptor) \ + , 0, 0, 0 } + + +struct RpcReqWifiStaEnterpriseEnable +{ + ProtobufCMessage base; +}; +#define RPC__REQ__WIFI_STA_ENTERPRISE_ENABLE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__wifi_sta_enterprise_enable__descriptor) \ + } + + +struct RpcRespWifiStaEnterpriseEnable +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__WIFI_STA_ENTERPRISE_ENABLE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__wifi_sta_enterprise_enable__descriptor) \ + , 0 } + + +struct RpcReqWifiStaEnterpriseDisable +{ + ProtobufCMessage base; +}; +#define RPC__REQ__WIFI_STA_ENTERPRISE_DISABLE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__wifi_sta_enterprise_disable__descriptor) \ + } + + +struct RpcRespWifiStaEnterpriseDisable +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__WIFI_STA_ENTERPRISE_DISABLE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__wifi_sta_enterprise_disable__descriptor) \ + , 0 } + + +struct RpcReqEapSetIdentity +{ + ProtobufCMessage base; + ProtobufCBinaryData identity; + int32_t len; +}; +#define RPC__REQ__EAP_SET_IDENTITY__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_set_identity__descriptor) \ + , {0,NULL}, 0 } + + +struct RpcRespEapSetIdentity +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_SET_IDENTITY__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_set_identity__descriptor) \ + , 0 } + + +struct RpcReqEapClearIdentity +{ + ProtobufCMessage base; +}; +#define RPC__REQ__EAP_CLEAR_IDENTITY__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_clear_identity__descriptor) \ + } + + +struct RpcRespEapClearIdentity +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_CLEAR_IDENTITY__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_clear_identity__descriptor) \ + , 0 } + + +struct RpcReqEapSetUsername +{ + ProtobufCMessage base; + ProtobufCBinaryData username; + int32_t len; +}; +#define RPC__REQ__EAP_SET_USERNAME__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_set_username__descriptor) \ + , {0,NULL}, 0 } + + +struct RpcRespEapSetUsername +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_SET_USERNAME__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_set_username__descriptor) \ + , 0 } + + +struct RpcReqEapClearUsername +{ + ProtobufCMessage base; +}; +#define RPC__REQ__EAP_CLEAR_USERNAME__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_clear_username__descriptor) \ + } + + +struct RpcRespEapClearUsername +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_CLEAR_USERNAME__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_clear_username__descriptor) \ + , 0 } + + +struct RpcReqEapSetPassword +{ + ProtobufCMessage base; + ProtobufCBinaryData password; + int32_t len; +}; +#define RPC__REQ__EAP_SET_PASSWORD__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_set_password__descriptor) \ + , {0,NULL}, 0 } + + +struct RpcRespEapSetPassword +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_SET_PASSWORD__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_set_password__descriptor) \ + , 0 } + + +struct RpcReqEapClearPassword +{ + ProtobufCMessage base; +}; +#define RPC__REQ__EAP_CLEAR_PASSWORD__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_clear_password__descriptor) \ + } + + +struct RpcRespEapClearPassword +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_CLEAR_PASSWORD__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_clear_password__descriptor) \ + , 0 } + + +struct RpcReqEapSetNewPassword +{ + ProtobufCMessage base; + ProtobufCBinaryData new_password; + int32_t len; +}; +#define RPC__REQ__EAP_SET_NEW_PASSWORD__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_set_new_password__descriptor) \ + , {0,NULL}, 0 } + + +struct RpcRespEapSetNewPassword +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_SET_NEW_PASSWORD__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_set_new_password__descriptor) \ + , 0 } + + +struct RpcReqEapClearNewPassword +{ + ProtobufCMessage base; +}; +#define RPC__REQ__EAP_CLEAR_NEW_PASSWORD__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_clear_new_password__descriptor) \ + } + + +struct RpcRespEapClearNewPassword +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_CLEAR_NEW_PASSWORD__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_clear_new_password__descriptor) \ + , 0 } + + +struct RpcReqEapSetCaCert +{ + ProtobufCMessage base; + ProtobufCBinaryData ca_cert; + int32_t ca_cert_len; +}; +#define RPC__REQ__EAP_SET_CA_CERT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_set_ca_cert__descriptor) \ + , {0,NULL}, 0 } + + +struct RpcRespEapSetCaCert +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_SET_CA_CERT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_set_ca_cert__descriptor) \ + , 0 } + + +struct RpcReqEapClearCaCert +{ + ProtobufCMessage base; +}; +#define RPC__REQ__EAP_CLEAR_CA_CERT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_clear_ca_cert__descriptor) \ + } + + +struct RpcRespEapClearCaCert +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_CLEAR_CA_CERT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_clear_ca_cert__descriptor) \ + , 0 } + + +struct RpcReqEapSetCertificateAndKey +{ + ProtobufCMessage base; + ProtobufCBinaryData client_cert; + int32_t client_cert_len; + ProtobufCBinaryData private_key; + int32_t private_key_len; + ProtobufCBinaryData private_key_password; + int32_t private_key_passwd_len; +}; +#define RPC__REQ__EAP_SET_CERTIFICATE_AND_KEY__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_set_certificate_and_key__descriptor) \ + , {0,NULL}, 0, {0,NULL}, 0, {0,NULL}, 0 } + + +struct RpcRespEapSetCertificateAndKey +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_SET_CERTIFICATE_AND_KEY__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_set_certificate_and_key__descriptor) \ + , 0 } + + +struct RpcReqEapClearCertificateAndKey +{ + ProtobufCMessage base; +}; +#define RPC__REQ__EAP_CLEAR_CERTIFICATE_AND_KEY__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_clear_certificate_and_key__descriptor) \ + } + + +struct RpcRespEapClearCertificateAndKey +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_CLEAR_CERTIFICATE_AND_KEY__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_clear_certificate_and_key__descriptor) \ + , 0 } + + +struct RpcReqEapSetDisableTimeCheck +{ + ProtobufCMessage base; + protobuf_c_boolean disable; +}; +#define RPC__REQ__EAP_SET_DISABLE_TIME_CHECK__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_set_disable_time_check__descriptor) \ + , 0 } + + +struct RpcRespEapSetDisableTimeCheck +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_SET_DISABLE_TIME_CHECK__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_set_disable_time_check__descriptor) \ + , 0 } + + +struct RpcReqEapGetDisableTimeCheck +{ + ProtobufCMessage base; +}; +#define RPC__REQ__EAP_GET_DISABLE_TIME_CHECK__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_get_disable_time_check__descriptor) \ + } + + +struct RpcRespEapGetDisableTimeCheck +{ + ProtobufCMessage base; + int32_t resp; + protobuf_c_boolean disable; +}; +#define RPC__RESP__EAP_GET_DISABLE_TIME_CHECK__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_get_disable_time_check__descriptor) \ + , 0, 0 } + + +struct RpcReqEapSetTtlsPhase2Method +{ + ProtobufCMessage base; + int32_t type; +}; +#define RPC__REQ__EAP_SET_TTLS_PHASE2_METHOD__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_set_ttls_phase2_method__descriptor) \ + , 0 } + + +struct RpcRespEapSetTtlsPhase2Method +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_SET_TTLS_PHASE2_METHOD__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_set_ttls_phase2_method__descriptor) \ + , 0 } + + +struct RpcReqEapSetSuiteb192bitCertification +{ + ProtobufCMessage base; + protobuf_c_boolean enable; +}; +#define RPC__REQ__EAP_SET_SUITEB192BIT_CERTIFICATION__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_set_suiteb192bit_certification__descriptor) \ + , 0 } + + +struct RpcRespEapSetSuiteb192bitCertification +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_SET_SUITEB192BIT_CERTIFICATION__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_set_suiteb192bit_certification__descriptor) \ + , 0 } + + +struct RpcReqEapSetPacFile +{ + ProtobufCMessage base; + ProtobufCBinaryData pac_file; + int32_t pac_file_len; +}; +#define RPC__REQ__EAP_SET_PAC_FILE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_set_pac_file__descriptor) \ + , {0,NULL}, 0 } + + +struct RpcRespEapSetPacFile +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_SET_PAC_FILE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_set_pac_file__descriptor) \ + , 0 } + + +struct RpcReqEapSetFastParams +{ + ProtobufCMessage base; + EapFastConfig *eap_fast_config; +}; +#define RPC__REQ__EAP_SET_FAST_PARAMS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_set_fast_params__descriptor) \ + , NULL } + + +struct RpcRespEapSetFastParams +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_SET_FAST_PARAMS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_set_fast_params__descriptor) \ + , 0 } + + +struct RpcReqEapUseDefaultCertBundle +{ + ProtobufCMessage base; + protobuf_c_boolean use_default_bundle; +}; +#define RPC__REQ__EAP_USE_DEFAULT_CERT_BUNDLE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_use_default_cert_bundle__descriptor) \ + , 0 } + + +struct RpcRespEapUseDefaultCertBundle +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_USE_DEFAULT_CERT_BUNDLE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_use_default_cert_bundle__descriptor) \ + , 0 } + + +struct RpcReqWifiSetOkcSupport +{ + ProtobufCMessage base; + protobuf_c_boolean enable; +}; +#define RPC__REQ__WIFI_SET_OKC_SUPPORT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__wifi_set_okc_support__descriptor) \ + , 0 } + + +struct RpcRespWifiSetOkcSupport +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__WIFI_SET_OKC_SUPPORT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__wifi_set_okc_support__descriptor) \ + , 0 } + + +struct RpcReqEapSetDomainName +{ + ProtobufCMessage base; + ProtobufCBinaryData domain_name; +}; +#define RPC__REQ__EAP_SET_DOMAIN_NAME__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_set_domain_name__descriptor) \ + , {0,NULL} } + + +struct RpcRespEapSetDomainName +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_SET_DOMAIN_NAME__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_set_domain_name__descriptor) \ + , 0 } + + +struct RpcReqEapSetEapMethods +{ + ProtobufCMessage base; + int32_t methods; +}; +#define RPC__REQ__EAP_SET_EAP_METHODS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__eap_set_eap_methods__descriptor) \ + , 0 } + + +struct RpcRespEapSetEapMethods +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__EAP_SET_EAP_METHODS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__eap_set_eap_methods__descriptor) \ + , 0 } + + +struct RpcEventSuppDppUriReady +{ + ProtobufCMessage base; + int32_t resp; + /* + * QR Code to configure the enrollee + */ + ProtobufCBinaryData qrcode; +}; +#define RPC__EVENT__SUPP_DPP_URI_READY__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__supp_dpp_uri_ready__descriptor) \ + , 0, {0,NULL} } + + +struct RpcEventSuppDppCfgRecvd +{ + ProtobufCMessage base; + int32_t resp; + WifiConfig *cfg; +}; +#define RPC__EVENT__SUPP_DPP_CFG_RECVD__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__supp_dpp_cfg_recvd__descriptor) \ + , 0, NULL } + + +struct RpcEventSuppDppFail +{ + ProtobufCMessage base; + int32_t resp; + /* + * failure reason + */ + int32_t reason; +}; +#define RPC__EVENT__SUPP_DPP_FAIL__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__supp_dpp_fail__descriptor) \ + , 0, 0 } + + +struct RpcEventWifiDppUriReady +{ + ProtobufCMessage base; + int32_t resp; + /* + * QR Code to configure the enrollee + */ + ProtobufCBinaryData qrcode; +}; +#define RPC__EVENT__WIFI_DPP_URI_READY__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__wifi_dpp_uri_ready__descriptor) \ + , 0, {0,NULL} } + + +struct RpcEventWifiDppCfgRecvd +{ + ProtobufCMessage base; + int32_t resp; + WifiConfig *cfg; +}; +#define RPC__EVENT__WIFI_DPP_CFG_RECVD__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__wifi_dpp_cfg_recvd__descriptor) \ + , 0, NULL } + + +struct RpcEventWifiDppFail +{ + ProtobufCMessage base; + int32_t resp; + /* + * failure reason + */ + int32_t reason; +}; +#define RPC__EVENT__WIFI_DPP_FAIL__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__event__wifi_dpp_fail__descriptor) \ + , 0, 0 } + + +struct RpcGpioConfig +{ + ProtobufCMessage base; + uint64_t pin_bit_mask; + RpcGpioMode mode; + protobuf_c_boolean pull_up_en; + protobuf_c_boolean pull_down_en; + int32_t intr_type; +}; +#define RPC__GPIO_CONFIG__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__gpio_config__descriptor) \ + , 0, RPC__GPIO_MODE__GPIO_MODE_DISABLE, 0, 0, 0 } + + +struct RpcReqGpioConfig +{ + ProtobufCMessage base; + RpcGpioConfig *config; +}; +#define RPC__REQ__GPIO_CONFIG__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__gpio_config__descriptor) \ + , NULL } + + +struct RpcRespGpioConfig +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__GPIO_CONFIG__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__gpio_config__descriptor) \ + , 0 } + + +struct RpcReqGpioReset +{ + ProtobufCMessage base; + int32_t gpio_num; +}; +#define RPC__REQ__GPIO_RESET__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__gpio_reset__descriptor) \ + , 0 } + + +struct RpcRespGpioResetPin +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__GPIO_RESET_PIN__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__gpio_reset_pin__descriptor) \ + , 0 } + + +struct RpcReqGpioSetLevel +{ + ProtobufCMessage base; + int32_t gpio_num; + /* + * 0 or 1 + */ + uint32_t level; +}; +#define RPC__REQ__GPIO_SET_LEVEL__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__gpio_set_level__descriptor) \ + , 0, 0 } + + +struct RpcRespGpioSetLevel +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__GPIO_SET_LEVEL__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__gpio_set_level__descriptor) \ + , 0 } + + +struct RpcReqGpioGetLevel +{ + ProtobufCMessage base; + int32_t gpio_num; +}; +#define RPC__REQ__GPIO_GET_LEVEL__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__gpio_get_level__descriptor) \ + , 0 } + + +struct RpcRespGpioGetLevel +{ + ProtobufCMessage base; + int32_t resp; + uint32_t level; +}; +#define RPC__RESP__GPIO_GET_LEVEL__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__gpio_get_level__descriptor) \ + , 0, 0 } + + +struct RpcReqGpioSetDirection +{ + ProtobufCMessage base; + int32_t gpio_num; + RpcGpioMode mode; +}; +#define RPC__REQ__GPIO_SET_DIRECTION__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__gpio_set_direction__descriptor) \ + , 0, RPC__GPIO_MODE__GPIO_MODE_DISABLE } + + +struct RpcRespGpioSetDirection +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__GPIO_SET_DIRECTION__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__gpio_set_direction__descriptor) \ + , 0 } + + +struct RpcReqGpioInputEnable +{ + ProtobufCMessage base; + int32_t gpio_num; +}; +#define RPC__REQ__GPIO_INPUT_ENABLE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__gpio_input_enable__descriptor) \ + , 0 } + + +struct RpcRespGpioInputEnable +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__GPIO_INPUT_ENABLE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__gpio_input_enable__descriptor) \ + , 0 } + + +struct RpcReqGpioSetPullMode +{ + ProtobufCMessage base; + int32_t gpio_num; + RpcGpioPullMode pull; +}; +#define RPC__REQ__GPIO_SET_PULL_MODE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__req__gpio_set_pull_mode__descriptor) \ + , 0, RPC__GPIO_PULL_MODE__GPIO_PULL_NONE } + + +struct RpcRespGpioSetPullMode +{ + ProtobufCMessage base; + int32_t resp; +}; +#define RPC__RESP__GPIO_SET_PULL_MODE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__resp__gpio_set_pull_mode__descriptor) \ + , 0 } + + +typedef enum { + RPC__PAYLOAD__NOT_SET = 0, + RPC__PAYLOAD_REQ_GET_MAC_ADDRESS = 257, + RPC__PAYLOAD_REQ_SET_MAC_ADDRESS = 258, + RPC__PAYLOAD_REQ_GET_WIFI_MODE = 259, + RPC__PAYLOAD_REQ_SET_WIFI_MODE = 260, + RPC__PAYLOAD_REQ_SUPP_DPP_INIT = 261, + RPC__PAYLOAD_REQ_SUPP_DPP_DEINIT = 262, + RPC__PAYLOAD_REQ_SUPP_DPP_BOOTSTRAP_GEN = 263, + RPC__PAYLOAD_REQ_SUPP_DPP_START_LISTEN = 264, + RPC__PAYLOAD_REQ_SUPP_DPP_STOP_LISTEN = 265, + RPC__PAYLOAD_REQ_OTA_ACTIVATE = 266, + RPC__PAYLOAD_REQ_WIFI_SET_PS = 270, + RPC__PAYLOAD_REQ_WIFI_GET_PS = 271, + RPC__PAYLOAD_REQ_OTA_BEGIN = 272, + RPC__PAYLOAD_REQ_OTA_WRITE = 273, + RPC__PAYLOAD_REQ_OTA_END = 274, + RPC__PAYLOAD_REQ_SET_WIFI_MAX_TX_POWER = 275, + RPC__PAYLOAD_REQ_GET_WIFI_MAX_TX_POWER = 276, + RPC__PAYLOAD_REQ_CONFIG_HEARTBEAT = 277, + RPC__PAYLOAD_REQ_WIFI_INIT = 278, + RPC__PAYLOAD_REQ_WIFI_DEINIT = 279, + RPC__PAYLOAD_REQ_WIFI_START = 280, + RPC__PAYLOAD_REQ_WIFI_STOP = 281, + RPC__PAYLOAD_REQ_WIFI_CONNECT = 282, + RPC__PAYLOAD_REQ_WIFI_DISCONNECT = 283, + RPC__PAYLOAD_REQ_WIFI_SET_CONFIG = 284, + RPC__PAYLOAD_REQ_WIFI_GET_CONFIG = 285, + RPC__PAYLOAD_REQ_WIFI_SCAN_START = 286, + RPC__PAYLOAD_REQ_WIFI_SCAN_STOP = 287, + RPC__PAYLOAD_REQ_WIFI_SCAN_GET_AP_NUM = 288, + RPC__PAYLOAD_REQ_WIFI_SCAN_GET_AP_RECORDS = 289, + RPC__PAYLOAD_REQ_WIFI_CLEAR_AP_LIST = 290, + RPC__PAYLOAD_REQ_WIFI_RESTORE = 291, + RPC__PAYLOAD_REQ_WIFI_CLEAR_FAST_CONNECT = 292, + RPC__PAYLOAD_REQ_WIFI_DEAUTH_STA = 293, + RPC__PAYLOAD_REQ_WIFI_STA_GET_AP_INFO = 294, + RPC__PAYLOAD_REQ_WIFI_SET_PROTOCOL = 297, + RPC__PAYLOAD_REQ_WIFI_GET_PROTOCOL = 298, + RPC__PAYLOAD_REQ_WIFI_SET_BANDWIDTH = 299, + RPC__PAYLOAD_REQ_WIFI_GET_BANDWIDTH = 300, + RPC__PAYLOAD_REQ_WIFI_SET_CHANNEL = 301, + RPC__PAYLOAD_REQ_WIFI_GET_CHANNEL = 302, + RPC__PAYLOAD_REQ_WIFI_SET_COUNTRY = 303, + RPC__PAYLOAD_REQ_WIFI_GET_COUNTRY = 304, + RPC__PAYLOAD_REQ_WIFI_AP_GET_STA_LIST = 311, + RPC__PAYLOAD_REQ_WIFI_AP_GET_STA_AID = 312, + RPC__PAYLOAD_REQ_WIFI_SET_STORAGE = 313, + RPC__PAYLOAD_REQ_WIFI_SET_INACTIVE_TIME = 325, + RPC__PAYLOAD_REQ_WIFI_GET_INACTIVE_TIME = 326, + RPC__PAYLOAD_REQ_WIFI_SET_COUNTRY_CODE = 334, + RPC__PAYLOAD_REQ_WIFI_GET_COUNTRY_CODE = 335, + RPC__PAYLOAD_REQ_WIFI_STA_GET_AID = 338, + RPC__PAYLOAD_REQ_WIFI_STA_GET_NEGOTIATED_PHYMODE = 339, + RPC__PAYLOAD_REQ_WIFI_STA_GET_RSSI = 341, + RPC__PAYLOAD_REQ_WIFI_SET_PROTOCOLS = 342, + RPC__PAYLOAD_REQ_WIFI_GET_PROTOCOLS = 343, + RPC__PAYLOAD_REQ_WIFI_SET_BANDWIDTHS = 344, + RPC__PAYLOAD_REQ_WIFI_GET_BANDWIDTHS = 345, + RPC__PAYLOAD_REQ_WIFI_SET_BAND = 346, + RPC__PAYLOAD_REQ_WIFI_GET_BAND = 347, + RPC__PAYLOAD_REQ_WIFI_SET_BANDMODE = 348, + RPC__PAYLOAD_REQ_WIFI_GET_BANDMODE = 349, + RPC__PAYLOAD_REQ_GET_COPROCESSOR_FWVERSION = 350, + RPC__PAYLOAD_REQ_WIFI_SCAN_GET_AP_RECORD = 351, + RPC__PAYLOAD_REQ_SET_DHCP_DNS = 352, + RPC__PAYLOAD_REQ_GET_DHCP_DNS = 353, + RPC__PAYLOAD_REQ_WIFI_STA_TWT_CONFIG = 354, + RPC__PAYLOAD_REQ_WIFI_STA_ITWT_SETUP = 355, + RPC__PAYLOAD_REQ_WIFI_STA_ITWT_TEARDOWN = 356, + RPC__PAYLOAD_REQ_WIFI_STA_ITWT_SUSPEND = 357, + RPC__PAYLOAD_REQ_WIFI_STA_ITWT_GET_FLOW_ID_STATUS = 358, + RPC__PAYLOAD_REQ_WIFI_STA_ITWT_SEND_PROBE_REQ = 359, + RPC__PAYLOAD_REQ_WIFI_STA_ITWT_SET_TARGET_WAKE_TIME_OFFSET = 360, + RPC__PAYLOAD_REQ_WIFI_STA_ENTERPRISE_ENABLE = 361, + RPC__PAYLOAD_REQ_WIFI_STA_ENTERPRISE_DISABLE = 362, + RPC__PAYLOAD_REQ_EAP_SET_IDENTITY = 363, + RPC__PAYLOAD_REQ_EAP_CLEAR_IDENTITY = 364, + RPC__PAYLOAD_REQ_EAP_SET_USERNAME = 365, + RPC__PAYLOAD_REQ_EAP_CLEAR_USERNAME = 366, + RPC__PAYLOAD_REQ_EAP_SET_PASSWORD = 367, + RPC__PAYLOAD_REQ_EAP_CLEAR_PASSWORD = 368, + RPC__PAYLOAD_REQ_EAP_SET_NEW_PASSWORD = 369, + RPC__PAYLOAD_REQ_EAP_CLEAR_NEW_PASSWORD = 370, + RPC__PAYLOAD_REQ_EAP_SET_CA_CERT = 371, + RPC__PAYLOAD_REQ_EAP_CLEAR_CA_CERT = 372, + RPC__PAYLOAD_REQ_EAP_SET_CERTIFICATE_AND_KEY = 373, + RPC__PAYLOAD_REQ_EAP_CLEAR_CERTIFICATE_AND_KEY = 374, + RPC__PAYLOAD_REQ_EAP_GET_DISABLE_TIME_CHECK = 375, + RPC__PAYLOAD_REQ_EAP_SET_TTLS_PHASE2_METHOD = 376, + RPC__PAYLOAD_REQ_EAP_SET_SUITEB_CERTIFICATION = 377, + RPC__PAYLOAD_REQ_EAP_SET_PAC_FILE = 378, + RPC__PAYLOAD_REQ_EAP_SET_FAST_PARAMS = 379, + RPC__PAYLOAD_REQ_EAP_USE_DEFAULT_CERT_BUNDLE = 380, + RPC__PAYLOAD_REQ_WIFI_SET_OKC_SUPPORT = 381, + RPC__PAYLOAD_REQ_EAP_SET_DOMAIN_NAME = 382, + RPC__PAYLOAD_REQ_EAP_SET_DISABLE_TIME_CHECK = 383, + RPC__PAYLOAD_REQ_EAP_SET_EAP_METHODS = 384, + RPC__PAYLOAD_REQ_IFACE_MAC_ADDR_SET_GET = 385, + RPC__PAYLOAD_REQ_IFACE_MAC_ADDR_LEN_GET = 386, + RPC__PAYLOAD_REQ_FEATURE_CONTROL = 387, + RPC__PAYLOAD_REQ_GPIO_CONFIG = 388, + RPC__PAYLOAD_REQ_GPIO_RESET = 389, + RPC__PAYLOAD_REQ_GPIO_SET_LEVEL = 390, + RPC__PAYLOAD_REQ_GPIO_GET_LEVEL = 391, + RPC__PAYLOAD_REQ_GPIO_SET_DIRECTION = 392, + RPC__PAYLOAD_REQ_GPIO_INPUT_ENABLE = 393, + RPC__PAYLOAD_REQ_GPIO_SET_PULL_MODE = 394, + RPC__PAYLOAD_RESP_GET_MAC_ADDRESS = 513, + RPC__PAYLOAD_RESP_SET_MAC_ADDRESS = 514, + RPC__PAYLOAD_RESP_GET_WIFI_MODE = 515, + RPC__PAYLOAD_RESP_SET_WIFI_MODE = 516, + RPC__PAYLOAD_RESP_SUPP_DPP_INIT = 517, + RPC__PAYLOAD_RESP_SUPP_DPP_DEINIT = 518, + RPC__PAYLOAD_RESP_SUPP_DPP_BOOTSTRAP_GEN = 519, + RPC__PAYLOAD_RESP_SUPP_DPP_START_LISTEN = 520, + RPC__PAYLOAD_RESP_SUPP_DPP_STOP_LISTEN = 521, + RPC__PAYLOAD_RESP_OTA_ACTIVATE = 522, + RPC__PAYLOAD_RESP_WIFI_SET_PS = 526, + RPC__PAYLOAD_RESP_WIFI_GET_PS = 527, + RPC__PAYLOAD_RESP_OTA_BEGIN = 528, + RPC__PAYLOAD_RESP_OTA_WRITE = 529, + RPC__PAYLOAD_RESP_OTA_END = 530, + RPC__PAYLOAD_RESP_SET_WIFI_MAX_TX_POWER = 531, + RPC__PAYLOAD_RESP_GET_WIFI_MAX_TX_POWER = 532, + RPC__PAYLOAD_RESP_CONFIG_HEARTBEAT = 533, + RPC__PAYLOAD_RESP_WIFI_INIT = 534, + RPC__PAYLOAD_RESP_WIFI_DEINIT = 535, + RPC__PAYLOAD_RESP_WIFI_START = 536, + RPC__PAYLOAD_RESP_WIFI_STOP = 537, + RPC__PAYLOAD_RESP_WIFI_CONNECT = 538, + RPC__PAYLOAD_RESP_WIFI_DISCONNECT = 539, + RPC__PAYLOAD_RESP_WIFI_SET_CONFIG = 540, + RPC__PAYLOAD_RESP_WIFI_GET_CONFIG = 541, + RPC__PAYLOAD_RESP_WIFI_SCAN_START = 542, + RPC__PAYLOAD_RESP_WIFI_SCAN_STOP = 543, + RPC__PAYLOAD_RESP_WIFI_SCAN_GET_AP_NUM = 544, + RPC__PAYLOAD_RESP_WIFI_SCAN_GET_AP_RECORDS = 545, + RPC__PAYLOAD_RESP_WIFI_CLEAR_AP_LIST = 546, + RPC__PAYLOAD_RESP_WIFI_RESTORE = 547, + RPC__PAYLOAD_RESP_WIFI_CLEAR_FAST_CONNECT = 548, + RPC__PAYLOAD_RESP_WIFI_DEAUTH_STA = 549, + RPC__PAYLOAD_RESP_WIFI_STA_GET_AP_INFO = 550, + RPC__PAYLOAD_RESP_WIFI_SET_PROTOCOL = 553, + RPC__PAYLOAD_RESP_WIFI_GET_PROTOCOL = 554, + RPC__PAYLOAD_RESP_WIFI_SET_BANDWIDTH = 555, + RPC__PAYLOAD_RESP_WIFI_GET_BANDWIDTH = 556, + RPC__PAYLOAD_RESP_WIFI_SET_CHANNEL = 557, + RPC__PAYLOAD_RESP_WIFI_GET_CHANNEL = 558, + RPC__PAYLOAD_RESP_WIFI_SET_COUNTRY = 559, + RPC__PAYLOAD_RESP_WIFI_GET_COUNTRY = 560, + RPC__PAYLOAD_RESP_WIFI_AP_GET_STA_LIST = 567, + RPC__PAYLOAD_RESP_WIFI_AP_GET_STA_AID = 568, + RPC__PAYLOAD_RESP_WIFI_SET_STORAGE = 569, + RPC__PAYLOAD_RESP_WIFI_SET_INACTIVE_TIME = 581, + RPC__PAYLOAD_RESP_WIFI_GET_INACTIVE_TIME = 582, + RPC__PAYLOAD_RESP_WIFI_SET_COUNTRY_CODE = 590, + RPC__PAYLOAD_RESP_WIFI_GET_COUNTRY_CODE = 591, + RPC__PAYLOAD_RESP_WIFI_STA_GET_AID = 594, + RPC__PAYLOAD_RESP_WIFI_STA_GET_NEGOTIATED_PHYMODE = 595, + RPC__PAYLOAD_RESP_WIFI_STA_GET_RSSI = 597, + RPC__PAYLOAD_RESP_WIFI_SET_PROTOCOLS = 598, + RPC__PAYLOAD_RESP_WIFI_GET_PROTOCOLS = 599, + RPC__PAYLOAD_RESP_WIFI_SET_BANDWIDTHS = 600, + RPC__PAYLOAD_RESP_WIFI_GET_BANDWIDTHS = 601, + RPC__PAYLOAD_RESP_WIFI_SET_BAND = 602, + RPC__PAYLOAD_RESP_WIFI_GET_BAND = 603, + RPC__PAYLOAD_RESP_WIFI_SET_BANDMODE = 604, + RPC__PAYLOAD_RESP_WIFI_GET_BANDMODE = 605, + RPC__PAYLOAD_RESP_GET_COPROCESSOR_FWVERSION = 606, + RPC__PAYLOAD_RESP_WIFI_SCAN_GET_AP_RECORD = 607, + RPC__PAYLOAD_RESP_SET_DHCP_DNS = 608, + RPC__PAYLOAD_RESP_GET_DHCP_DNS = 609, + RPC__PAYLOAD_RESP_WIFI_STA_TWT_CONFIG = 610, + RPC__PAYLOAD_RESP_WIFI_STA_ITWT_SETUP = 611, + RPC__PAYLOAD_RESP_WIFI_STA_ITWT_TEARDOWN = 612, + RPC__PAYLOAD_RESP_WIFI_STA_ITWT_SUSPEND = 613, + RPC__PAYLOAD_RESP_WIFI_STA_ITWT_GET_FLOW_ID_STATUS = 614, + RPC__PAYLOAD_RESP_WIFI_STA_ITWT_SEND_PROBE_REQ = 615, + RPC__PAYLOAD_RESP_WIFI_STA_ITWT_SET_TARGET_WAKE_TIME_OFFSET = 616, + RPC__PAYLOAD_RESP_WIFI_STA_ENTERPRISE_ENABLE = 617, + RPC__PAYLOAD_RESP_WIFI_STA_ENTERPRISE_DISABLE = 618, + RPC__PAYLOAD_RESP_EAP_SET_IDENTITY = 619, + RPC__PAYLOAD_RESP_EAP_CLEAR_IDENTITY = 620, + RPC__PAYLOAD_RESP_EAP_SET_USERNAME = 621, + RPC__PAYLOAD_RESP_EAP_CLEAR_USERNAME = 622, + RPC__PAYLOAD_RESP_EAP_SET_PASSWORD = 623, + RPC__PAYLOAD_RESP_EAP_CLEAR_PASSWORD = 624, + RPC__PAYLOAD_RESP_EAP_SET_NEW_PASSWORD = 625, + RPC__PAYLOAD_RESP_EAP_CLEAR_NEW_PASSWORD = 626, + RPC__PAYLOAD_RESP_EAP_SET_CA_CERT = 627, + RPC__PAYLOAD_RESP_EAP_CLEAR_CA_CERT = 628, + RPC__PAYLOAD_RESP_EAP_SET_CERTIFICATE_AND_KEY = 629, + RPC__PAYLOAD_RESP_EAP_CLEAR_CERTIFICATE_AND_KEY = 630, + RPC__PAYLOAD_RESP_EAP_GET_DISABLE_TIME_CHECK = 631, + RPC__PAYLOAD_RESP_EAP_SET_TTLS_PHASE2_METHOD = 632, + RPC__PAYLOAD_RESP_EAP_SET_SUITEB_CERTIFICATION = 633, + RPC__PAYLOAD_RESP_EAP_SET_PAC_FILE = 634, + RPC__PAYLOAD_RESP_EAP_SET_FAST_PARAMS = 635, + RPC__PAYLOAD_RESP_EAP_USE_DEFAULT_CERT_BUNDLE = 636, + RPC__PAYLOAD_RESP_WIFI_SET_OKC_SUPPORT = 637, + RPC__PAYLOAD_RESP_EAP_SET_DOMAIN_NAME = 638, + RPC__PAYLOAD_RESP_EAP_SET_DISABLE_TIME_CHECK = 639, + RPC__PAYLOAD_RESP_EAP_SET_EAP_METHODS = 640, + RPC__PAYLOAD_RESP_IFACE_MAC_ADDR_SET_GET = 641, + RPC__PAYLOAD_RESP_IFACE_MAC_ADDR_LEN_GET = 642, + RPC__PAYLOAD_RESP_FEATURE_CONTROL = 643, + RPC__PAYLOAD_RESP_GPIO_CONFIG = 644, + RPC__PAYLOAD_RESP_GPIO_RESET = 645, + RPC__PAYLOAD_RESP_GPIO_SET_LEVEL = 646, + RPC__PAYLOAD_RESP_GPIO_GET_LEVEL = 647, + RPC__PAYLOAD_RESP_GPIO_SET_DIRECTION = 648, + RPC__PAYLOAD_RESP_GPIO_INPUT_ENABLE = 649, + RPC__PAYLOAD_RESP_GPIO_SET_PULL_MODE = 650, + RPC__PAYLOAD_EVENT_ESP_INIT = 769, + RPC__PAYLOAD_EVENT_HEARTBEAT = 770, + RPC__PAYLOAD_EVENT_AP_STA_CONNECTED = 771, + RPC__PAYLOAD_EVENT_AP_STA_DISCONNECTED = 772, + RPC__PAYLOAD_EVENT_WIFI_EVENT_NO_ARGS = 773, + RPC__PAYLOAD_EVENT_STA_SCAN_DONE = 774, + RPC__PAYLOAD_EVENT_STA_CONNECTED = 775, + RPC__PAYLOAD_EVENT_STA_DISCONNECTED = 776, + RPC__PAYLOAD_EVENT_DHCP_DNS = 777, + RPC__PAYLOAD_EVENT_STA_ITWT_SETUP = 778, + RPC__PAYLOAD_EVENT_STA_ITWT_TEARDOWN = 779, + RPC__PAYLOAD_EVENT_STA_ITWT_SUSPEND = 780, + RPC__PAYLOAD_EVENT_STA_ITWT_PROBE = 781, + RPC__PAYLOAD_EVENT_SUPP_DPP_URI_READY = 782, + RPC__PAYLOAD_EVENT_SUPP_DPP_CFG_RECVD = 783, + RPC__PAYLOAD_EVENT_SUPP_DPP_FAIL = 784, + RPC__PAYLOAD_EVENT_WIFI_DPP_URI_READY = 785, + RPC__PAYLOAD_EVENT_WIFI_DPP_CFG_RECVD = 786, + RPC__PAYLOAD_EVENT_WIFI_DPP_FAIL = 787 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(RPC__PAYLOAD__CASE) +} Rpc__PayloadCase; + +struct Rpc +{ + ProtobufCMessage base; + /* + * msg_type could be req, resp or Event + */ + RpcType msg_type; + /* + * msg id + */ + RpcId msg_id; + /* + * UID of message + */ + uint32_t uid; + Rpc__PayloadCase payload_case; + union { + /* + ** Requests * + */ + RpcReqGetMacAddress *req_get_mac_address; + RpcReqSetMacAddress *req_set_mac_address; + RpcReqGetMode *req_get_wifi_mode; + RpcReqSetMode *req_set_wifi_mode; + RpcReqSuppDppInit *req_supp_dpp_init; + RpcReqSuppDppDeinit *req_supp_dpp_deinit; + RpcReqSuppDppBootstrapGen *req_supp_dpp_bootstrap_gen; + RpcReqSuppDppStartListen *req_supp_dpp_start_listen; + RpcReqSuppDppStopListen *req_supp_dpp_stop_listen; + /* + *Rpc_Req_StartSoftAP req_start_softap = 267; + *Rpc_Req_SoftAPConnectedSTA req_softap_connected_stas_list = 268; + *Rpc_Req_GetStatus req_stop_softap = 269; + */ + RpcReqOTAActivate *req_ota_activate; + RpcReqSetPs *req_wifi_set_ps; + RpcReqGetPs *req_wifi_get_ps; + RpcReqOTABegin *req_ota_begin; + RpcReqOTAWrite *req_ota_write; + RpcReqOTAEnd *req_ota_end; + RpcReqWifiSetMaxTxPower *req_set_wifi_max_tx_power; + RpcReqWifiGetMaxTxPower *req_get_wifi_max_tx_power; + RpcReqConfigHeartbeat *req_config_heartbeat; + RpcReqWifiInit *req_wifi_init; + RpcReqWifiDeinit *req_wifi_deinit; + RpcReqWifiStart *req_wifi_start; + RpcReqWifiStop *req_wifi_stop; + RpcReqWifiConnect *req_wifi_connect; + RpcReqWifiDisconnect *req_wifi_disconnect; + RpcReqWifiSetConfig *req_wifi_set_config; + RpcReqWifiGetConfig *req_wifi_get_config; + RpcReqWifiScanStart *req_wifi_scan_start; + RpcReqWifiScanStop *req_wifi_scan_stop; + RpcReqWifiScanGetApNum *req_wifi_scan_get_ap_num; + RpcReqWifiScanGetApRecords *req_wifi_scan_get_ap_records; + RpcReqWifiClearApList *req_wifi_clear_ap_list; + RpcReqWifiRestore *req_wifi_restore; + RpcReqWifiClearFastConnect *req_wifi_clear_fast_connect; + RpcReqWifiDeauthSta *req_wifi_deauth_sta; + RpcReqWifiStaGetApInfo *req_wifi_sta_get_ap_info; + RpcReqWifiSetProtocol *req_wifi_set_protocol; + RpcReqWifiGetProtocol *req_wifi_get_protocol; + RpcReqWifiSetBandwidth *req_wifi_set_bandwidth; + RpcReqWifiGetBandwidth *req_wifi_get_bandwidth; + RpcReqWifiSetChannel *req_wifi_set_channel; + RpcReqWifiGetChannel *req_wifi_get_channel; + RpcReqWifiSetCountry *req_wifi_set_country; + RpcReqWifiGetCountry *req_wifi_get_country; + RpcReqWifiApGetStaList *req_wifi_ap_get_sta_list; + RpcReqWifiApGetStaAid *req_wifi_ap_get_sta_aid; + RpcReqWifiSetStorage *req_wifi_set_storage; + RpcReqWifiSetInactiveTime *req_wifi_set_inactive_time; + RpcReqWifiGetInactiveTime *req_wifi_get_inactive_time; + RpcReqWifiSetCountryCode *req_wifi_set_country_code; + RpcReqWifiGetCountryCode *req_wifi_get_country_code; + RpcReqWifiStaGetAid *req_wifi_sta_get_aid; + RpcReqWifiStaGetNegotiatedPhymode *req_wifi_sta_get_negotiated_phymode; + RpcReqWifiStaGetRssi *req_wifi_sta_get_rssi; + RpcReqWifiSetProtocols *req_wifi_set_protocols; + RpcReqWifiGetProtocols *req_wifi_get_protocols; + RpcReqWifiSetBandwidths *req_wifi_set_bandwidths; + RpcReqWifiGetBandwidths *req_wifi_get_bandwidths; + RpcReqWifiSetBand *req_wifi_set_band; + RpcReqWifiGetBand *req_wifi_get_band; + RpcReqWifiSetBandMode *req_wifi_set_bandmode; + RpcReqWifiGetBandMode *req_wifi_get_bandmode; + RpcReqGetCoprocessorFwVersion *req_get_coprocessor_fwversion; + RpcReqWifiScanGetApRecord *req_wifi_scan_get_ap_record; + RpcReqSetDhcpDnsStatus *req_set_dhcp_dns; + RpcReqGetDhcpDnsStatus *req_get_dhcp_dns; + RpcReqWifiStaTwtConfig *req_wifi_sta_twt_config; + RpcReqWifiStaItwtSetup *req_wifi_sta_itwt_setup; + RpcReqWifiStaItwtTeardown *req_wifi_sta_itwt_teardown; + RpcReqWifiStaItwtSuspend *req_wifi_sta_itwt_suspend; + RpcReqWifiStaItwtGetFlowIdStatus *req_wifi_sta_itwt_get_flow_id_status; + RpcReqWifiStaItwtSendProbeReq *req_wifi_sta_itwt_send_probe_req; + RpcReqWifiStaItwtSetTargetWakeTimeOffset *req_wifi_sta_itwt_set_target_wake_time_offset; + RpcReqWifiStaEnterpriseEnable *req_wifi_sta_enterprise_enable; + RpcReqWifiStaEnterpriseDisable *req_wifi_sta_enterprise_disable; + RpcReqEapSetIdentity *req_eap_set_identity; + RpcReqEapClearIdentity *req_eap_clear_identity; + RpcReqEapSetUsername *req_eap_set_username; + RpcReqEapClearUsername *req_eap_clear_username; + RpcReqEapSetPassword *req_eap_set_password; + RpcReqEapClearPassword *req_eap_clear_password; + RpcReqEapSetNewPassword *req_eap_set_new_password; + RpcReqEapClearNewPassword *req_eap_clear_new_password; + RpcReqEapSetCaCert *req_eap_set_ca_cert; + RpcReqEapClearCaCert *req_eap_clear_ca_cert; + RpcReqEapSetCertificateAndKey *req_eap_set_certificate_and_key; + RpcReqEapClearCertificateAndKey *req_eap_clear_certificate_and_key; + RpcReqEapGetDisableTimeCheck *req_eap_get_disable_time_check; + RpcReqEapSetTtlsPhase2Method *req_eap_set_ttls_phase2_method; + RpcReqEapSetSuiteb192bitCertification *req_eap_set_suiteb_certification; + RpcReqEapSetPacFile *req_eap_set_pac_file; + RpcReqEapSetFastParams *req_eap_set_fast_params; + RpcReqEapUseDefaultCertBundle *req_eap_use_default_cert_bundle; + RpcReqWifiSetOkcSupport *req_wifi_set_okc_support; + RpcReqEapSetDomainName *req_eap_set_domain_name; + RpcReqEapSetDisableTimeCheck *req_eap_set_disable_time_check; + RpcReqEapSetEapMethods *req_eap_set_eap_methods; + RpcReqIfaceMacAddrSetGet *req_iface_mac_addr_set_get; + RpcReqIfaceMacAddrLenGet *req_iface_mac_addr_len_get; + RpcReqFeatureControl *req_feature_control; + RpcReqGpioConfig *req_gpio_config; + RpcReqGpioReset *req_gpio_reset; + RpcReqGpioSetLevel *req_gpio_set_level; + RpcReqGpioGetLevel *req_gpio_get_level; + RpcReqGpioSetDirection *req_gpio_set_direction; + RpcReqGpioInputEnable *req_gpio_input_enable; + RpcReqGpioSetPullMode *req_gpio_set_pull_mode; + /* + ** Responses * + */ + RpcRespGetMacAddress *resp_get_mac_address; + RpcRespSetMacAddress *resp_set_mac_address; + RpcRespGetMode *resp_get_wifi_mode; + RpcRespSetMode *resp_set_wifi_mode; + RpcRespSuppDppInit *resp_supp_dpp_init; + RpcRespSuppDppDeinit *resp_supp_dpp_deinit; + RpcRespSuppDppBootstrapGen *resp_supp_dpp_bootstrap_gen; + RpcRespSuppDppStartListen *resp_supp_dpp_start_listen; + RpcRespSuppDppStopListen *resp_supp_dpp_stop_listen; + /* + *Rpc_Resp_SetSoftAPVendorSpecificIE resp_set_softap_vendor_specific_ie = 522; + *Rpc_Resp_StartSoftAP resp_start_softap = 523; + *Rpc_Resp_SoftAPConnectedSTA resp_softap_connected_stas_list = 524; + *Rpc_Resp_GetStatus resp_stop_softap = 525; + */ + RpcRespOTAActivate *resp_ota_activate; + RpcRespSetPs *resp_wifi_set_ps; + RpcRespGetPs *resp_wifi_get_ps; + RpcRespOTABegin *resp_ota_begin; + RpcRespOTAWrite *resp_ota_write; + RpcRespOTAEnd *resp_ota_end; + RpcRespWifiSetMaxTxPower *resp_set_wifi_max_tx_power; + RpcRespWifiGetMaxTxPower *resp_get_wifi_max_tx_power; + RpcRespConfigHeartbeat *resp_config_heartbeat; + RpcRespWifiInit *resp_wifi_init; + RpcRespWifiDeinit *resp_wifi_deinit; + RpcRespWifiStart *resp_wifi_start; + RpcRespWifiStop *resp_wifi_stop; + RpcRespWifiConnect *resp_wifi_connect; + RpcRespWifiDisconnect *resp_wifi_disconnect; + RpcRespWifiSetConfig *resp_wifi_set_config; + RpcRespWifiGetConfig *resp_wifi_get_config; + RpcRespWifiScanStart *resp_wifi_scan_start; + RpcRespWifiScanStop *resp_wifi_scan_stop; + RpcRespWifiScanGetApNum *resp_wifi_scan_get_ap_num; + RpcRespWifiScanGetApRecords *resp_wifi_scan_get_ap_records; + RpcRespWifiClearApList *resp_wifi_clear_ap_list; + RpcRespWifiRestore *resp_wifi_restore; + RpcRespWifiClearFastConnect *resp_wifi_clear_fast_connect; + RpcRespWifiDeauthSta *resp_wifi_deauth_sta; + RpcRespWifiStaGetApInfo *resp_wifi_sta_get_ap_info; + RpcRespWifiSetProtocol *resp_wifi_set_protocol; + RpcRespWifiGetProtocol *resp_wifi_get_protocol; + RpcRespWifiSetBandwidth *resp_wifi_set_bandwidth; + RpcRespWifiGetBandwidth *resp_wifi_get_bandwidth; + RpcRespWifiSetChannel *resp_wifi_set_channel; + RpcRespWifiGetChannel *resp_wifi_get_channel; + RpcRespWifiSetCountry *resp_wifi_set_country; + RpcRespWifiGetCountry *resp_wifi_get_country; + RpcRespWifiApGetStaList *resp_wifi_ap_get_sta_list; + RpcRespWifiApGetStaAid *resp_wifi_ap_get_sta_aid; + RpcRespWifiSetStorage *resp_wifi_set_storage; + RpcRespWifiSetInactiveTime *resp_wifi_set_inactive_time; + RpcRespWifiGetInactiveTime *resp_wifi_get_inactive_time; + RpcRespWifiSetCountryCode *resp_wifi_set_country_code; + RpcRespWifiGetCountryCode *resp_wifi_get_country_code; + RpcRespWifiStaGetAid *resp_wifi_sta_get_aid; + RpcRespWifiStaGetNegotiatedPhymode *resp_wifi_sta_get_negotiated_phymode; + RpcRespWifiStaGetRssi *resp_wifi_sta_get_rssi; + RpcRespWifiSetProtocols *resp_wifi_set_protocols; + RpcRespWifiGetProtocols *resp_wifi_get_protocols; + RpcRespWifiSetBandwidths *resp_wifi_set_bandwidths; + RpcRespWifiGetBandwidths *resp_wifi_get_bandwidths; + RpcRespWifiSetBand *resp_wifi_set_band; + RpcRespWifiGetBand *resp_wifi_get_band; + RpcRespWifiSetBandMode *resp_wifi_set_bandmode; + RpcRespWifiGetBandMode *resp_wifi_get_bandmode; + RpcRespGetCoprocessorFwVersion *resp_get_coprocessor_fwversion; + RpcRespWifiScanGetApRecord *resp_wifi_scan_get_ap_record; + RpcRespSetDhcpDnsStatus *resp_set_dhcp_dns; + RpcRespGetDhcpDnsStatus *resp_get_dhcp_dns; + RpcRespWifiStaTwtConfig *resp_wifi_sta_twt_config; + RpcRespWifiStaItwtSetup *resp_wifi_sta_itwt_setup; + RpcRespWifiStaItwtTeardown *resp_wifi_sta_itwt_teardown; + RpcRespWifiStaItwtSuspend *resp_wifi_sta_itwt_suspend; + RpcRespWifiStaItwtGetFlowIdStatus *resp_wifi_sta_itwt_get_flow_id_status; + RpcRespWifiStaItwtSendProbeReq *resp_wifi_sta_itwt_send_probe_req; + RpcRespWifiStaItwtSetTargetWakeTimeOffset *resp_wifi_sta_itwt_set_target_wake_time_offset; + RpcRespWifiStaEnterpriseEnable *resp_wifi_sta_enterprise_enable; + RpcRespWifiStaEnterpriseDisable *resp_wifi_sta_enterprise_disable; + RpcRespEapSetIdentity *resp_eap_set_identity; + RpcRespEapClearIdentity *resp_eap_clear_identity; + RpcRespEapSetUsername *resp_eap_set_username; + RpcRespEapClearUsername *resp_eap_clear_username; + RpcRespEapSetPassword *resp_eap_set_password; + RpcRespEapClearPassword *resp_eap_clear_password; + RpcRespEapSetNewPassword *resp_eap_set_new_password; + RpcRespEapClearNewPassword *resp_eap_clear_new_password; + RpcRespEapSetCaCert *resp_eap_set_ca_cert; + RpcRespEapClearCaCert *resp_eap_clear_ca_cert; + RpcRespEapSetCertificateAndKey *resp_eap_set_certificate_and_key; + RpcRespEapClearCertificateAndKey *resp_eap_clear_certificate_and_key; + RpcRespEapGetDisableTimeCheck *resp_eap_get_disable_time_check; + RpcRespEapSetTtlsPhase2Method *resp_eap_set_ttls_phase2_method; + RpcRespEapSetSuiteb192bitCertification *resp_eap_set_suiteb_certification; + RpcRespEapSetPacFile *resp_eap_set_pac_file; + RpcRespEapSetFastParams *resp_eap_set_fast_params; + RpcRespEapUseDefaultCertBundle *resp_eap_use_default_cert_bundle; + RpcRespWifiSetOkcSupport *resp_wifi_set_okc_support; + RpcRespEapSetDomainName *resp_eap_set_domain_name; + RpcRespEapSetDisableTimeCheck *resp_eap_set_disable_time_check; + RpcRespEapSetEapMethods *resp_eap_set_eap_methods; + RpcRespIfaceMacAddrSetGet *resp_iface_mac_addr_set_get; + RpcRespIfaceMacAddrLenGet *resp_iface_mac_addr_len_get; + RpcRespFeatureControl *resp_feature_control; + RpcRespGpioConfig *resp_gpio_config; + RpcRespGpioResetPin *resp_gpio_reset; + RpcRespGpioSetLevel *resp_gpio_set_level; + RpcRespGpioGetLevel *resp_gpio_get_level; + RpcRespGpioSetDirection *resp_gpio_set_direction; + RpcRespGpioInputEnable *resp_gpio_input_enable; + RpcRespGpioSetPullMode *resp_gpio_set_pull_mode; + /* + ** Notifications * + */ + RpcEventESPInit *event_esp_init; + RpcEventHeartbeat *event_heartbeat; + RpcEventAPStaConnected *event_ap_sta_connected; + RpcEventAPStaDisconnected *event_ap_sta_disconnected; + RpcEventWifiEventNoArgs *event_wifi_event_no_args; + RpcEventStaScanDone *event_sta_scan_done; + RpcEventStaConnected *event_sta_connected; + RpcEventStaDisconnected *event_sta_disconnected; + RpcEventDhcpDnsStatus *event_dhcp_dns; + RpcEventStaItwtSetup *event_sta_itwt_setup; + RpcEventStaItwtTeardown *event_sta_itwt_teardown; + RpcEventStaItwtSuspend *event_sta_itwt_suspend; + RpcEventStaItwtProbe *event_sta_itwt_probe; + RpcEventSuppDppUriReady *event_supp_dpp_uri_ready; + RpcEventSuppDppCfgRecvd *event_supp_dpp_cfg_recvd; + RpcEventSuppDppFail *event_supp_dpp_fail; + RpcEventWifiDppUriReady *event_wifi_dpp_uri_ready; + RpcEventWifiDppCfgRecvd *event_wifi_dpp_cfg_recvd; + RpcEventWifiDppFail *event_wifi_dpp_fail; + }; +}; +#define RPC__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&rpc__descriptor) \ + , RPC_TYPE__MsgType_Invalid, RPC_ID__MsgId_Invalid, 0, RPC__PAYLOAD__NOT_SET, {0} } + + +/* WifiInitConfig methods */ +void wifi_init_config__init + (WifiInitConfig *message); +size_t wifi_init_config__get_packed_size + (const WifiInitConfig *message); +size_t wifi_init_config__pack + (const WifiInitConfig *message, + uint8_t *out); +size_t wifi_init_config__pack_to_buffer + (const WifiInitConfig *message, + ProtobufCBuffer *buffer); +WifiInitConfig * + wifi_init_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_init_config__free_unpacked + (WifiInitConfig *message, + ProtobufCAllocator *allocator); +/* WifiCountry methods */ +void wifi_country__init + (WifiCountry *message); +size_t wifi_country__get_packed_size + (const WifiCountry *message); +size_t wifi_country__pack + (const WifiCountry *message, + uint8_t *out); +size_t wifi_country__pack_to_buffer + (const WifiCountry *message, + ProtobufCBuffer *buffer); +WifiCountry * + wifi_country__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_country__free_unpacked + (WifiCountry *message, + ProtobufCAllocator *allocator); +/* WifiActiveScanTime methods */ +void wifi_active_scan_time__init + (WifiActiveScanTime *message); +size_t wifi_active_scan_time__get_packed_size + (const WifiActiveScanTime *message); +size_t wifi_active_scan_time__pack + (const WifiActiveScanTime *message, + uint8_t *out); +size_t wifi_active_scan_time__pack_to_buffer + (const WifiActiveScanTime *message, + ProtobufCBuffer *buffer); +WifiActiveScanTime * + wifi_active_scan_time__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_active_scan_time__free_unpacked + (WifiActiveScanTime *message, + ProtobufCAllocator *allocator); +/* WifiScanTime methods */ +void wifi_scan_time__init + (WifiScanTime *message); +size_t wifi_scan_time__get_packed_size + (const WifiScanTime *message); +size_t wifi_scan_time__pack + (const WifiScanTime *message, + uint8_t *out); +size_t wifi_scan_time__pack_to_buffer + (const WifiScanTime *message, + ProtobufCBuffer *buffer); +WifiScanTime * + wifi_scan_time__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_scan_time__free_unpacked + (WifiScanTime *message, + ProtobufCAllocator *allocator); +/* WifiScanChannelBitmap methods */ +void wifi_scan_channel_bitmap__init + (WifiScanChannelBitmap *message); +size_t wifi_scan_channel_bitmap__get_packed_size + (const WifiScanChannelBitmap *message); +size_t wifi_scan_channel_bitmap__pack + (const WifiScanChannelBitmap *message, + uint8_t *out); +size_t wifi_scan_channel_bitmap__pack_to_buffer + (const WifiScanChannelBitmap *message, + ProtobufCBuffer *buffer); +WifiScanChannelBitmap * + wifi_scan_channel_bitmap__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_scan_channel_bitmap__free_unpacked + (WifiScanChannelBitmap *message, + ProtobufCAllocator *allocator); +/* WifiScanConfig methods */ +void wifi_scan_config__init + (WifiScanConfig *message); +size_t wifi_scan_config__get_packed_size + (const WifiScanConfig *message); +size_t wifi_scan_config__pack + (const WifiScanConfig *message, + uint8_t *out); +size_t wifi_scan_config__pack_to_buffer + (const WifiScanConfig *message, + ProtobufCBuffer *buffer); +WifiScanConfig * + wifi_scan_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_scan_config__free_unpacked + (WifiScanConfig *message, + ProtobufCAllocator *allocator); +/* WifiHeApInfo methods */ +void wifi_he_ap_info__init + (WifiHeApInfo *message); +size_t wifi_he_ap_info__get_packed_size + (const WifiHeApInfo *message); +size_t wifi_he_ap_info__pack + (const WifiHeApInfo *message, + uint8_t *out); +size_t wifi_he_ap_info__pack_to_buffer + (const WifiHeApInfo *message, + ProtobufCBuffer *buffer); +WifiHeApInfo * + wifi_he_ap_info__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_he_ap_info__free_unpacked + (WifiHeApInfo *message, + ProtobufCAllocator *allocator); +/* WifiApRecord methods */ +void wifi_ap_record__init + (WifiApRecord *message); +size_t wifi_ap_record__get_packed_size + (const WifiApRecord *message); +size_t wifi_ap_record__pack + (const WifiApRecord *message, + uint8_t *out); +size_t wifi_ap_record__pack_to_buffer + (const WifiApRecord *message, + ProtobufCBuffer *buffer); +WifiApRecord * + wifi_ap_record__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_ap_record__free_unpacked + (WifiApRecord *message, + ProtobufCAllocator *allocator); +/* WifiScanThreshold methods */ +void wifi_scan_threshold__init + (WifiScanThreshold *message); +size_t wifi_scan_threshold__get_packed_size + (const WifiScanThreshold *message); +size_t wifi_scan_threshold__pack + (const WifiScanThreshold *message, + uint8_t *out); +size_t wifi_scan_threshold__pack_to_buffer + (const WifiScanThreshold *message, + ProtobufCBuffer *buffer); +WifiScanThreshold * + wifi_scan_threshold__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_scan_threshold__free_unpacked + (WifiScanThreshold *message, + ProtobufCAllocator *allocator); +/* WifiPmfConfig methods */ +void wifi_pmf_config__init + (WifiPmfConfig *message); +size_t wifi_pmf_config__get_packed_size + (const WifiPmfConfig *message); +size_t wifi_pmf_config__pack + (const WifiPmfConfig *message, + uint8_t *out); +size_t wifi_pmf_config__pack_to_buffer + (const WifiPmfConfig *message, + ProtobufCBuffer *buffer); +WifiPmfConfig * + wifi_pmf_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_pmf_config__free_unpacked + (WifiPmfConfig *message, + ProtobufCAllocator *allocator); +/* WifiBssMaxIdleConfig methods */ +void wifi_bss_max_idle_config__init + (WifiBssMaxIdleConfig *message); +size_t wifi_bss_max_idle_config__get_packed_size + (const WifiBssMaxIdleConfig *message); +size_t wifi_bss_max_idle_config__pack + (const WifiBssMaxIdleConfig *message, + uint8_t *out); +size_t wifi_bss_max_idle_config__pack_to_buffer + (const WifiBssMaxIdleConfig *message, + ProtobufCBuffer *buffer); +WifiBssMaxIdleConfig * + wifi_bss_max_idle_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_bss_max_idle_config__free_unpacked + (WifiBssMaxIdleConfig *message, + ProtobufCAllocator *allocator); +/* WifiApConfig methods */ +void wifi_ap_config__init + (WifiApConfig *message); +size_t wifi_ap_config__get_packed_size + (const WifiApConfig *message); +size_t wifi_ap_config__pack + (const WifiApConfig *message, + uint8_t *out); +size_t wifi_ap_config__pack_to_buffer + (const WifiApConfig *message, + ProtobufCBuffer *buffer); +WifiApConfig * + wifi_ap_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_ap_config__free_unpacked + (WifiApConfig *message, + ProtobufCAllocator *allocator); +/* WifiStaConfig methods */ +void wifi_sta_config__init + (WifiStaConfig *message); +size_t wifi_sta_config__get_packed_size + (const WifiStaConfig *message); +size_t wifi_sta_config__pack + (const WifiStaConfig *message, + uint8_t *out); +size_t wifi_sta_config__pack_to_buffer + (const WifiStaConfig *message, + ProtobufCBuffer *buffer); +WifiStaConfig * + wifi_sta_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_sta_config__free_unpacked + (WifiStaConfig *message, + ProtobufCAllocator *allocator); +/* WifiConfig methods */ +void wifi_config__init + (WifiConfig *message); +size_t wifi_config__get_packed_size + (const WifiConfig *message); +size_t wifi_config__pack + (const WifiConfig *message, + uint8_t *out); +size_t wifi_config__pack_to_buffer + (const WifiConfig *message, + ProtobufCBuffer *buffer); +WifiConfig * + wifi_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_config__free_unpacked + (WifiConfig *message, + ProtobufCAllocator *allocator); +/* WifiStaInfo methods */ +void wifi_sta_info__init + (WifiStaInfo *message); +size_t wifi_sta_info__get_packed_size + (const WifiStaInfo *message); +size_t wifi_sta_info__pack + (const WifiStaInfo *message, + uint8_t *out); +size_t wifi_sta_info__pack_to_buffer + (const WifiStaInfo *message, + ProtobufCBuffer *buffer); +WifiStaInfo * + wifi_sta_info__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_sta_info__free_unpacked + (WifiStaInfo *message, + ProtobufCAllocator *allocator); +/* WifiStaList methods */ +void wifi_sta_list__init + (WifiStaList *message); +size_t wifi_sta_list__get_packed_size + (const WifiStaList *message); +size_t wifi_sta_list__pack + (const WifiStaList *message, + uint8_t *out); +size_t wifi_sta_list__pack_to_buffer + (const WifiStaList *message, + ProtobufCBuffer *buffer); +WifiStaList * + wifi_sta_list__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_sta_list__free_unpacked + (WifiStaList *message, + ProtobufCAllocator *allocator); +/* WifiPktRxCtrl methods */ +void wifi_pkt_rx_ctrl__init + (WifiPktRxCtrl *message); +size_t wifi_pkt_rx_ctrl__get_packed_size + (const WifiPktRxCtrl *message); +size_t wifi_pkt_rx_ctrl__pack + (const WifiPktRxCtrl *message, + uint8_t *out); +size_t wifi_pkt_rx_ctrl__pack_to_buffer + (const WifiPktRxCtrl *message, + ProtobufCBuffer *buffer); +WifiPktRxCtrl * + wifi_pkt_rx_ctrl__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_pkt_rx_ctrl__free_unpacked + (WifiPktRxCtrl *message, + ProtobufCAllocator *allocator); +/* WifiPromiscuousPkt methods */ +void wifi_promiscuous_pkt__init + (WifiPromiscuousPkt *message); +size_t wifi_promiscuous_pkt__get_packed_size + (const WifiPromiscuousPkt *message); +size_t wifi_promiscuous_pkt__pack + (const WifiPromiscuousPkt *message, + uint8_t *out); +size_t wifi_promiscuous_pkt__pack_to_buffer + (const WifiPromiscuousPkt *message, + ProtobufCBuffer *buffer); +WifiPromiscuousPkt * + wifi_promiscuous_pkt__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_promiscuous_pkt__free_unpacked + (WifiPromiscuousPkt *message, + ProtobufCAllocator *allocator); +/* WifiPromiscuousFilter methods */ +void wifi_promiscuous_filter__init + (WifiPromiscuousFilter *message); +size_t wifi_promiscuous_filter__get_packed_size + (const WifiPromiscuousFilter *message); +size_t wifi_promiscuous_filter__pack + (const WifiPromiscuousFilter *message, + uint8_t *out); +size_t wifi_promiscuous_filter__pack_to_buffer + (const WifiPromiscuousFilter *message, + ProtobufCBuffer *buffer); +WifiPromiscuousFilter * + wifi_promiscuous_filter__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_promiscuous_filter__free_unpacked + (WifiPromiscuousFilter *message, + ProtobufCAllocator *allocator); +/* WifiCsiConfig methods */ +void wifi_csi_config__init + (WifiCsiConfig *message); +size_t wifi_csi_config__get_packed_size + (const WifiCsiConfig *message); +size_t wifi_csi_config__pack + (const WifiCsiConfig *message, + uint8_t *out); +size_t wifi_csi_config__pack_to_buffer + (const WifiCsiConfig *message, + ProtobufCBuffer *buffer); +WifiCsiConfig * + wifi_csi_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_csi_config__free_unpacked + (WifiCsiConfig *message, + ProtobufCAllocator *allocator); +/* WifiCsiInfo methods */ +void wifi_csi_info__init + (WifiCsiInfo *message); +size_t wifi_csi_info__get_packed_size + (const WifiCsiInfo *message); +size_t wifi_csi_info__pack + (const WifiCsiInfo *message, + uint8_t *out); +size_t wifi_csi_info__pack_to_buffer + (const WifiCsiInfo *message, + ProtobufCBuffer *buffer); +WifiCsiInfo * + wifi_csi_info__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_csi_info__free_unpacked + (WifiCsiInfo *message, + ProtobufCAllocator *allocator); +/* WifiAntGpio methods */ +void wifi_ant_gpio__init + (WifiAntGpio *message); +size_t wifi_ant_gpio__get_packed_size + (const WifiAntGpio *message); +size_t wifi_ant_gpio__pack + (const WifiAntGpio *message, + uint8_t *out); +size_t wifi_ant_gpio__pack_to_buffer + (const WifiAntGpio *message, + ProtobufCBuffer *buffer); +WifiAntGpio * + wifi_ant_gpio__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_ant_gpio__free_unpacked + (WifiAntGpio *message, + ProtobufCAllocator *allocator); +/* WifiAntGpioConfig methods */ +void wifi_ant_gpio_config__init + (WifiAntGpioConfig *message); +size_t wifi_ant_gpio_config__get_packed_size + (const WifiAntGpioConfig *message); +size_t wifi_ant_gpio_config__pack + (const WifiAntGpioConfig *message, + uint8_t *out); +size_t wifi_ant_gpio_config__pack_to_buffer + (const WifiAntGpioConfig *message, + ProtobufCBuffer *buffer); +WifiAntGpioConfig * + wifi_ant_gpio_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_ant_gpio_config__free_unpacked + (WifiAntGpioConfig *message, + ProtobufCAllocator *allocator); +/* WifiAntConfig methods */ +void wifi_ant_config__init + (WifiAntConfig *message); +size_t wifi_ant_config__get_packed_size + (const WifiAntConfig *message); +size_t wifi_ant_config__pack + (const WifiAntConfig *message, + uint8_t *out); +size_t wifi_ant_config__pack_to_buffer + (const WifiAntConfig *message, + ProtobufCBuffer *buffer); +WifiAntConfig * + wifi_ant_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_ant_config__free_unpacked + (WifiAntConfig *message, + ProtobufCAllocator *allocator); +/* WifiActionTxReq methods */ +void wifi_action_tx_req__init + (WifiActionTxReq *message); +size_t wifi_action_tx_req__get_packed_size + (const WifiActionTxReq *message); +size_t wifi_action_tx_req__pack + (const WifiActionTxReq *message, + uint8_t *out); +size_t wifi_action_tx_req__pack_to_buffer + (const WifiActionTxReq *message, + ProtobufCBuffer *buffer); +WifiActionTxReq * + wifi_action_tx_req__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_action_tx_req__free_unpacked + (WifiActionTxReq *message, + ProtobufCAllocator *allocator); +/* WifiFtmInitiatorCfg methods */ +void wifi_ftm_initiator_cfg__init + (WifiFtmInitiatorCfg *message); +size_t wifi_ftm_initiator_cfg__get_packed_size + (const WifiFtmInitiatorCfg *message); +size_t wifi_ftm_initiator_cfg__pack + (const WifiFtmInitiatorCfg *message, + uint8_t *out); +size_t wifi_ftm_initiator_cfg__pack_to_buffer + (const WifiFtmInitiatorCfg *message, + ProtobufCBuffer *buffer); +WifiFtmInitiatorCfg * + wifi_ftm_initiator_cfg__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_ftm_initiator_cfg__free_unpacked + (WifiFtmInitiatorCfg *message, + ProtobufCAllocator *allocator); +/* WifiEventStaScanDone methods */ +void wifi_event_sta_scan_done__init + (WifiEventStaScanDone *message); +size_t wifi_event_sta_scan_done__get_packed_size + (const WifiEventStaScanDone *message); +size_t wifi_event_sta_scan_done__pack + (const WifiEventStaScanDone *message, + uint8_t *out); +size_t wifi_event_sta_scan_done__pack_to_buffer + (const WifiEventStaScanDone *message, + ProtobufCBuffer *buffer); +WifiEventStaScanDone * + wifi_event_sta_scan_done__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_event_sta_scan_done__free_unpacked + (WifiEventStaScanDone *message, + ProtobufCAllocator *allocator); +/* WifiEventStaConnected methods */ +void wifi_event_sta_connected__init + (WifiEventStaConnected *message); +size_t wifi_event_sta_connected__get_packed_size + (const WifiEventStaConnected *message); +size_t wifi_event_sta_connected__pack + (const WifiEventStaConnected *message, + uint8_t *out); +size_t wifi_event_sta_connected__pack_to_buffer + (const WifiEventStaConnected *message, + ProtobufCBuffer *buffer); +WifiEventStaConnected * + wifi_event_sta_connected__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_event_sta_connected__free_unpacked + (WifiEventStaConnected *message, + ProtobufCAllocator *allocator); +/* WifiEventStaDisconnected methods */ +void wifi_event_sta_disconnected__init + (WifiEventStaDisconnected *message); +size_t wifi_event_sta_disconnected__get_packed_size + (const WifiEventStaDisconnected *message); +size_t wifi_event_sta_disconnected__pack + (const WifiEventStaDisconnected *message, + uint8_t *out); +size_t wifi_event_sta_disconnected__pack_to_buffer + (const WifiEventStaDisconnected *message, + ProtobufCBuffer *buffer); +WifiEventStaDisconnected * + wifi_event_sta_disconnected__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_event_sta_disconnected__free_unpacked + (WifiEventStaDisconnected *message, + ProtobufCAllocator *allocator); +/* WifiEventStaAuthmodeChange methods */ +void wifi_event_sta_authmode_change__init + (WifiEventStaAuthmodeChange *message); +size_t wifi_event_sta_authmode_change__get_packed_size + (const WifiEventStaAuthmodeChange *message); +size_t wifi_event_sta_authmode_change__pack + (const WifiEventStaAuthmodeChange *message, + uint8_t *out); +size_t wifi_event_sta_authmode_change__pack_to_buffer + (const WifiEventStaAuthmodeChange *message, + ProtobufCBuffer *buffer); +WifiEventStaAuthmodeChange * + wifi_event_sta_authmode_change__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_event_sta_authmode_change__free_unpacked + (WifiEventStaAuthmodeChange *message, + ProtobufCAllocator *allocator); +/* WifiEventStaWpsErPin methods */ +void wifi_event_sta_wps_er_pin__init + (WifiEventStaWpsErPin *message); +size_t wifi_event_sta_wps_er_pin__get_packed_size + (const WifiEventStaWpsErPin *message); +size_t wifi_event_sta_wps_er_pin__pack + (const WifiEventStaWpsErPin *message, + uint8_t *out); +size_t wifi_event_sta_wps_er_pin__pack_to_buffer + (const WifiEventStaWpsErPin *message, + ProtobufCBuffer *buffer); +WifiEventStaWpsErPin * + wifi_event_sta_wps_er_pin__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_event_sta_wps_er_pin__free_unpacked + (WifiEventStaWpsErPin *message, + ProtobufCAllocator *allocator); +/* ApCred methods */ +void ap_cred__init + (ApCred *message); +size_t ap_cred__get_packed_size + (const ApCred *message); +size_t ap_cred__pack + (const ApCred *message, + uint8_t *out); +size_t ap_cred__pack_to_buffer + (const ApCred *message, + ProtobufCBuffer *buffer); +ApCred * + ap_cred__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void ap_cred__free_unpacked + (ApCred *message, + ProtobufCAllocator *allocator); +/* WifiEventStaWpsErSuccess methods */ +void wifi_event_sta_wps_er_success__init + (WifiEventStaWpsErSuccess *message); +size_t wifi_event_sta_wps_er_success__get_packed_size + (const WifiEventStaWpsErSuccess *message); +size_t wifi_event_sta_wps_er_success__pack + (const WifiEventStaWpsErSuccess *message, + uint8_t *out); +size_t wifi_event_sta_wps_er_success__pack_to_buffer + (const WifiEventStaWpsErSuccess *message, + ProtobufCBuffer *buffer); +WifiEventStaWpsErSuccess * + wifi_event_sta_wps_er_success__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_event_sta_wps_er_success__free_unpacked + (WifiEventStaWpsErSuccess *message, + ProtobufCAllocator *allocator); +/* WifiEventApProbeReqRx methods */ +void wifi_event_ap_probe_req_rx__init + (WifiEventApProbeReqRx *message); +size_t wifi_event_ap_probe_req_rx__get_packed_size + (const WifiEventApProbeReqRx *message); +size_t wifi_event_ap_probe_req_rx__pack + (const WifiEventApProbeReqRx *message, + uint8_t *out); +size_t wifi_event_ap_probe_req_rx__pack_to_buffer + (const WifiEventApProbeReqRx *message, + ProtobufCBuffer *buffer); +WifiEventApProbeReqRx * + wifi_event_ap_probe_req_rx__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_event_ap_probe_req_rx__free_unpacked + (WifiEventApProbeReqRx *message, + ProtobufCAllocator *allocator); +/* WifiEventBssRssiLow methods */ +void wifi_event_bss_rssi_low__init + (WifiEventBssRssiLow *message); +size_t wifi_event_bss_rssi_low__get_packed_size + (const WifiEventBssRssiLow *message); +size_t wifi_event_bss_rssi_low__pack + (const WifiEventBssRssiLow *message, + uint8_t *out); +size_t wifi_event_bss_rssi_low__pack_to_buffer + (const WifiEventBssRssiLow *message, + ProtobufCBuffer *buffer); +WifiEventBssRssiLow * + wifi_event_bss_rssi_low__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_event_bss_rssi_low__free_unpacked + (WifiEventBssRssiLow *message, + ProtobufCAllocator *allocator); +/* WifiFtmReportEntry methods */ +void wifi_ftm_report_entry__init + (WifiFtmReportEntry *message); +size_t wifi_ftm_report_entry__get_packed_size + (const WifiFtmReportEntry *message); +size_t wifi_ftm_report_entry__pack + (const WifiFtmReportEntry *message, + uint8_t *out); +size_t wifi_ftm_report_entry__pack_to_buffer + (const WifiFtmReportEntry *message, + ProtobufCBuffer *buffer); +WifiFtmReportEntry * + wifi_ftm_report_entry__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_ftm_report_entry__free_unpacked + (WifiFtmReportEntry *message, + ProtobufCAllocator *allocator); +/* WifiEventFtmReport methods */ +void wifi_event_ftm_report__init + (WifiEventFtmReport *message); +size_t wifi_event_ftm_report__get_packed_size + (const WifiEventFtmReport *message); +size_t wifi_event_ftm_report__pack + (const WifiEventFtmReport *message, + uint8_t *out); +size_t wifi_event_ftm_report__pack_to_buffer + (const WifiEventFtmReport *message, + ProtobufCBuffer *buffer); +WifiEventFtmReport * + wifi_event_ftm_report__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_event_ftm_report__free_unpacked + (WifiEventFtmReport *message, + ProtobufCAllocator *allocator); +/* WifiEventActionTxStatus methods */ +void wifi_event_action_tx_status__init + (WifiEventActionTxStatus *message); +size_t wifi_event_action_tx_status__get_packed_size + (const WifiEventActionTxStatus *message); +size_t wifi_event_action_tx_status__pack + (const WifiEventActionTxStatus *message, + uint8_t *out); +size_t wifi_event_action_tx_status__pack_to_buffer + (const WifiEventActionTxStatus *message, + ProtobufCBuffer *buffer); +WifiEventActionTxStatus * + wifi_event_action_tx_status__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_event_action_tx_status__free_unpacked + (WifiEventActionTxStatus *message, + ProtobufCAllocator *allocator); +/* WifiEventRocDone methods */ +void wifi_event_roc_done__init + (WifiEventRocDone *message); +size_t wifi_event_roc_done__get_packed_size + (const WifiEventRocDone *message); +size_t wifi_event_roc_done__pack + (const WifiEventRocDone *message, + uint8_t *out); +size_t wifi_event_roc_done__pack_to_buffer + (const WifiEventRocDone *message, + ProtobufCBuffer *buffer); +WifiEventRocDone * + wifi_event_roc_done__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_event_roc_done__free_unpacked + (WifiEventRocDone *message, + ProtobufCAllocator *allocator); +/* WifiEventApWpsRgPin methods */ +void wifi_event_ap_wps_rg_pin__init + (WifiEventApWpsRgPin *message); +size_t wifi_event_ap_wps_rg_pin__get_packed_size + (const WifiEventApWpsRgPin *message); +size_t wifi_event_ap_wps_rg_pin__pack + (const WifiEventApWpsRgPin *message, + uint8_t *out); +size_t wifi_event_ap_wps_rg_pin__pack_to_buffer + (const WifiEventApWpsRgPin *message, + ProtobufCBuffer *buffer); +WifiEventApWpsRgPin * + wifi_event_ap_wps_rg_pin__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_event_ap_wps_rg_pin__free_unpacked + (WifiEventApWpsRgPin *message, + ProtobufCAllocator *allocator); +/* WifiEventApWpsRgFailReason methods */ +void wifi_event_ap_wps_rg_fail_reason__init + (WifiEventApWpsRgFailReason *message); +size_t wifi_event_ap_wps_rg_fail_reason__get_packed_size + (const WifiEventApWpsRgFailReason *message); +size_t wifi_event_ap_wps_rg_fail_reason__pack + (const WifiEventApWpsRgFailReason *message, + uint8_t *out); +size_t wifi_event_ap_wps_rg_fail_reason__pack_to_buffer + (const WifiEventApWpsRgFailReason *message, + ProtobufCBuffer *buffer); +WifiEventApWpsRgFailReason * + wifi_event_ap_wps_rg_fail_reason__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_event_ap_wps_rg_fail_reason__free_unpacked + (WifiEventApWpsRgFailReason *message, + ProtobufCAllocator *allocator); +/* WifiEventApWpsRgSuccess methods */ +void wifi_event_ap_wps_rg_success__init + (WifiEventApWpsRgSuccess *message); +size_t wifi_event_ap_wps_rg_success__get_packed_size + (const WifiEventApWpsRgSuccess *message); +size_t wifi_event_ap_wps_rg_success__pack + (const WifiEventApWpsRgSuccess *message, + uint8_t *out); +size_t wifi_event_ap_wps_rg_success__pack_to_buffer + (const WifiEventApWpsRgSuccess *message, + ProtobufCBuffer *buffer); +WifiEventApWpsRgSuccess * + wifi_event_ap_wps_rg_success__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_event_ap_wps_rg_success__free_unpacked + (WifiEventApWpsRgSuccess *message, + ProtobufCAllocator *allocator); +/* WifiProtocols methods */ +void wifi_protocols__init + (WifiProtocols *message); +size_t wifi_protocols__get_packed_size + (const WifiProtocols *message); +size_t wifi_protocols__pack + (const WifiProtocols *message, + uint8_t *out); +size_t wifi_protocols__pack_to_buffer + (const WifiProtocols *message, + ProtobufCBuffer *buffer); +WifiProtocols * + wifi_protocols__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_protocols__free_unpacked + (WifiProtocols *message, + ProtobufCAllocator *allocator); +/* WifiBandwidths methods */ +void wifi_bandwidths__init + (WifiBandwidths *message); +size_t wifi_bandwidths__get_packed_size + (const WifiBandwidths *message); +size_t wifi_bandwidths__pack + (const WifiBandwidths *message, + uint8_t *out); +size_t wifi_bandwidths__pack_to_buffer + (const WifiBandwidths *message, + ProtobufCBuffer *buffer); +WifiBandwidths * + wifi_bandwidths__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_bandwidths__free_unpacked + (WifiBandwidths *message, + ProtobufCAllocator *allocator); +/* WifiItwtSetupConfig methods */ +void wifi_itwt_setup_config__init + (WifiItwtSetupConfig *message); +size_t wifi_itwt_setup_config__get_packed_size + (const WifiItwtSetupConfig *message); +size_t wifi_itwt_setup_config__pack + (const WifiItwtSetupConfig *message, + uint8_t *out); +size_t wifi_itwt_setup_config__pack_to_buffer + (const WifiItwtSetupConfig *message, + ProtobufCBuffer *buffer); +WifiItwtSetupConfig * + wifi_itwt_setup_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_itwt_setup_config__free_unpacked + (WifiItwtSetupConfig *message, + ProtobufCAllocator *allocator); +/* WifiTwtConfig methods */ +void wifi_twt_config__init + (WifiTwtConfig *message); +size_t wifi_twt_config__get_packed_size + (const WifiTwtConfig *message); +size_t wifi_twt_config__pack + (const WifiTwtConfig *message, + uint8_t *out); +size_t wifi_twt_config__pack_to_buffer + (const WifiTwtConfig *message, + ProtobufCBuffer *buffer); +WifiTwtConfig * + wifi_twt_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void wifi_twt_config__free_unpacked + (WifiTwtConfig *message, + ProtobufCAllocator *allocator); +/* ConnectedSTAList methods */ +void connected_stalist__init + (ConnectedSTAList *message); +size_t connected_stalist__get_packed_size + (const ConnectedSTAList *message); +size_t connected_stalist__pack + (const ConnectedSTAList *message, + uint8_t *out); +size_t connected_stalist__pack_to_buffer + (const ConnectedSTAList *message, + ProtobufCBuffer *buffer); +ConnectedSTAList * + connected_stalist__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void connected_stalist__free_unpacked + (ConnectedSTAList *message, + ProtobufCAllocator *allocator); +/* EapFastConfig methods */ +void eap_fast_config__init + (EapFastConfig *message); +size_t eap_fast_config__get_packed_size + (const EapFastConfig *message); +size_t eap_fast_config__pack + (const EapFastConfig *message, + uint8_t *out); +size_t eap_fast_config__pack_to_buffer + (const EapFastConfig *message, + ProtobufCBuffer *buffer); +EapFastConfig * + eap_fast_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void eap_fast_config__free_unpacked + (EapFastConfig *message, + ProtobufCAllocator *allocator); +/* RpcReqGetMacAddress methods */ +void rpc__req__get_mac_address__init + (RpcReqGetMacAddress *message); +size_t rpc__req__get_mac_address__get_packed_size + (const RpcReqGetMacAddress *message); +size_t rpc__req__get_mac_address__pack + (const RpcReqGetMacAddress *message, + uint8_t *out); +size_t rpc__req__get_mac_address__pack_to_buffer + (const RpcReqGetMacAddress *message, + ProtobufCBuffer *buffer); +RpcReqGetMacAddress * + rpc__req__get_mac_address__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__get_mac_address__free_unpacked + (RpcReqGetMacAddress *message, + ProtobufCAllocator *allocator); +/* RpcRespGetMacAddress methods */ +void rpc__resp__get_mac_address__init + (RpcRespGetMacAddress *message); +size_t rpc__resp__get_mac_address__get_packed_size + (const RpcRespGetMacAddress *message); +size_t rpc__resp__get_mac_address__pack + (const RpcRespGetMacAddress *message, + uint8_t *out); +size_t rpc__resp__get_mac_address__pack_to_buffer + (const RpcRespGetMacAddress *message, + ProtobufCBuffer *buffer); +RpcRespGetMacAddress * + rpc__resp__get_mac_address__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__get_mac_address__free_unpacked + (RpcRespGetMacAddress *message, + ProtobufCAllocator *allocator); +/* RpcReqGetMode methods */ +void rpc__req__get_mode__init + (RpcReqGetMode *message); +size_t rpc__req__get_mode__get_packed_size + (const RpcReqGetMode *message); +size_t rpc__req__get_mode__pack + (const RpcReqGetMode *message, + uint8_t *out); +size_t rpc__req__get_mode__pack_to_buffer + (const RpcReqGetMode *message, + ProtobufCBuffer *buffer); +RpcReqGetMode * + rpc__req__get_mode__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__get_mode__free_unpacked + (RpcReqGetMode *message, + ProtobufCAllocator *allocator); +/* RpcRespGetMode methods */ +void rpc__resp__get_mode__init + (RpcRespGetMode *message); +size_t rpc__resp__get_mode__get_packed_size + (const RpcRespGetMode *message); +size_t rpc__resp__get_mode__pack + (const RpcRespGetMode *message, + uint8_t *out); +size_t rpc__resp__get_mode__pack_to_buffer + (const RpcRespGetMode *message, + ProtobufCBuffer *buffer); +RpcRespGetMode * + rpc__resp__get_mode__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__get_mode__free_unpacked + (RpcRespGetMode *message, + ProtobufCAllocator *allocator); +/* RpcReqSetMode methods */ +void rpc__req__set_mode__init + (RpcReqSetMode *message); +size_t rpc__req__set_mode__get_packed_size + (const RpcReqSetMode *message); +size_t rpc__req__set_mode__pack + (const RpcReqSetMode *message, + uint8_t *out); +size_t rpc__req__set_mode__pack_to_buffer + (const RpcReqSetMode *message, + ProtobufCBuffer *buffer); +RpcReqSetMode * + rpc__req__set_mode__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__set_mode__free_unpacked + (RpcReqSetMode *message, + ProtobufCAllocator *allocator); +/* RpcRespSetMode methods */ +void rpc__resp__set_mode__init + (RpcRespSetMode *message); +size_t rpc__resp__set_mode__get_packed_size + (const RpcRespSetMode *message); +size_t rpc__resp__set_mode__pack + (const RpcRespSetMode *message, + uint8_t *out); +size_t rpc__resp__set_mode__pack_to_buffer + (const RpcRespSetMode *message, + ProtobufCBuffer *buffer); +RpcRespSetMode * + rpc__resp__set_mode__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__set_mode__free_unpacked + (RpcRespSetMode *message, + ProtobufCAllocator *allocator); +/* RpcReqGetPs methods */ +void rpc__req__get_ps__init + (RpcReqGetPs *message); +size_t rpc__req__get_ps__get_packed_size + (const RpcReqGetPs *message); +size_t rpc__req__get_ps__pack + (const RpcReqGetPs *message, + uint8_t *out); +size_t rpc__req__get_ps__pack_to_buffer + (const RpcReqGetPs *message, + ProtobufCBuffer *buffer); +RpcReqGetPs * + rpc__req__get_ps__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__get_ps__free_unpacked + (RpcReqGetPs *message, + ProtobufCAllocator *allocator); +/* RpcRespGetPs methods */ +void rpc__resp__get_ps__init + (RpcRespGetPs *message); +size_t rpc__resp__get_ps__get_packed_size + (const RpcRespGetPs *message); +size_t rpc__resp__get_ps__pack + (const RpcRespGetPs *message, + uint8_t *out); +size_t rpc__resp__get_ps__pack_to_buffer + (const RpcRespGetPs *message, + ProtobufCBuffer *buffer); +RpcRespGetPs * + rpc__resp__get_ps__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__get_ps__free_unpacked + (RpcRespGetPs *message, + ProtobufCAllocator *allocator); +/* RpcReqSetPs methods */ +void rpc__req__set_ps__init + (RpcReqSetPs *message); +size_t rpc__req__set_ps__get_packed_size + (const RpcReqSetPs *message); +size_t rpc__req__set_ps__pack + (const RpcReqSetPs *message, + uint8_t *out); +size_t rpc__req__set_ps__pack_to_buffer + (const RpcReqSetPs *message, + ProtobufCBuffer *buffer); +RpcReqSetPs * + rpc__req__set_ps__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__set_ps__free_unpacked + (RpcReqSetPs *message, + ProtobufCAllocator *allocator); +/* RpcRespSetPs methods */ +void rpc__resp__set_ps__init + (RpcRespSetPs *message); +size_t rpc__resp__set_ps__get_packed_size + (const RpcRespSetPs *message); +size_t rpc__resp__set_ps__pack + (const RpcRespSetPs *message, + uint8_t *out); +size_t rpc__resp__set_ps__pack_to_buffer + (const RpcRespSetPs *message, + ProtobufCBuffer *buffer); +RpcRespSetPs * + rpc__resp__set_ps__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__set_ps__free_unpacked + (RpcRespSetPs *message, + ProtobufCAllocator *allocator); +/* RpcReqSetMacAddress methods */ +void rpc__req__set_mac_address__init + (RpcReqSetMacAddress *message); +size_t rpc__req__set_mac_address__get_packed_size + (const RpcReqSetMacAddress *message); +size_t rpc__req__set_mac_address__pack + (const RpcReqSetMacAddress *message, + uint8_t *out); +size_t rpc__req__set_mac_address__pack_to_buffer + (const RpcReqSetMacAddress *message, + ProtobufCBuffer *buffer); +RpcReqSetMacAddress * + rpc__req__set_mac_address__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__set_mac_address__free_unpacked + (RpcReqSetMacAddress *message, + ProtobufCAllocator *allocator); +/* RpcRespSetMacAddress methods */ +void rpc__resp__set_mac_address__init + (RpcRespSetMacAddress *message); +size_t rpc__resp__set_mac_address__get_packed_size + (const RpcRespSetMacAddress *message); +size_t rpc__resp__set_mac_address__pack + (const RpcRespSetMacAddress *message, + uint8_t *out); +size_t rpc__resp__set_mac_address__pack_to_buffer + (const RpcRespSetMacAddress *message, + ProtobufCBuffer *buffer); +RpcRespSetMacAddress * + rpc__resp__set_mac_address__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__set_mac_address__free_unpacked + (RpcRespSetMacAddress *message, + ProtobufCAllocator *allocator); +/* RpcReqOTABegin methods */ +void rpc__req__otabegin__init + (RpcReqOTABegin *message); +size_t rpc__req__otabegin__get_packed_size + (const RpcReqOTABegin *message); +size_t rpc__req__otabegin__pack + (const RpcReqOTABegin *message, + uint8_t *out); +size_t rpc__req__otabegin__pack_to_buffer + (const RpcReqOTABegin *message, + ProtobufCBuffer *buffer); +RpcReqOTABegin * + rpc__req__otabegin__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__otabegin__free_unpacked + (RpcReqOTABegin *message, + ProtobufCAllocator *allocator); +/* RpcRespOTABegin methods */ +void rpc__resp__otabegin__init + (RpcRespOTABegin *message); +size_t rpc__resp__otabegin__get_packed_size + (const RpcRespOTABegin *message); +size_t rpc__resp__otabegin__pack + (const RpcRespOTABegin *message, + uint8_t *out); +size_t rpc__resp__otabegin__pack_to_buffer + (const RpcRespOTABegin *message, + ProtobufCBuffer *buffer); +RpcRespOTABegin * + rpc__resp__otabegin__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__otabegin__free_unpacked + (RpcRespOTABegin *message, + ProtobufCAllocator *allocator); +/* RpcReqOTAWrite methods */ +void rpc__req__otawrite__init + (RpcReqOTAWrite *message); +size_t rpc__req__otawrite__get_packed_size + (const RpcReqOTAWrite *message); +size_t rpc__req__otawrite__pack + (const RpcReqOTAWrite *message, + uint8_t *out); +size_t rpc__req__otawrite__pack_to_buffer + (const RpcReqOTAWrite *message, + ProtobufCBuffer *buffer); +RpcReqOTAWrite * + rpc__req__otawrite__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__otawrite__free_unpacked + (RpcReqOTAWrite *message, + ProtobufCAllocator *allocator); +/* RpcRespOTAWrite methods */ +void rpc__resp__otawrite__init + (RpcRespOTAWrite *message); +size_t rpc__resp__otawrite__get_packed_size + (const RpcRespOTAWrite *message); +size_t rpc__resp__otawrite__pack + (const RpcRespOTAWrite *message, + uint8_t *out); +size_t rpc__resp__otawrite__pack_to_buffer + (const RpcRespOTAWrite *message, + ProtobufCBuffer *buffer); +RpcRespOTAWrite * + rpc__resp__otawrite__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__otawrite__free_unpacked + (RpcRespOTAWrite *message, + ProtobufCAllocator *allocator); +/* RpcReqOTAEnd methods */ +void rpc__req__otaend__init + (RpcReqOTAEnd *message); +size_t rpc__req__otaend__get_packed_size + (const RpcReqOTAEnd *message); +size_t rpc__req__otaend__pack + (const RpcReqOTAEnd *message, + uint8_t *out); +size_t rpc__req__otaend__pack_to_buffer + (const RpcReqOTAEnd *message, + ProtobufCBuffer *buffer); +RpcReqOTAEnd * + rpc__req__otaend__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__otaend__free_unpacked + (RpcReqOTAEnd *message, + ProtobufCAllocator *allocator); +/* RpcRespOTAEnd methods */ +void rpc__resp__otaend__init + (RpcRespOTAEnd *message); +size_t rpc__resp__otaend__get_packed_size + (const RpcRespOTAEnd *message); +size_t rpc__resp__otaend__pack + (const RpcRespOTAEnd *message, + uint8_t *out); +size_t rpc__resp__otaend__pack_to_buffer + (const RpcRespOTAEnd *message, + ProtobufCBuffer *buffer); +RpcRespOTAEnd * + rpc__resp__otaend__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__otaend__free_unpacked + (RpcRespOTAEnd *message, + ProtobufCAllocator *allocator); +/* RpcReqOTAActivate methods */ +void rpc__req__otaactivate__init + (RpcReqOTAActivate *message); +size_t rpc__req__otaactivate__get_packed_size + (const RpcReqOTAActivate *message); +size_t rpc__req__otaactivate__pack + (const RpcReqOTAActivate *message, + uint8_t *out); +size_t rpc__req__otaactivate__pack_to_buffer + (const RpcReqOTAActivate *message, + ProtobufCBuffer *buffer); +RpcReqOTAActivate * + rpc__req__otaactivate__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__otaactivate__free_unpacked + (RpcReqOTAActivate *message, + ProtobufCAllocator *allocator); +/* RpcRespOTAActivate methods */ +void rpc__resp__otaactivate__init + (RpcRespOTAActivate *message); +size_t rpc__resp__otaactivate__get_packed_size + (const RpcRespOTAActivate *message); +size_t rpc__resp__otaactivate__pack + (const RpcRespOTAActivate *message, + uint8_t *out); +size_t rpc__resp__otaactivate__pack_to_buffer + (const RpcRespOTAActivate *message, + ProtobufCBuffer *buffer); +RpcRespOTAActivate * + rpc__resp__otaactivate__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__otaactivate__free_unpacked + (RpcRespOTAActivate *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiSetMaxTxPower methods */ +void rpc__req__wifi_set_max_tx_power__init + (RpcReqWifiSetMaxTxPower *message); +size_t rpc__req__wifi_set_max_tx_power__get_packed_size + (const RpcReqWifiSetMaxTxPower *message); +size_t rpc__req__wifi_set_max_tx_power__pack + (const RpcReqWifiSetMaxTxPower *message, + uint8_t *out); +size_t rpc__req__wifi_set_max_tx_power__pack_to_buffer + (const RpcReqWifiSetMaxTxPower *message, + ProtobufCBuffer *buffer); +RpcReqWifiSetMaxTxPower * + rpc__req__wifi_set_max_tx_power__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_set_max_tx_power__free_unpacked + (RpcReqWifiSetMaxTxPower *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiSetMaxTxPower methods */ +void rpc__resp__wifi_set_max_tx_power__init + (RpcRespWifiSetMaxTxPower *message); +size_t rpc__resp__wifi_set_max_tx_power__get_packed_size + (const RpcRespWifiSetMaxTxPower *message); +size_t rpc__resp__wifi_set_max_tx_power__pack + (const RpcRespWifiSetMaxTxPower *message, + uint8_t *out); +size_t rpc__resp__wifi_set_max_tx_power__pack_to_buffer + (const RpcRespWifiSetMaxTxPower *message, + ProtobufCBuffer *buffer); +RpcRespWifiSetMaxTxPower * + rpc__resp__wifi_set_max_tx_power__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_set_max_tx_power__free_unpacked + (RpcRespWifiSetMaxTxPower *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiGetMaxTxPower methods */ +void rpc__req__wifi_get_max_tx_power__init + (RpcReqWifiGetMaxTxPower *message); +size_t rpc__req__wifi_get_max_tx_power__get_packed_size + (const RpcReqWifiGetMaxTxPower *message); +size_t rpc__req__wifi_get_max_tx_power__pack + (const RpcReqWifiGetMaxTxPower *message, + uint8_t *out); +size_t rpc__req__wifi_get_max_tx_power__pack_to_buffer + (const RpcReqWifiGetMaxTxPower *message, + ProtobufCBuffer *buffer); +RpcReqWifiGetMaxTxPower * + rpc__req__wifi_get_max_tx_power__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_get_max_tx_power__free_unpacked + (RpcReqWifiGetMaxTxPower *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiGetMaxTxPower methods */ +void rpc__resp__wifi_get_max_tx_power__init + (RpcRespWifiGetMaxTxPower *message); +size_t rpc__resp__wifi_get_max_tx_power__get_packed_size + (const RpcRespWifiGetMaxTxPower *message); +size_t rpc__resp__wifi_get_max_tx_power__pack + (const RpcRespWifiGetMaxTxPower *message, + uint8_t *out); +size_t rpc__resp__wifi_get_max_tx_power__pack_to_buffer + (const RpcRespWifiGetMaxTxPower *message, + ProtobufCBuffer *buffer); +RpcRespWifiGetMaxTxPower * + rpc__resp__wifi_get_max_tx_power__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_get_max_tx_power__free_unpacked + (RpcRespWifiGetMaxTxPower *message, + ProtobufCAllocator *allocator); +/* RpcReqConfigHeartbeat methods */ +void rpc__req__config_heartbeat__init + (RpcReqConfigHeartbeat *message); +size_t rpc__req__config_heartbeat__get_packed_size + (const RpcReqConfigHeartbeat *message); +size_t rpc__req__config_heartbeat__pack + (const RpcReqConfigHeartbeat *message, + uint8_t *out); +size_t rpc__req__config_heartbeat__pack_to_buffer + (const RpcReqConfigHeartbeat *message, + ProtobufCBuffer *buffer); +RpcReqConfigHeartbeat * + rpc__req__config_heartbeat__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__config_heartbeat__free_unpacked + (RpcReqConfigHeartbeat *message, + ProtobufCAllocator *allocator); +/* RpcRespConfigHeartbeat methods */ +void rpc__resp__config_heartbeat__init + (RpcRespConfigHeartbeat *message); +size_t rpc__resp__config_heartbeat__get_packed_size + (const RpcRespConfigHeartbeat *message); +size_t rpc__resp__config_heartbeat__pack + (const RpcRespConfigHeartbeat *message, + uint8_t *out); +size_t rpc__resp__config_heartbeat__pack_to_buffer + (const RpcRespConfigHeartbeat *message, + ProtobufCBuffer *buffer); +RpcRespConfigHeartbeat * + rpc__resp__config_heartbeat__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__config_heartbeat__free_unpacked + (RpcRespConfigHeartbeat *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiInit methods */ +void rpc__req__wifi_init__init + (RpcReqWifiInit *message); +size_t rpc__req__wifi_init__get_packed_size + (const RpcReqWifiInit *message); +size_t rpc__req__wifi_init__pack + (const RpcReqWifiInit *message, + uint8_t *out); +size_t rpc__req__wifi_init__pack_to_buffer + (const RpcReqWifiInit *message, + ProtobufCBuffer *buffer); +RpcReqWifiInit * + rpc__req__wifi_init__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_init__free_unpacked + (RpcReqWifiInit *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiInit methods */ +void rpc__resp__wifi_init__init + (RpcRespWifiInit *message); +size_t rpc__resp__wifi_init__get_packed_size + (const RpcRespWifiInit *message); +size_t rpc__resp__wifi_init__pack + (const RpcRespWifiInit *message, + uint8_t *out); +size_t rpc__resp__wifi_init__pack_to_buffer + (const RpcRespWifiInit *message, + ProtobufCBuffer *buffer); +RpcRespWifiInit * + rpc__resp__wifi_init__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_init__free_unpacked + (RpcRespWifiInit *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiDeinit methods */ +void rpc__req__wifi_deinit__init + (RpcReqWifiDeinit *message); +size_t rpc__req__wifi_deinit__get_packed_size + (const RpcReqWifiDeinit *message); +size_t rpc__req__wifi_deinit__pack + (const RpcReqWifiDeinit *message, + uint8_t *out); +size_t rpc__req__wifi_deinit__pack_to_buffer + (const RpcReqWifiDeinit *message, + ProtobufCBuffer *buffer); +RpcReqWifiDeinit * + rpc__req__wifi_deinit__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_deinit__free_unpacked + (RpcReqWifiDeinit *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiDeinit methods */ +void rpc__resp__wifi_deinit__init + (RpcRespWifiDeinit *message); +size_t rpc__resp__wifi_deinit__get_packed_size + (const RpcRespWifiDeinit *message); +size_t rpc__resp__wifi_deinit__pack + (const RpcRespWifiDeinit *message, + uint8_t *out); +size_t rpc__resp__wifi_deinit__pack_to_buffer + (const RpcRespWifiDeinit *message, + ProtobufCBuffer *buffer); +RpcRespWifiDeinit * + rpc__resp__wifi_deinit__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_deinit__free_unpacked + (RpcRespWifiDeinit *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiSetConfig methods */ +void rpc__req__wifi_set_config__init + (RpcReqWifiSetConfig *message); +size_t rpc__req__wifi_set_config__get_packed_size + (const RpcReqWifiSetConfig *message); +size_t rpc__req__wifi_set_config__pack + (const RpcReqWifiSetConfig *message, + uint8_t *out); +size_t rpc__req__wifi_set_config__pack_to_buffer + (const RpcReqWifiSetConfig *message, + ProtobufCBuffer *buffer); +RpcReqWifiSetConfig * + rpc__req__wifi_set_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_set_config__free_unpacked + (RpcReqWifiSetConfig *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiSetConfig methods */ +void rpc__resp__wifi_set_config__init + (RpcRespWifiSetConfig *message); +size_t rpc__resp__wifi_set_config__get_packed_size + (const RpcRespWifiSetConfig *message); +size_t rpc__resp__wifi_set_config__pack + (const RpcRespWifiSetConfig *message, + uint8_t *out); +size_t rpc__resp__wifi_set_config__pack_to_buffer + (const RpcRespWifiSetConfig *message, + ProtobufCBuffer *buffer); +RpcRespWifiSetConfig * + rpc__resp__wifi_set_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_set_config__free_unpacked + (RpcRespWifiSetConfig *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiGetConfig methods */ +void rpc__req__wifi_get_config__init + (RpcReqWifiGetConfig *message); +size_t rpc__req__wifi_get_config__get_packed_size + (const RpcReqWifiGetConfig *message); +size_t rpc__req__wifi_get_config__pack + (const RpcReqWifiGetConfig *message, + uint8_t *out); +size_t rpc__req__wifi_get_config__pack_to_buffer + (const RpcReqWifiGetConfig *message, + ProtobufCBuffer *buffer); +RpcReqWifiGetConfig * + rpc__req__wifi_get_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_get_config__free_unpacked + (RpcReqWifiGetConfig *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiGetConfig methods */ +void rpc__resp__wifi_get_config__init + (RpcRespWifiGetConfig *message); +size_t rpc__resp__wifi_get_config__get_packed_size + (const RpcRespWifiGetConfig *message); +size_t rpc__resp__wifi_get_config__pack + (const RpcRespWifiGetConfig *message, + uint8_t *out); +size_t rpc__resp__wifi_get_config__pack_to_buffer + (const RpcRespWifiGetConfig *message, + ProtobufCBuffer *buffer); +RpcRespWifiGetConfig * + rpc__resp__wifi_get_config__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_get_config__free_unpacked + (RpcRespWifiGetConfig *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiConnect methods */ +void rpc__req__wifi_connect__init + (RpcReqWifiConnect *message); +size_t rpc__req__wifi_connect__get_packed_size + (const RpcReqWifiConnect *message); +size_t rpc__req__wifi_connect__pack + (const RpcReqWifiConnect *message, + uint8_t *out); +size_t rpc__req__wifi_connect__pack_to_buffer + (const RpcReqWifiConnect *message, + ProtobufCBuffer *buffer); +RpcReqWifiConnect * + rpc__req__wifi_connect__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_connect__free_unpacked + (RpcReqWifiConnect *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiConnect methods */ +void rpc__resp__wifi_connect__init + (RpcRespWifiConnect *message); +size_t rpc__resp__wifi_connect__get_packed_size + (const RpcRespWifiConnect *message); +size_t rpc__resp__wifi_connect__pack + (const RpcRespWifiConnect *message, + uint8_t *out); +size_t rpc__resp__wifi_connect__pack_to_buffer + (const RpcRespWifiConnect *message, + ProtobufCBuffer *buffer); +RpcRespWifiConnect * + rpc__resp__wifi_connect__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_connect__free_unpacked + (RpcRespWifiConnect *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiDisconnect methods */ +void rpc__req__wifi_disconnect__init + (RpcReqWifiDisconnect *message); +size_t rpc__req__wifi_disconnect__get_packed_size + (const RpcReqWifiDisconnect *message); +size_t rpc__req__wifi_disconnect__pack + (const RpcReqWifiDisconnect *message, + uint8_t *out); +size_t rpc__req__wifi_disconnect__pack_to_buffer + (const RpcReqWifiDisconnect *message, + ProtobufCBuffer *buffer); +RpcReqWifiDisconnect * + rpc__req__wifi_disconnect__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_disconnect__free_unpacked + (RpcReqWifiDisconnect *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiDisconnect methods */ +void rpc__resp__wifi_disconnect__init + (RpcRespWifiDisconnect *message); +size_t rpc__resp__wifi_disconnect__get_packed_size + (const RpcRespWifiDisconnect *message); +size_t rpc__resp__wifi_disconnect__pack + (const RpcRespWifiDisconnect *message, + uint8_t *out); +size_t rpc__resp__wifi_disconnect__pack_to_buffer + (const RpcRespWifiDisconnect *message, + ProtobufCBuffer *buffer); +RpcRespWifiDisconnect * + rpc__resp__wifi_disconnect__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_disconnect__free_unpacked + (RpcRespWifiDisconnect *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiStart methods */ +void rpc__req__wifi_start__init + (RpcReqWifiStart *message); +size_t rpc__req__wifi_start__get_packed_size + (const RpcReqWifiStart *message); +size_t rpc__req__wifi_start__pack + (const RpcReqWifiStart *message, + uint8_t *out); +size_t rpc__req__wifi_start__pack_to_buffer + (const RpcReqWifiStart *message, + ProtobufCBuffer *buffer); +RpcReqWifiStart * + rpc__req__wifi_start__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_start__free_unpacked + (RpcReqWifiStart *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiStart methods */ +void rpc__resp__wifi_start__init + (RpcRespWifiStart *message); +size_t rpc__resp__wifi_start__get_packed_size + (const RpcRespWifiStart *message); +size_t rpc__resp__wifi_start__pack + (const RpcRespWifiStart *message, + uint8_t *out); +size_t rpc__resp__wifi_start__pack_to_buffer + (const RpcRespWifiStart *message, + ProtobufCBuffer *buffer); +RpcRespWifiStart * + rpc__resp__wifi_start__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_start__free_unpacked + (RpcRespWifiStart *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiStop methods */ +void rpc__req__wifi_stop__init + (RpcReqWifiStop *message); +size_t rpc__req__wifi_stop__get_packed_size + (const RpcReqWifiStop *message); +size_t rpc__req__wifi_stop__pack + (const RpcReqWifiStop *message, + uint8_t *out); +size_t rpc__req__wifi_stop__pack_to_buffer + (const RpcReqWifiStop *message, + ProtobufCBuffer *buffer); +RpcReqWifiStop * + rpc__req__wifi_stop__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_stop__free_unpacked + (RpcReqWifiStop *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiStop methods */ +void rpc__resp__wifi_stop__init + (RpcRespWifiStop *message); +size_t rpc__resp__wifi_stop__get_packed_size + (const RpcRespWifiStop *message); +size_t rpc__resp__wifi_stop__pack + (const RpcRespWifiStop *message, + uint8_t *out); +size_t rpc__resp__wifi_stop__pack_to_buffer + (const RpcRespWifiStop *message, + ProtobufCBuffer *buffer); +RpcRespWifiStop * + rpc__resp__wifi_stop__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_stop__free_unpacked + (RpcRespWifiStop *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiScanStart methods */ +void rpc__req__wifi_scan_start__init + (RpcReqWifiScanStart *message); +size_t rpc__req__wifi_scan_start__get_packed_size + (const RpcReqWifiScanStart *message); +size_t rpc__req__wifi_scan_start__pack + (const RpcReqWifiScanStart *message, + uint8_t *out); +size_t rpc__req__wifi_scan_start__pack_to_buffer + (const RpcReqWifiScanStart *message, + ProtobufCBuffer *buffer); +RpcReqWifiScanStart * + rpc__req__wifi_scan_start__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_scan_start__free_unpacked + (RpcReqWifiScanStart *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiScanStart methods */ +void rpc__resp__wifi_scan_start__init + (RpcRespWifiScanStart *message); +size_t rpc__resp__wifi_scan_start__get_packed_size + (const RpcRespWifiScanStart *message); +size_t rpc__resp__wifi_scan_start__pack + (const RpcRespWifiScanStart *message, + uint8_t *out); +size_t rpc__resp__wifi_scan_start__pack_to_buffer + (const RpcRespWifiScanStart *message, + ProtobufCBuffer *buffer); +RpcRespWifiScanStart * + rpc__resp__wifi_scan_start__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_scan_start__free_unpacked + (RpcRespWifiScanStart *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiScanStop methods */ +void rpc__req__wifi_scan_stop__init + (RpcReqWifiScanStop *message); +size_t rpc__req__wifi_scan_stop__get_packed_size + (const RpcReqWifiScanStop *message); +size_t rpc__req__wifi_scan_stop__pack + (const RpcReqWifiScanStop *message, + uint8_t *out); +size_t rpc__req__wifi_scan_stop__pack_to_buffer + (const RpcReqWifiScanStop *message, + ProtobufCBuffer *buffer); +RpcReqWifiScanStop * + rpc__req__wifi_scan_stop__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_scan_stop__free_unpacked + (RpcReqWifiScanStop *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiScanStop methods */ +void rpc__resp__wifi_scan_stop__init + (RpcRespWifiScanStop *message); +size_t rpc__resp__wifi_scan_stop__get_packed_size + (const RpcRespWifiScanStop *message); +size_t rpc__resp__wifi_scan_stop__pack + (const RpcRespWifiScanStop *message, + uint8_t *out); +size_t rpc__resp__wifi_scan_stop__pack_to_buffer + (const RpcRespWifiScanStop *message, + ProtobufCBuffer *buffer); +RpcRespWifiScanStop * + rpc__resp__wifi_scan_stop__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_scan_stop__free_unpacked + (RpcRespWifiScanStop *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiScanGetApNum methods */ +void rpc__req__wifi_scan_get_ap_num__init + (RpcReqWifiScanGetApNum *message); +size_t rpc__req__wifi_scan_get_ap_num__get_packed_size + (const RpcReqWifiScanGetApNum *message); +size_t rpc__req__wifi_scan_get_ap_num__pack + (const RpcReqWifiScanGetApNum *message, + uint8_t *out); +size_t rpc__req__wifi_scan_get_ap_num__pack_to_buffer + (const RpcReqWifiScanGetApNum *message, + ProtobufCBuffer *buffer); +RpcReqWifiScanGetApNum * + rpc__req__wifi_scan_get_ap_num__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_scan_get_ap_num__free_unpacked + (RpcReqWifiScanGetApNum *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiScanGetApNum methods */ +void rpc__resp__wifi_scan_get_ap_num__init + (RpcRespWifiScanGetApNum *message); +size_t rpc__resp__wifi_scan_get_ap_num__get_packed_size + (const RpcRespWifiScanGetApNum *message); +size_t rpc__resp__wifi_scan_get_ap_num__pack + (const RpcRespWifiScanGetApNum *message, + uint8_t *out); +size_t rpc__resp__wifi_scan_get_ap_num__pack_to_buffer + (const RpcRespWifiScanGetApNum *message, + ProtobufCBuffer *buffer); +RpcRespWifiScanGetApNum * + rpc__resp__wifi_scan_get_ap_num__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_scan_get_ap_num__free_unpacked + (RpcRespWifiScanGetApNum *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiScanGetApRecords methods */ +void rpc__req__wifi_scan_get_ap_records__init + (RpcReqWifiScanGetApRecords *message); +size_t rpc__req__wifi_scan_get_ap_records__get_packed_size + (const RpcReqWifiScanGetApRecords *message); +size_t rpc__req__wifi_scan_get_ap_records__pack + (const RpcReqWifiScanGetApRecords *message, + uint8_t *out); +size_t rpc__req__wifi_scan_get_ap_records__pack_to_buffer + (const RpcReqWifiScanGetApRecords *message, + ProtobufCBuffer *buffer); +RpcReqWifiScanGetApRecords * + rpc__req__wifi_scan_get_ap_records__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_scan_get_ap_records__free_unpacked + (RpcReqWifiScanGetApRecords *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiScanGetApRecords methods */ +void rpc__resp__wifi_scan_get_ap_records__init + (RpcRespWifiScanGetApRecords *message); +size_t rpc__resp__wifi_scan_get_ap_records__get_packed_size + (const RpcRespWifiScanGetApRecords *message); +size_t rpc__resp__wifi_scan_get_ap_records__pack + (const RpcRespWifiScanGetApRecords *message, + uint8_t *out); +size_t rpc__resp__wifi_scan_get_ap_records__pack_to_buffer + (const RpcRespWifiScanGetApRecords *message, + ProtobufCBuffer *buffer); +RpcRespWifiScanGetApRecords * + rpc__resp__wifi_scan_get_ap_records__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_scan_get_ap_records__free_unpacked + (RpcRespWifiScanGetApRecords *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiScanGetApRecord methods */ +void rpc__req__wifi_scan_get_ap_record__init + (RpcReqWifiScanGetApRecord *message); +size_t rpc__req__wifi_scan_get_ap_record__get_packed_size + (const RpcReqWifiScanGetApRecord *message); +size_t rpc__req__wifi_scan_get_ap_record__pack + (const RpcReqWifiScanGetApRecord *message, + uint8_t *out); +size_t rpc__req__wifi_scan_get_ap_record__pack_to_buffer + (const RpcReqWifiScanGetApRecord *message, + ProtobufCBuffer *buffer); +RpcReqWifiScanGetApRecord * + rpc__req__wifi_scan_get_ap_record__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_scan_get_ap_record__free_unpacked + (RpcReqWifiScanGetApRecord *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiScanGetApRecord methods */ +void rpc__resp__wifi_scan_get_ap_record__init + (RpcRespWifiScanGetApRecord *message); +size_t rpc__resp__wifi_scan_get_ap_record__get_packed_size + (const RpcRespWifiScanGetApRecord *message); +size_t rpc__resp__wifi_scan_get_ap_record__pack + (const RpcRespWifiScanGetApRecord *message, + uint8_t *out); +size_t rpc__resp__wifi_scan_get_ap_record__pack_to_buffer + (const RpcRespWifiScanGetApRecord *message, + ProtobufCBuffer *buffer); +RpcRespWifiScanGetApRecord * + rpc__resp__wifi_scan_get_ap_record__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_scan_get_ap_record__free_unpacked + (RpcRespWifiScanGetApRecord *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiClearApList methods */ +void rpc__req__wifi_clear_ap_list__init + (RpcReqWifiClearApList *message); +size_t rpc__req__wifi_clear_ap_list__get_packed_size + (const RpcReqWifiClearApList *message); +size_t rpc__req__wifi_clear_ap_list__pack + (const RpcReqWifiClearApList *message, + uint8_t *out); +size_t rpc__req__wifi_clear_ap_list__pack_to_buffer + (const RpcReqWifiClearApList *message, + ProtobufCBuffer *buffer); +RpcReqWifiClearApList * + rpc__req__wifi_clear_ap_list__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_clear_ap_list__free_unpacked + (RpcReqWifiClearApList *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiClearApList methods */ +void rpc__resp__wifi_clear_ap_list__init + (RpcRespWifiClearApList *message); +size_t rpc__resp__wifi_clear_ap_list__get_packed_size + (const RpcRespWifiClearApList *message); +size_t rpc__resp__wifi_clear_ap_list__pack + (const RpcRespWifiClearApList *message, + uint8_t *out); +size_t rpc__resp__wifi_clear_ap_list__pack_to_buffer + (const RpcRespWifiClearApList *message, + ProtobufCBuffer *buffer); +RpcRespWifiClearApList * + rpc__resp__wifi_clear_ap_list__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_clear_ap_list__free_unpacked + (RpcRespWifiClearApList *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiRestore methods */ +void rpc__req__wifi_restore__init + (RpcReqWifiRestore *message); +size_t rpc__req__wifi_restore__get_packed_size + (const RpcReqWifiRestore *message); +size_t rpc__req__wifi_restore__pack + (const RpcReqWifiRestore *message, + uint8_t *out); +size_t rpc__req__wifi_restore__pack_to_buffer + (const RpcReqWifiRestore *message, + ProtobufCBuffer *buffer); +RpcReqWifiRestore * + rpc__req__wifi_restore__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_restore__free_unpacked + (RpcReqWifiRestore *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiRestore methods */ +void rpc__resp__wifi_restore__init + (RpcRespWifiRestore *message); +size_t rpc__resp__wifi_restore__get_packed_size + (const RpcRespWifiRestore *message); +size_t rpc__resp__wifi_restore__pack + (const RpcRespWifiRestore *message, + uint8_t *out); +size_t rpc__resp__wifi_restore__pack_to_buffer + (const RpcRespWifiRestore *message, + ProtobufCBuffer *buffer); +RpcRespWifiRestore * + rpc__resp__wifi_restore__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_restore__free_unpacked + (RpcRespWifiRestore *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiClearFastConnect methods */ +void rpc__req__wifi_clear_fast_connect__init + (RpcReqWifiClearFastConnect *message); +size_t rpc__req__wifi_clear_fast_connect__get_packed_size + (const RpcReqWifiClearFastConnect *message); +size_t rpc__req__wifi_clear_fast_connect__pack + (const RpcReqWifiClearFastConnect *message, + uint8_t *out); +size_t rpc__req__wifi_clear_fast_connect__pack_to_buffer + (const RpcReqWifiClearFastConnect *message, + ProtobufCBuffer *buffer); +RpcReqWifiClearFastConnect * + rpc__req__wifi_clear_fast_connect__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_clear_fast_connect__free_unpacked + (RpcReqWifiClearFastConnect *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiClearFastConnect methods */ +void rpc__resp__wifi_clear_fast_connect__init + (RpcRespWifiClearFastConnect *message); +size_t rpc__resp__wifi_clear_fast_connect__get_packed_size + (const RpcRespWifiClearFastConnect *message); +size_t rpc__resp__wifi_clear_fast_connect__pack + (const RpcRespWifiClearFastConnect *message, + uint8_t *out); +size_t rpc__resp__wifi_clear_fast_connect__pack_to_buffer + (const RpcRespWifiClearFastConnect *message, + ProtobufCBuffer *buffer); +RpcRespWifiClearFastConnect * + rpc__resp__wifi_clear_fast_connect__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_clear_fast_connect__free_unpacked + (RpcRespWifiClearFastConnect *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiDeauthSta methods */ +void rpc__req__wifi_deauth_sta__init + (RpcReqWifiDeauthSta *message); +size_t rpc__req__wifi_deauth_sta__get_packed_size + (const RpcReqWifiDeauthSta *message); +size_t rpc__req__wifi_deauth_sta__pack + (const RpcReqWifiDeauthSta *message, + uint8_t *out); +size_t rpc__req__wifi_deauth_sta__pack_to_buffer + (const RpcReqWifiDeauthSta *message, + ProtobufCBuffer *buffer); +RpcReqWifiDeauthSta * + rpc__req__wifi_deauth_sta__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_deauth_sta__free_unpacked + (RpcReqWifiDeauthSta *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiDeauthSta methods */ +void rpc__resp__wifi_deauth_sta__init + (RpcRespWifiDeauthSta *message); +size_t rpc__resp__wifi_deauth_sta__get_packed_size + (const RpcRespWifiDeauthSta *message); +size_t rpc__resp__wifi_deauth_sta__pack + (const RpcRespWifiDeauthSta *message, uint8_t *out); -size_t wifi_init_config__pack_to_buffer - (const WifiInitConfig *message, +size_t rpc__resp__wifi_deauth_sta__pack_to_buffer + (const RpcRespWifiDeauthSta *message, ProtobufCBuffer *buffer); -WifiInitConfig * - wifi_init_config__unpack +RpcRespWifiDeauthSta * + rpc__resp__wifi_deauth_sta__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_init_config__free_unpacked - (WifiInitConfig *message, +void rpc__resp__wifi_deauth_sta__free_unpacked + (RpcRespWifiDeauthSta *message, ProtobufCAllocator *allocator); -/* WifiCountry methods */ -void wifi_country__init - (WifiCountry *message); -size_t wifi_country__get_packed_size - (const WifiCountry *message); -size_t wifi_country__pack - (const WifiCountry *message, +/* RpcReqWifiStaGetApInfo methods */ +void rpc__req__wifi_sta_get_ap_info__init + (RpcReqWifiStaGetApInfo *message); +size_t rpc__req__wifi_sta_get_ap_info__get_packed_size + (const RpcReqWifiStaGetApInfo *message); +size_t rpc__req__wifi_sta_get_ap_info__pack + (const RpcReqWifiStaGetApInfo *message, uint8_t *out); -size_t wifi_country__pack_to_buffer - (const WifiCountry *message, +size_t rpc__req__wifi_sta_get_ap_info__pack_to_buffer + (const RpcReqWifiStaGetApInfo *message, ProtobufCBuffer *buffer); -WifiCountry * - wifi_country__unpack +RpcReqWifiStaGetApInfo * + rpc__req__wifi_sta_get_ap_info__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_country__free_unpacked - (WifiCountry *message, +void rpc__req__wifi_sta_get_ap_info__free_unpacked + (RpcReqWifiStaGetApInfo *message, ProtobufCAllocator *allocator); -/* WifiActiveScanTime methods */ -void wifi_active_scan_time__init - (WifiActiveScanTime *message); -size_t wifi_active_scan_time__get_packed_size - (const WifiActiveScanTime *message); -size_t wifi_active_scan_time__pack - (const WifiActiveScanTime *message, +/* RpcRespWifiStaGetApInfo methods */ +void rpc__resp__wifi_sta_get_ap_info__init + (RpcRespWifiStaGetApInfo *message); +size_t rpc__resp__wifi_sta_get_ap_info__get_packed_size + (const RpcRespWifiStaGetApInfo *message); +size_t rpc__resp__wifi_sta_get_ap_info__pack + (const RpcRespWifiStaGetApInfo *message, uint8_t *out); -size_t wifi_active_scan_time__pack_to_buffer - (const WifiActiveScanTime *message, +size_t rpc__resp__wifi_sta_get_ap_info__pack_to_buffer + (const RpcRespWifiStaGetApInfo *message, ProtobufCBuffer *buffer); -WifiActiveScanTime * - wifi_active_scan_time__unpack +RpcRespWifiStaGetApInfo * + rpc__resp__wifi_sta_get_ap_info__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_active_scan_time__free_unpacked - (WifiActiveScanTime *message, +void rpc__resp__wifi_sta_get_ap_info__free_unpacked + (RpcRespWifiStaGetApInfo *message, ProtobufCAllocator *allocator); -/* WifiScanTime methods */ -void wifi_scan_time__init - (WifiScanTime *message); -size_t wifi_scan_time__get_packed_size - (const WifiScanTime *message); -size_t wifi_scan_time__pack - (const WifiScanTime *message, +/* RpcReqWifiSetProtocol methods */ +void rpc__req__wifi_set_protocol__init + (RpcReqWifiSetProtocol *message); +size_t rpc__req__wifi_set_protocol__get_packed_size + (const RpcReqWifiSetProtocol *message); +size_t rpc__req__wifi_set_protocol__pack + (const RpcReqWifiSetProtocol *message, uint8_t *out); -size_t wifi_scan_time__pack_to_buffer - (const WifiScanTime *message, +size_t rpc__req__wifi_set_protocol__pack_to_buffer + (const RpcReqWifiSetProtocol *message, ProtobufCBuffer *buffer); -WifiScanTime * - wifi_scan_time__unpack +RpcReqWifiSetProtocol * + rpc__req__wifi_set_protocol__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_scan_time__free_unpacked - (WifiScanTime *message, +void rpc__req__wifi_set_protocol__free_unpacked + (RpcReqWifiSetProtocol *message, ProtobufCAllocator *allocator); -/* WifiScanConfig methods */ -void wifi_scan_config__init - (WifiScanConfig *message); -size_t wifi_scan_config__get_packed_size - (const WifiScanConfig *message); -size_t wifi_scan_config__pack - (const WifiScanConfig *message, +/* RpcRespWifiSetProtocol methods */ +void rpc__resp__wifi_set_protocol__init + (RpcRespWifiSetProtocol *message); +size_t rpc__resp__wifi_set_protocol__get_packed_size + (const RpcRespWifiSetProtocol *message); +size_t rpc__resp__wifi_set_protocol__pack + (const RpcRespWifiSetProtocol *message, uint8_t *out); -size_t wifi_scan_config__pack_to_buffer - (const WifiScanConfig *message, +size_t rpc__resp__wifi_set_protocol__pack_to_buffer + (const RpcRespWifiSetProtocol *message, ProtobufCBuffer *buffer); -WifiScanConfig * - wifi_scan_config__unpack +RpcRespWifiSetProtocol * + rpc__resp__wifi_set_protocol__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_scan_config__free_unpacked - (WifiScanConfig *message, +void rpc__resp__wifi_set_protocol__free_unpacked + (RpcRespWifiSetProtocol *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiGetProtocol methods */ +void rpc__req__wifi_get_protocol__init + (RpcReqWifiGetProtocol *message); +size_t rpc__req__wifi_get_protocol__get_packed_size + (const RpcReqWifiGetProtocol *message); +size_t rpc__req__wifi_get_protocol__pack + (const RpcReqWifiGetProtocol *message, + uint8_t *out); +size_t rpc__req__wifi_get_protocol__pack_to_buffer + (const RpcReqWifiGetProtocol *message, + ProtobufCBuffer *buffer); +RpcReqWifiGetProtocol * + rpc__req__wifi_get_protocol__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_get_protocol__free_unpacked + (RpcReqWifiGetProtocol *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiGetProtocol methods */ +void rpc__resp__wifi_get_protocol__init + (RpcRespWifiGetProtocol *message); +size_t rpc__resp__wifi_get_protocol__get_packed_size + (const RpcRespWifiGetProtocol *message); +size_t rpc__resp__wifi_get_protocol__pack + (const RpcRespWifiGetProtocol *message, + uint8_t *out); +size_t rpc__resp__wifi_get_protocol__pack_to_buffer + (const RpcRespWifiGetProtocol *message, + ProtobufCBuffer *buffer); +RpcRespWifiGetProtocol * + rpc__resp__wifi_get_protocol__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_get_protocol__free_unpacked + (RpcRespWifiGetProtocol *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiSetBandwidth methods */ +void rpc__req__wifi_set_bandwidth__init + (RpcReqWifiSetBandwidth *message); +size_t rpc__req__wifi_set_bandwidth__get_packed_size + (const RpcReqWifiSetBandwidth *message); +size_t rpc__req__wifi_set_bandwidth__pack + (const RpcReqWifiSetBandwidth *message, + uint8_t *out); +size_t rpc__req__wifi_set_bandwidth__pack_to_buffer + (const RpcReqWifiSetBandwidth *message, + ProtobufCBuffer *buffer); +RpcReqWifiSetBandwidth * + rpc__req__wifi_set_bandwidth__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_set_bandwidth__free_unpacked + (RpcReqWifiSetBandwidth *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiSetBandwidth methods */ +void rpc__resp__wifi_set_bandwidth__init + (RpcRespWifiSetBandwidth *message); +size_t rpc__resp__wifi_set_bandwidth__get_packed_size + (const RpcRespWifiSetBandwidth *message); +size_t rpc__resp__wifi_set_bandwidth__pack + (const RpcRespWifiSetBandwidth *message, + uint8_t *out); +size_t rpc__resp__wifi_set_bandwidth__pack_to_buffer + (const RpcRespWifiSetBandwidth *message, + ProtobufCBuffer *buffer); +RpcRespWifiSetBandwidth * + rpc__resp__wifi_set_bandwidth__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_set_bandwidth__free_unpacked + (RpcRespWifiSetBandwidth *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiGetBandwidth methods */ +void rpc__req__wifi_get_bandwidth__init + (RpcReqWifiGetBandwidth *message); +size_t rpc__req__wifi_get_bandwidth__get_packed_size + (const RpcReqWifiGetBandwidth *message); +size_t rpc__req__wifi_get_bandwidth__pack + (const RpcReqWifiGetBandwidth *message, + uint8_t *out); +size_t rpc__req__wifi_get_bandwidth__pack_to_buffer + (const RpcReqWifiGetBandwidth *message, + ProtobufCBuffer *buffer); +RpcReqWifiGetBandwidth * + rpc__req__wifi_get_bandwidth__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_get_bandwidth__free_unpacked + (RpcReqWifiGetBandwidth *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiGetBandwidth methods */ +void rpc__resp__wifi_get_bandwidth__init + (RpcRespWifiGetBandwidth *message); +size_t rpc__resp__wifi_get_bandwidth__get_packed_size + (const RpcRespWifiGetBandwidth *message); +size_t rpc__resp__wifi_get_bandwidth__pack + (const RpcRespWifiGetBandwidth *message, + uint8_t *out); +size_t rpc__resp__wifi_get_bandwidth__pack_to_buffer + (const RpcRespWifiGetBandwidth *message, + ProtobufCBuffer *buffer); +RpcRespWifiGetBandwidth * + rpc__resp__wifi_get_bandwidth__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__wifi_get_bandwidth__free_unpacked + (RpcRespWifiGetBandwidth *message, + ProtobufCAllocator *allocator); +/* RpcReqWifiSetChannel methods */ +void rpc__req__wifi_set_channel__init + (RpcReqWifiSetChannel *message); +size_t rpc__req__wifi_set_channel__get_packed_size + (const RpcReqWifiSetChannel *message); +size_t rpc__req__wifi_set_channel__pack + (const RpcReqWifiSetChannel *message, + uint8_t *out); +size_t rpc__req__wifi_set_channel__pack_to_buffer + (const RpcReqWifiSetChannel *message, + ProtobufCBuffer *buffer); +RpcReqWifiSetChannel * + rpc__req__wifi_set_channel__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_set_channel__free_unpacked + (RpcReqWifiSetChannel *message, ProtobufCAllocator *allocator); -/* WifiHeApInfo methods */ -void wifi_he_ap_info__init - (WifiHeApInfo *message); -size_t wifi_he_ap_info__get_packed_size - (const WifiHeApInfo *message); -size_t wifi_he_ap_info__pack - (const WifiHeApInfo *message, +/* RpcRespWifiSetChannel methods */ +void rpc__resp__wifi_set_channel__init + (RpcRespWifiSetChannel *message); +size_t rpc__resp__wifi_set_channel__get_packed_size + (const RpcRespWifiSetChannel *message); +size_t rpc__resp__wifi_set_channel__pack + (const RpcRespWifiSetChannel *message, uint8_t *out); -size_t wifi_he_ap_info__pack_to_buffer - (const WifiHeApInfo *message, +size_t rpc__resp__wifi_set_channel__pack_to_buffer + (const RpcRespWifiSetChannel *message, ProtobufCBuffer *buffer); -WifiHeApInfo * - wifi_he_ap_info__unpack +RpcRespWifiSetChannel * + rpc__resp__wifi_set_channel__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_he_ap_info__free_unpacked - (WifiHeApInfo *message, +void rpc__resp__wifi_set_channel__free_unpacked + (RpcRespWifiSetChannel *message, ProtobufCAllocator *allocator); -/* WifiApRecord methods */ -void wifi_ap_record__init - (WifiApRecord *message); -size_t wifi_ap_record__get_packed_size - (const WifiApRecord *message); -size_t wifi_ap_record__pack - (const WifiApRecord *message, +/* RpcReqWifiGetChannel methods */ +void rpc__req__wifi_get_channel__init + (RpcReqWifiGetChannel *message); +size_t rpc__req__wifi_get_channel__get_packed_size + (const RpcReqWifiGetChannel *message); +size_t rpc__req__wifi_get_channel__pack + (const RpcReqWifiGetChannel *message, uint8_t *out); -size_t wifi_ap_record__pack_to_buffer - (const WifiApRecord *message, +size_t rpc__req__wifi_get_channel__pack_to_buffer + (const RpcReqWifiGetChannel *message, ProtobufCBuffer *buffer); -WifiApRecord * - wifi_ap_record__unpack +RpcReqWifiGetChannel * + rpc__req__wifi_get_channel__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_ap_record__free_unpacked - (WifiApRecord *message, +void rpc__req__wifi_get_channel__free_unpacked + (RpcReqWifiGetChannel *message, ProtobufCAllocator *allocator); -/* WifiScanThreshold methods */ -void wifi_scan_threshold__init - (WifiScanThreshold *message); -size_t wifi_scan_threshold__get_packed_size - (const WifiScanThreshold *message); -size_t wifi_scan_threshold__pack - (const WifiScanThreshold *message, +/* RpcRespWifiGetChannel methods */ +void rpc__resp__wifi_get_channel__init + (RpcRespWifiGetChannel *message); +size_t rpc__resp__wifi_get_channel__get_packed_size + (const RpcRespWifiGetChannel *message); +size_t rpc__resp__wifi_get_channel__pack + (const RpcRespWifiGetChannel *message, uint8_t *out); -size_t wifi_scan_threshold__pack_to_buffer - (const WifiScanThreshold *message, +size_t rpc__resp__wifi_get_channel__pack_to_buffer + (const RpcRespWifiGetChannel *message, ProtobufCBuffer *buffer); -WifiScanThreshold * - wifi_scan_threshold__unpack +RpcRespWifiGetChannel * + rpc__resp__wifi_get_channel__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_scan_threshold__free_unpacked - (WifiScanThreshold *message, +void rpc__resp__wifi_get_channel__free_unpacked + (RpcRespWifiGetChannel *message, ProtobufCAllocator *allocator); -/* WifiPmfConfig methods */ -void wifi_pmf_config__init - (WifiPmfConfig *message); -size_t wifi_pmf_config__get_packed_size - (const WifiPmfConfig *message); -size_t wifi_pmf_config__pack - (const WifiPmfConfig *message, +/* RpcReqWifiSetStorage methods */ +void rpc__req__wifi_set_storage__init + (RpcReqWifiSetStorage *message); +size_t rpc__req__wifi_set_storage__get_packed_size + (const RpcReqWifiSetStorage *message); +size_t rpc__req__wifi_set_storage__pack + (const RpcReqWifiSetStorage *message, uint8_t *out); -size_t wifi_pmf_config__pack_to_buffer - (const WifiPmfConfig *message, +size_t rpc__req__wifi_set_storage__pack_to_buffer + (const RpcReqWifiSetStorage *message, ProtobufCBuffer *buffer); -WifiPmfConfig * - wifi_pmf_config__unpack +RpcReqWifiSetStorage * + rpc__req__wifi_set_storage__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_pmf_config__free_unpacked - (WifiPmfConfig *message, +void rpc__req__wifi_set_storage__free_unpacked + (RpcReqWifiSetStorage *message, ProtobufCAllocator *allocator); -/* WifiApConfig methods */ -void wifi_ap_config__init - (WifiApConfig *message); -size_t wifi_ap_config__get_packed_size - (const WifiApConfig *message); -size_t wifi_ap_config__pack - (const WifiApConfig *message, +/* RpcRespWifiSetStorage methods */ +void rpc__resp__wifi_set_storage__init + (RpcRespWifiSetStorage *message); +size_t rpc__resp__wifi_set_storage__get_packed_size + (const RpcRespWifiSetStorage *message); +size_t rpc__resp__wifi_set_storage__pack + (const RpcRespWifiSetStorage *message, uint8_t *out); -size_t wifi_ap_config__pack_to_buffer - (const WifiApConfig *message, +size_t rpc__resp__wifi_set_storage__pack_to_buffer + (const RpcRespWifiSetStorage *message, ProtobufCBuffer *buffer); -WifiApConfig * - wifi_ap_config__unpack +RpcRespWifiSetStorage * + rpc__resp__wifi_set_storage__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_ap_config__free_unpacked - (WifiApConfig *message, +void rpc__resp__wifi_set_storage__free_unpacked + (RpcRespWifiSetStorage *message, ProtobufCAllocator *allocator); -/* WifiStaConfig methods */ -void wifi_sta_config__init - (WifiStaConfig *message); -size_t wifi_sta_config__get_packed_size - (const WifiStaConfig *message); -size_t wifi_sta_config__pack - (const WifiStaConfig *message, +/* RpcReqWifiSetCountryCode methods */ +void rpc__req__wifi_set_country_code__init + (RpcReqWifiSetCountryCode *message); +size_t rpc__req__wifi_set_country_code__get_packed_size + (const RpcReqWifiSetCountryCode *message); +size_t rpc__req__wifi_set_country_code__pack + (const RpcReqWifiSetCountryCode *message, uint8_t *out); -size_t wifi_sta_config__pack_to_buffer - (const WifiStaConfig *message, +size_t rpc__req__wifi_set_country_code__pack_to_buffer + (const RpcReqWifiSetCountryCode *message, ProtobufCBuffer *buffer); -WifiStaConfig * - wifi_sta_config__unpack +RpcReqWifiSetCountryCode * + rpc__req__wifi_set_country_code__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_sta_config__free_unpacked - (WifiStaConfig *message, +void rpc__req__wifi_set_country_code__free_unpacked + (RpcReqWifiSetCountryCode *message, ProtobufCAllocator *allocator); -/* WifiConfig methods */ -void wifi_config__init - (WifiConfig *message); -size_t wifi_config__get_packed_size - (const WifiConfig *message); -size_t wifi_config__pack - (const WifiConfig *message, +/* RpcRespWifiSetCountryCode methods */ +void rpc__resp__wifi_set_country_code__init + (RpcRespWifiSetCountryCode *message); +size_t rpc__resp__wifi_set_country_code__get_packed_size + (const RpcRespWifiSetCountryCode *message); +size_t rpc__resp__wifi_set_country_code__pack + (const RpcRespWifiSetCountryCode *message, uint8_t *out); -size_t wifi_config__pack_to_buffer - (const WifiConfig *message, +size_t rpc__resp__wifi_set_country_code__pack_to_buffer + (const RpcRespWifiSetCountryCode *message, ProtobufCBuffer *buffer); -WifiConfig * - wifi_config__unpack +RpcRespWifiSetCountryCode * + rpc__resp__wifi_set_country_code__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_config__free_unpacked - (WifiConfig *message, +void rpc__resp__wifi_set_country_code__free_unpacked + (RpcRespWifiSetCountryCode *message, ProtobufCAllocator *allocator); -/* WifiStaInfo methods */ -void wifi_sta_info__init - (WifiStaInfo *message); -size_t wifi_sta_info__get_packed_size - (const WifiStaInfo *message); -size_t wifi_sta_info__pack - (const WifiStaInfo *message, +/* RpcReqWifiGetCountryCode methods */ +void rpc__req__wifi_get_country_code__init + (RpcReqWifiGetCountryCode *message); +size_t rpc__req__wifi_get_country_code__get_packed_size + (const RpcReqWifiGetCountryCode *message); +size_t rpc__req__wifi_get_country_code__pack + (const RpcReqWifiGetCountryCode *message, uint8_t *out); -size_t wifi_sta_info__pack_to_buffer - (const WifiStaInfo *message, +size_t rpc__req__wifi_get_country_code__pack_to_buffer + (const RpcReqWifiGetCountryCode *message, ProtobufCBuffer *buffer); -WifiStaInfo * - wifi_sta_info__unpack +RpcReqWifiGetCountryCode * + rpc__req__wifi_get_country_code__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_sta_info__free_unpacked - (WifiStaInfo *message, +void rpc__req__wifi_get_country_code__free_unpacked + (RpcReqWifiGetCountryCode *message, ProtobufCAllocator *allocator); -/* WifiStaList methods */ -void wifi_sta_list__init - (WifiStaList *message); -size_t wifi_sta_list__get_packed_size - (const WifiStaList *message); -size_t wifi_sta_list__pack - (const WifiStaList *message, +/* RpcRespWifiGetCountryCode methods */ +void rpc__resp__wifi_get_country_code__init + (RpcRespWifiGetCountryCode *message); +size_t rpc__resp__wifi_get_country_code__get_packed_size + (const RpcRespWifiGetCountryCode *message); +size_t rpc__resp__wifi_get_country_code__pack + (const RpcRespWifiGetCountryCode *message, uint8_t *out); -size_t wifi_sta_list__pack_to_buffer - (const WifiStaList *message, +size_t rpc__resp__wifi_get_country_code__pack_to_buffer + (const RpcRespWifiGetCountryCode *message, ProtobufCBuffer *buffer); -WifiStaList * - wifi_sta_list__unpack +RpcRespWifiGetCountryCode * + rpc__resp__wifi_get_country_code__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_sta_list__free_unpacked - (WifiStaList *message, +void rpc__resp__wifi_get_country_code__free_unpacked + (RpcRespWifiGetCountryCode *message, ProtobufCAllocator *allocator); -/* WifiPktRxCtrl methods */ -void wifi_pkt_rx_ctrl__init - (WifiPktRxCtrl *message); -size_t wifi_pkt_rx_ctrl__get_packed_size - (const WifiPktRxCtrl *message); -size_t wifi_pkt_rx_ctrl__pack - (const WifiPktRxCtrl *message, +/* RpcReqWifiSetCountry methods */ +void rpc__req__wifi_set_country__init + (RpcReqWifiSetCountry *message); +size_t rpc__req__wifi_set_country__get_packed_size + (const RpcReqWifiSetCountry *message); +size_t rpc__req__wifi_set_country__pack + (const RpcReqWifiSetCountry *message, uint8_t *out); -size_t wifi_pkt_rx_ctrl__pack_to_buffer - (const WifiPktRxCtrl *message, +size_t rpc__req__wifi_set_country__pack_to_buffer + (const RpcReqWifiSetCountry *message, ProtobufCBuffer *buffer); -WifiPktRxCtrl * - wifi_pkt_rx_ctrl__unpack +RpcReqWifiSetCountry * + rpc__req__wifi_set_country__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_pkt_rx_ctrl__free_unpacked - (WifiPktRxCtrl *message, +void rpc__req__wifi_set_country__free_unpacked + (RpcReqWifiSetCountry *message, ProtobufCAllocator *allocator); -/* WifiPromiscuousPkt methods */ -void wifi_promiscuous_pkt__init - (WifiPromiscuousPkt *message); -size_t wifi_promiscuous_pkt__get_packed_size - (const WifiPromiscuousPkt *message); -size_t wifi_promiscuous_pkt__pack - (const WifiPromiscuousPkt *message, +/* RpcRespWifiSetCountry methods */ +void rpc__resp__wifi_set_country__init + (RpcRespWifiSetCountry *message); +size_t rpc__resp__wifi_set_country__get_packed_size + (const RpcRespWifiSetCountry *message); +size_t rpc__resp__wifi_set_country__pack + (const RpcRespWifiSetCountry *message, uint8_t *out); -size_t wifi_promiscuous_pkt__pack_to_buffer - (const WifiPromiscuousPkt *message, +size_t rpc__resp__wifi_set_country__pack_to_buffer + (const RpcRespWifiSetCountry *message, ProtobufCBuffer *buffer); -WifiPromiscuousPkt * - wifi_promiscuous_pkt__unpack +RpcRespWifiSetCountry * + rpc__resp__wifi_set_country__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_promiscuous_pkt__free_unpacked - (WifiPromiscuousPkt *message, +void rpc__resp__wifi_set_country__free_unpacked + (RpcRespWifiSetCountry *message, ProtobufCAllocator *allocator); -/* WifiPromiscuousFilter methods */ -void wifi_promiscuous_filter__init - (WifiPromiscuousFilter *message); -size_t wifi_promiscuous_filter__get_packed_size - (const WifiPromiscuousFilter *message); -size_t wifi_promiscuous_filter__pack - (const WifiPromiscuousFilter *message, +/* RpcReqWifiGetCountry methods */ +void rpc__req__wifi_get_country__init + (RpcReqWifiGetCountry *message); +size_t rpc__req__wifi_get_country__get_packed_size + (const RpcReqWifiGetCountry *message); +size_t rpc__req__wifi_get_country__pack + (const RpcReqWifiGetCountry *message, uint8_t *out); -size_t wifi_promiscuous_filter__pack_to_buffer - (const WifiPromiscuousFilter *message, +size_t rpc__req__wifi_get_country__pack_to_buffer + (const RpcReqWifiGetCountry *message, ProtobufCBuffer *buffer); -WifiPromiscuousFilter * - wifi_promiscuous_filter__unpack +RpcReqWifiGetCountry * + rpc__req__wifi_get_country__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_promiscuous_filter__free_unpacked - (WifiPromiscuousFilter *message, +void rpc__req__wifi_get_country__free_unpacked + (RpcReqWifiGetCountry *message, ProtobufCAllocator *allocator); -/* WifiCsiConfig methods */ -void wifi_csi_config__init - (WifiCsiConfig *message); -size_t wifi_csi_config__get_packed_size - (const WifiCsiConfig *message); -size_t wifi_csi_config__pack - (const WifiCsiConfig *message, +/* RpcRespWifiGetCountry methods */ +void rpc__resp__wifi_get_country__init + (RpcRespWifiGetCountry *message); +size_t rpc__resp__wifi_get_country__get_packed_size + (const RpcRespWifiGetCountry *message); +size_t rpc__resp__wifi_get_country__pack + (const RpcRespWifiGetCountry *message, uint8_t *out); -size_t wifi_csi_config__pack_to_buffer - (const WifiCsiConfig *message, +size_t rpc__resp__wifi_get_country__pack_to_buffer + (const RpcRespWifiGetCountry *message, ProtobufCBuffer *buffer); -WifiCsiConfig * - wifi_csi_config__unpack +RpcRespWifiGetCountry * + rpc__resp__wifi_get_country__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_csi_config__free_unpacked - (WifiCsiConfig *message, +void rpc__resp__wifi_get_country__free_unpacked + (RpcRespWifiGetCountry *message, ProtobufCAllocator *allocator); -/* WifiCsiInfo methods */ -void wifi_csi_info__init - (WifiCsiInfo *message); -size_t wifi_csi_info__get_packed_size - (const WifiCsiInfo *message); -size_t wifi_csi_info__pack - (const WifiCsiInfo *message, +/* RpcReqWifiApGetStaList methods */ +void rpc__req__wifi_ap_get_sta_list__init + (RpcReqWifiApGetStaList *message); +size_t rpc__req__wifi_ap_get_sta_list__get_packed_size + (const RpcReqWifiApGetStaList *message); +size_t rpc__req__wifi_ap_get_sta_list__pack + (const RpcReqWifiApGetStaList *message, uint8_t *out); -size_t wifi_csi_info__pack_to_buffer - (const WifiCsiInfo *message, +size_t rpc__req__wifi_ap_get_sta_list__pack_to_buffer + (const RpcReqWifiApGetStaList *message, ProtobufCBuffer *buffer); -WifiCsiInfo * - wifi_csi_info__unpack +RpcReqWifiApGetStaList * + rpc__req__wifi_ap_get_sta_list__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_csi_info__free_unpacked - (WifiCsiInfo *message, +void rpc__req__wifi_ap_get_sta_list__free_unpacked + (RpcReqWifiApGetStaList *message, ProtobufCAllocator *allocator); -/* WifiAntGpio methods */ -void wifi_ant_gpio__init - (WifiAntGpio *message); -size_t wifi_ant_gpio__get_packed_size - (const WifiAntGpio *message); -size_t wifi_ant_gpio__pack - (const WifiAntGpio *message, +/* RpcRespWifiApGetStaList methods */ +void rpc__resp__wifi_ap_get_sta_list__init + (RpcRespWifiApGetStaList *message); +size_t rpc__resp__wifi_ap_get_sta_list__get_packed_size + (const RpcRespWifiApGetStaList *message); +size_t rpc__resp__wifi_ap_get_sta_list__pack + (const RpcRespWifiApGetStaList *message, uint8_t *out); -size_t wifi_ant_gpio__pack_to_buffer - (const WifiAntGpio *message, +size_t rpc__resp__wifi_ap_get_sta_list__pack_to_buffer + (const RpcRespWifiApGetStaList *message, ProtobufCBuffer *buffer); -WifiAntGpio * - wifi_ant_gpio__unpack +RpcRespWifiApGetStaList * + rpc__resp__wifi_ap_get_sta_list__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_ant_gpio__free_unpacked - (WifiAntGpio *message, +void rpc__resp__wifi_ap_get_sta_list__free_unpacked + (RpcRespWifiApGetStaList *message, ProtobufCAllocator *allocator); -/* WifiAntGpioConfig methods */ -void wifi_ant_gpio_config__init - (WifiAntGpioConfig *message); -size_t wifi_ant_gpio_config__get_packed_size - (const WifiAntGpioConfig *message); -size_t wifi_ant_gpio_config__pack - (const WifiAntGpioConfig *message, +/* RpcReqWifiApGetStaAid methods */ +void rpc__req__wifi_ap_get_sta_aid__init + (RpcReqWifiApGetStaAid *message); +size_t rpc__req__wifi_ap_get_sta_aid__get_packed_size + (const RpcReqWifiApGetStaAid *message); +size_t rpc__req__wifi_ap_get_sta_aid__pack + (const RpcReqWifiApGetStaAid *message, uint8_t *out); -size_t wifi_ant_gpio_config__pack_to_buffer - (const WifiAntGpioConfig *message, +size_t rpc__req__wifi_ap_get_sta_aid__pack_to_buffer + (const RpcReqWifiApGetStaAid *message, ProtobufCBuffer *buffer); -WifiAntGpioConfig * - wifi_ant_gpio_config__unpack +RpcReqWifiApGetStaAid * + rpc__req__wifi_ap_get_sta_aid__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_ant_gpio_config__free_unpacked - (WifiAntGpioConfig *message, +void rpc__req__wifi_ap_get_sta_aid__free_unpacked + (RpcReqWifiApGetStaAid *message, ProtobufCAllocator *allocator); -/* WifiAntConfig methods */ -void wifi_ant_config__init - (WifiAntConfig *message); -size_t wifi_ant_config__get_packed_size - (const WifiAntConfig *message); -size_t wifi_ant_config__pack - (const WifiAntConfig *message, +/* RpcReqWifiStaGetNegotiatedPhymode methods */ +void rpc__req__wifi_sta_get_negotiated_phymode__init + (RpcReqWifiStaGetNegotiatedPhymode *message); +size_t rpc__req__wifi_sta_get_negotiated_phymode__get_packed_size + (const RpcReqWifiStaGetNegotiatedPhymode *message); +size_t rpc__req__wifi_sta_get_negotiated_phymode__pack + (const RpcReqWifiStaGetNegotiatedPhymode *message, uint8_t *out); -size_t wifi_ant_config__pack_to_buffer - (const WifiAntConfig *message, +size_t rpc__req__wifi_sta_get_negotiated_phymode__pack_to_buffer + (const RpcReqWifiStaGetNegotiatedPhymode *message, ProtobufCBuffer *buffer); -WifiAntConfig * - wifi_ant_config__unpack +RpcReqWifiStaGetNegotiatedPhymode * + rpc__req__wifi_sta_get_negotiated_phymode__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_ant_config__free_unpacked - (WifiAntConfig *message, +void rpc__req__wifi_sta_get_negotiated_phymode__free_unpacked + (RpcReqWifiStaGetNegotiatedPhymode *message, ProtobufCAllocator *allocator); -/* WifiActionTxReq methods */ -void wifi_action_tx_req__init - (WifiActionTxReq *message); -size_t wifi_action_tx_req__get_packed_size - (const WifiActionTxReq *message); -size_t wifi_action_tx_req__pack - (const WifiActionTxReq *message, +/* RpcRespWifiStaGetNegotiatedPhymode methods */ +void rpc__resp__wifi_sta_get_negotiated_phymode__init + (RpcRespWifiStaGetNegotiatedPhymode *message); +size_t rpc__resp__wifi_sta_get_negotiated_phymode__get_packed_size + (const RpcRespWifiStaGetNegotiatedPhymode *message); +size_t rpc__resp__wifi_sta_get_negotiated_phymode__pack + (const RpcRespWifiStaGetNegotiatedPhymode *message, uint8_t *out); -size_t wifi_action_tx_req__pack_to_buffer - (const WifiActionTxReq *message, +size_t rpc__resp__wifi_sta_get_negotiated_phymode__pack_to_buffer + (const RpcRespWifiStaGetNegotiatedPhymode *message, ProtobufCBuffer *buffer); -WifiActionTxReq * - wifi_action_tx_req__unpack +RpcRespWifiStaGetNegotiatedPhymode * + rpc__resp__wifi_sta_get_negotiated_phymode__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_action_tx_req__free_unpacked - (WifiActionTxReq *message, +void rpc__resp__wifi_sta_get_negotiated_phymode__free_unpacked + (RpcRespWifiStaGetNegotiatedPhymode *message, ProtobufCAllocator *allocator); -/* WifiFtmInitiatorCfg methods */ -void wifi_ftm_initiator_cfg__init - (WifiFtmInitiatorCfg *message); -size_t wifi_ftm_initiator_cfg__get_packed_size - (const WifiFtmInitiatorCfg *message); -size_t wifi_ftm_initiator_cfg__pack - (const WifiFtmInitiatorCfg *message, +/* RpcRespWifiApGetStaAid methods */ +void rpc__resp__wifi_ap_get_sta_aid__init + (RpcRespWifiApGetStaAid *message); +size_t rpc__resp__wifi_ap_get_sta_aid__get_packed_size + (const RpcRespWifiApGetStaAid *message); +size_t rpc__resp__wifi_ap_get_sta_aid__pack + (const RpcRespWifiApGetStaAid *message, uint8_t *out); -size_t wifi_ftm_initiator_cfg__pack_to_buffer - (const WifiFtmInitiatorCfg *message, +size_t rpc__resp__wifi_ap_get_sta_aid__pack_to_buffer + (const RpcRespWifiApGetStaAid *message, ProtobufCBuffer *buffer); -WifiFtmInitiatorCfg * - wifi_ftm_initiator_cfg__unpack +RpcRespWifiApGetStaAid * + rpc__resp__wifi_ap_get_sta_aid__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_ftm_initiator_cfg__free_unpacked - (WifiFtmInitiatorCfg *message, +void rpc__resp__wifi_ap_get_sta_aid__free_unpacked + (RpcRespWifiApGetStaAid *message, ProtobufCAllocator *allocator); -/* WifiEventStaScanDone methods */ -void wifi_event_sta_scan_done__init - (WifiEventStaScanDone *message); -size_t wifi_event_sta_scan_done__get_packed_size - (const WifiEventStaScanDone *message); -size_t wifi_event_sta_scan_done__pack - (const WifiEventStaScanDone *message, +/* RpcReqWifiStaGetRssi methods */ +void rpc__req__wifi_sta_get_rssi__init + (RpcReqWifiStaGetRssi *message); +size_t rpc__req__wifi_sta_get_rssi__get_packed_size + (const RpcReqWifiStaGetRssi *message); +size_t rpc__req__wifi_sta_get_rssi__pack + (const RpcReqWifiStaGetRssi *message, uint8_t *out); -size_t wifi_event_sta_scan_done__pack_to_buffer - (const WifiEventStaScanDone *message, +size_t rpc__req__wifi_sta_get_rssi__pack_to_buffer + (const RpcReqWifiStaGetRssi *message, ProtobufCBuffer *buffer); -WifiEventStaScanDone * - wifi_event_sta_scan_done__unpack +RpcReqWifiStaGetRssi * + rpc__req__wifi_sta_get_rssi__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_event_sta_scan_done__free_unpacked - (WifiEventStaScanDone *message, +void rpc__req__wifi_sta_get_rssi__free_unpacked + (RpcReqWifiStaGetRssi *message, ProtobufCAllocator *allocator); -/* WifiEventStaConnected methods */ -void wifi_event_sta_connected__init - (WifiEventStaConnected *message); -size_t wifi_event_sta_connected__get_packed_size - (const WifiEventStaConnected *message); -size_t wifi_event_sta_connected__pack - (const WifiEventStaConnected *message, +/* RpcRespWifiStaGetRssi methods */ +void rpc__resp__wifi_sta_get_rssi__init + (RpcRespWifiStaGetRssi *message); +size_t rpc__resp__wifi_sta_get_rssi__get_packed_size + (const RpcRespWifiStaGetRssi *message); +size_t rpc__resp__wifi_sta_get_rssi__pack + (const RpcRespWifiStaGetRssi *message, uint8_t *out); -size_t wifi_event_sta_connected__pack_to_buffer - (const WifiEventStaConnected *message, +size_t rpc__resp__wifi_sta_get_rssi__pack_to_buffer + (const RpcRespWifiStaGetRssi *message, ProtobufCBuffer *buffer); -WifiEventStaConnected * - wifi_event_sta_connected__unpack +RpcRespWifiStaGetRssi * + rpc__resp__wifi_sta_get_rssi__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_event_sta_connected__free_unpacked - (WifiEventStaConnected *message, +void rpc__resp__wifi_sta_get_rssi__free_unpacked + (RpcRespWifiStaGetRssi *message, ProtobufCAllocator *allocator); -/* WifiEventStaDisconnected methods */ -void wifi_event_sta_disconnected__init - (WifiEventStaDisconnected *message); -size_t wifi_event_sta_disconnected__get_packed_size - (const WifiEventStaDisconnected *message); -size_t wifi_event_sta_disconnected__pack - (const WifiEventStaDisconnected *message, +/* RpcReqWifiStaGetAid methods */ +void rpc__req__wifi_sta_get_aid__init + (RpcReqWifiStaGetAid *message); +size_t rpc__req__wifi_sta_get_aid__get_packed_size + (const RpcReqWifiStaGetAid *message); +size_t rpc__req__wifi_sta_get_aid__pack + (const RpcReqWifiStaGetAid *message, uint8_t *out); -size_t wifi_event_sta_disconnected__pack_to_buffer - (const WifiEventStaDisconnected *message, +size_t rpc__req__wifi_sta_get_aid__pack_to_buffer + (const RpcReqWifiStaGetAid *message, ProtobufCBuffer *buffer); -WifiEventStaDisconnected * - wifi_event_sta_disconnected__unpack +RpcReqWifiStaGetAid * + rpc__req__wifi_sta_get_aid__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_event_sta_disconnected__free_unpacked - (WifiEventStaDisconnected *message, +void rpc__req__wifi_sta_get_aid__free_unpacked + (RpcReqWifiStaGetAid *message, ProtobufCAllocator *allocator); -/* WifiEventStaAuthmodeChange methods */ -void wifi_event_sta_authmode_change__init - (WifiEventStaAuthmodeChange *message); -size_t wifi_event_sta_authmode_change__get_packed_size - (const WifiEventStaAuthmodeChange *message); -size_t wifi_event_sta_authmode_change__pack - (const WifiEventStaAuthmodeChange *message, +/* RpcRespWifiStaGetAid methods */ +void rpc__resp__wifi_sta_get_aid__init + (RpcRespWifiStaGetAid *message); +size_t rpc__resp__wifi_sta_get_aid__get_packed_size + (const RpcRespWifiStaGetAid *message); +size_t rpc__resp__wifi_sta_get_aid__pack + (const RpcRespWifiStaGetAid *message, uint8_t *out); -size_t wifi_event_sta_authmode_change__pack_to_buffer - (const WifiEventStaAuthmodeChange *message, +size_t rpc__resp__wifi_sta_get_aid__pack_to_buffer + (const RpcRespWifiStaGetAid *message, ProtobufCBuffer *buffer); -WifiEventStaAuthmodeChange * - wifi_event_sta_authmode_change__unpack +RpcRespWifiStaGetAid * + rpc__resp__wifi_sta_get_aid__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_event_sta_authmode_change__free_unpacked - (WifiEventStaAuthmodeChange *message, +void rpc__resp__wifi_sta_get_aid__free_unpacked + (RpcRespWifiStaGetAid *message, ProtobufCAllocator *allocator); -/* WifiEventStaWpsErPin methods */ -void wifi_event_sta_wps_er_pin__init - (WifiEventStaWpsErPin *message); -size_t wifi_event_sta_wps_er_pin__get_packed_size - (const WifiEventStaWpsErPin *message); -size_t wifi_event_sta_wps_er_pin__pack - (const WifiEventStaWpsErPin *message, +/* RpcReqWifiSetProtocols methods */ +void rpc__req__wifi_set_protocols__init + (RpcReqWifiSetProtocols *message); +size_t rpc__req__wifi_set_protocols__get_packed_size + (const RpcReqWifiSetProtocols *message); +size_t rpc__req__wifi_set_protocols__pack + (const RpcReqWifiSetProtocols *message, uint8_t *out); -size_t wifi_event_sta_wps_er_pin__pack_to_buffer - (const WifiEventStaWpsErPin *message, +size_t rpc__req__wifi_set_protocols__pack_to_buffer + (const RpcReqWifiSetProtocols *message, ProtobufCBuffer *buffer); -WifiEventStaWpsErPin * - wifi_event_sta_wps_er_pin__unpack +RpcReqWifiSetProtocols * + rpc__req__wifi_set_protocols__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_event_sta_wps_er_pin__free_unpacked - (WifiEventStaWpsErPin *message, +void rpc__req__wifi_set_protocols__free_unpacked + (RpcReqWifiSetProtocols *message, ProtobufCAllocator *allocator); -/* ApCred methods */ -void ap_cred__init - (ApCred *message); -size_t ap_cred__get_packed_size - (const ApCred *message); -size_t ap_cred__pack - (const ApCred *message, +/* RpcRespWifiSetProtocols methods */ +void rpc__resp__wifi_set_protocols__init + (RpcRespWifiSetProtocols *message); +size_t rpc__resp__wifi_set_protocols__get_packed_size + (const RpcRespWifiSetProtocols *message); +size_t rpc__resp__wifi_set_protocols__pack + (const RpcRespWifiSetProtocols *message, uint8_t *out); -size_t ap_cred__pack_to_buffer - (const ApCred *message, +size_t rpc__resp__wifi_set_protocols__pack_to_buffer + (const RpcRespWifiSetProtocols *message, ProtobufCBuffer *buffer); -ApCred * - ap_cred__unpack +RpcRespWifiSetProtocols * + rpc__resp__wifi_set_protocols__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void ap_cred__free_unpacked - (ApCred *message, +void rpc__resp__wifi_set_protocols__free_unpacked + (RpcRespWifiSetProtocols *message, ProtobufCAllocator *allocator); -/* WifiEventStaWpsErSuccess methods */ -void wifi_event_sta_wps_er_success__init - (WifiEventStaWpsErSuccess *message); -size_t wifi_event_sta_wps_er_success__get_packed_size - (const WifiEventStaWpsErSuccess *message); -size_t wifi_event_sta_wps_er_success__pack - (const WifiEventStaWpsErSuccess *message, +/* RpcReqWifiGetProtocols methods */ +void rpc__req__wifi_get_protocols__init + (RpcReqWifiGetProtocols *message); +size_t rpc__req__wifi_get_protocols__get_packed_size + (const RpcReqWifiGetProtocols *message); +size_t rpc__req__wifi_get_protocols__pack + (const RpcReqWifiGetProtocols *message, uint8_t *out); -size_t wifi_event_sta_wps_er_success__pack_to_buffer - (const WifiEventStaWpsErSuccess *message, +size_t rpc__req__wifi_get_protocols__pack_to_buffer + (const RpcReqWifiGetProtocols *message, ProtobufCBuffer *buffer); -WifiEventStaWpsErSuccess * - wifi_event_sta_wps_er_success__unpack +RpcReqWifiGetProtocols * + rpc__req__wifi_get_protocols__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_event_sta_wps_er_success__free_unpacked - (WifiEventStaWpsErSuccess *message, +void rpc__req__wifi_get_protocols__free_unpacked + (RpcReqWifiGetProtocols *message, ProtobufCAllocator *allocator); -/* WifiEventApProbeReqRx methods */ -void wifi_event_ap_probe_req_rx__init - (WifiEventApProbeReqRx *message); -size_t wifi_event_ap_probe_req_rx__get_packed_size - (const WifiEventApProbeReqRx *message); -size_t wifi_event_ap_probe_req_rx__pack - (const WifiEventApProbeReqRx *message, +/* RpcRespWifiGetProtocols methods */ +void rpc__resp__wifi_get_protocols__init + (RpcRespWifiGetProtocols *message); +size_t rpc__resp__wifi_get_protocols__get_packed_size + (const RpcRespWifiGetProtocols *message); +size_t rpc__resp__wifi_get_protocols__pack + (const RpcRespWifiGetProtocols *message, uint8_t *out); -size_t wifi_event_ap_probe_req_rx__pack_to_buffer - (const WifiEventApProbeReqRx *message, +size_t rpc__resp__wifi_get_protocols__pack_to_buffer + (const RpcRespWifiGetProtocols *message, ProtobufCBuffer *buffer); -WifiEventApProbeReqRx * - wifi_event_ap_probe_req_rx__unpack +RpcRespWifiGetProtocols * + rpc__resp__wifi_get_protocols__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_event_ap_probe_req_rx__free_unpacked - (WifiEventApProbeReqRx *message, +void rpc__resp__wifi_get_protocols__free_unpacked + (RpcRespWifiGetProtocols *message, ProtobufCAllocator *allocator); -/* WifiEventBssRssiLow methods */ -void wifi_event_bss_rssi_low__init - (WifiEventBssRssiLow *message); -size_t wifi_event_bss_rssi_low__get_packed_size - (const WifiEventBssRssiLow *message); -size_t wifi_event_bss_rssi_low__pack - (const WifiEventBssRssiLow *message, +/* RpcReqWifiSetBandwidths methods */ +void rpc__req__wifi_set_bandwidths__init + (RpcReqWifiSetBandwidths *message); +size_t rpc__req__wifi_set_bandwidths__get_packed_size + (const RpcReqWifiSetBandwidths *message); +size_t rpc__req__wifi_set_bandwidths__pack + (const RpcReqWifiSetBandwidths *message, uint8_t *out); -size_t wifi_event_bss_rssi_low__pack_to_buffer - (const WifiEventBssRssiLow *message, +size_t rpc__req__wifi_set_bandwidths__pack_to_buffer + (const RpcReqWifiSetBandwidths *message, ProtobufCBuffer *buffer); -WifiEventBssRssiLow * - wifi_event_bss_rssi_low__unpack +RpcReqWifiSetBandwidths * + rpc__req__wifi_set_bandwidths__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_event_bss_rssi_low__free_unpacked - (WifiEventBssRssiLow *message, +void rpc__req__wifi_set_bandwidths__free_unpacked + (RpcReqWifiSetBandwidths *message, ProtobufCAllocator *allocator); -/* WifiFtmReportEntry methods */ -void wifi_ftm_report_entry__init - (WifiFtmReportEntry *message); -size_t wifi_ftm_report_entry__get_packed_size - (const WifiFtmReportEntry *message); -size_t wifi_ftm_report_entry__pack - (const WifiFtmReportEntry *message, +/* RpcRespWifiSetBandwidths methods */ +void rpc__resp__wifi_set_bandwidths__init + (RpcRespWifiSetBandwidths *message); +size_t rpc__resp__wifi_set_bandwidths__get_packed_size + (const RpcRespWifiSetBandwidths *message); +size_t rpc__resp__wifi_set_bandwidths__pack + (const RpcRespWifiSetBandwidths *message, uint8_t *out); -size_t wifi_ftm_report_entry__pack_to_buffer - (const WifiFtmReportEntry *message, +size_t rpc__resp__wifi_set_bandwidths__pack_to_buffer + (const RpcRespWifiSetBandwidths *message, ProtobufCBuffer *buffer); -WifiFtmReportEntry * - wifi_ftm_report_entry__unpack +RpcRespWifiSetBandwidths * + rpc__resp__wifi_set_bandwidths__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_ftm_report_entry__free_unpacked - (WifiFtmReportEntry *message, +void rpc__resp__wifi_set_bandwidths__free_unpacked + (RpcRespWifiSetBandwidths *message, ProtobufCAllocator *allocator); -/* WifiEventFtmReport methods */ -void wifi_event_ftm_report__init - (WifiEventFtmReport *message); -size_t wifi_event_ftm_report__get_packed_size - (const WifiEventFtmReport *message); -size_t wifi_event_ftm_report__pack - (const WifiEventFtmReport *message, +/* RpcReqWifiGetBandwidths methods */ +void rpc__req__wifi_get_bandwidths__init + (RpcReqWifiGetBandwidths *message); +size_t rpc__req__wifi_get_bandwidths__get_packed_size + (const RpcReqWifiGetBandwidths *message); +size_t rpc__req__wifi_get_bandwidths__pack + (const RpcReqWifiGetBandwidths *message, uint8_t *out); -size_t wifi_event_ftm_report__pack_to_buffer - (const WifiEventFtmReport *message, +size_t rpc__req__wifi_get_bandwidths__pack_to_buffer + (const RpcReqWifiGetBandwidths *message, ProtobufCBuffer *buffer); -WifiEventFtmReport * - wifi_event_ftm_report__unpack +RpcReqWifiGetBandwidths * + rpc__req__wifi_get_bandwidths__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_event_ftm_report__free_unpacked - (WifiEventFtmReport *message, +void rpc__req__wifi_get_bandwidths__free_unpacked + (RpcReqWifiGetBandwidths *message, ProtobufCAllocator *allocator); -/* WifiEventActionTxStatus methods */ -void wifi_event_action_tx_status__init - (WifiEventActionTxStatus *message); -size_t wifi_event_action_tx_status__get_packed_size - (const WifiEventActionTxStatus *message); -size_t wifi_event_action_tx_status__pack - (const WifiEventActionTxStatus *message, +/* RpcRespWifiGetBandwidths methods */ +void rpc__resp__wifi_get_bandwidths__init + (RpcRespWifiGetBandwidths *message); +size_t rpc__resp__wifi_get_bandwidths__get_packed_size + (const RpcRespWifiGetBandwidths *message); +size_t rpc__resp__wifi_get_bandwidths__pack + (const RpcRespWifiGetBandwidths *message, uint8_t *out); -size_t wifi_event_action_tx_status__pack_to_buffer - (const WifiEventActionTxStatus *message, +size_t rpc__resp__wifi_get_bandwidths__pack_to_buffer + (const RpcRespWifiGetBandwidths *message, ProtobufCBuffer *buffer); -WifiEventActionTxStatus * - wifi_event_action_tx_status__unpack +RpcRespWifiGetBandwidths * + rpc__resp__wifi_get_bandwidths__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_event_action_tx_status__free_unpacked - (WifiEventActionTxStatus *message, +void rpc__resp__wifi_get_bandwidths__free_unpacked + (RpcRespWifiGetBandwidths *message, ProtobufCAllocator *allocator); -/* WifiEventRocDone methods */ -void wifi_event_roc_done__init - (WifiEventRocDone *message); -size_t wifi_event_roc_done__get_packed_size - (const WifiEventRocDone *message); -size_t wifi_event_roc_done__pack - (const WifiEventRocDone *message, +/* RpcReqWifiSetBand methods */ +void rpc__req__wifi_set_band__init + (RpcReqWifiSetBand *message); +size_t rpc__req__wifi_set_band__get_packed_size + (const RpcReqWifiSetBand *message); +size_t rpc__req__wifi_set_band__pack + (const RpcReqWifiSetBand *message, uint8_t *out); -size_t wifi_event_roc_done__pack_to_buffer - (const WifiEventRocDone *message, +size_t rpc__req__wifi_set_band__pack_to_buffer + (const RpcReqWifiSetBand *message, ProtobufCBuffer *buffer); -WifiEventRocDone * - wifi_event_roc_done__unpack +RpcReqWifiSetBand * + rpc__req__wifi_set_band__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_event_roc_done__free_unpacked - (WifiEventRocDone *message, +void rpc__req__wifi_set_band__free_unpacked + (RpcReqWifiSetBand *message, ProtobufCAllocator *allocator); -/* WifiEventApWpsRgPin methods */ -void wifi_event_ap_wps_rg_pin__init - (WifiEventApWpsRgPin *message); -size_t wifi_event_ap_wps_rg_pin__get_packed_size - (const WifiEventApWpsRgPin *message); -size_t wifi_event_ap_wps_rg_pin__pack - (const WifiEventApWpsRgPin *message, +/* RpcRespWifiSetBand methods */ +void rpc__resp__wifi_set_band__init + (RpcRespWifiSetBand *message); +size_t rpc__resp__wifi_set_band__get_packed_size + (const RpcRespWifiSetBand *message); +size_t rpc__resp__wifi_set_band__pack + (const RpcRespWifiSetBand *message, uint8_t *out); -size_t wifi_event_ap_wps_rg_pin__pack_to_buffer - (const WifiEventApWpsRgPin *message, +size_t rpc__resp__wifi_set_band__pack_to_buffer + (const RpcRespWifiSetBand *message, ProtobufCBuffer *buffer); -WifiEventApWpsRgPin * - wifi_event_ap_wps_rg_pin__unpack +RpcRespWifiSetBand * + rpc__resp__wifi_set_band__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_event_ap_wps_rg_pin__free_unpacked - (WifiEventApWpsRgPin *message, +void rpc__resp__wifi_set_band__free_unpacked + (RpcRespWifiSetBand *message, ProtobufCAllocator *allocator); -/* WifiEventApWpsRgFailReason methods */ -void wifi_event_ap_wps_rg_fail_reason__init - (WifiEventApWpsRgFailReason *message); -size_t wifi_event_ap_wps_rg_fail_reason__get_packed_size - (const WifiEventApWpsRgFailReason *message); -size_t wifi_event_ap_wps_rg_fail_reason__pack - (const WifiEventApWpsRgFailReason *message, +/* RpcReqWifiGetBand methods */ +void rpc__req__wifi_get_band__init + (RpcReqWifiGetBand *message); +size_t rpc__req__wifi_get_band__get_packed_size + (const RpcReqWifiGetBand *message); +size_t rpc__req__wifi_get_band__pack + (const RpcReqWifiGetBand *message, uint8_t *out); -size_t wifi_event_ap_wps_rg_fail_reason__pack_to_buffer - (const WifiEventApWpsRgFailReason *message, +size_t rpc__req__wifi_get_band__pack_to_buffer + (const RpcReqWifiGetBand *message, ProtobufCBuffer *buffer); -WifiEventApWpsRgFailReason * - wifi_event_ap_wps_rg_fail_reason__unpack +RpcReqWifiGetBand * + rpc__req__wifi_get_band__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_event_ap_wps_rg_fail_reason__free_unpacked - (WifiEventApWpsRgFailReason *message, +void rpc__req__wifi_get_band__free_unpacked + (RpcReqWifiGetBand *message, ProtobufCAllocator *allocator); -/* WifiEventApWpsRgSuccess methods */ -void wifi_event_ap_wps_rg_success__init - (WifiEventApWpsRgSuccess *message); -size_t wifi_event_ap_wps_rg_success__get_packed_size - (const WifiEventApWpsRgSuccess *message); -size_t wifi_event_ap_wps_rg_success__pack - (const WifiEventApWpsRgSuccess *message, +/* RpcRespWifiGetBand methods */ +void rpc__resp__wifi_get_band__init + (RpcRespWifiGetBand *message); +size_t rpc__resp__wifi_get_band__get_packed_size + (const RpcRespWifiGetBand *message); +size_t rpc__resp__wifi_get_band__pack + (const RpcRespWifiGetBand *message, uint8_t *out); -size_t wifi_event_ap_wps_rg_success__pack_to_buffer - (const WifiEventApWpsRgSuccess *message, +size_t rpc__resp__wifi_get_band__pack_to_buffer + (const RpcRespWifiGetBand *message, ProtobufCBuffer *buffer); -WifiEventApWpsRgSuccess * - wifi_event_ap_wps_rg_success__unpack +RpcRespWifiGetBand * + rpc__resp__wifi_get_band__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_event_ap_wps_rg_success__free_unpacked - (WifiEventApWpsRgSuccess *message, +void rpc__resp__wifi_get_band__free_unpacked + (RpcRespWifiGetBand *message, ProtobufCAllocator *allocator); -/* WifiProtocols methods */ -void wifi_protocols__init - (WifiProtocols *message); -size_t wifi_protocols__get_packed_size - (const WifiProtocols *message); -size_t wifi_protocols__pack - (const WifiProtocols *message, +/* RpcReqWifiSetBandMode methods */ +void rpc__req__wifi_set_band_mode__init + (RpcReqWifiSetBandMode *message); +size_t rpc__req__wifi_set_band_mode__get_packed_size + (const RpcReqWifiSetBandMode *message); +size_t rpc__req__wifi_set_band_mode__pack + (const RpcReqWifiSetBandMode *message, uint8_t *out); -size_t wifi_protocols__pack_to_buffer - (const WifiProtocols *message, +size_t rpc__req__wifi_set_band_mode__pack_to_buffer + (const RpcReqWifiSetBandMode *message, ProtobufCBuffer *buffer); -WifiProtocols * - wifi_protocols__unpack +RpcReqWifiSetBandMode * + rpc__req__wifi_set_band_mode__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_protocols__free_unpacked - (WifiProtocols *message, +void rpc__req__wifi_set_band_mode__free_unpacked + (RpcReqWifiSetBandMode *message, ProtobufCAllocator *allocator); -/* WifiBandwidths methods */ -void wifi_bandwidths__init - (WifiBandwidths *message); -size_t wifi_bandwidths__get_packed_size - (const WifiBandwidths *message); -size_t wifi_bandwidths__pack - (const WifiBandwidths *message, +/* RpcRespWifiSetBandMode methods */ +void rpc__resp__wifi_set_band_mode__init + (RpcRespWifiSetBandMode *message); +size_t rpc__resp__wifi_set_band_mode__get_packed_size + (const RpcRespWifiSetBandMode *message); +size_t rpc__resp__wifi_set_band_mode__pack + (const RpcRespWifiSetBandMode *message, uint8_t *out); -size_t wifi_bandwidths__pack_to_buffer - (const WifiBandwidths *message, +size_t rpc__resp__wifi_set_band_mode__pack_to_buffer + (const RpcRespWifiSetBandMode *message, ProtobufCBuffer *buffer); -WifiBandwidths * - wifi_bandwidths__unpack +RpcRespWifiSetBandMode * + rpc__resp__wifi_set_band_mode__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void wifi_bandwidths__free_unpacked - (WifiBandwidths *message, +void rpc__resp__wifi_set_band_mode__free_unpacked + (RpcRespWifiSetBandMode *message, ProtobufCAllocator *allocator); -/* ConnectedSTAList methods */ -void connected_stalist__init - (ConnectedSTAList *message); -size_t connected_stalist__get_packed_size - (const ConnectedSTAList *message); -size_t connected_stalist__pack - (const ConnectedSTAList *message, +/* RpcReqWifiGetBandMode methods */ +void rpc__req__wifi_get_band_mode__init + (RpcReqWifiGetBandMode *message); +size_t rpc__req__wifi_get_band_mode__get_packed_size + (const RpcReqWifiGetBandMode *message); +size_t rpc__req__wifi_get_band_mode__pack + (const RpcReqWifiGetBandMode *message, uint8_t *out); -size_t connected_stalist__pack_to_buffer - (const ConnectedSTAList *message, +size_t rpc__req__wifi_get_band_mode__pack_to_buffer + (const RpcReqWifiGetBandMode *message, ProtobufCBuffer *buffer); -ConnectedSTAList * - connected_stalist__unpack +RpcReqWifiGetBandMode * + rpc__req__wifi_get_band_mode__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void connected_stalist__free_unpacked - (ConnectedSTAList *message, +void rpc__req__wifi_get_band_mode__free_unpacked + (RpcReqWifiGetBandMode *message, ProtobufCAllocator *allocator); -/* RpcReqGetMacAddress methods */ -void rpc__req__get_mac_address__init - (RpcReqGetMacAddress *message); -size_t rpc__req__get_mac_address__get_packed_size - (const RpcReqGetMacAddress *message); -size_t rpc__req__get_mac_address__pack - (const RpcReqGetMacAddress *message, +/* RpcRespWifiGetBandMode methods */ +void rpc__resp__wifi_get_band_mode__init + (RpcRespWifiGetBandMode *message); +size_t rpc__resp__wifi_get_band_mode__get_packed_size + (const RpcRespWifiGetBandMode *message); +size_t rpc__resp__wifi_get_band_mode__pack + (const RpcRespWifiGetBandMode *message, uint8_t *out); -size_t rpc__req__get_mac_address__pack_to_buffer - (const RpcReqGetMacAddress *message, +size_t rpc__resp__wifi_get_band_mode__pack_to_buffer + (const RpcRespWifiGetBandMode *message, ProtobufCBuffer *buffer); -RpcReqGetMacAddress * - rpc__req__get_mac_address__unpack +RpcRespWifiGetBandMode * + rpc__resp__wifi_get_band_mode__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__get_mac_address__free_unpacked - (RpcReqGetMacAddress *message, +void rpc__resp__wifi_get_band_mode__free_unpacked + (RpcRespWifiGetBandMode *message, ProtobufCAllocator *allocator); -/* RpcRespGetMacAddress methods */ -void rpc__resp__get_mac_address__init - (RpcRespGetMacAddress *message); -size_t rpc__resp__get_mac_address__get_packed_size - (const RpcRespGetMacAddress *message); -size_t rpc__resp__get_mac_address__pack - (const RpcRespGetMacAddress *message, +/* RpcReqWifiSetInactiveTime methods */ +void rpc__req__wifi_set_inactive_time__init + (RpcReqWifiSetInactiveTime *message); +size_t rpc__req__wifi_set_inactive_time__get_packed_size + (const RpcReqWifiSetInactiveTime *message); +size_t rpc__req__wifi_set_inactive_time__pack + (const RpcReqWifiSetInactiveTime *message, + uint8_t *out); +size_t rpc__req__wifi_set_inactive_time__pack_to_buffer + (const RpcReqWifiSetInactiveTime *message, + ProtobufCBuffer *buffer); +RpcReqWifiSetInactiveTime * + rpc__req__wifi_set_inactive_time__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__wifi_set_inactive_time__free_unpacked + (RpcReqWifiSetInactiveTime *message, + ProtobufCAllocator *allocator); +/* RpcRespWifiSetInactiveTime methods */ +void rpc__resp__wifi_set_inactive_time__init + (RpcRespWifiSetInactiveTime *message); +size_t rpc__resp__wifi_set_inactive_time__get_packed_size + (const RpcRespWifiSetInactiveTime *message); +size_t rpc__resp__wifi_set_inactive_time__pack + (const RpcRespWifiSetInactiveTime *message, uint8_t *out); -size_t rpc__resp__get_mac_address__pack_to_buffer - (const RpcRespGetMacAddress *message, +size_t rpc__resp__wifi_set_inactive_time__pack_to_buffer + (const RpcRespWifiSetInactiveTime *message, ProtobufCBuffer *buffer); -RpcRespGetMacAddress * - rpc__resp__get_mac_address__unpack +RpcRespWifiSetInactiveTime * + rpc__resp__wifi_set_inactive_time__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__get_mac_address__free_unpacked - (RpcRespGetMacAddress *message, +void rpc__resp__wifi_set_inactive_time__free_unpacked + (RpcRespWifiSetInactiveTime *message, ProtobufCAllocator *allocator); -/* RpcReqGetMode methods */ -void rpc__req__get_mode__init - (RpcReqGetMode *message); -size_t rpc__req__get_mode__get_packed_size - (const RpcReqGetMode *message); -size_t rpc__req__get_mode__pack - (const RpcReqGetMode *message, +/* RpcReqWifiGetInactiveTime methods */ +void rpc__req__wifi_get_inactive_time__init + (RpcReqWifiGetInactiveTime *message); +size_t rpc__req__wifi_get_inactive_time__get_packed_size + (const RpcReqWifiGetInactiveTime *message); +size_t rpc__req__wifi_get_inactive_time__pack + (const RpcReqWifiGetInactiveTime *message, uint8_t *out); -size_t rpc__req__get_mode__pack_to_buffer - (const RpcReqGetMode *message, +size_t rpc__req__wifi_get_inactive_time__pack_to_buffer + (const RpcReqWifiGetInactiveTime *message, ProtobufCBuffer *buffer); -RpcReqGetMode * - rpc__req__get_mode__unpack +RpcReqWifiGetInactiveTime * + rpc__req__wifi_get_inactive_time__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__get_mode__free_unpacked - (RpcReqGetMode *message, +void rpc__req__wifi_get_inactive_time__free_unpacked + (RpcReqWifiGetInactiveTime *message, ProtobufCAllocator *allocator); -/* RpcRespGetMode methods */ -void rpc__resp__get_mode__init - (RpcRespGetMode *message); -size_t rpc__resp__get_mode__get_packed_size - (const RpcRespGetMode *message); -size_t rpc__resp__get_mode__pack - (const RpcRespGetMode *message, +/* RpcRespWifiGetInactiveTime methods */ +void rpc__resp__wifi_get_inactive_time__init + (RpcRespWifiGetInactiveTime *message); +size_t rpc__resp__wifi_get_inactive_time__get_packed_size + (const RpcRespWifiGetInactiveTime *message); +size_t rpc__resp__wifi_get_inactive_time__pack + (const RpcRespWifiGetInactiveTime *message, uint8_t *out); -size_t rpc__resp__get_mode__pack_to_buffer - (const RpcRespGetMode *message, +size_t rpc__resp__wifi_get_inactive_time__pack_to_buffer + (const RpcRespWifiGetInactiveTime *message, ProtobufCBuffer *buffer); -RpcRespGetMode * - rpc__resp__get_mode__unpack +RpcRespWifiGetInactiveTime * + rpc__resp__wifi_get_inactive_time__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__get_mode__free_unpacked - (RpcRespGetMode *message, +void rpc__resp__wifi_get_inactive_time__free_unpacked + (RpcRespWifiGetInactiveTime *message, ProtobufCAllocator *allocator); -/* RpcReqSetMode methods */ -void rpc__req__set_mode__init - (RpcReqSetMode *message); -size_t rpc__req__set_mode__get_packed_size - (const RpcReqSetMode *message); -size_t rpc__req__set_mode__pack - (const RpcReqSetMode *message, +/* RpcReqWifiStaItwtSetup methods */ +void rpc__req__wifi_sta_itwt_setup__init + (RpcReqWifiStaItwtSetup *message); +size_t rpc__req__wifi_sta_itwt_setup__get_packed_size + (const RpcReqWifiStaItwtSetup *message); +size_t rpc__req__wifi_sta_itwt_setup__pack + (const RpcReqWifiStaItwtSetup *message, uint8_t *out); -size_t rpc__req__set_mode__pack_to_buffer - (const RpcReqSetMode *message, +size_t rpc__req__wifi_sta_itwt_setup__pack_to_buffer + (const RpcReqWifiStaItwtSetup *message, ProtobufCBuffer *buffer); -RpcReqSetMode * - rpc__req__set_mode__unpack +RpcReqWifiStaItwtSetup * + rpc__req__wifi_sta_itwt_setup__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__set_mode__free_unpacked - (RpcReqSetMode *message, +void rpc__req__wifi_sta_itwt_setup__free_unpacked + (RpcReqWifiStaItwtSetup *message, ProtobufCAllocator *allocator); -/* RpcRespSetMode methods */ -void rpc__resp__set_mode__init - (RpcRespSetMode *message); -size_t rpc__resp__set_mode__get_packed_size - (const RpcRespSetMode *message); -size_t rpc__resp__set_mode__pack - (const RpcRespSetMode *message, +/* RpcRespWifiStaItwtSetup methods */ +void rpc__resp__wifi_sta_itwt_setup__init + (RpcRespWifiStaItwtSetup *message); +size_t rpc__resp__wifi_sta_itwt_setup__get_packed_size + (const RpcRespWifiStaItwtSetup *message); +size_t rpc__resp__wifi_sta_itwt_setup__pack + (const RpcRespWifiStaItwtSetup *message, uint8_t *out); -size_t rpc__resp__set_mode__pack_to_buffer - (const RpcRespSetMode *message, +size_t rpc__resp__wifi_sta_itwt_setup__pack_to_buffer + (const RpcRespWifiStaItwtSetup *message, ProtobufCBuffer *buffer); -RpcRespSetMode * - rpc__resp__set_mode__unpack +RpcRespWifiStaItwtSetup * + rpc__resp__wifi_sta_itwt_setup__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__set_mode__free_unpacked - (RpcRespSetMode *message, +void rpc__resp__wifi_sta_itwt_setup__free_unpacked + (RpcRespWifiStaItwtSetup *message, ProtobufCAllocator *allocator); -/* RpcReqGetPs methods */ -void rpc__req__get_ps__init - (RpcReqGetPs *message); -size_t rpc__req__get_ps__get_packed_size - (const RpcReqGetPs *message); -size_t rpc__req__get_ps__pack - (const RpcReqGetPs *message, +/* RpcReqWifiStaItwtTeardown methods */ +void rpc__req__wifi_sta_itwt_teardown__init + (RpcReqWifiStaItwtTeardown *message); +size_t rpc__req__wifi_sta_itwt_teardown__get_packed_size + (const RpcReqWifiStaItwtTeardown *message); +size_t rpc__req__wifi_sta_itwt_teardown__pack + (const RpcReqWifiStaItwtTeardown *message, uint8_t *out); -size_t rpc__req__get_ps__pack_to_buffer - (const RpcReqGetPs *message, +size_t rpc__req__wifi_sta_itwt_teardown__pack_to_buffer + (const RpcReqWifiStaItwtTeardown *message, ProtobufCBuffer *buffer); -RpcReqGetPs * - rpc__req__get_ps__unpack +RpcReqWifiStaItwtTeardown * + rpc__req__wifi_sta_itwt_teardown__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__get_ps__free_unpacked - (RpcReqGetPs *message, +void rpc__req__wifi_sta_itwt_teardown__free_unpacked + (RpcReqWifiStaItwtTeardown *message, ProtobufCAllocator *allocator); -/* RpcRespGetPs methods */ -void rpc__resp__get_ps__init - (RpcRespGetPs *message); -size_t rpc__resp__get_ps__get_packed_size - (const RpcRespGetPs *message); -size_t rpc__resp__get_ps__pack - (const RpcRespGetPs *message, +/* RpcRespWifiStaItwtTeardown methods */ +void rpc__resp__wifi_sta_itwt_teardown__init + (RpcRespWifiStaItwtTeardown *message); +size_t rpc__resp__wifi_sta_itwt_teardown__get_packed_size + (const RpcRespWifiStaItwtTeardown *message); +size_t rpc__resp__wifi_sta_itwt_teardown__pack + (const RpcRespWifiStaItwtTeardown *message, uint8_t *out); -size_t rpc__resp__get_ps__pack_to_buffer - (const RpcRespGetPs *message, +size_t rpc__resp__wifi_sta_itwt_teardown__pack_to_buffer + (const RpcRespWifiStaItwtTeardown *message, ProtobufCBuffer *buffer); -RpcRespGetPs * - rpc__resp__get_ps__unpack +RpcRespWifiStaItwtTeardown * + rpc__resp__wifi_sta_itwt_teardown__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__get_ps__free_unpacked - (RpcRespGetPs *message, +void rpc__resp__wifi_sta_itwt_teardown__free_unpacked + (RpcRespWifiStaItwtTeardown *message, ProtobufCAllocator *allocator); -/* RpcReqSetPs methods */ -void rpc__req__set_ps__init - (RpcReqSetPs *message); -size_t rpc__req__set_ps__get_packed_size - (const RpcReqSetPs *message); -size_t rpc__req__set_ps__pack - (const RpcReqSetPs *message, +/* RpcReqWifiStaItwtSuspend methods */ +void rpc__req__wifi_sta_itwt_suspend__init + (RpcReqWifiStaItwtSuspend *message); +size_t rpc__req__wifi_sta_itwt_suspend__get_packed_size + (const RpcReqWifiStaItwtSuspend *message); +size_t rpc__req__wifi_sta_itwt_suspend__pack + (const RpcReqWifiStaItwtSuspend *message, uint8_t *out); -size_t rpc__req__set_ps__pack_to_buffer - (const RpcReqSetPs *message, +size_t rpc__req__wifi_sta_itwt_suspend__pack_to_buffer + (const RpcReqWifiStaItwtSuspend *message, ProtobufCBuffer *buffer); -RpcReqSetPs * - rpc__req__set_ps__unpack +RpcReqWifiStaItwtSuspend * + rpc__req__wifi_sta_itwt_suspend__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__set_ps__free_unpacked - (RpcReqSetPs *message, +void rpc__req__wifi_sta_itwt_suspend__free_unpacked + (RpcReqWifiStaItwtSuspend *message, ProtobufCAllocator *allocator); -/* RpcRespSetPs methods */ -void rpc__resp__set_ps__init - (RpcRespSetPs *message); -size_t rpc__resp__set_ps__get_packed_size - (const RpcRespSetPs *message); -size_t rpc__resp__set_ps__pack - (const RpcRespSetPs *message, +/* RpcRespWifiStaItwtSuspend methods */ +void rpc__resp__wifi_sta_itwt_suspend__init + (RpcRespWifiStaItwtSuspend *message); +size_t rpc__resp__wifi_sta_itwt_suspend__get_packed_size + (const RpcRespWifiStaItwtSuspend *message); +size_t rpc__resp__wifi_sta_itwt_suspend__pack + (const RpcRespWifiStaItwtSuspend *message, uint8_t *out); -size_t rpc__resp__set_ps__pack_to_buffer - (const RpcRespSetPs *message, +size_t rpc__resp__wifi_sta_itwt_suspend__pack_to_buffer + (const RpcRespWifiStaItwtSuspend *message, ProtobufCBuffer *buffer); -RpcRespSetPs * - rpc__resp__set_ps__unpack +RpcRespWifiStaItwtSuspend * + rpc__resp__wifi_sta_itwt_suspend__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__set_ps__free_unpacked - (RpcRespSetPs *message, +void rpc__resp__wifi_sta_itwt_suspend__free_unpacked + (RpcRespWifiStaItwtSuspend *message, ProtobufCAllocator *allocator); -/* RpcReqSetMacAddress methods */ -void rpc__req__set_mac_address__init - (RpcReqSetMacAddress *message); -size_t rpc__req__set_mac_address__get_packed_size - (const RpcReqSetMacAddress *message); -size_t rpc__req__set_mac_address__pack - (const RpcReqSetMacAddress *message, +/* RpcReqWifiStaItwtGetFlowIdStatus methods */ +void rpc__req__wifi_sta_itwt_get_flow_id_status__init + (RpcReqWifiStaItwtGetFlowIdStatus *message); +size_t rpc__req__wifi_sta_itwt_get_flow_id_status__get_packed_size + (const RpcReqWifiStaItwtGetFlowIdStatus *message); +size_t rpc__req__wifi_sta_itwt_get_flow_id_status__pack + (const RpcReqWifiStaItwtGetFlowIdStatus *message, uint8_t *out); -size_t rpc__req__set_mac_address__pack_to_buffer - (const RpcReqSetMacAddress *message, +size_t rpc__req__wifi_sta_itwt_get_flow_id_status__pack_to_buffer + (const RpcReqWifiStaItwtGetFlowIdStatus *message, ProtobufCBuffer *buffer); -RpcReqSetMacAddress * - rpc__req__set_mac_address__unpack +RpcReqWifiStaItwtGetFlowIdStatus * + rpc__req__wifi_sta_itwt_get_flow_id_status__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__set_mac_address__free_unpacked - (RpcReqSetMacAddress *message, +void rpc__req__wifi_sta_itwt_get_flow_id_status__free_unpacked + (RpcReqWifiStaItwtGetFlowIdStatus *message, ProtobufCAllocator *allocator); -/* RpcRespSetMacAddress methods */ -void rpc__resp__set_mac_address__init - (RpcRespSetMacAddress *message); -size_t rpc__resp__set_mac_address__get_packed_size - (const RpcRespSetMacAddress *message); -size_t rpc__resp__set_mac_address__pack - (const RpcRespSetMacAddress *message, +/* RpcRespWifiStaItwtGetFlowIdStatus methods */ +void rpc__resp__wifi_sta_itwt_get_flow_id_status__init + (RpcRespWifiStaItwtGetFlowIdStatus *message); +size_t rpc__resp__wifi_sta_itwt_get_flow_id_status__get_packed_size + (const RpcRespWifiStaItwtGetFlowIdStatus *message); +size_t rpc__resp__wifi_sta_itwt_get_flow_id_status__pack + (const RpcRespWifiStaItwtGetFlowIdStatus *message, uint8_t *out); -size_t rpc__resp__set_mac_address__pack_to_buffer - (const RpcRespSetMacAddress *message, +size_t rpc__resp__wifi_sta_itwt_get_flow_id_status__pack_to_buffer + (const RpcRespWifiStaItwtGetFlowIdStatus *message, ProtobufCBuffer *buffer); -RpcRespSetMacAddress * - rpc__resp__set_mac_address__unpack +RpcRespWifiStaItwtGetFlowIdStatus * + rpc__resp__wifi_sta_itwt_get_flow_id_status__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__set_mac_address__free_unpacked - (RpcRespSetMacAddress *message, +void rpc__resp__wifi_sta_itwt_get_flow_id_status__free_unpacked + (RpcRespWifiStaItwtGetFlowIdStatus *message, ProtobufCAllocator *allocator); -/* RpcReqOTABegin methods */ -void rpc__req__otabegin__init - (RpcReqOTABegin *message); -size_t rpc__req__otabegin__get_packed_size - (const RpcReqOTABegin *message); -size_t rpc__req__otabegin__pack - (const RpcReqOTABegin *message, +/* RpcReqWifiStaItwtSendProbeReq methods */ +void rpc__req__wifi_sta_itwt_send_probe_req__init + (RpcReqWifiStaItwtSendProbeReq *message); +size_t rpc__req__wifi_sta_itwt_send_probe_req__get_packed_size + (const RpcReqWifiStaItwtSendProbeReq *message); +size_t rpc__req__wifi_sta_itwt_send_probe_req__pack + (const RpcReqWifiStaItwtSendProbeReq *message, uint8_t *out); -size_t rpc__req__otabegin__pack_to_buffer - (const RpcReqOTABegin *message, +size_t rpc__req__wifi_sta_itwt_send_probe_req__pack_to_buffer + (const RpcReqWifiStaItwtSendProbeReq *message, ProtobufCBuffer *buffer); -RpcReqOTABegin * - rpc__req__otabegin__unpack +RpcReqWifiStaItwtSendProbeReq * + rpc__req__wifi_sta_itwt_send_probe_req__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__otabegin__free_unpacked - (RpcReqOTABegin *message, +void rpc__req__wifi_sta_itwt_send_probe_req__free_unpacked + (RpcReqWifiStaItwtSendProbeReq *message, ProtobufCAllocator *allocator); -/* RpcRespOTABegin methods */ -void rpc__resp__otabegin__init - (RpcRespOTABegin *message); -size_t rpc__resp__otabegin__get_packed_size - (const RpcRespOTABegin *message); -size_t rpc__resp__otabegin__pack - (const RpcRespOTABegin *message, +/* RpcRespWifiStaItwtSendProbeReq methods */ +void rpc__resp__wifi_sta_itwt_send_probe_req__init + (RpcRespWifiStaItwtSendProbeReq *message); +size_t rpc__resp__wifi_sta_itwt_send_probe_req__get_packed_size + (const RpcRespWifiStaItwtSendProbeReq *message); +size_t rpc__resp__wifi_sta_itwt_send_probe_req__pack + (const RpcRespWifiStaItwtSendProbeReq *message, uint8_t *out); -size_t rpc__resp__otabegin__pack_to_buffer - (const RpcRespOTABegin *message, +size_t rpc__resp__wifi_sta_itwt_send_probe_req__pack_to_buffer + (const RpcRespWifiStaItwtSendProbeReq *message, ProtobufCBuffer *buffer); -RpcRespOTABegin * - rpc__resp__otabegin__unpack +RpcRespWifiStaItwtSendProbeReq * + rpc__resp__wifi_sta_itwt_send_probe_req__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__otabegin__free_unpacked - (RpcRespOTABegin *message, +void rpc__resp__wifi_sta_itwt_send_probe_req__free_unpacked + (RpcRespWifiStaItwtSendProbeReq *message, ProtobufCAllocator *allocator); -/* RpcReqOTAWrite methods */ -void rpc__req__otawrite__init - (RpcReqOTAWrite *message); -size_t rpc__req__otawrite__get_packed_size - (const RpcReqOTAWrite *message); -size_t rpc__req__otawrite__pack - (const RpcReqOTAWrite *message, +/* RpcReqWifiStaItwtSetTargetWakeTimeOffset methods */ +void rpc__req__wifi_sta_itwt_set_target_wake_time_offset__init + (RpcReqWifiStaItwtSetTargetWakeTimeOffset *message); +size_t rpc__req__wifi_sta_itwt_set_target_wake_time_offset__get_packed_size + (const RpcReqWifiStaItwtSetTargetWakeTimeOffset *message); +size_t rpc__req__wifi_sta_itwt_set_target_wake_time_offset__pack + (const RpcReqWifiStaItwtSetTargetWakeTimeOffset *message, uint8_t *out); -size_t rpc__req__otawrite__pack_to_buffer - (const RpcReqOTAWrite *message, +size_t rpc__req__wifi_sta_itwt_set_target_wake_time_offset__pack_to_buffer + (const RpcReqWifiStaItwtSetTargetWakeTimeOffset *message, ProtobufCBuffer *buffer); -RpcReqOTAWrite * - rpc__req__otawrite__unpack +RpcReqWifiStaItwtSetTargetWakeTimeOffset * + rpc__req__wifi_sta_itwt_set_target_wake_time_offset__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__otawrite__free_unpacked - (RpcReqOTAWrite *message, +void rpc__req__wifi_sta_itwt_set_target_wake_time_offset__free_unpacked + (RpcReqWifiStaItwtSetTargetWakeTimeOffset *message, ProtobufCAllocator *allocator); -/* RpcRespOTAWrite methods */ -void rpc__resp__otawrite__init - (RpcRespOTAWrite *message); -size_t rpc__resp__otawrite__get_packed_size - (const RpcRespOTAWrite *message); -size_t rpc__resp__otawrite__pack - (const RpcRespOTAWrite *message, +/* RpcRespWifiStaItwtSetTargetWakeTimeOffset methods */ +void rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__init + (RpcRespWifiStaItwtSetTargetWakeTimeOffset *message); +size_t rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__get_packed_size + (const RpcRespWifiStaItwtSetTargetWakeTimeOffset *message); +size_t rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__pack + (const RpcRespWifiStaItwtSetTargetWakeTimeOffset *message, uint8_t *out); -size_t rpc__resp__otawrite__pack_to_buffer - (const RpcRespOTAWrite *message, +size_t rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__pack_to_buffer + (const RpcRespWifiStaItwtSetTargetWakeTimeOffset *message, ProtobufCBuffer *buffer); -RpcRespOTAWrite * - rpc__resp__otawrite__unpack +RpcRespWifiStaItwtSetTargetWakeTimeOffset * + rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__otawrite__free_unpacked - (RpcRespOTAWrite *message, +void rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__free_unpacked + (RpcRespWifiStaItwtSetTargetWakeTimeOffset *message, ProtobufCAllocator *allocator); -/* RpcReqOTAEnd methods */ -void rpc__req__otaend__init - (RpcReqOTAEnd *message); -size_t rpc__req__otaend__get_packed_size - (const RpcReqOTAEnd *message); -size_t rpc__req__otaend__pack - (const RpcReqOTAEnd *message, +/* RpcReqWifiStaTwtConfig methods */ +void rpc__req__wifi_sta_twt_config__init + (RpcReqWifiStaTwtConfig *message); +size_t rpc__req__wifi_sta_twt_config__get_packed_size + (const RpcReqWifiStaTwtConfig *message); +size_t rpc__req__wifi_sta_twt_config__pack + (const RpcReqWifiStaTwtConfig *message, uint8_t *out); -size_t rpc__req__otaend__pack_to_buffer - (const RpcReqOTAEnd *message, +size_t rpc__req__wifi_sta_twt_config__pack_to_buffer + (const RpcReqWifiStaTwtConfig *message, ProtobufCBuffer *buffer); -RpcReqOTAEnd * - rpc__req__otaend__unpack +RpcReqWifiStaTwtConfig * + rpc__req__wifi_sta_twt_config__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__otaend__free_unpacked - (RpcReqOTAEnd *message, +void rpc__req__wifi_sta_twt_config__free_unpacked + (RpcReqWifiStaTwtConfig *message, ProtobufCAllocator *allocator); -/* RpcRespOTAEnd methods */ -void rpc__resp__otaend__init - (RpcRespOTAEnd *message); -size_t rpc__resp__otaend__get_packed_size - (const RpcRespOTAEnd *message); -size_t rpc__resp__otaend__pack - (const RpcRespOTAEnd *message, +/* RpcRespWifiStaTwtConfig methods */ +void rpc__resp__wifi_sta_twt_config__init + (RpcRespWifiStaTwtConfig *message); +size_t rpc__resp__wifi_sta_twt_config__get_packed_size + (const RpcRespWifiStaTwtConfig *message); +size_t rpc__resp__wifi_sta_twt_config__pack + (const RpcRespWifiStaTwtConfig *message, uint8_t *out); -size_t rpc__resp__otaend__pack_to_buffer - (const RpcRespOTAEnd *message, +size_t rpc__resp__wifi_sta_twt_config__pack_to_buffer + (const RpcRespWifiStaTwtConfig *message, ProtobufCBuffer *buffer); -RpcRespOTAEnd * - rpc__resp__otaend__unpack +RpcRespWifiStaTwtConfig * + rpc__resp__wifi_sta_twt_config__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__otaend__free_unpacked - (RpcRespOTAEnd *message, +void rpc__resp__wifi_sta_twt_config__free_unpacked + (RpcRespWifiStaTwtConfig *message, ProtobufCAllocator *allocator); -/* RpcReqWifiSetMaxTxPower methods */ -void rpc__req__wifi_set_max_tx_power__init - (RpcReqWifiSetMaxTxPower *message); -size_t rpc__req__wifi_set_max_tx_power__get_packed_size - (const RpcReqWifiSetMaxTxPower *message); -size_t rpc__req__wifi_set_max_tx_power__pack - (const RpcReqWifiSetMaxTxPower *message, +/* RpcReqGetCoprocessorFwVersion methods */ +void rpc__req__get_coprocessor_fw_version__init + (RpcReqGetCoprocessorFwVersion *message); +size_t rpc__req__get_coprocessor_fw_version__get_packed_size + (const RpcReqGetCoprocessorFwVersion *message); +size_t rpc__req__get_coprocessor_fw_version__pack + (const RpcReqGetCoprocessorFwVersion *message, uint8_t *out); -size_t rpc__req__wifi_set_max_tx_power__pack_to_buffer - (const RpcReqWifiSetMaxTxPower *message, +size_t rpc__req__get_coprocessor_fw_version__pack_to_buffer + (const RpcReqGetCoprocessorFwVersion *message, ProtobufCBuffer *buffer); -RpcReqWifiSetMaxTxPower * - rpc__req__wifi_set_max_tx_power__unpack +RpcReqGetCoprocessorFwVersion * + rpc__req__get_coprocessor_fw_version__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_set_max_tx_power__free_unpacked - (RpcReqWifiSetMaxTxPower *message, +void rpc__req__get_coprocessor_fw_version__free_unpacked + (RpcReqGetCoprocessorFwVersion *message, ProtobufCAllocator *allocator); -/* RpcRespWifiSetMaxTxPower methods */ -void rpc__resp__wifi_set_max_tx_power__init - (RpcRespWifiSetMaxTxPower *message); -size_t rpc__resp__wifi_set_max_tx_power__get_packed_size - (const RpcRespWifiSetMaxTxPower *message); -size_t rpc__resp__wifi_set_max_tx_power__pack - (const RpcRespWifiSetMaxTxPower *message, +/* RpcRespGetCoprocessorFwVersion methods */ +void rpc__resp__get_coprocessor_fw_version__init + (RpcRespGetCoprocessorFwVersion *message); +size_t rpc__resp__get_coprocessor_fw_version__get_packed_size + (const RpcRespGetCoprocessorFwVersion *message); +size_t rpc__resp__get_coprocessor_fw_version__pack + (const RpcRespGetCoprocessorFwVersion *message, uint8_t *out); -size_t rpc__resp__wifi_set_max_tx_power__pack_to_buffer - (const RpcRespWifiSetMaxTxPower *message, +size_t rpc__resp__get_coprocessor_fw_version__pack_to_buffer + (const RpcRespGetCoprocessorFwVersion *message, ProtobufCBuffer *buffer); -RpcRespWifiSetMaxTxPower * - rpc__resp__wifi_set_max_tx_power__unpack +RpcRespGetCoprocessorFwVersion * + rpc__resp__get_coprocessor_fw_version__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_set_max_tx_power__free_unpacked - (RpcRespWifiSetMaxTxPower *message, +void rpc__resp__get_coprocessor_fw_version__free_unpacked + (RpcRespGetCoprocessorFwVersion *message, ProtobufCAllocator *allocator); -/* RpcReqWifiGetMaxTxPower methods */ -void rpc__req__wifi_get_max_tx_power__init - (RpcReqWifiGetMaxTxPower *message); -size_t rpc__req__wifi_get_max_tx_power__get_packed_size - (const RpcReqWifiGetMaxTxPower *message); -size_t rpc__req__wifi_get_max_tx_power__pack - (const RpcReqWifiGetMaxTxPower *message, +/* RpcReqSetDhcpDnsStatus methods */ +void rpc__req__set_dhcp_dns_status__init + (RpcReqSetDhcpDnsStatus *message); +size_t rpc__req__set_dhcp_dns_status__get_packed_size + (const RpcReqSetDhcpDnsStatus *message); +size_t rpc__req__set_dhcp_dns_status__pack + (const RpcReqSetDhcpDnsStatus *message, uint8_t *out); -size_t rpc__req__wifi_get_max_tx_power__pack_to_buffer - (const RpcReqWifiGetMaxTxPower *message, +size_t rpc__req__set_dhcp_dns_status__pack_to_buffer + (const RpcReqSetDhcpDnsStatus *message, ProtobufCBuffer *buffer); -RpcReqWifiGetMaxTxPower * - rpc__req__wifi_get_max_tx_power__unpack +RpcReqSetDhcpDnsStatus * + rpc__req__set_dhcp_dns_status__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_get_max_tx_power__free_unpacked - (RpcReqWifiGetMaxTxPower *message, +void rpc__req__set_dhcp_dns_status__free_unpacked + (RpcReqSetDhcpDnsStatus *message, ProtobufCAllocator *allocator); -/* RpcRespWifiGetMaxTxPower methods */ -void rpc__resp__wifi_get_max_tx_power__init - (RpcRespWifiGetMaxTxPower *message); -size_t rpc__resp__wifi_get_max_tx_power__get_packed_size - (const RpcRespWifiGetMaxTxPower *message); -size_t rpc__resp__wifi_get_max_tx_power__pack - (const RpcRespWifiGetMaxTxPower *message, +/* RpcRespSetDhcpDnsStatus methods */ +void rpc__resp__set_dhcp_dns_status__init + (RpcRespSetDhcpDnsStatus *message); +size_t rpc__resp__set_dhcp_dns_status__get_packed_size + (const RpcRespSetDhcpDnsStatus *message); +size_t rpc__resp__set_dhcp_dns_status__pack + (const RpcRespSetDhcpDnsStatus *message, uint8_t *out); -size_t rpc__resp__wifi_get_max_tx_power__pack_to_buffer - (const RpcRespWifiGetMaxTxPower *message, +size_t rpc__resp__set_dhcp_dns_status__pack_to_buffer + (const RpcRespSetDhcpDnsStatus *message, ProtobufCBuffer *buffer); -RpcRespWifiGetMaxTxPower * - rpc__resp__wifi_get_max_tx_power__unpack +RpcRespSetDhcpDnsStatus * + rpc__resp__set_dhcp_dns_status__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_get_max_tx_power__free_unpacked - (RpcRespWifiGetMaxTxPower *message, +void rpc__resp__set_dhcp_dns_status__free_unpacked + (RpcRespSetDhcpDnsStatus *message, ProtobufCAllocator *allocator); -/* RpcReqConfigHeartbeat methods */ -void rpc__req__config_heartbeat__init - (RpcReqConfigHeartbeat *message); -size_t rpc__req__config_heartbeat__get_packed_size - (const RpcReqConfigHeartbeat *message); -size_t rpc__req__config_heartbeat__pack - (const RpcReqConfigHeartbeat *message, +/* RpcReqGetDhcpDnsStatus methods */ +void rpc__req__get_dhcp_dns_status__init + (RpcReqGetDhcpDnsStatus *message); +size_t rpc__req__get_dhcp_dns_status__get_packed_size + (const RpcReqGetDhcpDnsStatus *message); +size_t rpc__req__get_dhcp_dns_status__pack + (const RpcReqGetDhcpDnsStatus *message, uint8_t *out); -size_t rpc__req__config_heartbeat__pack_to_buffer - (const RpcReqConfigHeartbeat *message, +size_t rpc__req__get_dhcp_dns_status__pack_to_buffer + (const RpcReqGetDhcpDnsStatus *message, ProtobufCBuffer *buffer); -RpcReqConfigHeartbeat * - rpc__req__config_heartbeat__unpack +RpcReqGetDhcpDnsStatus * + rpc__req__get_dhcp_dns_status__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__config_heartbeat__free_unpacked - (RpcReqConfigHeartbeat *message, +void rpc__req__get_dhcp_dns_status__free_unpacked + (RpcReqGetDhcpDnsStatus *message, ProtobufCAllocator *allocator); -/* RpcRespConfigHeartbeat methods */ -void rpc__resp__config_heartbeat__init - (RpcRespConfigHeartbeat *message); -size_t rpc__resp__config_heartbeat__get_packed_size - (const RpcRespConfigHeartbeat *message); -size_t rpc__resp__config_heartbeat__pack - (const RpcRespConfigHeartbeat *message, +/* RpcRespGetDhcpDnsStatus methods */ +void rpc__resp__get_dhcp_dns_status__init + (RpcRespGetDhcpDnsStatus *message); +size_t rpc__resp__get_dhcp_dns_status__get_packed_size + (const RpcRespGetDhcpDnsStatus *message); +size_t rpc__resp__get_dhcp_dns_status__pack + (const RpcRespGetDhcpDnsStatus *message, uint8_t *out); -size_t rpc__resp__config_heartbeat__pack_to_buffer - (const RpcRespConfigHeartbeat *message, +size_t rpc__resp__get_dhcp_dns_status__pack_to_buffer + (const RpcRespGetDhcpDnsStatus *message, ProtobufCBuffer *buffer); -RpcRespConfigHeartbeat * - rpc__resp__config_heartbeat__unpack +RpcRespGetDhcpDnsStatus * + rpc__resp__get_dhcp_dns_status__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__config_heartbeat__free_unpacked - (RpcRespConfigHeartbeat *message, +void rpc__resp__get_dhcp_dns_status__free_unpacked + (RpcRespGetDhcpDnsStatus *message, ProtobufCAllocator *allocator); -/* RpcReqWifiInit methods */ -void rpc__req__wifi_init__init - (RpcReqWifiInit *message); -size_t rpc__req__wifi_init__get_packed_size - (const RpcReqWifiInit *message); -size_t rpc__req__wifi_init__pack - (const RpcReqWifiInit *message, +/* RpcReqSuppDppInit methods */ +void rpc__req__supp_dpp_init__init + (RpcReqSuppDppInit *message); +size_t rpc__req__supp_dpp_init__get_packed_size + (const RpcReqSuppDppInit *message); +size_t rpc__req__supp_dpp_init__pack + (const RpcReqSuppDppInit *message, uint8_t *out); -size_t rpc__req__wifi_init__pack_to_buffer - (const RpcReqWifiInit *message, +size_t rpc__req__supp_dpp_init__pack_to_buffer + (const RpcReqSuppDppInit *message, ProtobufCBuffer *buffer); -RpcReqWifiInit * - rpc__req__wifi_init__unpack +RpcReqSuppDppInit * + rpc__req__supp_dpp_init__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_init__free_unpacked - (RpcReqWifiInit *message, +void rpc__req__supp_dpp_init__free_unpacked + (RpcReqSuppDppInit *message, ProtobufCAllocator *allocator); -/* RpcRespWifiInit methods */ -void rpc__resp__wifi_init__init - (RpcRespWifiInit *message); -size_t rpc__resp__wifi_init__get_packed_size - (const RpcRespWifiInit *message); -size_t rpc__resp__wifi_init__pack - (const RpcRespWifiInit *message, +/* RpcRespSuppDppInit methods */ +void rpc__resp__supp_dpp_init__init + (RpcRespSuppDppInit *message); +size_t rpc__resp__supp_dpp_init__get_packed_size + (const RpcRespSuppDppInit *message); +size_t rpc__resp__supp_dpp_init__pack + (const RpcRespSuppDppInit *message, uint8_t *out); -size_t rpc__resp__wifi_init__pack_to_buffer - (const RpcRespWifiInit *message, +size_t rpc__resp__supp_dpp_init__pack_to_buffer + (const RpcRespSuppDppInit *message, ProtobufCBuffer *buffer); -RpcRespWifiInit * - rpc__resp__wifi_init__unpack +RpcRespSuppDppInit * + rpc__resp__supp_dpp_init__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_init__free_unpacked - (RpcRespWifiInit *message, +void rpc__resp__supp_dpp_init__free_unpacked + (RpcRespSuppDppInit *message, ProtobufCAllocator *allocator); -/* RpcReqWifiDeinit methods */ -void rpc__req__wifi_deinit__init - (RpcReqWifiDeinit *message); -size_t rpc__req__wifi_deinit__get_packed_size - (const RpcReqWifiDeinit *message); -size_t rpc__req__wifi_deinit__pack - (const RpcReqWifiDeinit *message, +/* RpcReqSuppDppDeinit methods */ +void rpc__req__supp_dpp_deinit__init + (RpcReqSuppDppDeinit *message); +size_t rpc__req__supp_dpp_deinit__get_packed_size + (const RpcReqSuppDppDeinit *message); +size_t rpc__req__supp_dpp_deinit__pack + (const RpcReqSuppDppDeinit *message, uint8_t *out); -size_t rpc__req__wifi_deinit__pack_to_buffer - (const RpcReqWifiDeinit *message, +size_t rpc__req__supp_dpp_deinit__pack_to_buffer + (const RpcReqSuppDppDeinit *message, ProtobufCBuffer *buffer); -RpcReqWifiDeinit * - rpc__req__wifi_deinit__unpack +RpcReqSuppDppDeinit * + rpc__req__supp_dpp_deinit__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_deinit__free_unpacked - (RpcReqWifiDeinit *message, +void rpc__req__supp_dpp_deinit__free_unpacked + (RpcReqSuppDppDeinit *message, ProtobufCAllocator *allocator); -/* RpcRespWifiDeinit methods */ -void rpc__resp__wifi_deinit__init - (RpcRespWifiDeinit *message); -size_t rpc__resp__wifi_deinit__get_packed_size - (const RpcRespWifiDeinit *message); -size_t rpc__resp__wifi_deinit__pack - (const RpcRespWifiDeinit *message, +/* RpcRespSuppDppDeinit methods */ +void rpc__resp__supp_dpp_deinit__init + (RpcRespSuppDppDeinit *message); +size_t rpc__resp__supp_dpp_deinit__get_packed_size + (const RpcRespSuppDppDeinit *message); +size_t rpc__resp__supp_dpp_deinit__pack + (const RpcRespSuppDppDeinit *message, uint8_t *out); -size_t rpc__resp__wifi_deinit__pack_to_buffer - (const RpcRespWifiDeinit *message, +size_t rpc__resp__supp_dpp_deinit__pack_to_buffer + (const RpcRespSuppDppDeinit *message, ProtobufCBuffer *buffer); -RpcRespWifiDeinit * - rpc__resp__wifi_deinit__unpack +RpcRespSuppDppDeinit * + rpc__resp__supp_dpp_deinit__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_deinit__free_unpacked - (RpcRespWifiDeinit *message, +void rpc__resp__supp_dpp_deinit__free_unpacked + (RpcRespSuppDppDeinit *message, ProtobufCAllocator *allocator); -/* RpcReqWifiSetConfig methods */ -void rpc__req__wifi_set_config__init - (RpcReqWifiSetConfig *message); -size_t rpc__req__wifi_set_config__get_packed_size - (const RpcReqWifiSetConfig *message); -size_t rpc__req__wifi_set_config__pack - (const RpcReqWifiSetConfig *message, +/* RpcReqSuppDppBootstrapGen methods */ +void rpc__req__supp_dpp_bootstrap_gen__init + (RpcReqSuppDppBootstrapGen *message); +size_t rpc__req__supp_dpp_bootstrap_gen__get_packed_size + (const RpcReqSuppDppBootstrapGen *message); +size_t rpc__req__supp_dpp_bootstrap_gen__pack + (const RpcReqSuppDppBootstrapGen *message, uint8_t *out); -size_t rpc__req__wifi_set_config__pack_to_buffer - (const RpcReqWifiSetConfig *message, +size_t rpc__req__supp_dpp_bootstrap_gen__pack_to_buffer + (const RpcReqSuppDppBootstrapGen *message, ProtobufCBuffer *buffer); -RpcReqWifiSetConfig * - rpc__req__wifi_set_config__unpack +RpcReqSuppDppBootstrapGen * + rpc__req__supp_dpp_bootstrap_gen__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_set_config__free_unpacked - (RpcReqWifiSetConfig *message, +void rpc__req__supp_dpp_bootstrap_gen__free_unpacked + (RpcReqSuppDppBootstrapGen *message, ProtobufCAllocator *allocator); -/* RpcRespWifiSetConfig methods */ -void rpc__resp__wifi_set_config__init - (RpcRespWifiSetConfig *message); -size_t rpc__resp__wifi_set_config__get_packed_size - (const RpcRespWifiSetConfig *message); -size_t rpc__resp__wifi_set_config__pack - (const RpcRespWifiSetConfig *message, +/* RpcRespSuppDppBootstrapGen methods */ +void rpc__resp__supp_dpp_bootstrap_gen__init + (RpcRespSuppDppBootstrapGen *message); +size_t rpc__resp__supp_dpp_bootstrap_gen__get_packed_size + (const RpcRespSuppDppBootstrapGen *message); +size_t rpc__resp__supp_dpp_bootstrap_gen__pack + (const RpcRespSuppDppBootstrapGen *message, uint8_t *out); -size_t rpc__resp__wifi_set_config__pack_to_buffer - (const RpcRespWifiSetConfig *message, +size_t rpc__resp__supp_dpp_bootstrap_gen__pack_to_buffer + (const RpcRespSuppDppBootstrapGen *message, ProtobufCBuffer *buffer); -RpcRespWifiSetConfig * - rpc__resp__wifi_set_config__unpack +RpcRespSuppDppBootstrapGen * + rpc__resp__supp_dpp_bootstrap_gen__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_set_config__free_unpacked - (RpcRespWifiSetConfig *message, +void rpc__resp__supp_dpp_bootstrap_gen__free_unpacked + (RpcRespSuppDppBootstrapGen *message, ProtobufCAllocator *allocator); -/* RpcReqWifiGetConfig methods */ -void rpc__req__wifi_get_config__init - (RpcReqWifiGetConfig *message); -size_t rpc__req__wifi_get_config__get_packed_size - (const RpcReqWifiGetConfig *message); -size_t rpc__req__wifi_get_config__pack - (const RpcReqWifiGetConfig *message, +/* RpcReqSuppDppStartListen methods */ +void rpc__req__supp_dpp_start_listen__init + (RpcReqSuppDppStartListen *message); +size_t rpc__req__supp_dpp_start_listen__get_packed_size + (const RpcReqSuppDppStartListen *message); +size_t rpc__req__supp_dpp_start_listen__pack + (const RpcReqSuppDppStartListen *message, uint8_t *out); -size_t rpc__req__wifi_get_config__pack_to_buffer - (const RpcReqWifiGetConfig *message, +size_t rpc__req__supp_dpp_start_listen__pack_to_buffer + (const RpcReqSuppDppStartListen *message, ProtobufCBuffer *buffer); -RpcReqWifiGetConfig * - rpc__req__wifi_get_config__unpack +RpcReqSuppDppStartListen * + rpc__req__supp_dpp_start_listen__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_get_config__free_unpacked - (RpcReqWifiGetConfig *message, +void rpc__req__supp_dpp_start_listen__free_unpacked + (RpcReqSuppDppStartListen *message, ProtobufCAllocator *allocator); -/* RpcRespWifiGetConfig methods */ -void rpc__resp__wifi_get_config__init - (RpcRespWifiGetConfig *message); -size_t rpc__resp__wifi_get_config__get_packed_size - (const RpcRespWifiGetConfig *message); -size_t rpc__resp__wifi_get_config__pack - (const RpcRespWifiGetConfig *message, +/* RpcRespSuppDppStartListen methods */ +void rpc__resp__supp_dpp_start_listen__init + (RpcRespSuppDppStartListen *message); +size_t rpc__resp__supp_dpp_start_listen__get_packed_size + (const RpcRespSuppDppStartListen *message); +size_t rpc__resp__supp_dpp_start_listen__pack + (const RpcRespSuppDppStartListen *message, uint8_t *out); -size_t rpc__resp__wifi_get_config__pack_to_buffer - (const RpcRespWifiGetConfig *message, +size_t rpc__resp__supp_dpp_start_listen__pack_to_buffer + (const RpcRespSuppDppStartListen *message, ProtobufCBuffer *buffer); -RpcRespWifiGetConfig * - rpc__resp__wifi_get_config__unpack +RpcRespSuppDppStartListen * + rpc__resp__supp_dpp_start_listen__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_get_config__free_unpacked - (RpcRespWifiGetConfig *message, +void rpc__resp__supp_dpp_start_listen__free_unpacked + (RpcRespSuppDppStartListen *message, ProtobufCAllocator *allocator); -/* RpcReqWifiConnect methods */ -void rpc__req__wifi_connect__init - (RpcReqWifiConnect *message); -size_t rpc__req__wifi_connect__get_packed_size - (const RpcReqWifiConnect *message); -size_t rpc__req__wifi_connect__pack - (const RpcReqWifiConnect *message, +/* RpcReqSuppDppStopListen methods */ +void rpc__req__supp_dpp_stop_listen__init + (RpcReqSuppDppStopListen *message); +size_t rpc__req__supp_dpp_stop_listen__get_packed_size + (const RpcReqSuppDppStopListen *message); +size_t rpc__req__supp_dpp_stop_listen__pack + (const RpcReqSuppDppStopListen *message, uint8_t *out); -size_t rpc__req__wifi_connect__pack_to_buffer - (const RpcReqWifiConnect *message, +size_t rpc__req__supp_dpp_stop_listen__pack_to_buffer + (const RpcReqSuppDppStopListen *message, ProtobufCBuffer *buffer); -RpcReqWifiConnect * - rpc__req__wifi_connect__unpack +RpcReqSuppDppStopListen * + rpc__req__supp_dpp_stop_listen__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_connect__free_unpacked - (RpcReqWifiConnect *message, +void rpc__req__supp_dpp_stop_listen__free_unpacked + (RpcReqSuppDppStopListen *message, ProtobufCAllocator *allocator); -/* RpcRespWifiConnect methods */ -void rpc__resp__wifi_connect__init - (RpcRespWifiConnect *message); -size_t rpc__resp__wifi_connect__get_packed_size - (const RpcRespWifiConnect *message); -size_t rpc__resp__wifi_connect__pack - (const RpcRespWifiConnect *message, +/* RpcRespSuppDppStopListen methods */ +void rpc__resp__supp_dpp_stop_listen__init + (RpcRespSuppDppStopListen *message); +size_t rpc__resp__supp_dpp_stop_listen__get_packed_size + (const RpcRespSuppDppStopListen *message); +size_t rpc__resp__supp_dpp_stop_listen__pack + (const RpcRespSuppDppStopListen *message, uint8_t *out); -size_t rpc__resp__wifi_connect__pack_to_buffer - (const RpcRespWifiConnect *message, +size_t rpc__resp__supp_dpp_stop_listen__pack_to_buffer + (const RpcRespSuppDppStopListen *message, ProtobufCBuffer *buffer); -RpcRespWifiConnect * - rpc__resp__wifi_connect__unpack +RpcRespSuppDppStopListen * + rpc__resp__supp_dpp_stop_listen__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_connect__free_unpacked - (RpcRespWifiConnect *message, +void rpc__resp__supp_dpp_stop_listen__free_unpacked + (RpcRespSuppDppStopListen *message, ProtobufCAllocator *allocator); -/* RpcReqWifiDisconnect methods */ -void rpc__req__wifi_disconnect__init - (RpcReqWifiDisconnect *message); -size_t rpc__req__wifi_disconnect__get_packed_size - (const RpcReqWifiDisconnect *message); -size_t rpc__req__wifi_disconnect__pack - (const RpcReqWifiDisconnect *message, +/* RpcReqIfaceMacAddrSetGet methods */ +void rpc__req__iface_mac_addr_set_get__init + (RpcReqIfaceMacAddrSetGet *message); +size_t rpc__req__iface_mac_addr_set_get__get_packed_size + (const RpcReqIfaceMacAddrSetGet *message); +size_t rpc__req__iface_mac_addr_set_get__pack + (const RpcReqIfaceMacAddrSetGet *message, uint8_t *out); -size_t rpc__req__wifi_disconnect__pack_to_buffer - (const RpcReqWifiDisconnect *message, +size_t rpc__req__iface_mac_addr_set_get__pack_to_buffer + (const RpcReqIfaceMacAddrSetGet *message, ProtobufCBuffer *buffer); -RpcReqWifiDisconnect * - rpc__req__wifi_disconnect__unpack +RpcReqIfaceMacAddrSetGet * + rpc__req__iface_mac_addr_set_get__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_disconnect__free_unpacked - (RpcReqWifiDisconnect *message, +void rpc__req__iface_mac_addr_set_get__free_unpacked + (RpcReqIfaceMacAddrSetGet *message, ProtobufCAllocator *allocator); -/* RpcRespWifiDisconnect methods */ -void rpc__resp__wifi_disconnect__init - (RpcRespWifiDisconnect *message); -size_t rpc__resp__wifi_disconnect__get_packed_size - (const RpcRespWifiDisconnect *message); -size_t rpc__resp__wifi_disconnect__pack - (const RpcRespWifiDisconnect *message, +/* RpcRespIfaceMacAddrSetGet methods */ +void rpc__resp__iface_mac_addr_set_get__init + (RpcRespIfaceMacAddrSetGet *message); +size_t rpc__resp__iface_mac_addr_set_get__get_packed_size + (const RpcRespIfaceMacAddrSetGet *message); +size_t rpc__resp__iface_mac_addr_set_get__pack + (const RpcRespIfaceMacAddrSetGet *message, uint8_t *out); -size_t rpc__resp__wifi_disconnect__pack_to_buffer - (const RpcRespWifiDisconnect *message, +size_t rpc__resp__iface_mac_addr_set_get__pack_to_buffer + (const RpcRespIfaceMacAddrSetGet *message, ProtobufCBuffer *buffer); -RpcRespWifiDisconnect * - rpc__resp__wifi_disconnect__unpack +RpcRespIfaceMacAddrSetGet * + rpc__resp__iface_mac_addr_set_get__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_disconnect__free_unpacked - (RpcRespWifiDisconnect *message, +void rpc__resp__iface_mac_addr_set_get__free_unpacked + (RpcRespIfaceMacAddrSetGet *message, ProtobufCAllocator *allocator); -/* RpcReqWifiStart methods */ -void rpc__req__wifi_start__init - (RpcReqWifiStart *message); -size_t rpc__req__wifi_start__get_packed_size - (const RpcReqWifiStart *message); -size_t rpc__req__wifi_start__pack - (const RpcReqWifiStart *message, +/* RpcReqIfaceMacAddrLenGet methods */ +void rpc__req__iface_mac_addr_len_get__init + (RpcReqIfaceMacAddrLenGet *message); +size_t rpc__req__iface_mac_addr_len_get__get_packed_size + (const RpcReqIfaceMacAddrLenGet *message); +size_t rpc__req__iface_mac_addr_len_get__pack + (const RpcReqIfaceMacAddrLenGet *message, uint8_t *out); -size_t rpc__req__wifi_start__pack_to_buffer - (const RpcReqWifiStart *message, +size_t rpc__req__iface_mac_addr_len_get__pack_to_buffer + (const RpcReqIfaceMacAddrLenGet *message, ProtobufCBuffer *buffer); -RpcReqWifiStart * - rpc__req__wifi_start__unpack +RpcReqIfaceMacAddrLenGet * + rpc__req__iface_mac_addr_len_get__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_start__free_unpacked - (RpcReqWifiStart *message, +void rpc__req__iface_mac_addr_len_get__free_unpacked + (RpcReqIfaceMacAddrLenGet *message, ProtobufCAllocator *allocator); -/* RpcRespWifiStart methods */ -void rpc__resp__wifi_start__init - (RpcRespWifiStart *message); -size_t rpc__resp__wifi_start__get_packed_size - (const RpcRespWifiStart *message); -size_t rpc__resp__wifi_start__pack - (const RpcRespWifiStart *message, +/* RpcRespIfaceMacAddrLenGet methods */ +void rpc__resp__iface_mac_addr_len_get__init + (RpcRespIfaceMacAddrLenGet *message); +size_t rpc__resp__iface_mac_addr_len_get__get_packed_size + (const RpcRespIfaceMacAddrLenGet *message); +size_t rpc__resp__iface_mac_addr_len_get__pack + (const RpcRespIfaceMacAddrLenGet *message, uint8_t *out); -size_t rpc__resp__wifi_start__pack_to_buffer - (const RpcRespWifiStart *message, +size_t rpc__resp__iface_mac_addr_len_get__pack_to_buffer + (const RpcRespIfaceMacAddrLenGet *message, ProtobufCBuffer *buffer); -RpcRespWifiStart * - rpc__resp__wifi_start__unpack +RpcRespIfaceMacAddrLenGet * + rpc__resp__iface_mac_addr_len_get__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_start__free_unpacked - (RpcRespWifiStart *message, +void rpc__resp__iface_mac_addr_len_get__free_unpacked + (RpcRespIfaceMacAddrLenGet *message, ProtobufCAllocator *allocator); -/* RpcReqWifiStop methods */ -void rpc__req__wifi_stop__init - (RpcReqWifiStop *message); -size_t rpc__req__wifi_stop__get_packed_size - (const RpcReqWifiStop *message); -size_t rpc__req__wifi_stop__pack - (const RpcReqWifiStop *message, +/* RpcReqFeatureControl methods */ +void rpc__req__feature_control__init + (RpcReqFeatureControl *message); +size_t rpc__req__feature_control__get_packed_size + (const RpcReqFeatureControl *message); +size_t rpc__req__feature_control__pack + (const RpcReqFeatureControl *message, uint8_t *out); -size_t rpc__req__wifi_stop__pack_to_buffer - (const RpcReqWifiStop *message, +size_t rpc__req__feature_control__pack_to_buffer + (const RpcReqFeatureControl *message, ProtobufCBuffer *buffer); -RpcReqWifiStop * - rpc__req__wifi_stop__unpack +RpcReqFeatureControl * + rpc__req__feature_control__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_stop__free_unpacked - (RpcReqWifiStop *message, +void rpc__req__feature_control__free_unpacked + (RpcReqFeatureControl *message, ProtobufCAllocator *allocator); -/* RpcRespWifiStop methods */ -void rpc__resp__wifi_stop__init - (RpcRespWifiStop *message); -size_t rpc__resp__wifi_stop__get_packed_size - (const RpcRespWifiStop *message); -size_t rpc__resp__wifi_stop__pack - (const RpcRespWifiStop *message, +/* RpcRespFeatureControl methods */ +void rpc__resp__feature_control__init + (RpcRespFeatureControl *message); +size_t rpc__resp__feature_control__get_packed_size + (const RpcRespFeatureControl *message); +size_t rpc__resp__feature_control__pack + (const RpcRespFeatureControl *message, uint8_t *out); -size_t rpc__resp__wifi_stop__pack_to_buffer - (const RpcRespWifiStop *message, +size_t rpc__resp__feature_control__pack_to_buffer + (const RpcRespFeatureControl *message, ProtobufCBuffer *buffer); -RpcRespWifiStop * - rpc__resp__wifi_stop__unpack +RpcRespFeatureControl * + rpc__resp__feature_control__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_stop__free_unpacked - (RpcRespWifiStop *message, +void rpc__resp__feature_control__free_unpacked + (RpcRespFeatureControl *message, ProtobufCAllocator *allocator); -/* RpcReqWifiScanStart methods */ -void rpc__req__wifi_scan_start__init - (RpcReqWifiScanStart *message); -size_t rpc__req__wifi_scan_start__get_packed_size - (const RpcReqWifiScanStart *message); -size_t rpc__req__wifi_scan_start__pack - (const RpcReqWifiScanStart *message, +/* RpcEventWifiEventNoArgs methods */ +void rpc__event__wifi_event_no_args__init + (RpcEventWifiEventNoArgs *message); +size_t rpc__event__wifi_event_no_args__get_packed_size + (const RpcEventWifiEventNoArgs *message); +size_t rpc__event__wifi_event_no_args__pack + (const RpcEventWifiEventNoArgs *message, uint8_t *out); -size_t rpc__req__wifi_scan_start__pack_to_buffer - (const RpcReqWifiScanStart *message, +size_t rpc__event__wifi_event_no_args__pack_to_buffer + (const RpcEventWifiEventNoArgs *message, ProtobufCBuffer *buffer); -RpcReqWifiScanStart * - rpc__req__wifi_scan_start__unpack +RpcEventWifiEventNoArgs * + rpc__event__wifi_event_no_args__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_scan_start__free_unpacked - (RpcReqWifiScanStart *message, +void rpc__event__wifi_event_no_args__free_unpacked + (RpcEventWifiEventNoArgs *message, ProtobufCAllocator *allocator); -/* RpcRespWifiScanStart methods */ -void rpc__resp__wifi_scan_start__init - (RpcRespWifiScanStart *message); -size_t rpc__resp__wifi_scan_start__get_packed_size - (const RpcRespWifiScanStart *message); -size_t rpc__resp__wifi_scan_start__pack - (const RpcRespWifiScanStart *message, +/* RpcEventESPInit methods */ +void rpc__event__espinit__init + (RpcEventESPInit *message); +size_t rpc__event__espinit__get_packed_size + (const RpcEventESPInit *message); +size_t rpc__event__espinit__pack + (const RpcEventESPInit *message, uint8_t *out); -size_t rpc__resp__wifi_scan_start__pack_to_buffer - (const RpcRespWifiScanStart *message, +size_t rpc__event__espinit__pack_to_buffer + (const RpcEventESPInit *message, ProtobufCBuffer *buffer); -RpcRespWifiScanStart * - rpc__resp__wifi_scan_start__unpack +RpcEventESPInit * + rpc__event__espinit__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_scan_start__free_unpacked - (RpcRespWifiScanStart *message, +void rpc__event__espinit__free_unpacked + (RpcEventESPInit *message, ProtobufCAllocator *allocator); -/* RpcReqWifiScanStop methods */ -void rpc__req__wifi_scan_stop__init - (RpcReqWifiScanStop *message); -size_t rpc__req__wifi_scan_stop__get_packed_size - (const RpcReqWifiScanStop *message); -size_t rpc__req__wifi_scan_stop__pack - (const RpcReqWifiScanStop *message, +/* RpcEventHeartbeat methods */ +void rpc__event__heartbeat__init + (RpcEventHeartbeat *message); +size_t rpc__event__heartbeat__get_packed_size + (const RpcEventHeartbeat *message); +size_t rpc__event__heartbeat__pack + (const RpcEventHeartbeat *message, uint8_t *out); -size_t rpc__req__wifi_scan_stop__pack_to_buffer - (const RpcReqWifiScanStop *message, +size_t rpc__event__heartbeat__pack_to_buffer + (const RpcEventHeartbeat *message, ProtobufCBuffer *buffer); -RpcReqWifiScanStop * - rpc__req__wifi_scan_stop__unpack +RpcEventHeartbeat * + rpc__event__heartbeat__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_scan_stop__free_unpacked - (RpcReqWifiScanStop *message, +void rpc__event__heartbeat__free_unpacked + (RpcEventHeartbeat *message, ProtobufCAllocator *allocator); -/* RpcRespWifiScanStop methods */ -void rpc__resp__wifi_scan_stop__init - (RpcRespWifiScanStop *message); -size_t rpc__resp__wifi_scan_stop__get_packed_size - (const RpcRespWifiScanStop *message); -size_t rpc__resp__wifi_scan_stop__pack - (const RpcRespWifiScanStop *message, +/* RpcEventAPStaDisconnected methods */ +void rpc__event__ap__sta_disconnected__init + (RpcEventAPStaDisconnected *message); +size_t rpc__event__ap__sta_disconnected__get_packed_size + (const RpcEventAPStaDisconnected *message); +size_t rpc__event__ap__sta_disconnected__pack + (const RpcEventAPStaDisconnected *message, uint8_t *out); -size_t rpc__resp__wifi_scan_stop__pack_to_buffer - (const RpcRespWifiScanStop *message, +size_t rpc__event__ap__sta_disconnected__pack_to_buffer + (const RpcEventAPStaDisconnected *message, ProtobufCBuffer *buffer); -RpcRespWifiScanStop * - rpc__resp__wifi_scan_stop__unpack +RpcEventAPStaDisconnected * + rpc__event__ap__sta_disconnected__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_scan_stop__free_unpacked - (RpcRespWifiScanStop *message, +void rpc__event__ap__sta_disconnected__free_unpacked + (RpcEventAPStaDisconnected *message, ProtobufCAllocator *allocator); -/* RpcReqWifiScanGetApNum methods */ -void rpc__req__wifi_scan_get_ap_num__init - (RpcReqWifiScanGetApNum *message); -size_t rpc__req__wifi_scan_get_ap_num__get_packed_size - (const RpcReqWifiScanGetApNum *message); -size_t rpc__req__wifi_scan_get_ap_num__pack - (const RpcReqWifiScanGetApNum *message, +/* RpcEventAPStaConnected methods */ +void rpc__event__ap__sta_connected__init + (RpcEventAPStaConnected *message); +size_t rpc__event__ap__sta_connected__get_packed_size + (const RpcEventAPStaConnected *message); +size_t rpc__event__ap__sta_connected__pack + (const RpcEventAPStaConnected *message, uint8_t *out); -size_t rpc__req__wifi_scan_get_ap_num__pack_to_buffer - (const RpcReqWifiScanGetApNum *message, +size_t rpc__event__ap__sta_connected__pack_to_buffer + (const RpcEventAPStaConnected *message, ProtobufCBuffer *buffer); -RpcReqWifiScanGetApNum * - rpc__req__wifi_scan_get_ap_num__unpack +RpcEventAPStaConnected * + rpc__event__ap__sta_connected__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_scan_get_ap_num__free_unpacked - (RpcReqWifiScanGetApNum *message, +void rpc__event__ap__sta_connected__free_unpacked + (RpcEventAPStaConnected *message, ProtobufCAllocator *allocator); -/* RpcRespWifiScanGetApNum methods */ -void rpc__resp__wifi_scan_get_ap_num__init - (RpcRespWifiScanGetApNum *message); -size_t rpc__resp__wifi_scan_get_ap_num__get_packed_size - (const RpcRespWifiScanGetApNum *message); -size_t rpc__resp__wifi_scan_get_ap_num__pack - (const RpcRespWifiScanGetApNum *message, +/* RpcEventStaScanDone methods */ +void rpc__event__sta_scan_done__init + (RpcEventStaScanDone *message); +size_t rpc__event__sta_scan_done__get_packed_size + (const RpcEventStaScanDone *message); +size_t rpc__event__sta_scan_done__pack + (const RpcEventStaScanDone *message, uint8_t *out); -size_t rpc__resp__wifi_scan_get_ap_num__pack_to_buffer - (const RpcRespWifiScanGetApNum *message, +size_t rpc__event__sta_scan_done__pack_to_buffer + (const RpcEventStaScanDone *message, ProtobufCBuffer *buffer); -RpcRespWifiScanGetApNum * - rpc__resp__wifi_scan_get_ap_num__unpack +RpcEventStaScanDone * + rpc__event__sta_scan_done__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_scan_get_ap_num__free_unpacked - (RpcRespWifiScanGetApNum *message, +void rpc__event__sta_scan_done__free_unpacked + (RpcEventStaScanDone *message, ProtobufCAllocator *allocator); -/* RpcReqWifiScanGetApRecords methods */ -void rpc__req__wifi_scan_get_ap_records__init - (RpcReqWifiScanGetApRecords *message); -size_t rpc__req__wifi_scan_get_ap_records__get_packed_size - (const RpcReqWifiScanGetApRecords *message); -size_t rpc__req__wifi_scan_get_ap_records__pack - (const RpcReqWifiScanGetApRecords *message, +/* RpcEventStaConnected methods */ +void rpc__event__sta_connected__init + (RpcEventStaConnected *message); +size_t rpc__event__sta_connected__get_packed_size + (const RpcEventStaConnected *message); +size_t rpc__event__sta_connected__pack + (const RpcEventStaConnected *message, uint8_t *out); -size_t rpc__req__wifi_scan_get_ap_records__pack_to_buffer - (const RpcReqWifiScanGetApRecords *message, +size_t rpc__event__sta_connected__pack_to_buffer + (const RpcEventStaConnected *message, ProtobufCBuffer *buffer); -RpcReqWifiScanGetApRecords * - rpc__req__wifi_scan_get_ap_records__unpack +RpcEventStaConnected * + rpc__event__sta_connected__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_scan_get_ap_records__free_unpacked - (RpcReqWifiScanGetApRecords *message, +void rpc__event__sta_connected__free_unpacked + (RpcEventStaConnected *message, ProtobufCAllocator *allocator); -/* RpcRespWifiScanGetApRecords methods */ -void rpc__resp__wifi_scan_get_ap_records__init - (RpcRespWifiScanGetApRecords *message); -size_t rpc__resp__wifi_scan_get_ap_records__get_packed_size - (const RpcRespWifiScanGetApRecords *message); -size_t rpc__resp__wifi_scan_get_ap_records__pack - (const RpcRespWifiScanGetApRecords *message, +/* RpcEventStaDisconnected methods */ +void rpc__event__sta_disconnected__init + (RpcEventStaDisconnected *message); +size_t rpc__event__sta_disconnected__get_packed_size + (const RpcEventStaDisconnected *message); +size_t rpc__event__sta_disconnected__pack + (const RpcEventStaDisconnected *message, uint8_t *out); -size_t rpc__resp__wifi_scan_get_ap_records__pack_to_buffer - (const RpcRespWifiScanGetApRecords *message, +size_t rpc__event__sta_disconnected__pack_to_buffer + (const RpcEventStaDisconnected *message, ProtobufCBuffer *buffer); -RpcRespWifiScanGetApRecords * - rpc__resp__wifi_scan_get_ap_records__unpack +RpcEventStaDisconnected * + rpc__event__sta_disconnected__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_scan_get_ap_records__free_unpacked - (RpcRespWifiScanGetApRecords *message, +void rpc__event__sta_disconnected__free_unpacked + (RpcEventStaDisconnected *message, ProtobufCAllocator *allocator); -/* RpcReqWifiScanGetApRecord methods */ -void rpc__req__wifi_scan_get_ap_record__init - (RpcReqWifiScanGetApRecord *message); -size_t rpc__req__wifi_scan_get_ap_record__get_packed_size - (const RpcReqWifiScanGetApRecord *message); -size_t rpc__req__wifi_scan_get_ap_record__pack - (const RpcReqWifiScanGetApRecord *message, +/* RpcEventDhcpDnsStatus methods */ +void rpc__event__dhcp_dns_status__init + (RpcEventDhcpDnsStatus *message); +size_t rpc__event__dhcp_dns_status__get_packed_size + (const RpcEventDhcpDnsStatus *message); +size_t rpc__event__dhcp_dns_status__pack + (const RpcEventDhcpDnsStatus *message, uint8_t *out); -size_t rpc__req__wifi_scan_get_ap_record__pack_to_buffer - (const RpcReqWifiScanGetApRecord *message, +size_t rpc__event__dhcp_dns_status__pack_to_buffer + (const RpcEventDhcpDnsStatus *message, ProtobufCBuffer *buffer); -RpcReqWifiScanGetApRecord * - rpc__req__wifi_scan_get_ap_record__unpack +RpcEventDhcpDnsStatus * + rpc__event__dhcp_dns_status__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_scan_get_ap_record__free_unpacked - (RpcReqWifiScanGetApRecord *message, +void rpc__event__dhcp_dns_status__free_unpacked + (RpcEventDhcpDnsStatus *message, ProtobufCAllocator *allocator); -/* RpcRespWifiScanGetApRecord methods */ -void rpc__resp__wifi_scan_get_ap_record__init - (RpcRespWifiScanGetApRecord *message); -size_t rpc__resp__wifi_scan_get_ap_record__get_packed_size - (const RpcRespWifiScanGetApRecord *message); -size_t rpc__resp__wifi_scan_get_ap_record__pack - (const RpcRespWifiScanGetApRecord *message, +/* RpcEventStaItwtSetup methods */ +void rpc__event__sta_itwt_setup__init + (RpcEventStaItwtSetup *message); +size_t rpc__event__sta_itwt_setup__get_packed_size + (const RpcEventStaItwtSetup *message); +size_t rpc__event__sta_itwt_setup__pack + (const RpcEventStaItwtSetup *message, + uint8_t *out); +size_t rpc__event__sta_itwt_setup__pack_to_buffer + (const RpcEventStaItwtSetup *message, + ProtobufCBuffer *buffer); +RpcEventStaItwtSetup * + rpc__event__sta_itwt_setup__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__event__sta_itwt_setup__free_unpacked + (RpcEventStaItwtSetup *message, + ProtobufCAllocator *allocator); +/* RpcEventStaItwtTeardown methods */ +void rpc__event__sta_itwt_teardown__init + (RpcEventStaItwtTeardown *message); +size_t rpc__event__sta_itwt_teardown__get_packed_size + (const RpcEventStaItwtTeardown *message); +size_t rpc__event__sta_itwt_teardown__pack + (const RpcEventStaItwtTeardown *message, + uint8_t *out); +size_t rpc__event__sta_itwt_teardown__pack_to_buffer + (const RpcEventStaItwtTeardown *message, + ProtobufCBuffer *buffer); +RpcEventStaItwtTeardown * + rpc__event__sta_itwt_teardown__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__event__sta_itwt_teardown__free_unpacked + (RpcEventStaItwtTeardown *message, + ProtobufCAllocator *allocator); +/* RpcEventStaItwtSuspend methods */ +void rpc__event__sta_itwt_suspend__init + (RpcEventStaItwtSuspend *message); +size_t rpc__event__sta_itwt_suspend__get_packed_size + (const RpcEventStaItwtSuspend *message); +size_t rpc__event__sta_itwt_suspend__pack + (const RpcEventStaItwtSuspend *message, uint8_t *out); -size_t rpc__resp__wifi_scan_get_ap_record__pack_to_buffer - (const RpcRespWifiScanGetApRecord *message, +size_t rpc__event__sta_itwt_suspend__pack_to_buffer + (const RpcEventStaItwtSuspend *message, ProtobufCBuffer *buffer); -RpcRespWifiScanGetApRecord * - rpc__resp__wifi_scan_get_ap_record__unpack +RpcEventStaItwtSuspend * + rpc__event__sta_itwt_suspend__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_scan_get_ap_record__free_unpacked - (RpcRespWifiScanGetApRecord *message, +void rpc__event__sta_itwt_suspend__free_unpacked + (RpcEventStaItwtSuspend *message, ProtobufCAllocator *allocator); -/* RpcReqWifiClearApList methods */ -void rpc__req__wifi_clear_ap_list__init - (RpcReqWifiClearApList *message); -size_t rpc__req__wifi_clear_ap_list__get_packed_size - (const RpcReqWifiClearApList *message); -size_t rpc__req__wifi_clear_ap_list__pack - (const RpcReqWifiClearApList *message, +/* RpcEventStaItwtProbe methods */ +void rpc__event__sta_itwt_probe__init + (RpcEventStaItwtProbe *message); +size_t rpc__event__sta_itwt_probe__get_packed_size + (const RpcEventStaItwtProbe *message); +size_t rpc__event__sta_itwt_probe__pack + (const RpcEventStaItwtProbe *message, uint8_t *out); -size_t rpc__req__wifi_clear_ap_list__pack_to_buffer - (const RpcReqWifiClearApList *message, +size_t rpc__event__sta_itwt_probe__pack_to_buffer + (const RpcEventStaItwtProbe *message, ProtobufCBuffer *buffer); -RpcReqWifiClearApList * - rpc__req__wifi_clear_ap_list__unpack +RpcEventStaItwtProbe * + rpc__event__sta_itwt_probe__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_clear_ap_list__free_unpacked - (RpcReqWifiClearApList *message, +void rpc__event__sta_itwt_probe__free_unpacked + (RpcEventStaItwtProbe *message, ProtobufCAllocator *allocator); -/* RpcRespWifiClearApList methods */ -void rpc__resp__wifi_clear_ap_list__init - (RpcRespWifiClearApList *message); -size_t rpc__resp__wifi_clear_ap_list__get_packed_size - (const RpcRespWifiClearApList *message); -size_t rpc__resp__wifi_clear_ap_list__pack - (const RpcRespWifiClearApList *message, +/* RpcReqWifiStaEnterpriseEnable methods */ +void rpc__req__wifi_sta_enterprise_enable__init + (RpcReqWifiStaEnterpriseEnable *message); +size_t rpc__req__wifi_sta_enterprise_enable__get_packed_size + (const RpcReqWifiStaEnterpriseEnable *message); +size_t rpc__req__wifi_sta_enterprise_enable__pack + (const RpcReqWifiStaEnterpriseEnable *message, uint8_t *out); -size_t rpc__resp__wifi_clear_ap_list__pack_to_buffer - (const RpcRespWifiClearApList *message, +size_t rpc__req__wifi_sta_enterprise_enable__pack_to_buffer + (const RpcReqWifiStaEnterpriseEnable *message, ProtobufCBuffer *buffer); -RpcRespWifiClearApList * - rpc__resp__wifi_clear_ap_list__unpack +RpcReqWifiStaEnterpriseEnable * + rpc__req__wifi_sta_enterprise_enable__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_clear_ap_list__free_unpacked - (RpcRespWifiClearApList *message, +void rpc__req__wifi_sta_enterprise_enable__free_unpacked + (RpcReqWifiStaEnterpriseEnable *message, ProtobufCAllocator *allocator); -/* RpcReqWifiRestore methods */ -void rpc__req__wifi_restore__init - (RpcReqWifiRestore *message); -size_t rpc__req__wifi_restore__get_packed_size - (const RpcReqWifiRestore *message); -size_t rpc__req__wifi_restore__pack - (const RpcReqWifiRestore *message, +/* RpcRespWifiStaEnterpriseEnable methods */ +void rpc__resp__wifi_sta_enterprise_enable__init + (RpcRespWifiStaEnterpriseEnable *message); +size_t rpc__resp__wifi_sta_enterprise_enable__get_packed_size + (const RpcRespWifiStaEnterpriseEnable *message); +size_t rpc__resp__wifi_sta_enterprise_enable__pack + (const RpcRespWifiStaEnterpriseEnable *message, uint8_t *out); -size_t rpc__req__wifi_restore__pack_to_buffer - (const RpcReqWifiRestore *message, +size_t rpc__resp__wifi_sta_enterprise_enable__pack_to_buffer + (const RpcRespWifiStaEnterpriseEnable *message, ProtobufCBuffer *buffer); -RpcReqWifiRestore * - rpc__req__wifi_restore__unpack +RpcRespWifiStaEnterpriseEnable * + rpc__resp__wifi_sta_enterprise_enable__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_restore__free_unpacked - (RpcReqWifiRestore *message, +void rpc__resp__wifi_sta_enterprise_enable__free_unpacked + (RpcRespWifiStaEnterpriseEnable *message, ProtobufCAllocator *allocator); -/* RpcRespWifiRestore methods */ -void rpc__resp__wifi_restore__init - (RpcRespWifiRestore *message); -size_t rpc__resp__wifi_restore__get_packed_size - (const RpcRespWifiRestore *message); -size_t rpc__resp__wifi_restore__pack - (const RpcRespWifiRestore *message, +/* RpcReqWifiStaEnterpriseDisable methods */ +void rpc__req__wifi_sta_enterprise_disable__init + (RpcReqWifiStaEnterpriseDisable *message); +size_t rpc__req__wifi_sta_enterprise_disable__get_packed_size + (const RpcReqWifiStaEnterpriseDisable *message); +size_t rpc__req__wifi_sta_enterprise_disable__pack + (const RpcReqWifiStaEnterpriseDisable *message, uint8_t *out); -size_t rpc__resp__wifi_restore__pack_to_buffer - (const RpcRespWifiRestore *message, +size_t rpc__req__wifi_sta_enterprise_disable__pack_to_buffer + (const RpcReqWifiStaEnterpriseDisable *message, ProtobufCBuffer *buffer); -RpcRespWifiRestore * - rpc__resp__wifi_restore__unpack +RpcReqWifiStaEnterpriseDisable * + rpc__req__wifi_sta_enterprise_disable__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_restore__free_unpacked - (RpcRespWifiRestore *message, +void rpc__req__wifi_sta_enterprise_disable__free_unpacked + (RpcReqWifiStaEnterpriseDisable *message, ProtobufCAllocator *allocator); -/* RpcReqWifiClearFastConnect methods */ -void rpc__req__wifi_clear_fast_connect__init - (RpcReqWifiClearFastConnect *message); -size_t rpc__req__wifi_clear_fast_connect__get_packed_size - (const RpcReqWifiClearFastConnect *message); -size_t rpc__req__wifi_clear_fast_connect__pack - (const RpcReqWifiClearFastConnect *message, +/* RpcRespWifiStaEnterpriseDisable methods */ +void rpc__resp__wifi_sta_enterprise_disable__init + (RpcRespWifiStaEnterpriseDisable *message); +size_t rpc__resp__wifi_sta_enterprise_disable__get_packed_size + (const RpcRespWifiStaEnterpriseDisable *message); +size_t rpc__resp__wifi_sta_enterprise_disable__pack + (const RpcRespWifiStaEnterpriseDisable *message, uint8_t *out); -size_t rpc__req__wifi_clear_fast_connect__pack_to_buffer - (const RpcReqWifiClearFastConnect *message, +size_t rpc__resp__wifi_sta_enterprise_disable__pack_to_buffer + (const RpcRespWifiStaEnterpriseDisable *message, ProtobufCBuffer *buffer); -RpcReqWifiClearFastConnect * - rpc__req__wifi_clear_fast_connect__unpack +RpcRespWifiStaEnterpriseDisable * + rpc__resp__wifi_sta_enterprise_disable__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_clear_fast_connect__free_unpacked - (RpcReqWifiClearFastConnect *message, +void rpc__resp__wifi_sta_enterprise_disable__free_unpacked + (RpcRespWifiStaEnterpriseDisable *message, ProtobufCAllocator *allocator); -/* RpcRespWifiClearFastConnect methods */ -void rpc__resp__wifi_clear_fast_connect__init - (RpcRespWifiClearFastConnect *message); -size_t rpc__resp__wifi_clear_fast_connect__get_packed_size - (const RpcRespWifiClearFastConnect *message); -size_t rpc__resp__wifi_clear_fast_connect__pack - (const RpcRespWifiClearFastConnect *message, +/* RpcReqEapSetIdentity methods */ +void rpc__req__eap_set_identity__init + (RpcReqEapSetIdentity *message); +size_t rpc__req__eap_set_identity__get_packed_size + (const RpcReqEapSetIdentity *message); +size_t rpc__req__eap_set_identity__pack + (const RpcReqEapSetIdentity *message, uint8_t *out); -size_t rpc__resp__wifi_clear_fast_connect__pack_to_buffer - (const RpcRespWifiClearFastConnect *message, +size_t rpc__req__eap_set_identity__pack_to_buffer + (const RpcReqEapSetIdentity *message, ProtobufCBuffer *buffer); -RpcRespWifiClearFastConnect * - rpc__resp__wifi_clear_fast_connect__unpack +RpcReqEapSetIdentity * + rpc__req__eap_set_identity__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_clear_fast_connect__free_unpacked - (RpcRespWifiClearFastConnect *message, +void rpc__req__eap_set_identity__free_unpacked + (RpcReqEapSetIdentity *message, ProtobufCAllocator *allocator); -/* RpcReqWifiDeauthSta methods */ -void rpc__req__wifi_deauth_sta__init - (RpcReqWifiDeauthSta *message); -size_t rpc__req__wifi_deauth_sta__get_packed_size - (const RpcReqWifiDeauthSta *message); -size_t rpc__req__wifi_deauth_sta__pack - (const RpcReqWifiDeauthSta *message, +/* RpcRespEapSetIdentity methods */ +void rpc__resp__eap_set_identity__init + (RpcRespEapSetIdentity *message); +size_t rpc__resp__eap_set_identity__get_packed_size + (const RpcRespEapSetIdentity *message); +size_t rpc__resp__eap_set_identity__pack + (const RpcRespEapSetIdentity *message, uint8_t *out); -size_t rpc__req__wifi_deauth_sta__pack_to_buffer - (const RpcReqWifiDeauthSta *message, +size_t rpc__resp__eap_set_identity__pack_to_buffer + (const RpcRespEapSetIdentity *message, ProtobufCBuffer *buffer); -RpcReqWifiDeauthSta * - rpc__req__wifi_deauth_sta__unpack +RpcRespEapSetIdentity * + rpc__resp__eap_set_identity__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_deauth_sta__free_unpacked - (RpcReqWifiDeauthSta *message, +void rpc__resp__eap_set_identity__free_unpacked + (RpcRespEapSetIdentity *message, ProtobufCAllocator *allocator); -/* RpcRespWifiDeauthSta methods */ -void rpc__resp__wifi_deauth_sta__init - (RpcRespWifiDeauthSta *message); -size_t rpc__resp__wifi_deauth_sta__get_packed_size - (const RpcRespWifiDeauthSta *message); -size_t rpc__resp__wifi_deauth_sta__pack - (const RpcRespWifiDeauthSta *message, +/* RpcReqEapClearIdentity methods */ +void rpc__req__eap_clear_identity__init + (RpcReqEapClearIdentity *message); +size_t rpc__req__eap_clear_identity__get_packed_size + (const RpcReqEapClearIdentity *message); +size_t rpc__req__eap_clear_identity__pack + (const RpcReqEapClearIdentity *message, uint8_t *out); -size_t rpc__resp__wifi_deauth_sta__pack_to_buffer - (const RpcRespWifiDeauthSta *message, +size_t rpc__req__eap_clear_identity__pack_to_buffer + (const RpcReqEapClearIdentity *message, ProtobufCBuffer *buffer); -RpcRespWifiDeauthSta * - rpc__resp__wifi_deauth_sta__unpack +RpcReqEapClearIdentity * + rpc__req__eap_clear_identity__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_deauth_sta__free_unpacked - (RpcRespWifiDeauthSta *message, +void rpc__req__eap_clear_identity__free_unpacked + (RpcReqEapClearIdentity *message, ProtobufCAllocator *allocator); -/* RpcReqWifiStaGetApInfo methods */ -void rpc__req__wifi_sta_get_ap_info__init - (RpcReqWifiStaGetApInfo *message); -size_t rpc__req__wifi_sta_get_ap_info__get_packed_size - (const RpcReqWifiStaGetApInfo *message); -size_t rpc__req__wifi_sta_get_ap_info__pack - (const RpcReqWifiStaGetApInfo *message, +/* RpcRespEapClearIdentity methods */ +void rpc__resp__eap_clear_identity__init + (RpcRespEapClearIdentity *message); +size_t rpc__resp__eap_clear_identity__get_packed_size + (const RpcRespEapClearIdentity *message); +size_t rpc__resp__eap_clear_identity__pack + (const RpcRespEapClearIdentity *message, uint8_t *out); -size_t rpc__req__wifi_sta_get_ap_info__pack_to_buffer - (const RpcReqWifiStaGetApInfo *message, +size_t rpc__resp__eap_clear_identity__pack_to_buffer + (const RpcRespEapClearIdentity *message, ProtobufCBuffer *buffer); -RpcReqWifiStaGetApInfo * - rpc__req__wifi_sta_get_ap_info__unpack +RpcRespEapClearIdentity * + rpc__resp__eap_clear_identity__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_sta_get_ap_info__free_unpacked - (RpcReqWifiStaGetApInfo *message, +void rpc__resp__eap_clear_identity__free_unpacked + (RpcRespEapClearIdentity *message, ProtobufCAllocator *allocator); -/* RpcRespWifiStaGetApInfo methods */ -void rpc__resp__wifi_sta_get_ap_info__init - (RpcRespWifiStaGetApInfo *message); -size_t rpc__resp__wifi_sta_get_ap_info__get_packed_size - (const RpcRespWifiStaGetApInfo *message); -size_t rpc__resp__wifi_sta_get_ap_info__pack - (const RpcRespWifiStaGetApInfo *message, +/* RpcReqEapSetUsername methods */ +void rpc__req__eap_set_username__init + (RpcReqEapSetUsername *message); +size_t rpc__req__eap_set_username__get_packed_size + (const RpcReqEapSetUsername *message); +size_t rpc__req__eap_set_username__pack + (const RpcReqEapSetUsername *message, uint8_t *out); -size_t rpc__resp__wifi_sta_get_ap_info__pack_to_buffer - (const RpcRespWifiStaGetApInfo *message, +size_t rpc__req__eap_set_username__pack_to_buffer + (const RpcReqEapSetUsername *message, ProtobufCBuffer *buffer); -RpcRespWifiStaGetApInfo * - rpc__resp__wifi_sta_get_ap_info__unpack +RpcReqEapSetUsername * + rpc__req__eap_set_username__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_sta_get_ap_info__free_unpacked - (RpcRespWifiStaGetApInfo *message, +void rpc__req__eap_set_username__free_unpacked + (RpcReqEapSetUsername *message, ProtobufCAllocator *allocator); -/* RpcReqWifiSetProtocol methods */ -void rpc__req__wifi_set_protocol__init - (RpcReqWifiSetProtocol *message); -size_t rpc__req__wifi_set_protocol__get_packed_size - (const RpcReqWifiSetProtocol *message); -size_t rpc__req__wifi_set_protocol__pack - (const RpcReqWifiSetProtocol *message, +/* RpcRespEapSetUsername methods */ +void rpc__resp__eap_set_username__init + (RpcRespEapSetUsername *message); +size_t rpc__resp__eap_set_username__get_packed_size + (const RpcRespEapSetUsername *message); +size_t rpc__resp__eap_set_username__pack + (const RpcRespEapSetUsername *message, uint8_t *out); -size_t rpc__req__wifi_set_protocol__pack_to_buffer - (const RpcReqWifiSetProtocol *message, +size_t rpc__resp__eap_set_username__pack_to_buffer + (const RpcRespEapSetUsername *message, ProtobufCBuffer *buffer); -RpcReqWifiSetProtocol * - rpc__req__wifi_set_protocol__unpack +RpcRespEapSetUsername * + rpc__resp__eap_set_username__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_set_protocol__free_unpacked - (RpcReqWifiSetProtocol *message, +void rpc__resp__eap_set_username__free_unpacked + (RpcRespEapSetUsername *message, ProtobufCAllocator *allocator); -/* RpcRespWifiSetProtocol methods */ -void rpc__resp__wifi_set_protocol__init - (RpcRespWifiSetProtocol *message); -size_t rpc__resp__wifi_set_protocol__get_packed_size - (const RpcRespWifiSetProtocol *message); -size_t rpc__resp__wifi_set_protocol__pack - (const RpcRespWifiSetProtocol *message, +/* RpcReqEapClearUsername methods */ +void rpc__req__eap_clear_username__init + (RpcReqEapClearUsername *message); +size_t rpc__req__eap_clear_username__get_packed_size + (const RpcReqEapClearUsername *message); +size_t rpc__req__eap_clear_username__pack + (const RpcReqEapClearUsername *message, uint8_t *out); -size_t rpc__resp__wifi_set_protocol__pack_to_buffer - (const RpcRespWifiSetProtocol *message, +size_t rpc__req__eap_clear_username__pack_to_buffer + (const RpcReqEapClearUsername *message, ProtobufCBuffer *buffer); -RpcRespWifiSetProtocol * - rpc__resp__wifi_set_protocol__unpack +RpcReqEapClearUsername * + rpc__req__eap_clear_username__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_set_protocol__free_unpacked - (RpcRespWifiSetProtocol *message, +void rpc__req__eap_clear_username__free_unpacked + (RpcReqEapClearUsername *message, ProtobufCAllocator *allocator); -/* RpcReqWifiGetProtocol methods */ -void rpc__req__wifi_get_protocol__init - (RpcReqWifiGetProtocol *message); -size_t rpc__req__wifi_get_protocol__get_packed_size - (const RpcReqWifiGetProtocol *message); -size_t rpc__req__wifi_get_protocol__pack - (const RpcReqWifiGetProtocol *message, +/* RpcRespEapClearUsername methods */ +void rpc__resp__eap_clear_username__init + (RpcRespEapClearUsername *message); +size_t rpc__resp__eap_clear_username__get_packed_size + (const RpcRespEapClearUsername *message); +size_t rpc__resp__eap_clear_username__pack + (const RpcRespEapClearUsername *message, uint8_t *out); -size_t rpc__req__wifi_get_protocol__pack_to_buffer - (const RpcReqWifiGetProtocol *message, +size_t rpc__resp__eap_clear_username__pack_to_buffer + (const RpcRespEapClearUsername *message, ProtobufCBuffer *buffer); -RpcReqWifiGetProtocol * - rpc__req__wifi_get_protocol__unpack +RpcRespEapClearUsername * + rpc__resp__eap_clear_username__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_get_protocol__free_unpacked - (RpcReqWifiGetProtocol *message, +void rpc__resp__eap_clear_username__free_unpacked + (RpcRespEapClearUsername *message, ProtobufCAllocator *allocator); -/* RpcRespWifiGetProtocol methods */ -void rpc__resp__wifi_get_protocol__init - (RpcRespWifiGetProtocol *message); -size_t rpc__resp__wifi_get_protocol__get_packed_size - (const RpcRespWifiGetProtocol *message); -size_t rpc__resp__wifi_get_protocol__pack - (const RpcRespWifiGetProtocol *message, +/* RpcReqEapSetPassword methods */ +void rpc__req__eap_set_password__init + (RpcReqEapSetPassword *message); +size_t rpc__req__eap_set_password__get_packed_size + (const RpcReqEapSetPassword *message); +size_t rpc__req__eap_set_password__pack + (const RpcReqEapSetPassword *message, uint8_t *out); -size_t rpc__resp__wifi_get_protocol__pack_to_buffer - (const RpcRespWifiGetProtocol *message, +size_t rpc__req__eap_set_password__pack_to_buffer + (const RpcReqEapSetPassword *message, ProtobufCBuffer *buffer); -RpcRespWifiGetProtocol * - rpc__resp__wifi_get_protocol__unpack +RpcReqEapSetPassword * + rpc__req__eap_set_password__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_get_protocol__free_unpacked - (RpcRespWifiGetProtocol *message, +void rpc__req__eap_set_password__free_unpacked + (RpcReqEapSetPassword *message, ProtobufCAllocator *allocator); -/* RpcReqWifiSetBandwidth methods */ -void rpc__req__wifi_set_bandwidth__init - (RpcReqWifiSetBandwidth *message); -size_t rpc__req__wifi_set_bandwidth__get_packed_size - (const RpcReqWifiSetBandwidth *message); -size_t rpc__req__wifi_set_bandwidth__pack - (const RpcReqWifiSetBandwidth *message, +/* RpcRespEapSetPassword methods */ +void rpc__resp__eap_set_password__init + (RpcRespEapSetPassword *message); +size_t rpc__resp__eap_set_password__get_packed_size + (const RpcRespEapSetPassword *message); +size_t rpc__resp__eap_set_password__pack + (const RpcRespEapSetPassword *message, uint8_t *out); -size_t rpc__req__wifi_set_bandwidth__pack_to_buffer - (const RpcReqWifiSetBandwidth *message, +size_t rpc__resp__eap_set_password__pack_to_buffer + (const RpcRespEapSetPassword *message, ProtobufCBuffer *buffer); -RpcReqWifiSetBandwidth * - rpc__req__wifi_set_bandwidth__unpack +RpcRespEapSetPassword * + rpc__resp__eap_set_password__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_set_bandwidth__free_unpacked - (RpcReqWifiSetBandwidth *message, +void rpc__resp__eap_set_password__free_unpacked + (RpcRespEapSetPassword *message, ProtobufCAllocator *allocator); -/* RpcRespWifiSetBandwidth methods */ -void rpc__resp__wifi_set_bandwidth__init - (RpcRespWifiSetBandwidth *message); -size_t rpc__resp__wifi_set_bandwidth__get_packed_size - (const RpcRespWifiSetBandwidth *message); -size_t rpc__resp__wifi_set_bandwidth__pack - (const RpcRespWifiSetBandwidth *message, +/* RpcReqEapClearPassword methods */ +void rpc__req__eap_clear_password__init + (RpcReqEapClearPassword *message); +size_t rpc__req__eap_clear_password__get_packed_size + (const RpcReqEapClearPassword *message); +size_t rpc__req__eap_clear_password__pack + (const RpcReqEapClearPassword *message, uint8_t *out); -size_t rpc__resp__wifi_set_bandwidth__pack_to_buffer - (const RpcRespWifiSetBandwidth *message, +size_t rpc__req__eap_clear_password__pack_to_buffer + (const RpcReqEapClearPassword *message, ProtobufCBuffer *buffer); -RpcRespWifiSetBandwidth * - rpc__resp__wifi_set_bandwidth__unpack +RpcReqEapClearPassword * + rpc__req__eap_clear_password__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_set_bandwidth__free_unpacked - (RpcRespWifiSetBandwidth *message, +void rpc__req__eap_clear_password__free_unpacked + (RpcReqEapClearPassword *message, ProtobufCAllocator *allocator); -/* RpcReqWifiGetBandwidth methods */ -void rpc__req__wifi_get_bandwidth__init - (RpcReqWifiGetBandwidth *message); -size_t rpc__req__wifi_get_bandwidth__get_packed_size - (const RpcReqWifiGetBandwidth *message); -size_t rpc__req__wifi_get_bandwidth__pack - (const RpcReqWifiGetBandwidth *message, +/* RpcRespEapClearPassword methods */ +void rpc__resp__eap_clear_password__init + (RpcRespEapClearPassword *message); +size_t rpc__resp__eap_clear_password__get_packed_size + (const RpcRespEapClearPassword *message); +size_t rpc__resp__eap_clear_password__pack + (const RpcRespEapClearPassword *message, uint8_t *out); -size_t rpc__req__wifi_get_bandwidth__pack_to_buffer - (const RpcReqWifiGetBandwidth *message, +size_t rpc__resp__eap_clear_password__pack_to_buffer + (const RpcRespEapClearPassword *message, ProtobufCBuffer *buffer); -RpcReqWifiGetBandwidth * - rpc__req__wifi_get_bandwidth__unpack +RpcRespEapClearPassword * + rpc__resp__eap_clear_password__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_get_bandwidth__free_unpacked - (RpcReqWifiGetBandwidth *message, +void rpc__resp__eap_clear_password__free_unpacked + (RpcRespEapClearPassword *message, ProtobufCAllocator *allocator); -/* RpcRespWifiGetBandwidth methods */ -void rpc__resp__wifi_get_bandwidth__init - (RpcRespWifiGetBandwidth *message); -size_t rpc__resp__wifi_get_bandwidth__get_packed_size - (const RpcRespWifiGetBandwidth *message); -size_t rpc__resp__wifi_get_bandwidth__pack - (const RpcRespWifiGetBandwidth *message, +/* RpcReqEapSetNewPassword methods */ +void rpc__req__eap_set_new_password__init + (RpcReqEapSetNewPassword *message); +size_t rpc__req__eap_set_new_password__get_packed_size + (const RpcReqEapSetNewPassword *message); +size_t rpc__req__eap_set_new_password__pack + (const RpcReqEapSetNewPassword *message, uint8_t *out); -size_t rpc__resp__wifi_get_bandwidth__pack_to_buffer - (const RpcRespWifiGetBandwidth *message, +size_t rpc__req__eap_set_new_password__pack_to_buffer + (const RpcReqEapSetNewPassword *message, ProtobufCBuffer *buffer); -RpcRespWifiGetBandwidth * - rpc__resp__wifi_get_bandwidth__unpack +RpcReqEapSetNewPassword * + rpc__req__eap_set_new_password__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_get_bandwidth__free_unpacked - (RpcRespWifiGetBandwidth *message, +void rpc__req__eap_set_new_password__free_unpacked + (RpcReqEapSetNewPassword *message, ProtobufCAllocator *allocator); -/* RpcReqWifiSetChannel methods */ -void rpc__req__wifi_set_channel__init - (RpcReqWifiSetChannel *message); -size_t rpc__req__wifi_set_channel__get_packed_size - (const RpcReqWifiSetChannel *message); -size_t rpc__req__wifi_set_channel__pack - (const RpcReqWifiSetChannel *message, +/* RpcRespEapSetNewPassword methods */ +void rpc__resp__eap_set_new_password__init + (RpcRespEapSetNewPassword *message); +size_t rpc__resp__eap_set_new_password__get_packed_size + (const RpcRespEapSetNewPassword *message); +size_t rpc__resp__eap_set_new_password__pack + (const RpcRespEapSetNewPassword *message, uint8_t *out); -size_t rpc__req__wifi_set_channel__pack_to_buffer - (const RpcReqWifiSetChannel *message, +size_t rpc__resp__eap_set_new_password__pack_to_buffer + (const RpcRespEapSetNewPassword *message, ProtobufCBuffer *buffer); -RpcReqWifiSetChannel * - rpc__req__wifi_set_channel__unpack +RpcRespEapSetNewPassword * + rpc__resp__eap_set_new_password__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_set_channel__free_unpacked - (RpcReqWifiSetChannel *message, +void rpc__resp__eap_set_new_password__free_unpacked + (RpcRespEapSetNewPassword *message, ProtobufCAllocator *allocator); -/* RpcRespWifiSetChannel methods */ -void rpc__resp__wifi_set_channel__init - (RpcRespWifiSetChannel *message); -size_t rpc__resp__wifi_set_channel__get_packed_size - (const RpcRespWifiSetChannel *message); -size_t rpc__resp__wifi_set_channel__pack - (const RpcRespWifiSetChannel *message, +/* RpcReqEapClearNewPassword methods */ +void rpc__req__eap_clear_new_password__init + (RpcReqEapClearNewPassword *message); +size_t rpc__req__eap_clear_new_password__get_packed_size + (const RpcReqEapClearNewPassword *message); +size_t rpc__req__eap_clear_new_password__pack + (const RpcReqEapClearNewPassword *message, uint8_t *out); -size_t rpc__resp__wifi_set_channel__pack_to_buffer - (const RpcRespWifiSetChannel *message, +size_t rpc__req__eap_clear_new_password__pack_to_buffer + (const RpcReqEapClearNewPassword *message, ProtobufCBuffer *buffer); -RpcRespWifiSetChannel * - rpc__resp__wifi_set_channel__unpack +RpcReqEapClearNewPassword * + rpc__req__eap_clear_new_password__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_set_channel__free_unpacked - (RpcRespWifiSetChannel *message, +void rpc__req__eap_clear_new_password__free_unpacked + (RpcReqEapClearNewPassword *message, ProtobufCAllocator *allocator); -/* RpcReqWifiGetChannel methods */ -void rpc__req__wifi_get_channel__init - (RpcReqWifiGetChannel *message); -size_t rpc__req__wifi_get_channel__get_packed_size - (const RpcReqWifiGetChannel *message); -size_t rpc__req__wifi_get_channel__pack - (const RpcReqWifiGetChannel *message, +/* RpcRespEapClearNewPassword methods */ +void rpc__resp__eap_clear_new_password__init + (RpcRespEapClearNewPassword *message); +size_t rpc__resp__eap_clear_new_password__get_packed_size + (const RpcRespEapClearNewPassword *message); +size_t rpc__resp__eap_clear_new_password__pack + (const RpcRespEapClearNewPassword *message, uint8_t *out); -size_t rpc__req__wifi_get_channel__pack_to_buffer - (const RpcReqWifiGetChannel *message, +size_t rpc__resp__eap_clear_new_password__pack_to_buffer + (const RpcRespEapClearNewPassword *message, ProtobufCBuffer *buffer); -RpcReqWifiGetChannel * - rpc__req__wifi_get_channel__unpack +RpcRespEapClearNewPassword * + rpc__resp__eap_clear_new_password__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_get_channel__free_unpacked - (RpcReqWifiGetChannel *message, +void rpc__resp__eap_clear_new_password__free_unpacked + (RpcRespEapClearNewPassword *message, ProtobufCAllocator *allocator); -/* RpcRespWifiGetChannel methods */ -void rpc__resp__wifi_get_channel__init - (RpcRespWifiGetChannel *message); -size_t rpc__resp__wifi_get_channel__get_packed_size - (const RpcRespWifiGetChannel *message); -size_t rpc__resp__wifi_get_channel__pack - (const RpcRespWifiGetChannel *message, +/* RpcReqEapSetCaCert methods */ +void rpc__req__eap_set_ca_cert__init + (RpcReqEapSetCaCert *message); +size_t rpc__req__eap_set_ca_cert__get_packed_size + (const RpcReqEapSetCaCert *message); +size_t rpc__req__eap_set_ca_cert__pack + (const RpcReqEapSetCaCert *message, uint8_t *out); -size_t rpc__resp__wifi_get_channel__pack_to_buffer - (const RpcRespWifiGetChannel *message, +size_t rpc__req__eap_set_ca_cert__pack_to_buffer + (const RpcReqEapSetCaCert *message, ProtobufCBuffer *buffer); -RpcRespWifiGetChannel * - rpc__resp__wifi_get_channel__unpack +RpcReqEapSetCaCert * + rpc__req__eap_set_ca_cert__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_get_channel__free_unpacked - (RpcRespWifiGetChannel *message, +void rpc__req__eap_set_ca_cert__free_unpacked + (RpcReqEapSetCaCert *message, ProtobufCAllocator *allocator); -/* RpcReqWifiSetStorage methods */ -void rpc__req__wifi_set_storage__init - (RpcReqWifiSetStorage *message); -size_t rpc__req__wifi_set_storage__get_packed_size - (const RpcReqWifiSetStorage *message); -size_t rpc__req__wifi_set_storage__pack - (const RpcReqWifiSetStorage *message, +/* RpcRespEapSetCaCert methods */ +void rpc__resp__eap_set_ca_cert__init + (RpcRespEapSetCaCert *message); +size_t rpc__resp__eap_set_ca_cert__get_packed_size + (const RpcRespEapSetCaCert *message); +size_t rpc__resp__eap_set_ca_cert__pack + (const RpcRespEapSetCaCert *message, uint8_t *out); -size_t rpc__req__wifi_set_storage__pack_to_buffer - (const RpcReqWifiSetStorage *message, +size_t rpc__resp__eap_set_ca_cert__pack_to_buffer + (const RpcRespEapSetCaCert *message, ProtobufCBuffer *buffer); -RpcReqWifiSetStorage * - rpc__req__wifi_set_storage__unpack +RpcRespEapSetCaCert * + rpc__resp__eap_set_ca_cert__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_set_storage__free_unpacked - (RpcReqWifiSetStorage *message, +void rpc__resp__eap_set_ca_cert__free_unpacked + (RpcRespEapSetCaCert *message, ProtobufCAllocator *allocator); -/* RpcRespWifiSetStorage methods */ -void rpc__resp__wifi_set_storage__init - (RpcRespWifiSetStorage *message); -size_t rpc__resp__wifi_set_storage__get_packed_size - (const RpcRespWifiSetStorage *message); -size_t rpc__resp__wifi_set_storage__pack - (const RpcRespWifiSetStorage *message, +/* RpcReqEapClearCaCert methods */ +void rpc__req__eap_clear_ca_cert__init + (RpcReqEapClearCaCert *message); +size_t rpc__req__eap_clear_ca_cert__get_packed_size + (const RpcReqEapClearCaCert *message); +size_t rpc__req__eap_clear_ca_cert__pack + (const RpcReqEapClearCaCert *message, uint8_t *out); -size_t rpc__resp__wifi_set_storage__pack_to_buffer - (const RpcRespWifiSetStorage *message, +size_t rpc__req__eap_clear_ca_cert__pack_to_buffer + (const RpcReqEapClearCaCert *message, ProtobufCBuffer *buffer); -RpcRespWifiSetStorage * - rpc__resp__wifi_set_storage__unpack +RpcReqEapClearCaCert * + rpc__req__eap_clear_ca_cert__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_set_storage__free_unpacked - (RpcRespWifiSetStorage *message, +void rpc__req__eap_clear_ca_cert__free_unpacked + (RpcReqEapClearCaCert *message, ProtobufCAllocator *allocator); -/* RpcReqWifiSetCountryCode methods */ -void rpc__req__wifi_set_country_code__init - (RpcReqWifiSetCountryCode *message); -size_t rpc__req__wifi_set_country_code__get_packed_size - (const RpcReqWifiSetCountryCode *message); -size_t rpc__req__wifi_set_country_code__pack - (const RpcReqWifiSetCountryCode *message, +/* RpcRespEapClearCaCert methods */ +void rpc__resp__eap_clear_ca_cert__init + (RpcRespEapClearCaCert *message); +size_t rpc__resp__eap_clear_ca_cert__get_packed_size + (const RpcRespEapClearCaCert *message); +size_t rpc__resp__eap_clear_ca_cert__pack + (const RpcRespEapClearCaCert *message, uint8_t *out); -size_t rpc__req__wifi_set_country_code__pack_to_buffer - (const RpcReqWifiSetCountryCode *message, +size_t rpc__resp__eap_clear_ca_cert__pack_to_buffer + (const RpcRespEapClearCaCert *message, ProtobufCBuffer *buffer); -RpcReqWifiSetCountryCode * - rpc__req__wifi_set_country_code__unpack +RpcRespEapClearCaCert * + rpc__resp__eap_clear_ca_cert__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_set_country_code__free_unpacked - (RpcReqWifiSetCountryCode *message, +void rpc__resp__eap_clear_ca_cert__free_unpacked + (RpcRespEapClearCaCert *message, ProtobufCAllocator *allocator); -/* RpcRespWifiSetCountryCode methods */ -void rpc__resp__wifi_set_country_code__init - (RpcRespWifiSetCountryCode *message); -size_t rpc__resp__wifi_set_country_code__get_packed_size - (const RpcRespWifiSetCountryCode *message); -size_t rpc__resp__wifi_set_country_code__pack - (const RpcRespWifiSetCountryCode *message, +/* RpcReqEapSetCertificateAndKey methods */ +void rpc__req__eap_set_certificate_and_key__init + (RpcReqEapSetCertificateAndKey *message); +size_t rpc__req__eap_set_certificate_and_key__get_packed_size + (const RpcReqEapSetCertificateAndKey *message); +size_t rpc__req__eap_set_certificate_and_key__pack + (const RpcReqEapSetCertificateAndKey *message, uint8_t *out); -size_t rpc__resp__wifi_set_country_code__pack_to_buffer - (const RpcRespWifiSetCountryCode *message, +size_t rpc__req__eap_set_certificate_and_key__pack_to_buffer + (const RpcReqEapSetCertificateAndKey *message, ProtobufCBuffer *buffer); -RpcRespWifiSetCountryCode * - rpc__resp__wifi_set_country_code__unpack +RpcReqEapSetCertificateAndKey * + rpc__req__eap_set_certificate_and_key__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_set_country_code__free_unpacked - (RpcRespWifiSetCountryCode *message, +void rpc__req__eap_set_certificate_and_key__free_unpacked + (RpcReqEapSetCertificateAndKey *message, ProtobufCAllocator *allocator); -/* RpcReqWifiGetCountryCode methods */ -void rpc__req__wifi_get_country_code__init - (RpcReqWifiGetCountryCode *message); -size_t rpc__req__wifi_get_country_code__get_packed_size - (const RpcReqWifiGetCountryCode *message); -size_t rpc__req__wifi_get_country_code__pack - (const RpcReqWifiGetCountryCode *message, +/* RpcRespEapSetCertificateAndKey methods */ +void rpc__resp__eap_set_certificate_and_key__init + (RpcRespEapSetCertificateAndKey *message); +size_t rpc__resp__eap_set_certificate_and_key__get_packed_size + (const RpcRespEapSetCertificateAndKey *message); +size_t rpc__resp__eap_set_certificate_and_key__pack + (const RpcRespEapSetCertificateAndKey *message, uint8_t *out); -size_t rpc__req__wifi_get_country_code__pack_to_buffer - (const RpcReqWifiGetCountryCode *message, +size_t rpc__resp__eap_set_certificate_and_key__pack_to_buffer + (const RpcRespEapSetCertificateAndKey *message, ProtobufCBuffer *buffer); -RpcReqWifiGetCountryCode * - rpc__req__wifi_get_country_code__unpack +RpcRespEapSetCertificateAndKey * + rpc__resp__eap_set_certificate_and_key__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_get_country_code__free_unpacked - (RpcReqWifiGetCountryCode *message, +void rpc__resp__eap_set_certificate_and_key__free_unpacked + (RpcRespEapSetCertificateAndKey *message, ProtobufCAllocator *allocator); -/* RpcRespWifiGetCountryCode methods */ -void rpc__resp__wifi_get_country_code__init - (RpcRespWifiGetCountryCode *message); -size_t rpc__resp__wifi_get_country_code__get_packed_size - (const RpcRespWifiGetCountryCode *message); -size_t rpc__resp__wifi_get_country_code__pack - (const RpcRespWifiGetCountryCode *message, +/* RpcReqEapClearCertificateAndKey methods */ +void rpc__req__eap_clear_certificate_and_key__init + (RpcReqEapClearCertificateAndKey *message); +size_t rpc__req__eap_clear_certificate_and_key__get_packed_size + (const RpcReqEapClearCertificateAndKey *message); +size_t rpc__req__eap_clear_certificate_and_key__pack + (const RpcReqEapClearCertificateAndKey *message, uint8_t *out); -size_t rpc__resp__wifi_get_country_code__pack_to_buffer - (const RpcRespWifiGetCountryCode *message, +size_t rpc__req__eap_clear_certificate_and_key__pack_to_buffer + (const RpcReqEapClearCertificateAndKey *message, ProtobufCBuffer *buffer); -RpcRespWifiGetCountryCode * - rpc__resp__wifi_get_country_code__unpack +RpcReqEapClearCertificateAndKey * + rpc__req__eap_clear_certificate_and_key__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_get_country_code__free_unpacked - (RpcRespWifiGetCountryCode *message, +void rpc__req__eap_clear_certificate_and_key__free_unpacked + (RpcReqEapClearCertificateAndKey *message, ProtobufCAllocator *allocator); -/* RpcReqWifiSetCountry methods */ -void rpc__req__wifi_set_country__init - (RpcReqWifiSetCountry *message); -size_t rpc__req__wifi_set_country__get_packed_size - (const RpcReqWifiSetCountry *message); -size_t rpc__req__wifi_set_country__pack - (const RpcReqWifiSetCountry *message, +/* RpcRespEapClearCertificateAndKey methods */ +void rpc__resp__eap_clear_certificate_and_key__init + (RpcRespEapClearCertificateAndKey *message); +size_t rpc__resp__eap_clear_certificate_and_key__get_packed_size + (const RpcRespEapClearCertificateAndKey *message); +size_t rpc__resp__eap_clear_certificate_and_key__pack + (const RpcRespEapClearCertificateAndKey *message, uint8_t *out); -size_t rpc__req__wifi_set_country__pack_to_buffer - (const RpcReqWifiSetCountry *message, +size_t rpc__resp__eap_clear_certificate_and_key__pack_to_buffer + (const RpcRespEapClearCertificateAndKey *message, ProtobufCBuffer *buffer); -RpcReqWifiSetCountry * - rpc__req__wifi_set_country__unpack +RpcRespEapClearCertificateAndKey * + rpc__resp__eap_clear_certificate_and_key__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_set_country__free_unpacked - (RpcReqWifiSetCountry *message, +void rpc__resp__eap_clear_certificate_and_key__free_unpacked + (RpcRespEapClearCertificateAndKey *message, ProtobufCAllocator *allocator); -/* RpcRespWifiSetCountry methods */ -void rpc__resp__wifi_set_country__init - (RpcRespWifiSetCountry *message); -size_t rpc__resp__wifi_set_country__get_packed_size - (const RpcRespWifiSetCountry *message); -size_t rpc__resp__wifi_set_country__pack - (const RpcRespWifiSetCountry *message, +/* RpcReqEapSetDisableTimeCheck methods */ +void rpc__req__eap_set_disable_time_check__init + (RpcReqEapSetDisableTimeCheck *message); +size_t rpc__req__eap_set_disable_time_check__get_packed_size + (const RpcReqEapSetDisableTimeCheck *message); +size_t rpc__req__eap_set_disable_time_check__pack + (const RpcReqEapSetDisableTimeCheck *message, uint8_t *out); -size_t rpc__resp__wifi_set_country__pack_to_buffer - (const RpcRespWifiSetCountry *message, +size_t rpc__req__eap_set_disable_time_check__pack_to_buffer + (const RpcReqEapSetDisableTimeCheck *message, ProtobufCBuffer *buffer); -RpcRespWifiSetCountry * - rpc__resp__wifi_set_country__unpack +RpcReqEapSetDisableTimeCheck * + rpc__req__eap_set_disable_time_check__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_set_country__free_unpacked - (RpcRespWifiSetCountry *message, +void rpc__req__eap_set_disable_time_check__free_unpacked + (RpcReqEapSetDisableTimeCheck *message, ProtobufCAllocator *allocator); -/* RpcReqWifiGetCountry methods */ -void rpc__req__wifi_get_country__init - (RpcReqWifiGetCountry *message); -size_t rpc__req__wifi_get_country__get_packed_size - (const RpcReqWifiGetCountry *message); -size_t rpc__req__wifi_get_country__pack - (const RpcReqWifiGetCountry *message, +/* RpcRespEapSetDisableTimeCheck methods */ +void rpc__resp__eap_set_disable_time_check__init + (RpcRespEapSetDisableTimeCheck *message); +size_t rpc__resp__eap_set_disable_time_check__get_packed_size + (const RpcRespEapSetDisableTimeCheck *message); +size_t rpc__resp__eap_set_disable_time_check__pack + (const RpcRespEapSetDisableTimeCheck *message, uint8_t *out); -size_t rpc__req__wifi_get_country__pack_to_buffer - (const RpcReqWifiGetCountry *message, +size_t rpc__resp__eap_set_disable_time_check__pack_to_buffer + (const RpcRespEapSetDisableTimeCheck *message, ProtobufCBuffer *buffer); -RpcReqWifiGetCountry * - rpc__req__wifi_get_country__unpack +RpcRespEapSetDisableTimeCheck * + rpc__resp__eap_set_disable_time_check__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_get_country__free_unpacked - (RpcReqWifiGetCountry *message, +void rpc__resp__eap_set_disable_time_check__free_unpacked + (RpcRespEapSetDisableTimeCheck *message, ProtobufCAllocator *allocator); -/* RpcRespWifiGetCountry methods */ -void rpc__resp__wifi_get_country__init - (RpcRespWifiGetCountry *message); -size_t rpc__resp__wifi_get_country__get_packed_size - (const RpcRespWifiGetCountry *message); -size_t rpc__resp__wifi_get_country__pack - (const RpcRespWifiGetCountry *message, +/* RpcReqEapGetDisableTimeCheck methods */ +void rpc__req__eap_get_disable_time_check__init + (RpcReqEapGetDisableTimeCheck *message); +size_t rpc__req__eap_get_disable_time_check__get_packed_size + (const RpcReqEapGetDisableTimeCheck *message); +size_t rpc__req__eap_get_disable_time_check__pack + (const RpcReqEapGetDisableTimeCheck *message, uint8_t *out); -size_t rpc__resp__wifi_get_country__pack_to_buffer - (const RpcRespWifiGetCountry *message, +size_t rpc__req__eap_get_disable_time_check__pack_to_buffer + (const RpcReqEapGetDisableTimeCheck *message, ProtobufCBuffer *buffer); -RpcRespWifiGetCountry * - rpc__resp__wifi_get_country__unpack +RpcReqEapGetDisableTimeCheck * + rpc__req__eap_get_disable_time_check__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_get_country__free_unpacked - (RpcRespWifiGetCountry *message, +void rpc__req__eap_get_disable_time_check__free_unpacked + (RpcReqEapGetDisableTimeCheck *message, ProtobufCAllocator *allocator); -/* RpcReqWifiApGetStaList methods */ -void rpc__req__wifi_ap_get_sta_list__init - (RpcReqWifiApGetStaList *message); -size_t rpc__req__wifi_ap_get_sta_list__get_packed_size - (const RpcReqWifiApGetStaList *message); -size_t rpc__req__wifi_ap_get_sta_list__pack - (const RpcReqWifiApGetStaList *message, +/* RpcRespEapGetDisableTimeCheck methods */ +void rpc__resp__eap_get_disable_time_check__init + (RpcRespEapGetDisableTimeCheck *message); +size_t rpc__resp__eap_get_disable_time_check__get_packed_size + (const RpcRespEapGetDisableTimeCheck *message); +size_t rpc__resp__eap_get_disable_time_check__pack + (const RpcRespEapGetDisableTimeCheck *message, uint8_t *out); -size_t rpc__req__wifi_ap_get_sta_list__pack_to_buffer - (const RpcReqWifiApGetStaList *message, +size_t rpc__resp__eap_get_disable_time_check__pack_to_buffer + (const RpcRespEapGetDisableTimeCheck *message, ProtobufCBuffer *buffer); -RpcReqWifiApGetStaList * - rpc__req__wifi_ap_get_sta_list__unpack +RpcRespEapGetDisableTimeCheck * + rpc__resp__eap_get_disable_time_check__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_ap_get_sta_list__free_unpacked - (RpcReqWifiApGetStaList *message, +void rpc__resp__eap_get_disable_time_check__free_unpacked + (RpcRespEapGetDisableTimeCheck *message, ProtobufCAllocator *allocator); -/* RpcRespWifiApGetStaList methods */ -void rpc__resp__wifi_ap_get_sta_list__init - (RpcRespWifiApGetStaList *message); -size_t rpc__resp__wifi_ap_get_sta_list__get_packed_size - (const RpcRespWifiApGetStaList *message); -size_t rpc__resp__wifi_ap_get_sta_list__pack - (const RpcRespWifiApGetStaList *message, +/* RpcReqEapSetTtlsPhase2Method methods */ +void rpc__req__eap_set_ttls_phase2_method__init + (RpcReqEapSetTtlsPhase2Method *message); +size_t rpc__req__eap_set_ttls_phase2_method__get_packed_size + (const RpcReqEapSetTtlsPhase2Method *message); +size_t rpc__req__eap_set_ttls_phase2_method__pack + (const RpcReqEapSetTtlsPhase2Method *message, uint8_t *out); -size_t rpc__resp__wifi_ap_get_sta_list__pack_to_buffer - (const RpcRespWifiApGetStaList *message, +size_t rpc__req__eap_set_ttls_phase2_method__pack_to_buffer + (const RpcReqEapSetTtlsPhase2Method *message, ProtobufCBuffer *buffer); -RpcRespWifiApGetStaList * - rpc__resp__wifi_ap_get_sta_list__unpack +RpcReqEapSetTtlsPhase2Method * + rpc__req__eap_set_ttls_phase2_method__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_ap_get_sta_list__free_unpacked - (RpcRespWifiApGetStaList *message, +void rpc__req__eap_set_ttls_phase2_method__free_unpacked + (RpcReqEapSetTtlsPhase2Method *message, ProtobufCAllocator *allocator); -/* RpcReqWifiApGetStaAid methods */ -void rpc__req__wifi_ap_get_sta_aid__init - (RpcReqWifiApGetStaAid *message); -size_t rpc__req__wifi_ap_get_sta_aid__get_packed_size - (const RpcReqWifiApGetStaAid *message); -size_t rpc__req__wifi_ap_get_sta_aid__pack - (const RpcReqWifiApGetStaAid *message, +/* RpcRespEapSetTtlsPhase2Method methods */ +void rpc__resp__eap_set_ttls_phase2_method__init + (RpcRespEapSetTtlsPhase2Method *message); +size_t rpc__resp__eap_set_ttls_phase2_method__get_packed_size + (const RpcRespEapSetTtlsPhase2Method *message); +size_t rpc__resp__eap_set_ttls_phase2_method__pack + (const RpcRespEapSetTtlsPhase2Method *message, uint8_t *out); -size_t rpc__req__wifi_ap_get_sta_aid__pack_to_buffer - (const RpcReqWifiApGetStaAid *message, +size_t rpc__resp__eap_set_ttls_phase2_method__pack_to_buffer + (const RpcRespEapSetTtlsPhase2Method *message, ProtobufCBuffer *buffer); -RpcReqWifiApGetStaAid * - rpc__req__wifi_ap_get_sta_aid__unpack +RpcRespEapSetTtlsPhase2Method * + rpc__resp__eap_set_ttls_phase2_method__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_ap_get_sta_aid__free_unpacked - (RpcReqWifiApGetStaAid *message, +void rpc__resp__eap_set_ttls_phase2_method__free_unpacked + (RpcRespEapSetTtlsPhase2Method *message, ProtobufCAllocator *allocator); -/* RpcReqWifiStaGetNegotiatedPhymode methods */ -void rpc__req__wifi_sta_get_negotiated_phymode__init - (RpcReqWifiStaGetNegotiatedPhymode *message); -size_t rpc__req__wifi_sta_get_negotiated_phymode__get_packed_size - (const RpcReqWifiStaGetNegotiatedPhymode *message); -size_t rpc__req__wifi_sta_get_negotiated_phymode__pack - (const RpcReqWifiStaGetNegotiatedPhymode *message, +/* RpcReqEapSetSuiteb192bitCertification methods */ +void rpc__req__eap_set_suiteb192bit_certification__init + (RpcReqEapSetSuiteb192bitCertification *message); +size_t rpc__req__eap_set_suiteb192bit_certification__get_packed_size + (const RpcReqEapSetSuiteb192bitCertification *message); +size_t rpc__req__eap_set_suiteb192bit_certification__pack + (const RpcReqEapSetSuiteb192bitCertification *message, uint8_t *out); -size_t rpc__req__wifi_sta_get_negotiated_phymode__pack_to_buffer - (const RpcReqWifiStaGetNegotiatedPhymode *message, +size_t rpc__req__eap_set_suiteb192bit_certification__pack_to_buffer + (const RpcReqEapSetSuiteb192bitCertification *message, ProtobufCBuffer *buffer); -RpcReqWifiStaGetNegotiatedPhymode * - rpc__req__wifi_sta_get_negotiated_phymode__unpack +RpcReqEapSetSuiteb192bitCertification * + rpc__req__eap_set_suiteb192bit_certification__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_sta_get_negotiated_phymode__free_unpacked - (RpcReqWifiStaGetNegotiatedPhymode *message, +void rpc__req__eap_set_suiteb192bit_certification__free_unpacked + (RpcReqEapSetSuiteb192bitCertification *message, ProtobufCAllocator *allocator); -/* RpcRespWifiStaGetNegotiatedPhymode methods */ -void rpc__resp__wifi_sta_get_negotiated_phymode__init - (RpcRespWifiStaGetNegotiatedPhymode *message); -size_t rpc__resp__wifi_sta_get_negotiated_phymode__get_packed_size - (const RpcRespWifiStaGetNegotiatedPhymode *message); -size_t rpc__resp__wifi_sta_get_negotiated_phymode__pack - (const RpcRespWifiStaGetNegotiatedPhymode *message, +/* RpcRespEapSetSuiteb192bitCertification methods */ +void rpc__resp__eap_set_suiteb192bit_certification__init + (RpcRespEapSetSuiteb192bitCertification *message); +size_t rpc__resp__eap_set_suiteb192bit_certification__get_packed_size + (const RpcRespEapSetSuiteb192bitCertification *message); +size_t rpc__resp__eap_set_suiteb192bit_certification__pack + (const RpcRespEapSetSuiteb192bitCertification *message, uint8_t *out); -size_t rpc__resp__wifi_sta_get_negotiated_phymode__pack_to_buffer - (const RpcRespWifiStaGetNegotiatedPhymode *message, +size_t rpc__resp__eap_set_suiteb192bit_certification__pack_to_buffer + (const RpcRespEapSetSuiteb192bitCertification *message, ProtobufCBuffer *buffer); -RpcRespWifiStaGetNegotiatedPhymode * - rpc__resp__wifi_sta_get_negotiated_phymode__unpack +RpcRespEapSetSuiteb192bitCertification * + rpc__resp__eap_set_suiteb192bit_certification__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_sta_get_negotiated_phymode__free_unpacked - (RpcRespWifiStaGetNegotiatedPhymode *message, +void rpc__resp__eap_set_suiteb192bit_certification__free_unpacked + (RpcRespEapSetSuiteb192bitCertification *message, ProtobufCAllocator *allocator); -/* RpcRespWifiApGetStaAid methods */ -void rpc__resp__wifi_ap_get_sta_aid__init - (RpcRespWifiApGetStaAid *message); -size_t rpc__resp__wifi_ap_get_sta_aid__get_packed_size - (const RpcRespWifiApGetStaAid *message); -size_t rpc__resp__wifi_ap_get_sta_aid__pack - (const RpcRespWifiApGetStaAid *message, +/* RpcReqEapSetPacFile methods */ +void rpc__req__eap_set_pac_file__init + (RpcReqEapSetPacFile *message); +size_t rpc__req__eap_set_pac_file__get_packed_size + (const RpcReqEapSetPacFile *message); +size_t rpc__req__eap_set_pac_file__pack + (const RpcReqEapSetPacFile *message, uint8_t *out); -size_t rpc__resp__wifi_ap_get_sta_aid__pack_to_buffer - (const RpcRespWifiApGetStaAid *message, +size_t rpc__req__eap_set_pac_file__pack_to_buffer + (const RpcReqEapSetPacFile *message, ProtobufCBuffer *buffer); -RpcRespWifiApGetStaAid * - rpc__resp__wifi_ap_get_sta_aid__unpack +RpcReqEapSetPacFile * + rpc__req__eap_set_pac_file__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_ap_get_sta_aid__free_unpacked - (RpcRespWifiApGetStaAid *message, +void rpc__req__eap_set_pac_file__free_unpacked + (RpcReqEapSetPacFile *message, ProtobufCAllocator *allocator); -/* RpcReqWifiStaGetRssi methods */ -void rpc__req__wifi_sta_get_rssi__init - (RpcReqWifiStaGetRssi *message); -size_t rpc__req__wifi_sta_get_rssi__get_packed_size - (const RpcReqWifiStaGetRssi *message); -size_t rpc__req__wifi_sta_get_rssi__pack - (const RpcReqWifiStaGetRssi *message, +/* RpcRespEapSetPacFile methods */ +void rpc__resp__eap_set_pac_file__init + (RpcRespEapSetPacFile *message); +size_t rpc__resp__eap_set_pac_file__get_packed_size + (const RpcRespEapSetPacFile *message); +size_t rpc__resp__eap_set_pac_file__pack + (const RpcRespEapSetPacFile *message, + uint8_t *out); +size_t rpc__resp__eap_set_pac_file__pack_to_buffer + (const RpcRespEapSetPacFile *message, + ProtobufCBuffer *buffer); +RpcRespEapSetPacFile * + rpc__resp__eap_set_pac_file__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__resp__eap_set_pac_file__free_unpacked + (RpcRespEapSetPacFile *message, + ProtobufCAllocator *allocator); +/* RpcReqEapSetFastParams methods */ +void rpc__req__eap_set_fast_params__init + (RpcReqEapSetFastParams *message); +size_t rpc__req__eap_set_fast_params__get_packed_size + (const RpcReqEapSetFastParams *message); +size_t rpc__req__eap_set_fast_params__pack + (const RpcReqEapSetFastParams *message, uint8_t *out); -size_t rpc__req__wifi_sta_get_rssi__pack_to_buffer - (const RpcReqWifiStaGetRssi *message, +size_t rpc__req__eap_set_fast_params__pack_to_buffer + (const RpcReqEapSetFastParams *message, ProtobufCBuffer *buffer); -RpcReqWifiStaGetRssi * - rpc__req__wifi_sta_get_rssi__unpack +RpcReqEapSetFastParams * + rpc__req__eap_set_fast_params__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_sta_get_rssi__free_unpacked - (RpcReqWifiStaGetRssi *message, +void rpc__req__eap_set_fast_params__free_unpacked + (RpcReqEapSetFastParams *message, ProtobufCAllocator *allocator); -/* RpcRespWifiStaGetRssi methods */ -void rpc__resp__wifi_sta_get_rssi__init - (RpcRespWifiStaGetRssi *message); -size_t rpc__resp__wifi_sta_get_rssi__get_packed_size - (const RpcRespWifiStaGetRssi *message); -size_t rpc__resp__wifi_sta_get_rssi__pack - (const RpcRespWifiStaGetRssi *message, +/* RpcRespEapSetFastParams methods */ +void rpc__resp__eap_set_fast_params__init + (RpcRespEapSetFastParams *message); +size_t rpc__resp__eap_set_fast_params__get_packed_size + (const RpcRespEapSetFastParams *message); +size_t rpc__resp__eap_set_fast_params__pack + (const RpcRespEapSetFastParams *message, uint8_t *out); -size_t rpc__resp__wifi_sta_get_rssi__pack_to_buffer - (const RpcRespWifiStaGetRssi *message, +size_t rpc__resp__eap_set_fast_params__pack_to_buffer + (const RpcRespEapSetFastParams *message, ProtobufCBuffer *buffer); -RpcRespWifiStaGetRssi * - rpc__resp__wifi_sta_get_rssi__unpack +RpcRespEapSetFastParams * + rpc__resp__eap_set_fast_params__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_sta_get_rssi__free_unpacked - (RpcRespWifiStaGetRssi *message, +void rpc__resp__eap_set_fast_params__free_unpacked + (RpcRespEapSetFastParams *message, ProtobufCAllocator *allocator); -/* RpcReqWifiStaGetAid methods */ -void rpc__req__wifi_sta_get_aid__init - (RpcReqWifiStaGetAid *message); -size_t rpc__req__wifi_sta_get_aid__get_packed_size - (const RpcReqWifiStaGetAid *message); -size_t rpc__req__wifi_sta_get_aid__pack - (const RpcReqWifiStaGetAid *message, +/* RpcReqEapUseDefaultCertBundle methods */ +void rpc__req__eap_use_default_cert_bundle__init + (RpcReqEapUseDefaultCertBundle *message); +size_t rpc__req__eap_use_default_cert_bundle__get_packed_size + (const RpcReqEapUseDefaultCertBundle *message); +size_t rpc__req__eap_use_default_cert_bundle__pack + (const RpcReqEapUseDefaultCertBundle *message, uint8_t *out); -size_t rpc__req__wifi_sta_get_aid__pack_to_buffer - (const RpcReqWifiStaGetAid *message, +size_t rpc__req__eap_use_default_cert_bundle__pack_to_buffer + (const RpcReqEapUseDefaultCertBundle *message, ProtobufCBuffer *buffer); -RpcReqWifiStaGetAid * - rpc__req__wifi_sta_get_aid__unpack +RpcReqEapUseDefaultCertBundle * + rpc__req__eap_use_default_cert_bundle__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_sta_get_aid__free_unpacked - (RpcReqWifiStaGetAid *message, +void rpc__req__eap_use_default_cert_bundle__free_unpacked + (RpcReqEapUseDefaultCertBundle *message, ProtobufCAllocator *allocator); -/* RpcRespWifiStaGetAid methods */ -void rpc__resp__wifi_sta_get_aid__init - (RpcRespWifiStaGetAid *message); -size_t rpc__resp__wifi_sta_get_aid__get_packed_size - (const RpcRespWifiStaGetAid *message); -size_t rpc__resp__wifi_sta_get_aid__pack - (const RpcRespWifiStaGetAid *message, +/* RpcRespEapUseDefaultCertBundle methods */ +void rpc__resp__eap_use_default_cert_bundle__init + (RpcRespEapUseDefaultCertBundle *message); +size_t rpc__resp__eap_use_default_cert_bundle__get_packed_size + (const RpcRespEapUseDefaultCertBundle *message); +size_t rpc__resp__eap_use_default_cert_bundle__pack + (const RpcRespEapUseDefaultCertBundle *message, uint8_t *out); -size_t rpc__resp__wifi_sta_get_aid__pack_to_buffer - (const RpcRespWifiStaGetAid *message, +size_t rpc__resp__eap_use_default_cert_bundle__pack_to_buffer + (const RpcRespEapUseDefaultCertBundle *message, ProtobufCBuffer *buffer); -RpcRespWifiStaGetAid * - rpc__resp__wifi_sta_get_aid__unpack +RpcRespEapUseDefaultCertBundle * + rpc__resp__eap_use_default_cert_bundle__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_sta_get_aid__free_unpacked - (RpcRespWifiStaGetAid *message, +void rpc__resp__eap_use_default_cert_bundle__free_unpacked + (RpcRespEapUseDefaultCertBundle *message, ProtobufCAllocator *allocator); -/* RpcReqWifiSetProtocols methods */ -void rpc__req__wifi_set_protocols__init - (RpcReqWifiSetProtocols *message); -size_t rpc__req__wifi_set_protocols__get_packed_size - (const RpcReqWifiSetProtocols *message); -size_t rpc__req__wifi_set_protocols__pack - (const RpcReqWifiSetProtocols *message, +/* RpcReqWifiSetOkcSupport methods */ +void rpc__req__wifi_set_okc_support__init + (RpcReqWifiSetOkcSupport *message); +size_t rpc__req__wifi_set_okc_support__get_packed_size + (const RpcReqWifiSetOkcSupport *message); +size_t rpc__req__wifi_set_okc_support__pack + (const RpcReqWifiSetOkcSupport *message, uint8_t *out); -size_t rpc__req__wifi_set_protocols__pack_to_buffer - (const RpcReqWifiSetProtocols *message, +size_t rpc__req__wifi_set_okc_support__pack_to_buffer + (const RpcReqWifiSetOkcSupport *message, ProtobufCBuffer *buffer); -RpcReqWifiSetProtocols * - rpc__req__wifi_set_protocols__unpack +RpcReqWifiSetOkcSupport * + rpc__req__wifi_set_okc_support__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_set_protocols__free_unpacked - (RpcReqWifiSetProtocols *message, +void rpc__req__wifi_set_okc_support__free_unpacked + (RpcReqWifiSetOkcSupport *message, ProtobufCAllocator *allocator); -/* RpcRespWifiSetProtocols methods */ -void rpc__resp__wifi_set_protocols__init - (RpcRespWifiSetProtocols *message); -size_t rpc__resp__wifi_set_protocols__get_packed_size - (const RpcRespWifiSetProtocols *message); -size_t rpc__resp__wifi_set_protocols__pack - (const RpcRespWifiSetProtocols *message, +/* RpcRespWifiSetOkcSupport methods */ +void rpc__resp__wifi_set_okc_support__init + (RpcRespWifiSetOkcSupport *message); +size_t rpc__resp__wifi_set_okc_support__get_packed_size + (const RpcRespWifiSetOkcSupport *message); +size_t rpc__resp__wifi_set_okc_support__pack + (const RpcRespWifiSetOkcSupport *message, uint8_t *out); -size_t rpc__resp__wifi_set_protocols__pack_to_buffer - (const RpcRespWifiSetProtocols *message, +size_t rpc__resp__wifi_set_okc_support__pack_to_buffer + (const RpcRespWifiSetOkcSupport *message, ProtobufCBuffer *buffer); -RpcRespWifiSetProtocols * - rpc__resp__wifi_set_protocols__unpack +RpcRespWifiSetOkcSupport * + rpc__resp__wifi_set_okc_support__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_set_protocols__free_unpacked - (RpcRespWifiSetProtocols *message, +void rpc__resp__wifi_set_okc_support__free_unpacked + (RpcRespWifiSetOkcSupport *message, ProtobufCAllocator *allocator); -/* RpcReqWifiGetProtocols methods */ -void rpc__req__wifi_get_protocols__init - (RpcReqWifiGetProtocols *message); -size_t rpc__req__wifi_get_protocols__get_packed_size - (const RpcReqWifiGetProtocols *message); -size_t rpc__req__wifi_get_protocols__pack - (const RpcReqWifiGetProtocols *message, +/* RpcReqEapSetDomainName methods */ +void rpc__req__eap_set_domain_name__init + (RpcReqEapSetDomainName *message); +size_t rpc__req__eap_set_domain_name__get_packed_size + (const RpcReqEapSetDomainName *message); +size_t rpc__req__eap_set_domain_name__pack + (const RpcReqEapSetDomainName *message, uint8_t *out); -size_t rpc__req__wifi_get_protocols__pack_to_buffer - (const RpcReqWifiGetProtocols *message, +size_t rpc__req__eap_set_domain_name__pack_to_buffer + (const RpcReqEapSetDomainName *message, ProtobufCBuffer *buffer); -RpcReqWifiGetProtocols * - rpc__req__wifi_get_protocols__unpack +RpcReqEapSetDomainName * + rpc__req__eap_set_domain_name__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_get_protocols__free_unpacked - (RpcReqWifiGetProtocols *message, +void rpc__req__eap_set_domain_name__free_unpacked + (RpcReqEapSetDomainName *message, ProtobufCAllocator *allocator); -/* RpcRespWifiGetProtocols methods */ -void rpc__resp__wifi_get_protocols__init - (RpcRespWifiGetProtocols *message); -size_t rpc__resp__wifi_get_protocols__get_packed_size - (const RpcRespWifiGetProtocols *message); -size_t rpc__resp__wifi_get_protocols__pack - (const RpcRespWifiGetProtocols *message, +/* RpcRespEapSetDomainName methods */ +void rpc__resp__eap_set_domain_name__init + (RpcRespEapSetDomainName *message); +size_t rpc__resp__eap_set_domain_name__get_packed_size + (const RpcRespEapSetDomainName *message); +size_t rpc__resp__eap_set_domain_name__pack + (const RpcRespEapSetDomainName *message, uint8_t *out); -size_t rpc__resp__wifi_get_protocols__pack_to_buffer - (const RpcRespWifiGetProtocols *message, +size_t rpc__resp__eap_set_domain_name__pack_to_buffer + (const RpcRespEapSetDomainName *message, ProtobufCBuffer *buffer); -RpcRespWifiGetProtocols * - rpc__resp__wifi_get_protocols__unpack +RpcRespEapSetDomainName * + rpc__resp__eap_set_domain_name__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_get_protocols__free_unpacked - (RpcRespWifiGetProtocols *message, +void rpc__resp__eap_set_domain_name__free_unpacked + (RpcRespEapSetDomainName *message, ProtobufCAllocator *allocator); -/* RpcReqWifiSetBandwidths methods */ -void rpc__req__wifi_set_bandwidths__init - (RpcReqWifiSetBandwidths *message); -size_t rpc__req__wifi_set_bandwidths__get_packed_size - (const RpcReqWifiSetBandwidths *message); -size_t rpc__req__wifi_set_bandwidths__pack - (const RpcReqWifiSetBandwidths *message, +/* RpcReqEapSetEapMethods methods */ +void rpc__req__eap_set_eap_methods__init + (RpcReqEapSetEapMethods *message); +size_t rpc__req__eap_set_eap_methods__get_packed_size + (const RpcReqEapSetEapMethods *message); +size_t rpc__req__eap_set_eap_methods__pack + (const RpcReqEapSetEapMethods *message, uint8_t *out); -size_t rpc__req__wifi_set_bandwidths__pack_to_buffer - (const RpcReqWifiSetBandwidths *message, +size_t rpc__req__eap_set_eap_methods__pack_to_buffer + (const RpcReqEapSetEapMethods *message, ProtobufCBuffer *buffer); -RpcReqWifiSetBandwidths * - rpc__req__wifi_set_bandwidths__unpack +RpcReqEapSetEapMethods * + rpc__req__eap_set_eap_methods__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_set_bandwidths__free_unpacked - (RpcReqWifiSetBandwidths *message, +void rpc__req__eap_set_eap_methods__free_unpacked + (RpcReqEapSetEapMethods *message, ProtobufCAllocator *allocator); -/* RpcRespWifiSetBandwidths methods */ -void rpc__resp__wifi_set_bandwidths__init - (RpcRespWifiSetBandwidths *message); -size_t rpc__resp__wifi_set_bandwidths__get_packed_size - (const RpcRespWifiSetBandwidths *message); -size_t rpc__resp__wifi_set_bandwidths__pack - (const RpcRespWifiSetBandwidths *message, +/* RpcRespEapSetEapMethods methods */ +void rpc__resp__eap_set_eap_methods__init + (RpcRespEapSetEapMethods *message); +size_t rpc__resp__eap_set_eap_methods__get_packed_size + (const RpcRespEapSetEapMethods *message); +size_t rpc__resp__eap_set_eap_methods__pack + (const RpcRespEapSetEapMethods *message, uint8_t *out); -size_t rpc__resp__wifi_set_bandwidths__pack_to_buffer - (const RpcRespWifiSetBandwidths *message, +size_t rpc__resp__eap_set_eap_methods__pack_to_buffer + (const RpcRespEapSetEapMethods *message, ProtobufCBuffer *buffer); -RpcRespWifiSetBandwidths * - rpc__resp__wifi_set_bandwidths__unpack +RpcRespEapSetEapMethods * + rpc__resp__eap_set_eap_methods__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_set_bandwidths__free_unpacked - (RpcRespWifiSetBandwidths *message, +void rpc__resp__eap_set_eap_methods__free_unpacked + (RpcRespEapSetEapMethods *message, ProtobufCAllocator *allocator); -/* RpcReqWifiGetBandwidths methods */ -void rpc__req__wifi_get_bandwidths__init - (RpcReqWifiGetBandwidths *message); -size_t rpc__req__wifi_get_bandwidths__get_packed_size - (const RpcReqWifiGetBandwidths *message); -size_t rpc__req__wifi_get_bandwidths__pack - (const RpcReqWifiGetBandwidths *message, +/* RpcEventSuppDppUriReady methods */ +void rpc__event__supp_dpp_uri_ready__init + (RpcEventSuppDppUriReady *message); +size_t rpc__event__supp_dpp_uri_ready__get_packed_size + (const RpcEventSuppDppUriReady *message); +size_t rpc__event__supp_dpp_uri_ready__pack + (const RpcEventSuppDppUriReady *message, uint8_t *out); -size_t rpc__req__wifi_get_bandwidths__pack_to_buffer - (const RpcReqWifiGetBandwidths *message, +size_t rpc__event__supp_dpp_uri_ready__pack_to_buffer + (const RpcEventSuppDppUriReady *message, ProtobufCBuffer *buffer); -RpcReqWifiGetBandwidths * - rpc__req__wifi_get_bandwidths__unpack +RpcEventSuppDppUriReady * + rpc__event__supp_dpp_uri_ready__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_get_bandwidths__free_unpacked - (RpcReqWifiGetBandwidths *message, +void rpc__event__supp_dpp_uri_ready__free_unpacked + (RpcEventSuppDppUriReady *message, ProtobufCAllocator *allocator); -/* RpcRespWifiGetBandwidths methods */ -void rpc__resp__wifi_get_bandwidths__init - (RpcRespWifiGetBandwidths *message); -size_t rpc__resp__wifi_get_bandwidths__get_packed_size - (const RpcRespWifiGetBandwidths *message); -size_t rpc__resp__wifi_get_bandwidths__pack - (const RpcRespWifiGetBandwidths *message, +/* RpcEventSuppDppCfgRecvd methods */ +void rpc__event__supp_dpp_cfg_recvd__init + (RpcEventSuppDppCfgRecvd *message); +size_t rpc__event__supp_dpp_cfg_recvd__get_packed_size + (const RpcEventSuppDppCfgRecvd *message); +size_t rpc__event__supp_dpp_cfg_recvd__pack + (const RpcEventSuppDppCfgRecvd *message, uint8_t *out); -size_t rpc__resp__wifi_get_bandwidths__pack_to_buffer - (const RpcRespWifiGetBandwidths *message, +size_t rpc__event__supp_dpp_cfg_recvd__pack_to_buffer + (const RpcEventSuppDppCfgRecvd *message, ProtobufCBuffer *buffer); -RpcRespWifiGetBandwidths * - rpc__resp__wifi_get_bandwidths__unpack +RpcEventSuppDppCfgRecvd * + rpc__event__supp_dpp_cfg_recvd__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_get_bandwidths__free_unpacked - (RpcRespWifiGetBandwidths *message, +void rpc__event__supp_dpp_cfg_recvd__free_unpacked + (RpcEventSuppDppCfgRecvd *message, ProtobufCAllocator *allocator); -/* RpcReqWifiSetBand methods */ -void rpc__req__wifi_set_band__init - (RpcReqWifiSetBand *message); -size_t rpc__req__wifi_set_band__get_packed_size - (const RpcReqWifiSetBand *message); -size_t rpc__req__wifi_set_band__pack - (const RpcReqWifiSetBand *message, +/* RpcEventSuppDppFail methods */ +void rpc__event__supp_dpp_fail__init + (RpcEventSuppDppFail *message); +size_t rpc__event__supp_dpp_fail__get_packed_size + (const RpcEventSuppDppFail *message); +size_t rpc__event__supp_dpp_fail__pack + (const RpcEventSuppDppFail *message, uint8_t *out); -size_t rpc__req__wifi_set_band__pack_to_buffer - (const RpcReqWifiSetBand *message, +size_t rpc__event__supp_dpp_fail__pack_to_buffer + (const RpcEventSuppDppFail *message, ProtobufCBuffer *buffer); -RpcReqWifiSetBand * - rpc__req__wifi_set_band__unpack +RpcEventSuppDppFail * + rpc__event__supp_dpp_fail__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_set_band__free_unpacked - (RpcReqWifiSetBand *message, +void rpc__event__supp_dpp_fail__free_unpacked + (RpcEventSuppDppFail *message, ProtobufCAllocator *allocator); -/* RpcRespWifiSetBand methods */ -void rpc__resp__wifi_set_band__init - (RpcRespWifiSetBand *message); -size_t rpc__resp__wifi_set_band__get_packed_size - (const RpcRespWifiSetBand *message); -size_t rpc__resp__wifi_set_band__pack - (const RpcRespWifiSetBand *message, +/* RpcEventWifiDppUriReady methods */ +void rpc__event__wifi_dpp_uri_ready__init + (RpcEventWifiDppUriReady *message); +size_t rpc__event__wifi_dpp_uri_ready__get_packed_size + (const RpcEventWifiDppUriReady *message); +size_t rpc__event__wifi_dpp_uri_ready__pack + (const RpcEventWifiDppUriReady *message, uint8_t *out); -size_t rpc__resp__wifi_set_band__pack_to_buffer - (const RpcRespWifiSetBand *message, +size_t rpc__event__wifi_dpp_uri_ready__pack_to_buffer + (const RpcEventWifiDppUriReady *message, ProtobufCBuffer *buffer); -RpcRespWifiSetBand * - rpc__resp__wifi_set_band__unpack +RpcEventWifiDppUriReady * + rpc__event__wifi_dpp_uri_ready__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_set_band__free_unpacked - (RpcRespWifiSetBand *message, +void rpc__event__wifi_dpp_uri_ready__free_unpacked + (RpcEventWifiDppUriReady *message, ProtobufCAllocator *allocator); -/* RpcReqWifiGetBand methods */ -void rpc__req__wifi_get_band__init - (RpcReqWifiGetBand *message); -size_t rpc__req__wifi_get_band__get_packed_size - (const RpcReqWifiGetBand *message); -size_t rpc__req__wifi_get_band__pack - (const RpcReqWifiGetBand *message, +/* RpcEventWifiDppCfgRecvd methods */ +void rpc__event__wifi_dpp_cfg_recvd__init + (RpcEventWifiDppCfgRecvd *message); +size_t rpc__event__wifi_dpp_cfg_recvd__get_packed_size + (const RpcEventWifiDppCfgRecvd *message); +size_t rpc__event__wifi_dpp_cfg_recvd__pack + (const RpcEventWifiDppCfgRecvd *message, uint8_t *out); -size_t rpc__req__wifi_get_band__pack_to_buffer - (const RpcReqWifiGetBand *message, +size_t rpc__event__wifi_dpp_cfg_recvd__pack_to_buffer + (const RpcEventWifiDppCfgRecvd *message, ProtobufCBuffer *buffer); -RpcReqWifiGetBand * - rpc__req__wifi_get_band__unpack +RpcEventWifiDppCfgRecvd * + rpc__event__wifi_dpp_cfg_recvd__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_get_band__free_unpacked - (RpcReqWifiGetBand *message, +void rpc__event__wifi_dpp_cfg_recvd__free_unpacked + (RpcEventWifiDppCfgRecvd *message, ProtobufCAllocator *allocator); -/* RpcRespWifiGetBand methods */ -void rpc__resp__wifi_get_band__init - (RpcRespWifiGetBand *message); -size_t rpc__resp__wifi_get_band__get_packed_size - (const RpcRespWifiGetBand *message); -size_t rpc__resp__wifi_get_band__pack - (const RpcRespWifiGetBand *message, +/* RpcEventWifiDppFail methods */ +void rpc__event__wifi_dpp_fail__init + (RpcEventWifiDppFail *message); +size_t rpc__event__wifi_dpp_fail__get_packed_size + (const RpcEventWifiDppFail *message); +size_t rpc__event__wifi_dpp_fail__pack + (const RpcEventWifiDppFail *message, uint8_t *out); -size_t rpc__resp__wifi_get_band__pack_to_buffer - (const RpcRespWifiGetBand *message, +size_t rpc__event__wifi_dpp_fail__pack_to_buffer + (const RpcEventWifiDppFail *message, ProtobufCBuffer *buffer); -RpcRespWifiGetBand * - rpc__resp__wifi_get_band__unpack +RpcEventWifiDppFail * + rpc__event__wifi_dpp_fail__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_get_band__free_unpacked - (RpcRespWifiGetBand *message, +void rpc__event__wifi_dpp_fail__free_unpacked + (RpcEventWifiDppFail *message, ProtobufCAllocator *allocator); -/* RpcReqWifiSetBandMode methods */ -void rpc__req__wifi_set_band_mode__init - (RpcReqWifiSetBandMode *message); -size_t rpc__req__wifi_set_band_mode__get_packed_size - (const RpcReqWifiSetBandMode *message); -size_t rpc__req__wifi_set_band_mode__pack - (const RpcReqWifiSetBandMode *message, +/* RpcGpioConfig methods */ +void rpc__gpio_config__init + (RpcGpioConfig *message); +size_t rpc__gpio_config__get_packed_size + (const RpcGpioConfig *message); +size_t rpc__gpio_config__pack + (const RpcGpioConfig *message, uint8_t *out); -size_t rpc__req__wifi_set_band_mode__pack_to_buffer - (const RpcReqWifiSetBandMode *message, +size_t rpc__gpio_config__pack_to_buffer + (const RpcGpioConfig *message, ProtobufCBuffer *buffer); -RpcReqWifiSetBandMode * - rpc__req__wifi_set_band_mode__unpack +RpcGpioConfig * + rpc__gpio_config__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_set_band_mode__free_unpacked - (RpcReqWifiSetBandMode *message, +void rpc__gpio_config__free_unpacked + (RpcGpioConfig *message, ProtobufCAllocator *allocator); -/* RpcRespWifiSetBandMode methods */ -void rpc__resp__wifi_set_band_mode__init - (RpcRespWifiSetBandMode *message); -size_t rpc__resp__wifi_set_band_mode__get_packed_size - (const RpcRespWifiSetBandMode *message); -size_t rpc__resp__wifi_set_band_mode__pack - (const RpcRespWifiSetBandMode *message, +/* RpcReqGpioConfig methods */ +void rpc__req__gpio_config__init + (RpcReqGpioConfig *message); +size_t rpc__req__gpio_config__get_packed_size + (const RpcReqGpioConfig *message); +size_t rpc__req__gpio_config__pack + (const RpcReqGpioConfig *message, uint8_t *out); -size_t rpc__resp__wifi_set_band_mode__pack_to_buffer - (const RpcRespWifiSetBandMode *message, +size_t rpc__req__gpio_config__pack_to_buffer + (const RpcReqGpioConfig *message, ProtobufCBuffer *buffer); -RpcRespWifiSetBandMode * - rpc__resp__wifi_set_band_mode__unpack +RpcReqGpioConfig * + rpc__req__gpio_config__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_set_band_mode__free_unpacked - (RpcRespWifiSetBandMode *message, +void rpc__req__gpio_config__free_unpacked + (RpcReqGpioConfig *message, ProtobufCAllocator *allocator); -/* RpcReqWifiGetBandMode methods */ -void rpc__req__wifi_get_band_mode__init - (RpcReqWifiGetBandMode *message); -size_t rpc__req__wifi_get_band_mode__get_packed_size - (const RpcReqWifiGetBandMode *message); -size_t rpc__req__wifi_get_band_mode__pack - (const RpcReqWifiGetBandMode *message, +/* RpcRespGpioConfig methods */ +void rpc__resp__gpio_config__init + (RpcRespGpioConfig *message); +size_t rpc__resp__gpio_config__get_packed_size + (const RpcRespGpioConfig *message); +size_t rpc__resp__gpio_config__pack + (const RpcRespGpioConfig *message, uint8_t *out); -size_t rpc__req__wifi_get_band_mode__pack_to_buffer - (const RpcReqWifiGetBandMode *message, +size_t rpc__resp__gpio_config__pack_to_buffer + (const RpcRespGpioConfig *message, ProtobufCBuffer *buffer); -RpcReqWifiGetBandMode * - rpc__req__wifi_get_band_mode__unpack +RpcRespGpioConfig * + rpc__resp__gpio_config__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__wifi_get_band_mode__free_unpacked - (RpcReqWifiGetBandMode *message, +void rpc__resp__gpio_config__free_unpacked + (RpcRespGpioConfig *message, ProtobufCAllocator *allocator); -/* RpcRespWifiGetBandMode methods */ -void rpc__resp__wifi_get_band_mode__init - (RpcRespWifiGetBandMode *message); -size_t rpc__resp__wifi_get_band_mode__get_packed_size - (const RpcRespWifiGetBandMode *message); -size_t rpc__resp__wifi_get_band_mode__pack - (const RpcRespWifiGetBandMode *message, +/* RpcReqGpioReset methods */ +void rpc__req__gpio_reset__init + (RpcReqGpioReset *message); +size_t rpc__req__gpio_reset__get_packed_size + (const RpcReqGpioReset *message); +size_t rpc__req__gpio_reset__pack + (const RpcReqGpioReset *message, + uint8_t *out); +size_t rpc__req__gpio_reset__pack_to_buffer + (const RpcReqGpioReset *message, + ProtobufCBuffer *buffer); +RpcReqGpioReset * + rpc__req__gpio_reset__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void rpc__req__gpio_reset__free_unpacked + (RpcReqGpioReset *message, + ProtobufCAllocator *allocator); +/* RpcRespGpioResetPin methods */ +void rpc__resp__gpio_reset_pin__init + (RpcRespGpioResetPin *message); +size_t rpc__resp__gpio_reset_pin__get_packed_size + (const RpcRespGpioResetPin *message); +size_t rpc__resp__gpio_reset_pin__pack + (const RpcRespGpioResetPin *message, uint8_t *out); -size_t rpc__resp__wifi_get_band_mode__pack_to_buffer - (const RpcRespWifiGetBandMode *message, +size_t rpc__resp__gpio_reset_pin__pack_to_buffer + (const RpcRespGpioResetPin *message, ProtobufCBuffer *buffer); -RpcRespWifiGetBandMode * - rpc__resp__wifi_get_band_mode__unpack +RpcRespGpioResetPin * + rpc__resp__gpio_reset_pin__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__wifi_get_band_mode__free_unpacked - (RpcRespWifiGetBandMode *message, +void rpc__resp__gpio_reset_pin__free_unpacked + (RpcRespGpioResetPin *message, ProtobufCAllocator *allocator); -/* RpcReqGetCoprocessorFwVersion methods */ -void rpc__req__get_coprocessor_fw_version__init - (RpcReqGetCoprocessorFwVersion *message); -size_t rpc__req__get_coprocessor_fw_version__get_packed_size - (const RpcReqGetCoprocessorFwVersion *message); -size_t rpc__req__get_coprocessor_fw_version__pack - (const RpcReqGetCoprocessorFwVersion *message, +/* RpcReqGpioSetLevel methods */ +void rpc__req__gpio_set_level__init + (RpcReqGpioSetLevel *message); +size_t rpc__req__gpio_set_level__get_packed_size + (const RpcReqGpioSetLevel *message); +size_t rpc__req__gpio_set_level__pack + (const RpcReqGpioSetLevel *message, uint8_t *out); -size_t rpc__req__get_coprocessor_fw_version__pack_to_buffer - (const RpcReqGetCoprocessorFwVersion *message, +size_t rpc__req__gpio_set_level__pack_to_buffer + (const RpcReqGpioSetLevel *message, ProtobufCBuffer *buffer); -RpcReqGetCoprocessorFwVersion * - rpc__req__get_coprocessor_fw_version__unpack +RpcReqGpioSetLevel * + rpc__req__gpio_set_level__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__req__get_coprocessor_fw_version__free_unpacked - (RpcReqGetCoprocessorFwVersion *message, +void rpc__req__gpio_set_level__free_unpacked + (RpcReqGpioSetLevel *message, ProtobufCAllocator *allocator); -/* RpcRespGetCoprocessorFwVersion methods */ -void rpc__resp__get_coprocessor_fw_version__init - (RpcRespGetCoprocessorFwVersion *message); -size_t rpc__resp__get_coprocessor_fw_version__get_packed_size - (const RpcRespGetCoprocessorFwVersion *message); -size_t rpc__resp__get_coprocessor_fw_version__pack - (const RpcRespGetCoprocessorFwVersion *message, +/* RpcRespGpioSetLevel methods */ +void rpc__resp__gpio_set_level__init + (RpcRespGpioSetLevel *message); +size_t rpc__resp__gpio_set_level__get_packed_size + (const RpcRespGpioSetLevel *message); +size_t rpc__resp__gpio_set_level__pack + (const RpcRespGpioSetLevel *message, uint8_t *out); -size_t rpc__resp__get_coprocessor_fw_version__pack_to_buffer - (const RpcRespGetCoprocessorFwVersion *message, +size_t rpc__resp__gpio_set_level__pack_to_buffer + (const RpcRespGpioSetLevel *message, ProtobufCBuffer *buffer); -RpcRespGetCoprocessorFwVersion * - rpc__resp__get_coprocessor_fw_version__unpack +RpcRespGpioSetLevel * + rpc__resp__gpio_set_level__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__resp__get_coprocessor_fw_version__free_unpacked - (RpcRespGetCoprocessorFwVersion *message, +void rpc__resp__gpio_set_level__free_unpacked + (RpcRespGpioSetLevel *message, ProtobufCAllocator *allocator); -/* RpcEventWifiEventNoArgs methods */ -void rpc__event__wifi_event_no_args__init - (RpcEventWifiEventNoArgs *message); -size_t rpc__event__wifi_event_no_args__get_packed_size - (const RpcEventWifiEventNoArgs *message); -size_t rpc__event__wifi_event_no_args__pack - (const RpcEventWifiEventNoArgs *message, +/* RpcReqGpioGetLevel methods */ +void rpc__req__gpio_get_level__init + (RpcReqGpioGetLevel *message); +size_t rpc__req__gpio_get_level__get_packed_size + (const RpcReqGpioGetLevel *message); +size_t rpc__req__gpio_get_level__pack + (const RpcReqGpioGetLevel *message, uint8_t *out); -size_t rpc__event__wifi_event_no_args__pack_to_buffer - (const RpcEventWifiEventNoArgs *message, +size_t rpc__req__gpio_get_level__pack_to_buffer + (const RpcReqGpioGetLevel *message, ProtobufCBuffer *buffer); -RpcEventWifiEventNoArgs * - rpc__event__wifi_event_no_args__unpack +RpcReqGpioGetLevel * + rpc__req__gpio_get_level__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__event__wifi_event_no_args__free_unpacked - (RpcEventWifiEventNoArgs *message, +void rpc__req__gpio_get_level__free_unpacked + (RpcReqGpioGetLevel *message, ProtobufCAllocator *allocator); -/* RpcEventESPInit methods */ -void rpc__event__espinit__init - (RpcEventESPInit *message); -size_t rpc__event__espinit__get_packed_size - (const RpcEventESPInit *message); -size_t rpc__event__espinit__pack - (const RpcEventESPInit *message, +/* RpcRespGpioGetLevel methods */ +void rpc__resp__gpio_get_level__init + (RpcRespGpioGetLevel *message); +size_t rpc__resp__gpio_get_level__get_packed_size + (const RpcRespGpioGetLevel *message); +size_t rpc__resp__gpio_get_level__pack + (const RpcRespGpioGetLevel *message, uint8_t *out); -size_t rpc__event__espinit__pack_to_buffer - (const RpcEventESPInit *message, +size_t rpc__resp__gpio_get_level__pack_to_buffer + (const RpcRespGpioGetLevel *message, ProtobufCBuffer *buffer); -RpcEventESPInit * - rpc__event__espinit__unpack +RpcRespGpioGetLevel * + rpc__resp__gpio_get_level__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__event__espinit__free_unpacked - (RpcEventESPInit *message, +void rpc__resp__gpio_get_level__free_unpacked + (RpcRespGpioGetLevel *message, ProtobufCAllocator *allocator); -/* RpcEventHeartbeat methods */ -void rpc__event__heartbeat__init - (RpcEventHeartbeat *message); -size_t rpc__event__heartbeat__get_packed_size - (const RpcEventHeartbeat *message); -size_t rpc__event__heartbeat__pack - (const RpcEventHeartbeat *message, +/* RpcReqGpioSetDirection methods */ +void rpc__req__gpio_set_direction__init + (RpcReqGpioSetDirection *message); +size_t rpc__req__gpio_set_direction__get_packed_size + (const RpcReqGpioSetDirection *message); +size_t rpc__req__gpio_set_direction__pack + (const RpcReqGpioSetDirection *message, uint8_t *out); -size_t rpc__event__heartbeat__pack_to_buffer - (const RpcEventHeartbeat *message, +size_t rpc__req__gpio_set_direction__pack_to_buffer + (const RpcReqGpioSetDirection *message, ProtobufCBuffer *buffer); -RpcEventHeartbeat * - rpc__event__heartbeat__unpack +RpcReqGpioSetDirection * + rpc__req__gpio_set_direction__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__event__heartbeat__free_unpacked - (RpcEventHeartbeat *message, +void rpc__req__gpio_set_direction__free_unpacked + (RpcReqGpioSetDirection *message, ProtobufCAllocator *allocator); -/* RpcEventAPStaDisconnected methods */ -void rpc__event__ap__sta_disconnected__init - (RpcEventAPStaDisconnected *message); -size_t rpc__event__ap__sta_disconnected__get_packed_size - (const RpcEventAPStaDisconnected *message); -size_t rpc__event__ap__sta_disconnected__pack - (const RpcEventAPStaDisconnected *message, +/* RpcRespGpioSetDirection methods */ +void rpc__resp__gpio_set_direction__init + (RpcRespGpioSetDirection *message); +size_t rpc__resp__gpio_set_direction__get_packed_size + (const RpcRespGpioSetDirection *message); +size_t rpc__resp__gpio_set_direction__pack + (const RpcRespGpioSetDirection *message, uint8_t *out); -size_t rpc__event__ap__sta_disconnected__pack_to_buffer - (const RpcEventAPStaDisconnected *message, +size_t rpc__resp__gpio_set_direction__pack_to_buffer + (const RpcRespGpioSetDirection *message, ProtobufCBuffer *buffer); -RpcEventAPStaDisconnected * - rpc__event__ap__sta_disconnected__unpack +RpcRespGpioSetDirection * + rpc__resp__gpio_set_direction__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__event__ap__sta_disconnected__free_unpacked - (RpcEventAPStaDisconnected *message, +void rpc__resp__gpio_set_direction__free_unpacked + (RpcRespGpioSetDirection *message, ProtobufCAllocator *allocator); -/* RpcEventAPStaConnected methods */ -void rpc__event__ap__sta_connected__init - (RpcEventAPStaConnected *message); -size_t rpc__event__ap__sta_connected__get_packed_size - (const RpcEventAPStaConnected *message); -size_t rpc__event__ap__sta_connected__pack - (const RpcEventAPStaConnected *message, +/* RpcReqGpioInputEnable methods */ +void rpc__req__gpio_input_enable__init + (RpcReqGpioInputEnable *message); +size_t rpc__req__gpio_input_enable__get_packed_size + (const RpcReqGpioInputEnable *message); +size_t rpc__req__gpio_input_enable__pack + (const RpcReqGpioInputEnable *message, uint8_t *out); -size_t rpc__event__ap__sta_connected__pack_to_buffer - (const RpcEventAPStaConnected *message, +size_t rpc__req__gpio_input_enable__pack_to_buffer + (const RpcReqGpioInputEnable *message, ProtobufCBuffer *buffer); -RpcEventAPStaConnected * - rpc__event__ap__sta_connected__unpack +RpcReqGpioInputEnable * + rpc__req__gpio_input_enable__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__event__ap__sta_connected__free_unpacked - (RpcEventAPStaConnected *message, +void rpc__req__gpio_input_enable__free_unpacked + (RpcReqGpioInputEnable *message, ProtobufCAllocator *allocator); -/* RpcEventStaScanDone methods */ -void rpc__event__sta_scan_done__init - (RpcEventStaScanDone *message); -size_t rpc__event__sta_scan_done__get_packed_size - (const RpcEventStaScanDone *message); -size_t rpc__event__sta_scan_done__pack - (const RpcEventStaScanDone *message, +/* RpcRespGpioInputEnable methods */ +void rpc__resp__gpio_input_enable__init + (RpcRespGpioInputEnable *message); +size_t rpc__resp__gpio_input_enable__get_packed_size + (const RpcRespGpioInputEnable *message); +size_t rpc__resp__gpio_input_enable__pack + (const RpcRespGpioInputEnable *message, uint8_t *out); -size_t rpc__event__sta_scan_done__pack_to_buffer - (const RpcEventStaScanDone *message, +size_t rpc__resp__gpio_input_enable__pack_to_buffer + (const RpcRespGpioInputEnable *message, ProtobufCBuffer *buffer); -RpcEventStaScanDone * - rpc__event__sta_scan_done__unpack +RpcRespGpioInputEnable * + rpc__resp__gpio_input_enable__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__event__sta_scan_done__free_unpacked - (RpcEventStaScanDone *message, +void rpc__resp__gpio_input_enable__free_unpacked + (RpcRespGpioInputEnable *message, ProtobufCAllocator *allocator); -/* RpcEventStaConnected methods */ -void rpc__event__sta_connected__init - (RpcEventStaConnected *message); -size_t rpc__event__sta_connected__get_packed_size - (const RpcEventStaConnected *message); -size_t rpc__event__sta_connected__pack - (const RpcEventStaConnected *message, +/* RpcReqGpioSetPullMode methods */ +void rpc__req__gpio_set_pull_mode__init + (RpcReqGpioSetPullMode *message); +size_t rpc__req__gpio_set_pull_mode__get_packed_size + (const RpcReqGpioSetPullMode *message); +size_t rpc__req__gpio_set_pull_mode__pack + (const RpcReqGpioSetPullMode *message, uint8_t *out); -size_t rpc__event__sta_connected__pack_to_buffer - (const RpcEventStaConnected *message, +size_t rpc__req__gpio_set_pull_mode__pack_to_buffer + (const RpcReqGpioSetPullMode *message, ProtobufCBuffer *buffer); -RpcEventStaConnected * - rpc__event__sta_connected__unpack +RpcReqGpioSetPullMode * + rpc__req__gpio_set_pull_mode__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__event__sta_connected__free_unpacked - (RpcEventStaConnected *message, +void rpc__req__gpio_set_pull_mode__free_unpacked + (RpcReqGpioSetPullMode *message, ProtobufCAllocator *allocator); -/* RpcEventStaDisconnected methods */ -void rpc__event__sta_disconnected__init - (RpcEventStaDisconnected *message); -size_t rpc__event__sta_disconnected__get_packed_size - (const RpcEventStaDisconnected *message); -size_t rpc__event__sta_disconnected__pack - (const RpcEventStaDisconnected *message, +/* RpcRespGpioSetPullMode methods */ +void rpc__resp__gpio_set_pull_mode__init + (RpcRespGpioSetPullMode *message); +size_t rpc__resp__gpio_set_pull_mode__get_packed_size + (const RpcRespGpioSetPullMode *message); +size_t rpc__resp__gpio_set_pull_mode__pack + (const RpcRespGpioSetPullMode *message, uint8_t *out); -size_t rpc__event__sta_disconnected__pack_to_buffer - (const RpcEventStaDisconnected *message, +size_t rpc__resp__gpio_set_pull_mode__pack_to_buffer + (const RpcRespGpioSetPullMode *message, ProtobufCBuffer *buffer); -RpcEventStaDisconnected * - rpc__event__sta_disconnected__unpack +RpcRespGpioSetPullMode * + rpc__resp__gpio_set_pull_mode__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); -void rpc__event__sta_disconnected__free_unpacked - (RpcEventStaDisconnected *message, +void rpc__resp__gpio_set_pull_mode__free_unpacked + (RpcRespGpioSetPullMode *message, ProtobufCAllocator *allocator); /* Rpc methods */ void rpc__init @@ -6564,6 +10908,9 @@ typedef void (*WifiActiveScanTime_Closure) typedef void (*WifiScanTime_Closure) (const WifiScanTime *message, void *closure_data); +typedef void (*WifiScanChannelBitmap_Closure) + (const WifiScanChannelBitmap *message, + void *closure_data); typedef void (*WifiScanConfig_Closure) (const WifiScanConfig *message, void *closure_data); @@ -6579,6 +10926,9 @@ typedef void (*WifiScanThreshold_Closure) typedef void (*WifiPmfConfig_Closure) (const WifiPmfConfig *message, void *closure_data); +typedef void (*WifiBssMaxIdleConfig_Closure) + (const WifiBssMaxIdleConfig *message, + void *closure_data); typedef void (*WifiApConfig_Closure) (const WifiApConfig *message, void *closure_data); @@ -6678,9 +11028,18 @@ typedef void (*WifiProtocols_Closure) typedef void (*WifiBandwidths_Closure) (const WifiBandwidths *message, void *closure_data); +typedef void (*WifiItwtSetupConfig_Closure) + (const WifiItwtSetupConfig *message, + void *closure_data); +typedef void (*WifiTwtConfig_Closure) + (const WifiTwtConfig *message, + void *closure_data); typedef void (*ConnectedSTAList_Closure) (const ConnectedSTAList *message, void *closure_data); +typedef void (*EapFastConfig_Closure) + (const EapFastConfig *message, + void *closure_data); typedef void (*RpcReqGetMacAddress_Closure) (const RpcReqGetMacAddress *message, void *closure_data); @@ -6735,6 +11094,12 @@ typedef void (*RpcReqOTAEnd_Closure) typedef void (*RpcRespOTAEnd_Closure) (const RpcRespOTAEnd *message, void *closure_data); +typedef void (*RpcReqOTAActivate_Closure) + (const RpcReqOTAActivate *message, + void *closure_data); +typedef void (*RpcRespOTAActivate_Closure) + (const RpcRespOTAActivate *message, + void *closure_data); typedef void (*RpcReqWifiSetMaxTxPower_Closure) (const RpcReqWifiSetMaxTxPower *message, void *closure_data); @@ -7005,12 +11370,126 @@ typedef void (*RpcReqWifiGetBandMode_Closure) typedef void (*RpcRespWifiGetBandMode_Closure) (const RpcRespWifiGetBandMode *message, void *closure_data); +typedef void (*RpcReqWifiSetInactiveTime_Closure) + (const RpcReqWifiSetInactiveTime *message, + void *closure_data); +typedef void (*RpcRespWifiSetInactiveTime_Closure) + (const RpcRespWifiSetInactiveTime *message, + void *closure_data); +typedef void (*RpcReqWifiGetInactiveTime_Closure) + (const RpcReqWifiGetInactiveTime *message, + void *closure_data); +typedef void (*RpcRespWifiGetInactiveTime_Closure) + (const RpcRespWifiGetInactiveTime *message, + void *closure_data); +typedef void (*RpcReqWifiStaItwtSetup_Closure) + (const RpcReqWifiStaItwtSetup *message, + void *closure_data); +typedef void (*RpcRespWifiStaItwtSetup_Closure) + (const RpcRespWifiStaItwtSetup *message, + void *closure_data); +typedef void (*RpcReqWifiStaItwtTeardown_Closure) + (const RpcReqWifiStaItwtTeardown *message, + void *closure_data); +typedef void (*RpcRespWifiStaItwtTeardown_Closure) + (const RpcRespWifiStaItwtTeardown *message, + void *closure_data); +typedef void (*RpcReqWifiStaItwtSuspend_Closure) + (const RpcReqWifiStaItwtSuspend *message, + void *closure_data); +typedef void (*RpcRespWifiStaItwtSuspend_Closure) + (const RpcRespWifiStaItwtSuspend *message, + void *closure_data); +typedef void (*RpcReqWifiStaItwtGetFlowIdStatus_Closure) + (const RpcReqWifiStaItwtGetFlowIdStatus *message, + void *closure_data); +typedef void (*RpcRespWifiStaItwtGetFlowIdStatus_Closure) + (const RpcRespWifiStaItwtGetFlowIdStatus *message, + void *closure_data); +typedef void (*RpcReqWifiStaItwtSendProbeReq_Closure) + (const RpcReqWifiStaItwtSendProbeReq *message, + void *closure_data); +typedef void (*RpcRespWifiStaItwtSendProbeReq_Closure) + (const RpcRespWifiStaItwtSendProbeReq *message, + void *closure_data); +typedef void (*RpcReqWifiStaItwtSetTargetWakeTimeOffset_Closure) + (const RpcReqWifiStaItwtSetTargetWakeTimeOffset *message, + void *closure_data); +typedef void (*RpcRespWifiStaItwtSetTargetWakeTimeOffset_Closure) + (const RpcRespWifiStaItwtSetTargetWakeTimeOffset *message, + void *closure_data); +typedef void (*RpcReqWifiStaTwtConfig_Closure) + (const RpcReqWifiStaTwtConfig *message, + void *closure_data); +typedef void (*RpcRespWifiStaTwtConfig_Closure) + (const RpcRespWifiStaTwtConfig *message, + void *closure_data); typedef void (*RpcReqGetCoprocessorFwVersion_Closure) (const RpcReqGetCoprocessorFwVersion *message, void *closure_data); typedef void (*RpcRespGetCoprocessorFwVersion_Closure) (const RpcRespGetCoprocessorFwVersion *message, void *closure_data); +typedef void (*RpcReqSetDhcpDnsStatus_Closure) + (const RpcReqSetDhcpDnsStatus *message, + void *closure_data); +typedef void (*RpcRespSetDhcpDnsStatus_Closure) + (const RpcRespSetDhcpDnsStatus *message, + void *closure_data); +typedef void (*RpcReqGetDhcpDnsStatus_Closure) + (const RpcReqGetDhcpDnsStatus *message, + void *closure_data); +typedef void (*RpcRespGetDhcpDnsStatus_Closure) + (const RpcRespGetDhcpDnsStatus *message, + void *closure_data); +typedef void (*RpcReqSuppDppInit_Closure) + (const RpcReqSuppDppInit *message, + void *closure_data); +typedef void (*RpcRespSuppDppInit_Closure) + (const RpcRespSuppDppInit *message, + void *closure_data); +typedef void (*RpcReqSuppDppDeinit_Closure) + (const RpcReqSuppDppDeinit *message, + void *closure_data); +typedef void (*RpcRespSuppDppDeinit_Closure) + (const RpcRespSuppDppDeinit *message, + void *closure_data); +typedef void (*RpcReqSuppDppBootstrapGen_Closure) + (const RpcReqSuppDppBootstrapGen *message, + void *closure_data); +typedef void (*RpcRespSuppDppBootstrapGen_Closure) + (const RpcRespSuppDppBootstrapGen *message, + void *closure_data); +typedef void (*RpcReqSuppDppStartListen_Closure) + (const RpcReqSuppDppStartListen *message, + void *closure_data); +typedef void (*RpcRespSuppDppStartListen_Closure) + (const RpcRespSuppDppStartListen *message, + void *closure_data); +typedef void (*RpcReqSuppDppStopListen_Closure) + (const RpcReqSuppDppStopListen *message, + void *closure_data); +typedef void (*RpcRespSuppDppStopListen_Closure) + (const RpcRespSuppDppStopListen *message, + void *closure_data); +typedef void (*RpcReqIfaceMacAddrSetGet_Closure) + (const RpcReqIfaceMacAddrSetGet *message, + void *closure_data); +typedef void (*RpcRespIfaceMacAddrSetGet_Closure) + (const RpcRespIfaceMacAddrSetGet *message, + void *closure_data); +typedef void (*RpcReqIfaceMacAddrLenGet_Closure) + (const RpcReqIfaceMacAddrLenGet *message, + void *closure_data); +typedef void (*RpcRespIfaceMacAddrLenGet_Closure) + (const RpcRespIfaceMacAddrLenGet *message, + void *closure_data); +typedef void (*RpcReqFeatureControl_Closure) + (const RpcReqFeatureControl *message, + void *closure_data); +typedef void (*RpcRespFeatureControl_Closure) + (const RpcRespFeatureControl *message, + void *closure_data); typedef void (*RpcEventWifiEventNoArgs_Closure) (const RpcEventWifiEventNoArgs *message, void *closure_data); @@ -7035,6 +11514,228 @@ typedef void (*RpcEventStaConnected_Closure) typedef void (*RpcEventStaDisconnected_Closure) (const RpcEventStaDisconnected *message, void *closure_data); +typedef void (*RpcEventDhcpDnsStatus_Closure) + (const RpcEventDhcpDnsStatus *message, + void *closure_data); +typedef void (*RpcEventStaItwtSetup_Closure) + (const RpcEventStaItwtSetup *message, + void *closure_data); +typedef void (*RpcEventStaItwtTeardown_Closure) + (const RpcEventStaItwtTeardown *message, + void *closure_data); +typedef void (*RpcEventStaItwtSuspend_Closure) + (const RpcEventStaItwtSuspend *message, + void *closure_data); +typedef void (*RpcEventStaItwtProbe_Closure) + (const RpcEventStaItwtProbe *message, + void *closure_data); +typedef void (*RpcReqWifiStaEnterpriseEnable_Closure) + (const RpcReqWifiStaEnterpriseEnable *message, + void *closure_data); +typedef void (*RpcRespWifiStaEnterpriseEnable_Closure) + (const RpcRespWifiStaEnterpriseEnable *message, + void *closure_data); +typedef void (*RpcReqWifiStaEnterpriseDisable_Closure) + (const RpcReqWifiStaEnterpriseDisable *message, + void *closure_data); +typedef void (*RpcRespWifiStaEnterpriseDisable_Closure) + (const RpcRespWifiStaEnterpriseDisable *message, + void *closure_data); +typedef void (*RpcReqEapSetIdentity_Closure) + (const RpcReqEapSetIdentity *message, + void *closure_data); +typedef void (*RpcRespEapSetIdentity_Closure) + (const RpcRespEapSetIdentity *message, + void *closure_data); +typedef void (*RpcReqEapClearIdentity_Closure) + (const RpcReqEapClearIdentity *message, + void *closure_data); +typedef void (*RpcRespEapClearIdentity_Closure) + (const RpcRespEapClearIdentity *message, + void *closure_data); +typedef void (*RpcReqEapSetUsername_Closure) + (const RpcReqEapSetUsername *message, + void *closure_data); +typedef void (*RpcRespEapSetUsername_Closure) + (const RpcRespEapSetUsername *message, + void *closure_data); +typedef void (*RpcReqEapClearUsername_Closure) + (const RpcReqEapClearUsername *message, + void *closure_data); +typedef void (*RpcRespEapClearUsername_Closure) + (const RpcRespEapClearUsername *message, + void *closure_data); +typedef void (*RpcReqEapSetPassword_Closure) + (const RpcReqEapSetPassword *message, + void *closure_data); +typedef void (*RpcRespEapSetPassword_Closure) + (const RpcRespEapSetPassword *message, + void *closure_data); +typedef void (*RpcReqEapClearPassword_Closure) + (const RpcReqEapClearPassword *message, + void *closure_data); +typedef void (*RpcRespEapClearPassword_Closure) + (const RpcRespEapClearPassword *message, + void *closure_data); +typedef void (*RpcReqEapSetNewPassword_Closure) + (const RpcReqEapSetNewPassword *message, + void *closure_data); +typedef void (*RpcRespEapSetNewPassword_Closure) + (const RpcRespEapSetNewPassword *message, + void *closure_data); +typedef void (*RpcReqEapClearNewPassword_Closure) + (const RpcReqEapClearNewPassword *message, + void *closure_data); +typedef void (*RpcRespEapClearNewPassword_Closure) + (const RpcRespEapClearNewPassword *message, + void *closure_data); +typedef void (*RpcReqEapSetCaCert_Closure) + (const RpcReqEapSetCaCert *message, + void *closure_data); +typedef void (*RpcRespEapSetCaCert_Closure) + (const RpcRespEapSetCaCert *message, + void *closure_data); +typedef void (*RpcReqEapClearCaCert_Closure) + (const RpcReqEapClearCaCert *message, + void *closure_data); +typedef void (*RpcRespEapClearCaCert_Closure) + (const RpcRespEapClearCaCert *message, + void *closure_data); +typedef void (*RpcReqEapSetCertificateAndKey_Closure) + (const RpcReqEapSetCertificateAndKey *message, + void *closure_data); +typedef void (*RpcRespEapSetCertificateAndKey_Closure) + (const RpcRespEapSetCertificateAndKey *message, + void *closure_data); +typedef void (*RpcReqEapClearCertificateAndKey_Closure) + (const RpcReqEapClearCertificateAndKey *message, + void *closure_data); +typedef void (*RpcRespEapClearCertificateAndKey_Closure) + (const RpcRespEapClearCertificateAndKey *message, + void *closure_data); +typedef void (*RpcReqEapSetDisableTimeCheck_Closure) + (const RpcReqEapSetDisableTimeCheck *message, + void *closure_data); +typedef void (*RpcRespEapSetDisableTimeCheck_Closure) + (const RpcRespEapSetDisableTimeCheck *message, + void *closure_data); +typedef void (*RpcReqEapGetDisableTimeCheck_Closure) + (const RpcReqEapGetDisableTimeCheck *message, + void *closure_data); +typedef void (*RpcRespEapGetDisableTimeCheck_Closure) + (const RpcRespEapGetDisableTimeCheck *message, + void *closure_data); +typedef void (*RpcReqEapSetTtlsPhase2Method_Closure) + (const RpcReqEapSetTtlsPhase2Method *message, + void *closure_data); +typedef void (*RpcRespEapSetTtlsPhase2Method_Closure) + (const RpcRespEapSetTtlsPhase2Method *message, + void *closure_data); +typedef void (*RpcReqEapSetSuiteb192bitCertification_Closure) + (const RpcReqEapSetSuiteb192bitCertification *message, + void *closure_data); +typedef void (*RpcRespEapSetSuiteb192bitCertification_Closure) + (const RpcRespEapSetSuiteb192bitCertification *message, + void *closure_data); +typedef void (*RpcReqEapSetPacFile_Closure) + (const RpcReqEapSetPacFile *message, + void *closure_data); +typedef void (*RpcRespEapSetPacFile_Closure) + (const RpcRespEapSetPacFile *message, + void *closure_data); +typedef void (*RpcReqEapSetFastParams_Closure) + (const RpcReqEapSetFastParams *message, + void *closure_data); +typedef void (*RpcRespEapSetFastParams_Closure) + (const RpcRespEapSetFastParams *message, + void *closure_data); +typedef void (*RpcReqEapUseDefaultCertBundle_Closure) + (const RpcReqEapUseDefaultCertBundle *message, + void *closure_data); +typedef void (*RpcRespEapUseDefaultCertBundle_Closure) + (const RpcRespEapUseDefaultCertBundle *message, + void *closure_data); +typedef void (*RpcReqWifiSetOkcSupport_Closure) + (const RpcReqWifiSetOkcSupport *message, + void *closure_data); +typedef void (*RpcRespWifiSetOkcSupport_Closure) + (const RpcRespWifiSetOkcSupport *message, + void *closure_data); +typedef void (*RpcReqEapSetDomainName_Closure) + (const RpcReqEapSetDomainName *message, + void *closure_data); +typedef void (*RpcRespEapSetDomainName_Closure) + (const RpcRespEapSetDomainName *message, + void *closure_data); +typedef void (*RpcReqEapSetEapMethods_Closure) + (const RpcReqEapSetEapMethods *message, + void *closure_data); +typedef void (*RpcRespEapSetEapMethods_Closure) + (const RpcRespEapSetEapMethods *message, + void *closure_data); +typedef void (*RpcEventSuppDppUriReady_Closure) + (const RpcEventSuppDppUriReady *message, + void *closure_data); +typedef void (*RpcEventSuppDppCfgRecvd_Closure) + (const RpcEventSuppDppCfgRecvd *message, + void *closure_data); +typedef void (*RpcEventSuppDppFail_Closure) + (const RpcEventSuppDppFail *message, + void *closure_data); +typedef void (*RpcEventWifiDppUriReady_Closure) + (const RpcEventWifiDppUriReady *message, + void *closure_data); +typedef void (*RpcEventWifiDppCfgRecvd_Closure) + (const RpcEventWifiDppCfgRecvd *message, + void *closure_data); +typedef void (*RpcEventWifiDppFail_Closure) + (const RpcEventWifiDppFail *message, + void *closure_data); +typedef void (*RpcGpioConfig_Closure) + (const RpcGpioConfig *message, + void *closure_data); +typedef void (*RpcReqGpioConfig_Closure) + (const RpcReqGpioConfig *message, + void *closure_data); +typedef void (*RpcRespGpioConfig_Closure) + (const RpcRespGpioConfig *message, + void *closure_data); +typedef void (*RpcReqGpioReset_Closure) + (const RpcReqGpioReset *message, + void *closure_data); +typedef void (*RpcRespGpioResetPin_Closure) + (const RpcRespGpioResetPin *message, + void *closure_data); +typedef void (*RpcReqGpioSetLevel_Closure) + (const RpcReqGpioSetLevel *message, + void *closure_data); +typedef void (*RpcRespGpioSetLevel_Closure) + (const RpcRespGpioSetLevel *message, + void *closure_data); +typedef void (*RpcReqGpioGetLevel_Closure) + (const RpcReqGpioGetLevel *message, + void *closure_data); +typedef void (*RpcRespGpioGetLevel_Closure) + (const RpcRespGpioGetLevel *message, + void *closure_data); +typedef void (*RpcReqGpioSetDirection_Closure) + (const RpcReqGpioSetDirection *message, + void *closure_data); +typedef void (*RpcRespGpioSetDirection_Closure) + (const RpcRespGpioSetDirection *message, + void *closure_data); +typedef void (*RpcReqGpioInputEnable_Closure) + (const RpcReqGpioInputEnable *message, + void *closure_data); +typedef void (*RpcRespGpioInputEnable_Closure) + (const RpcRespGpioInputEnable *message, + void *closure_data); +typedef void (*RpcReqGpioSetPullMode_Closure) + (const RpcReqGpioSetPullMode *message, + void *closure_data); +typedef void (*RpcRespGpioSetPullMode_Closure) + (const RpcRespGpioSetPullMode *message, + void *closure_data); typedef void (*Rpc_Closure) (const Rpc *message, void *closure_data); @@ -7049,16 +11750,23 @@ extern const ProtobufCEnumDescriptor rpc__wifi_power_save__descriptor; extern const ProtobufCEnumDescriptor rpc__wifi_sec_prot__descriptor; extern const ProtobufCEnumDescriptor rpc__status__descriptor; extern const ProtobufCEnumDescriptor rpc_type__descriptor; +extern const ProtobufCEnumDescriptor rpc_feature__descriptor; +extern const ProtobufCEnumDescriptor rpc_feature_command__descriptor; +extern const ProtobufCEnumDescriptor rpc_feature_option__descriptor; extern const ProtobufCEnumDescriptor rpc_id__descriptor; +extern const ProtobufCEnumDescriptor rpc__gpio_mode__descriptor; +extern const ProtobufCEnumDescriptor rpc__gpio_pull_mode__descriptor; extern const ProtobufCMessageDescriptor wifi_init_config__descriptor; extern const ProtobufCMessageDescriptor wifi_country__descriptor; extern const ProtobufCMessageDescriptor wifi_active_scan_time__descriptor; extern const ProtobufCMessageDescriptor wifi_scan_time__descriptor; +extern const ProtobufCMessageDescriptor wifi_scan_channel_bitmap__descriptor; extern const ProtobufCMessageDescriptor wifi_scan_config__descriptor; extern const ProtobufCMessageDescriptor wifi_he_ap_info__descriptor; extern const ProtobufCMessageDescriptor wifi_ap_record__descriptor; extern const ProtobufCMessageDescriptor wifi_scan_threshold__descriptor; extern const ProtobufCMessageDescriptor wifi_pmf_config__descriptor; +extern const ProtobufCMessageDescriptor wifi_bss_max_idle_config__descriptor; extern const ProtobufCMessageDescriptor wifi_ap_config__descriptor; extern const ProtobufCMessageDescriptor wifi_sta_config__descriptor; extern const ProtobufCMessageDescriptor wifi_config__descriptor; @@ -7092,7 +11800,10 @@ extern const ProtobufCMessageDescriptor wifi_event_ap_wps_rg_fail_reason__descri extern const ProtobufCMessageDescriptor wifi_event_ap_wps_rg_success__descriptor; extern const ProtobufCMessageDescriptor wifi_protocols__descriptor; extern const ProtobufCMessageDescriptor wifi_bandwidths__descriptor; +extern const ProtobufCMessageDescriptor wifi_itwt_setup_config__descriptor; +extern const ProtobufCMessageDescriptor wifi_twt_config__descriptor; extern const ProtobufCMessageDescriptor connected_stalist__descriptor; +extern const ProtobufCMessageDescriptor eap_fast_config__descriptor; extern const ProtobufCMessageDescriptor rpc__req__get_mac_address__descriptor; extern const ProtobufCMessageDescriptor rpc__resp__get_mac_address__descriptor; extern const ProtobufCMessageDescriptor rpc__req__get_mode__descriptor; @@ -7111,6 +11822,8 @@ extern const ProtobufCMessageDescriptor rpc__req__otawrite__descriptor; extern const ProtobufCMessageDescriptor rpc__resp__otawrite__descriptor; extern const ProtobufCMessageDescriptor rpc__req__otaend__descriptor; extern const ProtobufCMessageDescriptor rpc__resp__otaend__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__otaactivate__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__otaactivate__descriptor; extern const ProtobufCMessageDescriptor rpc__req__wifi_set_max_tx_power__descriptor; extern const ProtobufCMessageDescriptor rpc__resp__wifi_set_max_tx_power__descriptor; extern const ProtobufCMessageDescriptor rpc__req__wifi_get_max_tx_power__descriptor; @@ -7201,8 +11914,46 @@ extern const ProtobufCMessageDescriptor rpc__req__wifi_set_band_mode__descriptor extern const ProtobufCMessageDescriptor rpc__resp__wifi_set_band_mode__descriptor; extern const ProtobufCMessageDescriptor rpc__req__wifi_get_band_mode__descriptor; extern const ProtobufCMessageDescriptor rpc__resp__wifi_get_band_mode__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__wifi_set_inactive_time__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__wifi_set_inactive_time__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__wifi_get_inactive_time__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__wifi_get_inactive_time__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__wifi_sta_itwt_setup__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__wifi_sta_itwt_setup__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__wifi_sta_itwt_teardown__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__wifi_sta_itwt_teardown__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__wifi_sta_itwt_suspend__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__wifi_sta_itwt_suspend__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__wifi_sta_itwt_get_flow_id_status__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__wifi_sta_itwt_get_flow_id_status__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__wifi_sta_itwt_send_probe_req__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__wifi_sta_itwt_send_probe_req__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__wifi_sta_itwt_set_target_wake_time_offset__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__wifi_sta_twt_config__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__wifi_sta_twt_config__descriptor; extern const ProtobufCMessageDescriptor rpc__req__get_coprocessor_fw_version__descriptor; extern const ProtobufCMessageDescriptor rpc__resp__get_coprocessor_fw_version__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__set_dhcp_dns_status__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__set_dhcp_dns_status__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__get_dhcp_dns_status__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__get_dhcp_dns_status__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__supp_dpp_init__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__supp_dpp_init__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__supp_dpp_deinit__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__supp_dpp_deinit__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__supp_dpp_bootstrap_gen__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__supp_dpp_bootstrap_gen__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__supp_dpp_start_listen__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__supp_dpp_start_listen__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__supp_dpp_stop_listen__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__supp_dpp_stop_listen__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__iface_mac_addr_set_get__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__iface_mac_addr_set_get__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__iface_mac_addr_len_get__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__iface_mac_addr_len_get__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__feature_control__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__feature_control__descriptor; extern const ProtobufCMessageDescriptor rpc__event__wifi_event_no_args__descriptor; extern const ProtobufCMessageDescriptor rpc__event__espinit__descriptor; extern const ProtobufCMessageDescriptor rpc__event__heartbeat__descriptor; @@ -7211,6 +11962,80 @@ extern const ProtobufCMessageDescriptor rpc__event__ap__sta_connected__descripto extern const ProtobufCMessageDescriptor rpc__event__sta_scan_done__descriptor; extern const ProtobufCMessageDescriptor rpc__event__sta_connected__descriptor; extern const ProtobufCMessageDescriptor rpc__event__sta_disconnected__descriptor; +extern const ProtobufCMessageDescriptor rpc__event__dhcp_dns_status__descriptor; +extern const ProtobufCMessageDescriptor rpc__event__sta_itwt_setup__descriptor; +extern const ProtobufCMessageDescriptor rpc__event__sta_itwt_teardown__descriptor; +extern const ProtobufCMessageDescriptor rpc__event__sta_itwt_suspend__descriptor; +extern const ProtobufCMessageDescriptor rpc__event__sta_itwt_probe__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__wifi_sta_enterprise_enable__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__wifi_sta_enterprise_enable__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__wifi_sta_enterprise_disable__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__wifi_sta_enterprise_disable__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_set_identity__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_set_identity__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_clear_identity__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_clear_identity__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_set_username__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_set_username__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_clear_username__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_clear_username__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_set_password__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_set_password__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_clear_password__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_clear_password__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_set_new_password__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_set_new_password__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_clear_new_password__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_clear_new_password__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_set_ca_cert__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_set_ca_cert__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_clear_ca_cert__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_clear_ca_cert__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_set_certificate_and_key__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_set_certificate_and_key__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_clear_certificate_and_key__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_clear_certificate_and_key__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_set_disable_time_check__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_set_disable_time_check__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_get_disable_time_check__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_get_disable_time_check__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_set_ttls_phase2_method__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_set_ttls_phase2_method__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_set_suiteb192bit_certification__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_set_suiteb192bit_certification__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_set_pac_file__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_set_pac_file__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_set_fast_params__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_set_fast_params__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_use_default_cert_bundle__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_use_default_cert_bundle__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__wifi_set_okc_support__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__wifi_set_okc_support__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_set_domain_name__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_set_domain_name__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__eap_set_eap_methods__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__eap_set_eap_methods__descriptor; +extern const ProtobufCMessageDescriptor rpc__event__supp_dpp_uri_ready__descriptor; +extern const ProtobufCMessageDescriptor rpc__event__supp_dpp_cfg_recvd__descriptor; +extern const ProtobufCMessageDescriptor rpc__event__supp_dpp_fail__descriptor; +extern const ProtobufCMessageDescriptor rpc__event__wifi_dpp_uri_ready__descriptor; +extern const ProtobufCMessageDescriptor rpc__event__wifi_dpp_cfg_recvd__descriptor; +extern const ProtobufCMessageDescriptor rpc__event__wifi_dpp_fail__descriptor; +extern const ProtobufCMessageDescriptor rpc__gpio_config__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__gpio_config__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__gpio_config__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__gpio_reset__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__gpio_reset_pin__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__gpio_set_level__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__gpio_set_level__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__gpio_get_level__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__gpio_get_level__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__gpio_set_direction__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__gpio_set_direction__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__gpio_input_enable__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__gpio_input_enable__descriptor; +extern const ProtobufCMessageDescriptor rpc__req__gpio_set_pull_mode__descriptor; +extern const ProtobufCMessageDescriptor rpc__resp__gpio_set_pull_mode__descriptor; extern const ProtobufCMessageDescriptor rpc__descriptor; PROTOBUF_C__END_DECLS diff --git a/common/proto/esp_hosted_rpc.proto b/common/proto/esp_hosted_rpc.proto index db37ac49..c7c7966b 100644 --- a/common/proto/esp_hosted_rpc.proto +++ b/common/proto/esp_hosted_rpc.proto @@ -1,1830 +1,2273 @@ -/* Copyright (C) 2015-2023 Espressif Systems (Shanghai) PTE LTD */ -/* SPDX-License-Identifier: GPL-2.0-only OR Apache-2.0 */ - -syntax = "proto3"; - -/* Enums similar to ESP IDF */ -//enum Rpc_VendorIEType { -// Beacon = 0; -// Probe_req = 1; -// Probe_resp = 2; -// Assoc_req = 3; -// Assoc_resp = 4; -//} -// -//enum Rpc_VendorIEID { -// ID_0 = 0; -// ID_1 = 1; -//} - - -enum Rpc_WifiBw { - BW_Invalid = 0; - HT20 = 1; - HT40 = 2; -} - -enum Rpc_WifiPowerSave { - PS_Invalid = 0; - MIN_MODEM = 1; - MAX_MODEM = 2; -} - -enum Rpc_WifiSecProt { - Open = 0; - WEP = 1; - WPA_PSK = 2; - WPA2_PSK = 3; - WPA_WPA2_PSK = 4; - WPA2_ENTERPRISE = 5; - WPA3_PSK = 6; - WPA2_WPA3_PSK = 7; -} - -/* enums for Control path */ -enum Rpc_Status { - Connected = 0; - Not_Connected = 1; - No_AP_Found = 2; - Connection_Fail = 3; - Invalid_Argument = 4; - Out_Of_Range = 5; -} - - -enum RpcType { -MsgType_Invalid = 0; - Req = 1; - Resp = 2; - Event = 3; - MsgType_Max = 4; -} -// -//enum Rpc { -// ESP_ERR_WIFI_BASE = 0x3000; -// ESP_ERR_WIFI_NOT_INIT = 0x3001; -// ESP_ERR_WIFI_NOT_STARTED = 0x3002; -// ESP_ERR_WIFI_NOT_STOPPED = 0x3003; -// ESP_ERR_WIFI_IF = 0x3004; -// ESP_ERR_WIFI_MODE = 0x3005; -// ESP_ERR_WIFI_STATE = 0x3006; -// ESP_ERR_WIFI_CONN = 0x3007; -// ESP_ERR_WIFI_NVS = 0x3008; -// ESP_ERR_WIFI_MAC = 0x3009; -// ESP_ERR_WIFI_SSID = 0x300a; -// ESP_ERR_WIFI_PASSWORD = 0x300b; -// ESP_ERR_WIFI_TIMEOUT = 0x300c; -// ESP_ERR_WIFI_WAKE_FAIL = 0x300d; -// ESP_ERR_WIFI_WOULD_BLOCK = 0x300e; -// ESP_ERR_WIFI_NOT_CONNECT = 0x300f; -// /* 0x3010 0x3011 not present intentionally */ -// ESP_ERR_WIFI_POST = 0x3012; -// ESP_ERR_WIFI_INIT_STATE = 0x3013; -// ESP_ERR_WIFI_STOP_STATE = 0x3014; -// ESP_ERR_WIFI_NOT_ASSOC = 0x3015; -// ESP_ERR_WIFI_TX_DISALLOW = 0x3016; -//} - - -//enum ctrl_msg_type { -// invalid = 0; -// req = 1; -// resp = 2; -// event = 3; -// max = 4; -//} -// -//enum ctrl_msg_id { -// invalid = 0; -// req_base = 400; -// req_w_init = 401; -// req_w_deinit = 402; -// req_w_set_mode = 403; -// req_w_get_mode = 404; -// req_w_start = 405; -// req_w_stop = 406; -// req_w_restore = 407; -// req_w_connect = 408; -// req_w_disconnect = 409; -// req_w_clear_fast_connect = 410; -// req_w_deauth_sta = 411; -// req_w_scan_start = 412; -// req_w_scan_stop = 413; -// req_w_scan_get_ap_name = 414; -// req_w_scan_get_ap_records = 415; -// req_w_clear_ap_list = 416; -// req_w_sta_get_ap_info = 417; -// req_w_set_ps = 418; -// req_w_get_ps = 419; -// req_w_set_protocol = 420; -// req_w_get_protocol = 421; -// req_w_set_bandwidth = 422; -// req_w_get_bandwidth = 423; -// req_w_set_channel = 424; -// req_w_get_channel = 425; -// req_w_set_country = 426; -// req_w_get_country = 427; -// req_w_set_mac = 428; -// req_w_get_mac = 429; -// req_w_set_promiscuous_cb = 430; -// req_w_set_promiscuous = 431; -// req_w_get_promiscuous = 432; -// req_w_set_promiscuous_filter = 433; -// req_w_get_promiscuous_filter = 434; -// req_w_set_promiscuous_ctrl_filter = 435; -// req_w_get_promiscuous_ctrl_filter = 436; -// req_w_set_config = 437; -// req_w_get_config = 438; -// req_w_ap_get_sta_list = 439; -// req_w_ap_get_sta_aid = 440; -// req_w_set_storage = 441; -// req_w_set_vendor_ie = 442; -// req_w_set_vendor_ie_cb = 443; -// req_w_set_max_tx_power = 444; -// req_w_get_max_tx_power = 445; -// req_w_set_event_mask = 446; -// req_w_get_event_mask = 447; -// req_w_80211_tx = 448; -// req_w_set_csi_rx_cb = 449; -// req_w_set_csi_config = 450; -// req_w_set_csi = 451; -// req_w_set_ant_gpio = 452; -// req_w_get_ant_gpio = 453; -// req_w_set_ant = 454; -// req_w_get_ant = 455; -// req_w_get_tsf_time = 456; -// req_w_set_inactive_time = 457; -// req_w_get_inactive_time = 458; -// req_w_statis_dump = 459; -// req_w_set_rssi_threshold = 460; -// req_w_ftm_initiate_session = 461; -// req_w_ftm_end_session = 462; -// req_w_ftm_resp_set_offset = 463; -// req_w_config_11b_rate = 464; -// req_w_connectionless_module_set_wake_interval = 465; -// req_w_set_country_code = 466; -// req_w_get_country_code = 467; -// req_w_config_80211_tx_rate = 468; -// req_w_disable_pmf_config = 469; -// -// req_max = 470; -// -// -// rsp_base = 600; -// rsp_w_init = 601; -// rsp_w_deinit = 602; -// rsp_w_set_mode = 603; -// rsp_w_get_mode = 604; -// rsp_w_start = 605; -// rsp_w_stop = 606; -// rsp_w_restore = 607; -// rsp_w_connect = 608; -// rsp_w_disconnect = 609; -// rsp_w_clear_fast_connect = 610; -// rsp_w_deauth_sta = 611; -// rsp_w_scan_start = 612; -// rsp_w_scan_stop = 613; -// rsp_w_scan_get_ap_name = 614; -// rsp_w_scan_get_ap_records = 615; -// rsp_w_clear_ap_list = 616; -// rsp_w_sta_get_ap_info = 617; -// rsp_w_set_ps = 618; -// rsp_w_get_ps = 619; -// rsp_w_set_protocol = 620; -// rsp_w_get_protocol = 621; -// rsp_w_set_bandwidth = 622; -// rsp_w_get_bandwidth = 623; -// rsp_w_set_channel = 624; -// rsp_w_get_channel = 625; -// rsp_w_set_country = 626; -// rsp_w_get_country = 627; -// rsp_w_set_mac = 628; -// rsp_w_get_mac = 629; -// rsp_w_set_promiscuous_cb = 630; -// rsp_w_set_promiscuous = 631; -// rsp_w_get_promiscuous = 632; -// rsp_w_set_promiscuous_filter = 633; -// rsp_w_get_promiscuous_filter = 634; -// rsp_w_set_promiscuous_ctrl_filter = 635; -// rsp_w_get_promiscuous_ctrl_filter = 636; -// rsp_w_set_config = 637; -// rsp_w_get_config = 638; -// rsp_w_ap_get_sta_list = 639; -// rsp_w_ap_get_sta_aid = 640; -// rsp_w_set_storage = 641; -// rsp_w_set_vendor_ie = 642; -// rsp_w_set_vendor_ie_cb = 643; -// rsp_w_set_max_tx_power = 644; -// rsp_w_get_max_tx_power = 645; -// rsp_w_set_event_mask = 646; -// rsp_w_get_event_mask = 647; -// rsp_w_80211_tx = 648; -// rsp_w_set_csi_rx_cb = 649; -// rsp_w_set_csi_config = 650; -// rsp_w_set_csi = 651; -// rsp_w_set_ant_gpio = 652; -// rsp_w_get_ant_gpio = 653; -// rsp_w_set_ant = 654; -// rsp_w_get_ant = 655; -// rsp_w_get_tsf_time = 656; -// rsp_w_set_inactive_time = 657; -// rsp_w_get_inactive_time = 658; -// rsp_w_statis_dump = 659; -// rsp_w_set_rssi_threshold = 660; -// rsp_w_ftm_initiate_session = 661; -// rsp_w_ftm_end_session = 662; -// rsp_w_ftm_resp_set_offset = 663; -// rsp_w_config_11b_rate = 664; -// rsp_w_connectionless_module_set_wake_interval = 665; -// rsp_w_set_country_code = 666; -// rsp_w_get_country_code = 667; -// rsp_w_config_80211_tx_rate = 668; -// rsp_w_disable_pmf_config = 669; -// -// rsp_max = 670; -// -// -// evt_base = 800; -// evt_esp_started = 801; -// evt_heartbeat = 802; -// evt_w_ready = 803; /**< ESP32 WiFi ready */ -// evt_w_scan_done = 804; /**< ESP32 finish scanning AP */ -// evt_w_sta_start = 805; /**< ESP32 station start */ -// evt_w_sta_stop = 806; /**< ESP32 station stop */ -// evt_w_sta_connected = 807; /**< ESP32 station connected to AP */ -// evt_w_sta_disconnected = 808; /**< ESP32 station disconnected from AP */ -// evt_w_sta_authmode_change = 809; /**< the auth mode of AP connected by ESP32 station changed */ -// -// evt_w_sta_wps_er_success = 810; /**< ESP32 station wps succeeds in enrollee mode */ -// evt_w_sta_wps_er_failed = 811; /**< ESP32 station wps fails in enrollee mode */ -// evt_w_sta_wps_er_timeout = 812; /**< ESP32 station wps timeout in enrollee mode */ -// evt_w_sta_wps_er_pin = 813; /**< ESP32 station wps pin code in enrollee mode */ -// evt_w_sta_wps_er_pbc_overlap = 814; /**< ESP32 station wps overlap in enrollee mode */ -// -// evt_w_ap_start = 815; /**< ESP32 soft-AP start */ -// evt_w_ap_stop = 816; /**< ESP32 soft-AP stop */ -// evt_w_ap_staconnected = 817; /**< a station connected to ESP32 soft-AP */ -// evt_w_ap_stadisconnected = 818; /**< a station disconnected from ESP32 soft-AP */ -// evt_w_ap_probereqrecved = 819; /**< Receive probe request packet in soft-AP interface */ -// -// evt_w_ftm_report = 820; /**< Receive report of FTM procedure */ -// -// /* Add next events after this only */ -// evt_w_sta_bss_rssi_low = 821; /**< AP's RSSI crossed configured threshold */ -// evt_w_action_tx_status = 822; /**< Status indication of Action Tx operation */ -// evt_w_roc_done = 823; /**< Remain-on-Channel operation complete */ -// -// evt_w_sta_beacon_timeout = 824; /**< ESP32 station beacon timeout */ -// -// evt_w_connectionless_module_wake_interval_start = 825; /**< ESP32 connectionless module wake interval start */ -// -// evt_w_ap_wps_rg_success = 826; /**< Soft-AP wps succeeds in registrar mode */ -// evt_w_ap_wps_rg_failed = 827; /**< Soft-AP wps fails in registrar mode */ -// evt_w_ap_wps_rg_timeout = 828; /**< Soft-AP wps timeout in registrar mode */ -// evt_w_ap_wps_rg_pin = 829; /**< Soft-AP wps pin code in registrar mode */ -// evt_w_ap_wps_rg_pbc_overlap = 830; /**< Soft-AP wps overlap in registrar mode */ -// -// evt_max = 831; /**< Invalid WiFi event ID */ -// -//} - - -enum RpcId { - MsgId_Invalid = 0; - - /** Request Msgs **/ - Req_Base = 256; //0x100 - - Req_GetMACAddress = 257; //0x101 - Req_SetMacAddress = 258; //0x102 - Req_GetWifiMode = 259; //0x103 - Req_SetWifiMode = 260; //0x104 - - //Req_GetAPScanList = 261; //0x105 - //Req_GetAPConfig = 262; //0x106 - //Req_ConnectAP = 263; //0x107 - //Req_DisconnectAP = 264; //0x108 - - //Req_GetSoftAPConfig = 265; //0x109 - //Req_SetSoftAPVendorSpecificIE = 266; //0x10a - //Req_StartSoftAP = 267; //0x10b - //Req_GetSoftAPConnectedSTAList = 268; //0x10c - //Req_StopSoftAP = 269; //0x10d - - Req_WifiSetPs = 270; //0x10e - Req_WifiGetPs = 271; //0x10f - - Req_OTABegin = 272; //0x110 - Req_OTAWrite = 273; //0x111 - Req_OTAEnd = 274; //0x112 - - Req_WifiSetMaxTxPower = 275; //0x113 - Req_WifiGetMaxTxPower = 276; //0x114 - - Req_ConfigHeartbeat = 277; //0x115 - - Req_WifiInit = 278; //0x116 - Req_WifiDeinit = 279; //0x117 - Req_WifiStart = 280; //0x118 - Req_WifiStop = 281; //0x119 - Req_WifiConnect = 282; //0x11a - Req_WifiDisconnect = 283; //0x11b - Req_WifiSetConfig = 284; //0x11c - Req_WifiGetConfig = 285; //0x11d - - Req_WifiScanStart = 286; //0x11e - Req_WifiScanStop = 287; //0x11f - Req_WifiScanGetApNum = 288; //0x120 - Req_WifiScanGetApRecords = 289; //0x121 - Req_WifiClearApList = 290; //0x122 - - Req_WifiRestore = 291; //0x123 - Req_WifiClearFastConnect = 292; //0x124 - Req_WifiDeauthSta = 293; //0x125 - Req_WifiStaGetApInfo = 294; //0x126 - //Req_WifiSetPs = 295; //0x127 - //Req_WifiGetPs = 296; //0x128 - Req_WifiSetProtocol = 297; //0x129 - Req_WifiGetProtocol = 298; //0x12a - Req_WifiSetBandwidth = 299; //0x12b - Req_WifiGetBandwidth = 300; //0x12c - Req_WifiSetChannel = 301; //0x12d - Req_WifiGetChannel = 302; //0x12e - Req_WifiSetCountry = 303; //0x12f - Req_WifiGetCountry = 304; //0x130 - -// Req_WifiSetPromiscuousRxCb = 305; //0x131 - Req_WifiSetPromiscuous = 305; //0x131 - Req_WifiGetPromiscuous = 306; //0x132 - Req_WifiSetPromiscuousFilter = 307; //0x133 - Req_WifiGetPromiscuousFilter = 308; //0x134 - Req_WifiSetPromiscuousCtrlFilter = 309; //0x135 - Req_WifiGetPromiscuousCtrlFilter = 310; //0x136 - - Req_WifiApGetStaList = 311; //0x137 - Req_WifiApGetStaAid = 312; //0x138 - Req_WifiSetStorage = 313; //0x139 - Req_WifiSetVendorIe = 314; //0x13a -// Req_WifiSetVendorIeCb = 315; //0x13b - Req_WifiSetEventMask = 315; //0x13b - Req_WifiGetEventMask = 316; //0x13c - Req_Wifi80211Tx = 317; //0x13d - -// Req_WifiSetCsiRxCb = 318; //0x13e - Req_WifiSetCsiConfig = 318; //0x13e - Req_WifiSetCsi = 319; //0x13f - - Req_WifiSetAntGpio = 320; //0x140 - Req_WifiGetAntGpio = 321; //0x141 - Req_WifiSetAnt = 322; //0x142 - Req_WifiGetAnt = 323; //0x143 - - Req_WifiGetTsfTime = 324; //0x144 - Req_WifiSetInactiveTime = 325; //0x145 - Req_WifiGetInactiveTime = 326; //0x146 - Req_WifiStatisDump = 327; //0x147 - Req_WifiSetRssiThreshold = 328; //0x148 - - Req_WifiFtmInitiateSession = 329; //0x149 - Req_WifiFtmEndSession = 330; //0x14a - Req_WifiFtmRespSetOffset = 331; //0x14b - - Req_WifiConfig11bRate = 332; //0x14c - Req_WifiConnectionlessModuleSetWakeInterval = 333; //0x14d - Req_WifiSetCountryCode = 334; //0x14e - Req_WifiGetCountryCode = 335; //0x14f - Req_WifiConfig80211TxRate = 336; //0x150 - Req_WifiDisablePmfConfig = 337; //0x151 - Req_WifiStaGetAid = 338; //0x152 - Req_WifiStaGetNegotiatedPhymode = 339; //0x153 - Req_WifiSetDynamicCs = 340; //0x154 - Req_WifiStaGetRssi = 341; //0x155 - - Req_WifiSetProtocols = 342; //0x156 - Req_WifiGetProtocols = 343; //0x157 - Req_WifiSetBandwidths = 344; //0x158 - Req_WifiGetBandwidths = 345; //0x159 - - Req_WifiSetBand = 346; //0x15a - Req_WifiGetBand = 347; //0x15b - Req_WifiSetBandMode = 348; //0x15c - Req_WifiGetBandMode = 349; //0x15d - - Req_GetCoprocessorFwVersion = 350; //0x15e - - Req_WifiScanGetApRecord = 351; //0x15f - -/* Add new control path command response before Req_Max - * and update Req_Max */ - Req_Max = 352; //0x160 - - /** Response Msgs **/ - Resp_Base = 512; - - Resp_GetMACAddress = 513; - Resp_SetMacAddress = 514; - Resp_GetWifiMode = 515; - Resp_SetWifiMode = 516; - - //Resp_GetAPScanList = 517; - //Resp_GetAPConfig = 518; - //Resp_ConnectAP = 519; - //Resp_DisconnectAP = 520; - - //Resp_GetSoftAPConfig = 521; - //Resp_SetSoftAPVendorSpecificIE = 522; - //Resp_StartSoftAP = 523; - //Resp_GetSoftAPConnectedSTAList = 524; - //Resp_StopSoftAP = 525; - - Resp_WifiSetPs = 526; - Resp_WifiGetPs = 527; - - Resp_OTABegin = 528; - Resp_OTAWrite = 529; - Resp_OTAEnd = 530; - - Resp_WifiSetMaxTxPower = 531; - Resp_WifiGetMaxTxPower = 532; - - Resp_ConfigHeartbeat = 533; - - Resp_WifiInit = 534; - Resp_WifiDeinit = 535; - Resp_WifiStart = 536; - Resp_WifiStop = 537; - Resp_WifiConnect = 538; - Resp_WifiDisconnect = 539; - Resp_WifiSetConfig = 540; - Resp_WifiGetConfig = 541; - - Resp_WifiScanStart = 542; - Resp_WifiScanStop = 543; - Resp_WifiScanGetApNum = 544; - Resp_WifiScanGetApRecords = 545; - Resp_WifiClearApList = 546; - - Resp_WifiRestore = 547; - Resp_WifiClearFastConnect = 548; - Resp_WifiDeauthSta = 549; - Resp_WifiStaGetApInfo = 550; - //Resp_WifiSetPs = 551; - //Resp_WifiGetPs = 552; - Resp_WifiSetProtocol = 553; - Resp_WifiGetProtocol = 554; - Resp_WifiSetBandwidth = 555; - Resp_WifiGetBandwidth = 556; - Resp_WifiSetChannel = 557; - Resp_WifiGetChannel = 558; - Resp_WifiSetCountry = 559; - Resp_WifiGetCountry = 560; - -// Resp_WifiSetPromiscuousRxCb = 561; - Resp_WifiSetPromiscuous = 561; - Resp_WifiGetPromiscuous = 562; - Resp_WifiSetPromiscuousFilter = 563; - Resp_WifiGetPromiscuousFilter = 564; - Resp_WifiSetPromiscuousCtrlFilter = 565; - Resp_WifiGetPromiscuousCtrlFilter = 566; - - Resp_WifiApGetStaList = 567; - Resp_WifiApGetStaAid = 568; - Resp_WifiSetStorage = 569; - Resp_WifiSetVendorIe = 570; -// Resp_WifiSetVendorIeCb = 571; - Resp_WifiSetEventMask = 571; - Resp_WifiGetEventMask = 572; - Resp_Wifi80211Tx = 573; - -// Resp_WifiSetCsiRxCb = 573; - Resp_WifiSetCsiConfig = 574; - Resp_WifiSetCsi = 575; - - Resp_WifiSetAntGpio = 576; - Resp_WifiGetAntGpio = 577; - Resp_WifiSetAnt = 578; - Resp_WifiGetAnt = 579; - - Resp_WifiGetTsfTime = 580; - Resp_WifiSetInactiveTime = 581; - Resp_WifiGetInactiveTime = 582; - Resp_WifiStatisDump = 583; - Resp_WifiSetRssiThreshold = 584; - - Resp_WifiFtmInitiateSession = 585; - Resp_WifiFtmEndSession = 586; - Resp_WifiFtmRespSetOffset = 587; - - Resp_WifiConfig11bRate = 588; - Resp_WifiConnectionlessModuleSetWakeInterval = 589; - Resp_WifiSetCountryCode = 590; - Resp_WifiGetCountryCode = 591; - Resp_WifiConfig80211TxRate = 592; - Resp_WifiDisablePmfConfig = 593; - Resp_WifiStaGetAid = 594; - Resp_WifiStaGetNegotiatedPhymode = 595; - Resp_WifiSetDynamicCs = 596; - Resp_WifiStaGetRssi = 597; - - Resp_WifiSetProtocols = 598; - Resp_WifiGetProtocols = 599; - Resp_WifiSetBandwidths = 600; - Resp_WifiGetBandwidths = 601; - - Resp_WifiSetBand = 602; - Resp_WifiGetBand = 603; - Resp_WifiSetBandMode = 604; - Resp_WifiGetBandMode = 605; - - Resp_GetCoprocessorFwVersion = 606; - - Resp_WifiScanGetApRecord = 607; - - /* Add new control path command response before Resp_Max - * and update Resp_Max */ - Resp_Max = 608; - - /** Event Msgs **/ - Event_Base = 768; - Event_ESPInit = 769; - Event_Heartbeat = 770; - Event_AP_StaConnected = 771; - Event_AP_StaDisconnected = 772; - Event_WifiEventNoArgs = 773; - Event_StaScanDone = 774; - Event_StaConnected = 775; - Event_StaDisconnected = 776; - - /* Add new control path command notification before Event_Max - * and update Event_Max */ - Event_Max = 777; -} - -message wifi_init_config { - int32 static_rx_buf_num = 1; /**< WiFi static RX buffer number */ - int32 dynamic_rx_buf_num = 2; /**< WiFi dynamic RX buffer number */ - int32 tx_buf_type = 3; /**< WiFi TX buffer type */ - int32 static_tx_buf_num = 4; /**< WiFi static TX buffer number */ - int32 dynamic_tx_buf_num = 5; /**< WiFi dynamic TX buffer number */ - int32 cache_tx_buf_num = 6; /**< WiFi TX cache buffer number */ - int32 csi_enable = 7; /**< WiFi channel state information enable flag */ - int32 ampdu_rx_enable = 8; /**< WiFi AMPDU RX feature enable flag */ - int32 ampdu_tx_enable = 9; /**< WiFi AMPDU TX feature enable flag */ - int32 amsdu_tx_enable = 10; /**< WiFi AMSDU TX feature enable flag */ - int32 nvs_enable = 11; /**< WiFi NVS flash enable flag */ - int32 nano_enable = 12; /**< Nano option for printf/scan family enable flag */ - int32 rx_ba_win = 13; /**< WiFi Block Ack RX window size */ - int32 wifi_task_core_id = 14; /**< WiFi Task Core ID */ - int32 beacon_max_len = 15; /**< WiFi softAP maximum length of the beacon */ - int32 mgmt_sbuf_num = 16; /**< WiFi management short buffer number, the minimum value is 6, the maximum value is 32 */ - uint64 feature_caps = 17; /**< Enables additional WiFi features and capabilities */ - bool sta_disconnected_pm = 18; /**< WiFi Power Management for station at disconnected status */ - int32 espnow_max_encrypt_num = 19; /**< Maximum encrypt number of peers supported by espnow */ - int32 magic = 20; /**< WiFi init magic number, it should be the last field */ -} - -message wifi_country { - bytes cc = 1; /**< country code string of 3 chars*/ - uint32 schan = 2; /**< start channel */ - uint32 nchan = 3; /**< total channel number */ - int32 max_tx_power = 4; /**< This field is used for getting WiFi maximum transmitting power, - call esp_wifi_set_max_tx_power to set the maximum transmitting power. */ - int32 policy = 5; /**< country policy */ -} - - -message wifi_active_scan_time { - uint32 min = 1; /**< minimum active scan time per channel, units: millisecond */ - uint32 max = 2; /**< maximum active scan time per channel, units: millisecond, values above 1500ms may - cause station to disconnect from AP and are not recommended. */ -} ; - -message wifi_scan_time { - wifi_active_scan_time active = 1; /**< active scan time per channel, units: millisecond. */ - uint32 passive = 2; /**< passive scan time per channel, units: millisecond, values above 1500ms may - cause station to disconnect from AP and are not recommended. */ -} - -message wifi_scan_config { - bytes ssid = 1; /**< SSID of AP 33char*/ - bytes bssid = 2; /**< MAC address of AP 6char */ - uint32 channel = 3; /**< channel, scan the specific channel */ - bool show_hidden = 4; /**< enable to scan AP whose SSID is hidden */ - int32 scan_type = 5; /**< scan type, active or passive */ - wifi_scan_time scan_time = 6; /**< scan time per channel */ - uint32 home_chan_dwell_time = 7; /**< time spent at home channel between scanning consecutive channels.*/ -} - -message wifi_he_ap_info { - //uint8_t bss_color:6; /**< an unsigned integer whose value is the BSS Color of the BSS corresponding to the AP */ - //uint8_t partial_bss_color:1; /**< indicate if an AID assignment rule based on the BSS color */ - //uint8_t bss_color_disabled:1; /**< indicate if the use of BSS color is disabled */ - uint32 bitmask = 1; /* Manually have to parse for above bits */ - uint32 bssid_index = 2; /**< in M-BSSID set, identifies the nontransmitted BSSID */ -} - -message wifi_ap_record { - bytes bssid = 1; /**< MAC address of AP 6char */ - bytes ssid = 2; /**< SSID of AP 33char */ - uint32 primary = 3; /**< channel of AP */ - int32 second = 4; /**< secondary channel of AP */ - int32 rssi = 5; /**< signal strength of AP */ - int32 authmode = 6; /**< authmode of AP */ - int32 pairwise_cipher = 7; /**< pairwise cipher of AP */ - int32 group_cipher = 8; /**< group cipher of AP */ - int32 ant = 9; /**< antenna used to receive beacon from AP */ - //uint32_t phy_11b:1; /**< bit: 0 flag to identify if 11b mode is enabled or not */ - //uint32_t phy_11g:1; /**< bit: 1 flag to identify if 11g mode is enabled or not */ - //uint32_t phy_11n:1; /**< bit: 2 flag to identify if 11n mode is enabled or not */ - //uint32_t phy_lr:1; /**< bit: 3 flag to identify if low rate is enabled or not */ - //uint32_t wps:1; /**< bit: 4 flag to identify if WPS is supported or not */ - //uint32_t ftm_responder:1; /**< bit: 5 flag to identify if FTM is supported in responder mode */ - //uint32_t ftm_initiator:1; /**< bit: 6 flag to identify if FTM is supported in initiator mode */ - //uint32_t reserved:25; /**< bit: 7..31 reserved */ - uint32 bitmask = 10; /* Manually have to parse for above bits */ - - wifi_country country = 11; /**< country information of AP */ - wifi_he_ap_info he_ap = 12; - uint32 bandwidth = 13; /**< For AP 20 MHz this value is set to 1. For AP 40 MHz this value is set to 2. - For AP 80 MHz this value is set to 3. For AP 160MHz this value is set to 4. - For AP 80+80MHz this value is set to 5*/ - uint32 vht_ch_freq1 = 14; /**< This fields are used only AP bandwidth is 80 and 160 MHz, to transmit the center channel - frequency of the BSS. For AP bandwidth is 80 + 80 MHz, it is the center channel frequency - of the lower frequency segment.*/ - uint32 vht_ch_freq2 = 15; /**< This fields are used only AP bandwidth is 80 + 80 MHz, and is used to transmit the center - channel frequency of the second segment. */ -} - -message wifi_scan_threshold { - int32 rssi = 1; /**< The minimum rssi to accept in the fast scan mode */ - int32 authmode = 2; /**< The weakest authmode to accept in the fast scan mode -Note: Incase this value is not set and password is set as per WPA2 standards(password len >= 8), -it will be defaulted to WPA2 and device won't connect to deprecated WEP/WPA networks. -Please set authmode threshold as WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK to connect to WEP/WPA networks */ -} - -message wifi_pmf_config { - bool capable = 1; /**< Deprecated variable. Device will always connect in PMF mode if other device also advertizes PMF capability. */ - bool required = 2; /**< Advertizes that Protected Management Frame is required. Device will not associate to non-PMF capable devices. */ -} - -message wifi_ap_config { - bytes ssid = 1; /**< SSID of ESP32 soft-AP. If ssid_len field is 0, this must be a Null terminated string. Otherwise, length is set according to ssid_len. 32 char*/ - bytes password = 2; /**< Password of ESP32 soft-AP. 64 char*/ - uint32 ssid_len = 3; /**< Optional length of SSID field. */ - uint32 channel = 4; /**< Channel of ESP32 soft-AP */ - int32 authmode = 5; /**< Auth mode of ESP32 soft-AP. Do not support AUTH_WEP in soft-AP mode */ - uint32 ssid_hidden = 6; /**< Broadcast SSID or not, default 0, broadcast the SSID */ - uint32 max_connection = 7; /**< Max number of stations allowed to connect in */ - uint32 beacon_interval = 8; /**< Beacon interval which should be multiples of 100. Unit: TU(time unit, 1 TU = 1024 us). Range: 100 ~ 60000. Default value: 100 */ - int32 pairwise_cipher = 9; /**< pairwise cipher of SoftAP, group cipher will be derived using this. - cipher values are valid starting from WIFI_CIPHER_TYPE_TKIP, enum values before that will be considered as invalid and default cipher suites(TKIP+CCMP) will be used. - Valid cipher suites in softAP mode are WIFI_CIPHER_TYPE_TKIP, WIFI_CIPHER_TYPE_CCMP and WIFI_CIPHER_TYPE_TKIP_CCMP. */ - bool ftm_responder = 10; /**< Enable FTM Responder mode */ - wifi_pmf_config pmf_cfg = 11; /**< Configuration for Protected Management Frame */ - int32 sae_pwe_h2e = 12; /**< Configuration for SAE PWE derivation method */ -} - -message wifi_sta_config { - bytes ssid = 1; /**< SSID of target AP. 32char */ - bytes password = 2; /**< Password of target AP. 64char */ - int32 scan_method = 3; /**< do all channel scan or fast scan */ - bool bssid_set = 4; /**< whether set MAC address of target AP or not. Generally, station_config.bssid_set needs to be 0, - and it needs to be 1 only when users need to check the MAC address of the AP.*/ - bytes bssid = 5; /**< MAC address of target AP 6char */ - uint32 channel = 6; /**< channel of target AP. Set to 1~13 to scan starting from the specified channel - before connecting to AP. If the channel of AP is unknown, set it to 0.*/ - uint32 listen_interval = 7; /**< Listen interval for ESP32 station to receive beacon when WIFI_PS_MAX_MODEM is set. -Units: AP beacon intervals. Defaults to 3 if set to 0. */ - int32 sort_method = 8; /**< sort the connect AP in the list by rssi or security mode */ - wifi_scan_threshold threshold = 9; /**< When sort_method is set, only APs which have an auth mode that is more secure - than the selected auth mode and a signal stronger than the minimum RSSI will be used. */ - wifi_pmf_config pmf_cfg = 10; /**< Configuration for Protected Management Frame. Will be advertized in RSN Capabilities in RSN IE. */ - //uint32_t rm_enabled:1; /**< Whether Radio Measurements are enabled for the connection */ - //uint32_t btm_enabled:1; /**< Whether BSS Transition Management is enabled for the connection */ - //uint32_t mbo_enabled:1; /**< Whether MBO is enabled for the connection */ - //uint32_t ft_enabled:1; /**< Whether FT is enabled for the connection */ - //uint32_t owe_enabled:1; /**< Whether OWE is enabled for the connection */ - //uint32_t transition_disable:1; /**< Whether to enable transition disable feature */ - //uint32_t reserved:26; /**< Reserved for future feature set */ - uint32 bitmask = 11; - int32 sae_pwe_h2e = 12; /**< Whether SAE hash to element is enabled */ - uint32 failure_retry_cnt = 13; /**< Number of connection retries station will do before moving to next AP. - scan_method should be set as WIFI_ALL_CHANNEL_SCAN to use this config. - Note: Enabling this may cause connection time to increase incase best AP doesn't behave properly. */ - //uint32_t he_dcm_set:1; /**< Whether DCM max.constellation for transmission and reception is set. */ - //uint32_t he_dcm_max_constellation_tx:2; /**< Indicate the max.constellation for DCM in TB PPDU the STA supported. 0: not supported. 1: BPSK, 2: QPSK, 3: 16-QAM. The default value is 3. */ - //uint32_t he_dcm_max_constellation_rx:2; /**< Indicate the max.constellation for DCM in both Data field and HE-SIG-B field the STA supported. 0: not supported. 1: BPSK, 2: QPSK, 3: 16-QAM. The default value is 3. */ - //uint32_t he_mcs9_enabled:1; /**< Whether to support HE-MCS 0 to 9. The default value is 0. */ - //uint32_t he_su_beamformee_disabled:1; /**< Whether to disable support for operation as an SU beamformee. */ - //uint32_t he_trig_su_bmforming_feedback_disabled:1; /**< Whether to disable support the transmission of SU feedback in an HE TB sounding sequence. */ - //uint32_t he_trig_mu_bmforming_partial_feedback_disabled:1; /**< Whether to disable support the transmission of partial-bandwidth MU feedback in an HE TB sounding sequence. */ - // uint32_t he_trig_cqi_feedback_disabled:1; /**< Whether to disable support the transmission of CQI feedback in an HE TB sounding sequence. */ - // uint32_t he_reserved:22; /**< Reserved for future feature set */ - uint32 he_bitmask = 14; - bytes sae_h2e_identifier = 15; /**< Password identifier for H2E. this needs to be null terminated string. SAE_H2E_IDENTIFIER_LEN chars */ -} - -message wifi_config { - oneof u { - wifi_ap_config ap = 1; /**< configuration of AP */ - wifi_sta_config sta = 2; /**< configuration of STA */ - } -} - -message wifi_sta_info { - bytes mac = 1; /**< mac address 6 char */ - int32 rssi = 2; /**< current average rssi of sta connected */ - //uint32_t phy_11b:1; /**< bit: 0 flag to identify if 11b mode is enabled or not */ - //uint32_t phy_11g:1; /**< bit: 1 flag to identify if 11g mode is enabled or not */ - //uint32_t phy_11n:1; /**< bit: 2 flag to identify if 11n mode is enabled or not */ - //uint32_t phy_lr:1; /**< bit: 3 flag to identify if low rate is enabled or not */ - //uint32_t phy_11x:1; /**< bit: 4 flag to identify identify if 11ax mode is enabled or not */ - //uint32_t is_mesh_child:1; /**< bit: 5 flag to identify mesh child */ - //uint32_t reserved:26; /**< bit: 6..31 reserved */ - uint32 bitmask = 3; -} - -message wifi_sta_list { - repeated wifi_sta_info sta = 1; /**< station list */ - int32 num = 2; /**< number of stations in the list (other entries are invalid) */ -} - -//message vendor_ie_data { -// uint32 element_id = 1; /**< Should be set to WIFI_VENDOR_IE_ELEMENT_ID (0xDD) */ -// uint32 length = 2; /**< Length of all bytes in the element data following this field. Minimum 4. */ -// bytes vendor_oui = 3; /**< Vendor identifier (OUI). 3 chars */ -// uint32 vendor_oui_type = 4; /**< Vendor-specific OUI type. */ -// bytes payload = 5; /**< Payload. Length is equal to value in 'length' field, minus 4. Note: Variable size */ -//} - -message wifi_pkt_rx_ctrl { - int32 rssi = 1; /**< 8bits Received Signal Strength Indicator(RSSI) of packet. unit: dBm */ - uint32 rate = 2; /**< 5bits PHY rate encoding of the packet. Only valid for non HT(11bg) packet */ - //uint32 :1; /**< reserved */ - uint32 sig_mode = 3; /**< 2bits 0: non HT(11bg) packet; 1: HT(11n) packet; 3: VHT(11ac) packet */ - //uint32 :16; /**< reserved */ - uint32 mcs = 4; /**< 7bits Modulation Coding Scheme. If is HT(11n) packet, shows the modulation, range from 0 to 76(MSC0 ~ MCS76) */ - uint32 cwb = 5; /**< 1bit Channel Bandwidth of the packet. 0: 20MHz; 1: 40MHz */ - //uint32 :16; /**< reserved */ - uint32 smoothing = 6; /**< 1bit reserved */ - uint32 not_sounding = 7; /**< 1bit reserved */ - //uint32 :1; /**< reserved */ - uint32 aggregation = 8; /**< 1bit Aggregation. 0: MPDU packet; 1: AMPDU packet */ - uint32 stbc = 9; /**< 2bits Space Time Block Code(STBC). 0: non STBC packet; 1: STBC packet */ - uint32 fec_coding = 10; /**< 1bit Flag is set for 11n packets which are LDPC */ - uint32 sgi = 11; /**< 1bit Short Guide Interval(SGI). 0: Long GI; 1: Short GI */ - int32 noise_floor = 12; /**< 8bits noise floor of Radio Frequency Module(RF). unit: dBm*/ - uint32 ampdu_cnt = 13; /**< 8bits ampdu cnt */ - uint32 channel = 14; /**< 4bits primary channel on which this packet is received */ - uint32 secondary_channel = 15; /**< 4bits secondary channel on which this packet is received. 0: none; 1: above; 2: below */ - //uint32 :8; /**< reserved */ - uint32 timestamp = 16; /**< 32bit timestamp. The local time when this packet is received. It is precise only if modem sleep or light sleep is not enabled. unit: microsecond */ - //uint32 :32; /**< reserved */ - //unsigned :32; /**< reserved */ - //unsigned :31; /**< reserved */ - uint32 ant = 17; /**< 1bit antenna number from which this packet is received. 0: WiFi antenna 0; 1: WiFi antenna 1 */ - uint32 sig_len = 18; /**< 12bits length of packet including Frame Check Sequence(FCS) */ - //unsigned :12; /**< reserved */ - uint32 rx_state = 19; /**< 8bits state of the packet. 0: no error; others: error numbers which are not public */ -} - -message wifi_promiscuous_pkt { - wifi_pkt_rx_ctrl rx_ctrl = 1; /**< metadata header */ - bytes payload = 2; /**< Note: variable length. Data or management payload. Length of payload is described by rx_ctrl.sig_len. Type of content determined by packet type argument of callback. */ -} - -message wifi_promiscuous_filter { - uint32 filter_mask = 1; /**< OR of one or more filter values WIFI_PROMIS_FILTER_* */ -} - -message wifi_csi_config { - bool lltf_en = 1; /**< enable to receive legacy long training field(lltf) data. Default enabled */ - bool htltf_en = 2; /**< enable to receive HT long training field(htltf) data. Default enabled */ - bool stbc_htltf2_en = 3; /**< enable to receive space time block code HT long training field(stbc-htltf2) data. Default enabled */ - bool ltf_merge_en = 4; /**< enable to generate htlft data by averaging lltf and ht_ltf data when receiving HT packet. Otherwise, use ht_ltf data directly. Default enabled */ - bool channel_filter_en = 5; /**< enable to turn on channel filter to smooth adjacent sub-carrier. Disable it to keep independence of adjacent sub-carrier. Default enabled */ - bool manu_scale = 6; /**< manually scale the CSI data by left shifting or automatically scale the CSI data. - If set true, please set the shift bits. false: automatically. true: manually. Default false */ - uint32 shift = 7; /**< manually left shift bits of the scale of the CSI data. The range of the left shift bits is 0~15 */ -} - -message wifi_csi_info { - wifi_pkt_rx_ctrl rx_ctrl = 1; /**< received packet radio metadata header of the CSI data */ - bytes mac = 2; /**< 6bits source MAC address of the CSI data */ - bytes dmac = 3; /**< 6bits destination MAC address of the CSI data */ - bool first_word_invalid = 4; /**< first four bytes of the CSI data is invalid or not */ - bytes buf = 5; /**< Note: variable length. buffer of CSI data */ - uint32 len = 6; /**< length of CSI data */ -} - -message wifi_ant_gpio { - uint32 gpio_select = 1; /**< 1bit Whether this GPIO is connected to external antenna switch */ - uint32 gpio_num = 2; /**< 7bits The GPIO number that connects to external antenna switch */ -} - -message wifi_ant_gpio_config { - repeated wifi_ant_gpio gpio_cfgs = 1; /**< The configurations of GPIOs that connect to external antenna switch */ -} - -message wifi_ant_config { - int32 rx_ant_mode = 1; /**< WiFi antenna mode for receiving */ - int32 rx_ant_default = 2; /**< Default antenna mode for receiving, it's ignored if rx_ant_mode is not WIFI_ANT_MODE_AUTO */ - int32 tx_ant_mode = 3; /**< WiFi antenna mode for transmission, it can be set to WIFI_ANT_MODE_AUTO only if rx_ant_mode is set to WIFI_ANT_MODE_AUTO */ - uint32 enabled_ant0 = 4; /**< 4bits Index (in antenna GPIO configuration) of enabled WIFI_ANT_MODE_ANT0 */ - uint32 enabled_ant1 = 5; /**< 4bits Index (in antenna GPIO configuration) of enabled WIFI_ANT_MODE_ANT1 */ -} - -message wifi_action_tx_req { - int32 ifx = 1; /**< WiFi interface to send request to */ - bytes dest_mac = 2; /**< 6bits Destination MAC address */ - bool no_ack = 3; /**< Indicates no ack required */ - //TODO - //wifi_action_rx_cb_t rx_cb; /**< Rx Callback to receive any response */ - uint32 data_len = 4; /**< Length of the appended Data */ - bytes data = 5; /**< note: variable length. Appended Data payload */ -} - -message wifi_ftm_initiator_cfg { - bytes resp_mac = 1; /**< 6bits MAC address of the FTM Responder */ - uint32 channel = 2; /**< Primary channel of the FTM Responder */ - uint32 frm_count = 3; /**< No. of FTM frames requested in terms of 4 or 8 bursts (allowed values - 0(No pref), 16, 24, 32, 64) */ - uint32 burst_period = 4; /**< Requested time period between consecutive FTM bursts in 100's of milliseconds (0 - No pref) */ -} - -message wifi_event_sta_scan_done { - uint32 status = 1; /**< status of scanning APs: 0 — success, 1 - failure */ - uint32 number = 2; /**< number of scan results */ - uint32 scan_id = 3; /**< scan sequence number, used for block scan */ -} - -message wifi_event_sta_connected { - bytes ssid = 1; /**< 32bytes SSID of connected AP */ - uint32 ssid_len = 2; /**< SSID length of connected AP */ - bytes bssid = 3; /**< 6bytes BSSID of connected AP*/ - uint32 channel = 4; /**< channel of connected AP*/ - int32 authmode = 5; /**< authentication mode used by AP*/ - int32 aid = 6; /**< authentication id assigned by the connected AP*/ -} - -message wifi_event_sta_disconnected { - bytes ssid = 1; /**< SSID of disconnected AP */ - uint32 ssid_len = 2; /**< SSID length of disconnected AP */ - bytes bssid = 3; /**< BSSID of disconnected AP */ - uint32 reason = 4; /**< reason of disconnection */ - int32 rssi = 5; /**< rssi of disconnection */ -} - -message wifi_event_sta_authmode_change { - int32 old_mode = 1; /**< the old auth mode of AP */ - int32 new_mode = 2; /**< the new auth mode of AP */ -} - -message wifi_event_sta_wps_er_pin { - bytes pin_code = 1; /**< 8bytes PIN code of station in enrollee mode */ -} - -message ap_cred { - bytes ssid = 1; /**< 32bytes SSID of AP */ - bytes passphrase = 2; /**< 64bytes Passphrase for the AP */ -} - -message wifi_event_sta_wps_er_success { - uint32 ap_cred_cnt = 1; /**< Number of AP credentials received */ - repeated ap_cred ap_creds = 2; /**< All AP credentials received from WPS handshake */ -} - -/** Argument structure for WIFI_EVENT_AP_PROBEREQRECVED event */ -message wifi_event_ap_probe_req_rx { - int32 rssi = 1; /**< Received probe request signal strength */ - uint32 mac = 2; /**< MAC address of the station which send probe request */ -} - -/** Argument structure for WIFI_EVENT_STA_BSS_RSSI_LOW event */ -message wifi_event_bss_rssi_low { - int32 rssi = 1; /**< RSSI value of bss */ -} - -message wifi_ftm_report_entry { - uint32 dlog_token = 1; /* *< Dialog Token of the FTM frame */ - int32 rssi = 2; /* *< RSSI of the FTM frame received */ - uint32 rtt = 3; /* *< Round Trip Time in pSec with a peer */ - /* TODO: uint32 is supported by proto? */ - uint64 t1 = 4; /* *< Time of departure of FTM frame from FTM Responder in pSec */ - uint64 t2 = 5; /* *< Time of arrival of FTM frame at FTM Initiator in pSec */ - uint64 t3 = 6; /* *< Time of departure of ACK from FTM Initiator in pSec */ - uint64 t4 = 7; /* *< Time of arrival of ACK at FTM Responder in pSec */ -} - -message wifi_event_ftm_report { - bytes peer_mac = 1; /* *< 6bytes MAC address of the FTM Peer */ - int32 status = 2; /* *< Status of the FTM operation */ - uint32 rtt_raw = 3; /* *< Raw average Round-Trip-Time with peer in Nano-Seconds */ - uint32 rtt_est = 4; /* *< Estimated Round-Trip-Time with peer in Nano-Seconds */ - uint32 dist_est = 5; /* *< Estimated one-way distance in Centi-Meters */ - repeated wifi_ftm_report_entry ftm_report_data = 6; /* *< Note var len Pointer to FTM Report with multiple entries, should be freed after use */ - uint32 ftm_report_num_entries = 7; /* *< Number of entries in the FTM Report data */ -} - -message wifi_event_action_tx_status { - int32 ifx = 1; /**< WiFi interface to send request to */ - uint32 context = 2; /**< Context to identify the request */ - bytes da = 3; /**< 6bytes Destination MAC address */ - uint32 status = 4; /**< Status of the operation */ -} - -message wifi_event_roc_done { - uint32 context = 1; /**< Context to identify the request */ -} - -message wifi_event_ap_wps_rg_pin { - bytes pin_code = 1; /**< 8bytes PIN code of station in enrollee mode */ -} - -message wifi_event_ap_wps_rg_fail_reason { - int32 reason = 1; /**< WPS failure reason wps_fail_reason_t */ - bytes peer_macaddr = 2; /**< 6bytes Enrollee mac address */ -} - -message wifi_event_ap_wps_rg_success { - bytes peer_macaddr = 1; /**< 6bytes Enrollee mac address */ -} - -message wifi_protocols { - uint32 ghz_2g = 1; /**< Represents 2.4 GHz protocol, support 802.11b or 802.11g or 802.11n or 802.11ax or LR mode */ - uint32 ghz_5g = 2; /**< Represents 5 GHz protocol, support 802.11a or 802.11n or 802.11ac or 802.11ax */ -} - -message wifi_bandwidths { - uint32 ghz_2g = 1; /* Represents 2.4 GHz bandwidth */ - uint32 ghz_5g = 2; /* Represents 5 GHz bandwidth */ -} - -/* internal supporting structures for Rpc */ -//message ScanResult { -// bytes bssid = 1; -// bytes ssid = 2; -// uint32 chnl = 3; -// int32 rssi = 4; -// int32 sec_prot = 5; -//} - -message ConnectedSTAList { - bytes mac = 1; - int32 rssi = 2; -} - - -/* Control path structures */ -/** Req/Resp structure **/ -message Rpc_Req_GetMacAddress { - int32 mode = 1; -} - -message Rpc_Resp_GetMacAddress { - bytes mac = 1; - int32 resp = 2; -} - -message Rpc_Req_GetMode { -} - -message Rpc_Resp_GetMode { - int32 mode = 1; - int32 resp = 2; -} - -message Rpc_Req_SetMode { - int32 mode = 1; -} - -message Rpc_Resp_SetMode { - int32 resp = 1; -} - -message Rpc_Req_GetPs { -} - -message Rpc_Resp_GetPs { - int32 resp = 1; - int32 type = 2; -} - -message Rpc_Req_SetPs { - int32 type = 1; -} - -message Rpc_Resp_SetPs { - int32 resp = 1; -} - -message Rpc_Req_SetMacAddress { - bytes mac = 1; - int32 mode = 2; -} - -message Rpc_Resp_SetMacAddress { - int32 resp = 1; -} - - -//message Rpc_Req_GetAPConfig { -//} -// -///* To be deprecated */ -//message Rpc_Resp_GetAPConfig { -// bytes ssid = 1; -// bytes bssid = 2; -// int32 rssi = 3; -// int32 chnl = 4; -// int32 sec_prot = 5; -// int32 resp = 6; -//} - -/* To be deprecated */ -//message Rpc_Req_ConnectAP { -// string ssid = 1; -// string pwd = 2; -// string bssid = 3; -// bool is_wpa3_supported = 4; -// int32 listen_interval = 5; -//} -// -//message Rpc_Resp_ConnectAP { -// int32 resp = 1; -// bytes mac = 2; -//} - -//message Rpc_Req_GetSoftAPConfig { -//} -// -//message Rpc_Resp_GetSoftAPConfig { -// bytes ssid = 1; -// bytes pwd = 2; -// int32 chnl = 3; -// int32 sec_prot = 4; -// int32 max_conn = 5; -// bool ssid_hidden = 6; -// int32 bw = 7; -// int32 resp = 8; -//} - -//message Rpc_Req_StartSoftAP { -// string ssid = 1; -// string pwd = 2; -// int32 chnl = 3; -// int32 sec_prot = 4; -// int32 max_conn = 5; -// bool ssid_hidden = 6; -// int32 bw = 7; -//} -// -//message Rpc_Resp_StartSoftAP { -// int32 resp = 1; -// bytes mac = 2; -//} - -//message Rpc_Req_ScanResult { -//} -// -//message Rpc_Resp_ScanResult { -// uint32 count = 1; -// repeated ScanResult entries = 2; -// int32 resp = 3; -//} - -//message Rpc_Req_SoftAPConnectedSTA { -//} -// -//message Rpc_Resp_SoftAPConnectedSTA { -// uint32 num = 1; -// repeated ConnectedSTAList stations = 2; -// int32 resp = 3; -//} - -message Rpc_Req_OTABegin { -} - -message Rpc_Resp_OTABegin { - int32 resp = 1; -} - -message Rpc_Req_OTAWrite { - bytes ota_data = 1; -} - -message Rpc_Resp_OTAWrite { - int32 resp = 1; -} - -message Rpc_Req_OTAEnd { -} - -message Rpc_Resp_OTAEnd { - int32 resp = 1; -} - -//message Rpc_Req_VendorIEData { -// int32 element_id = 1; -// int32 length = 2; -// bytes vendor_oui = 3; -// int32 vendor_oui_type = 4; -// bytes payload = 5; -//} -// -//message Rpc_Req_SetSoftAPVendorSpecificIE { -// bool enable = 1; -// int32 type = 2; -// int32 idx = 3; -// Rpc_Req_VendorIEData vendor_ie_data = 4; -//} -// -//message Rpc_Resp_SetSoftAPVendorSpecificIE { -// int32 resp = 1; -//} - -message Rpc_Req_WifiSetMaxTxPower { - int32 power = 1; -} - -message Rpc_Resp_WifiSetMaxTxPower { - int32 resp = 1; -} - -message Rpc_Req_WifiGetMaxTxPower { -} - -message Rpc_Resp_WifiGetMaxTxPower { - int32 power = 1; - int32 resp = 2; -} - -message Rpc_Req_ConfigHeartbeat { - bool enable = 1; - int32 duration = 2; -} - -message Rpc_Resp_ConfigHeartbeat { - int32 resp = 1; -} - -message Rpc_Req_WifiInit { - wifi_init_config cfg = 1; -} - -message Rpc_Resp_WifiInit { - int32 resp = 1; -} - -message Rpc_Req_WifiDeinit { -} - -message Rpc_Resp_WifiDeinit { - int32 resp = 1; -} - -message Rpc_Req_WifiSetConfig { - int32 iface = 1; - wifi_config cfg = 2; -} - -message Rpc_Resp_WifiSetConfig { - int32 resp = 1; -} - -message Rpc_Req_WifiGetConfig { - int32 iface = 1; -} - -message Rpc_Resp_WifiGetConfig { - int32 resp = 1; - int32 iface = 2; - wifi_config cfg = 3; -} - -message Rpc_Req_WifiConnect { -} - -message Rpc_Resp_WifiConnect { - int32 resp = 1; -} - -message Rpc_Req_WifiDisconnect { -} - -message Rpc_Resp_WifiDisconnect { - int32 resp = 1; -} - -message Rpc_Req_WifiStart { -} - -message Rpc_Resp_WifiStart { - int32 resp = 1; -} - -message Rpc_Req_WifiStop { -} - -message Rpc_Resp_WifiStop { - int32 resp = 1; -} - -message Rpc_Req_WifiScanStart { - wifi_scan_config config = 1; - bool block = 2; - int32 config_set = 3; -} - -message Rpc_Resp_WifiScanStart { - int32 resp = 1; -} - -message Rpc_Req_WifiScanStop { -} - -message Rpc_Resp_WifiScanStop { - int32 resp = 1; -} - -message Rpc_Req_WifiScanGetApNum { -} - -message Rpc_Resp_WifiScanGetApNum { - int32 resp = 1; - int32 number = 2; -} - -message Rpc_Req_WifiScanGetApRecords { - int32 number = 1; -} - -message Rpc_Resp_WifiScanGetApRecords { - int32 resp = 1; - int32 number = 2; - repeated wifi_ap_record ap_records = 3; -} - -message Rpc_Req_WifiScanGetApRecord { -} - -message Rpc_Resp_WifiScanGetApRecord { - int32 resp = 1; - wifi_ap_record ap_record = 2; -} - -message Rpc_Req_WifiClearApList { -} - -message Rpc_Resp_WifiClearApList { - int32 resp = 1; -} - -message Rpc_Req_WifiRestore { -} - -message Rpc_Resp_WifiRestore { - int32 resp = 1; -} - -message Rpc_Req_WifiClearFastConnect{ -} - -message Rpc_Resp_WifiClearFastConnect { - int32 resp = 1; -} - -message Rpc_Req_WifiDeauthSta { - int32 aid = 1; -} - -message Rpc_Resp_WifiDeauthSta { - int32 resp = 1; - int32 aid = 2; -} - -message Rpc_Req_WifiStaGetApInfo { -} - -message Rpc_Resp_WifiStaGetApInfo { - int32 resp = 1; - wifi_ap_record ap_record = 2; -} - -message Rpc_Req_WifiSetProtocol { - int32 ifx = 1; - int32 protocol_bitmap = 2; -} - -message Rpc_Resp_WifiSetProtocol { - int32 resp = 1; -} - -message Rpc_Req_WifiGetProtocol { - int32 ifx = 1; -} - -message Rpc_Resp_WifiGetProtocol { - int32 resp = 1; - int32 protocol_bitmap = 2; -} - -message Rpc_Req_WifiSetBandwidth { - int32 ifx = 1; - int32 bw = 2; -} - -message Rpc_Resp_WifiSetBandwidth { - int32 resp = 1; -} - -message Rpc_Req_WifiGetBandwidth { - int32 ifx = 1; -} - -message Rpc_Resp_WifiGetBandwidth { - int32 resp = 1; - int32 bw = 2; -} - -message Rpc_Req_WifiSetChannel { - int32 primary = 1; - int32 second = 2; -} - -message Rpc_Resp_WifiSetChannel { - int32 resp = 1; -} - -message Rpc_Req_WifiGetChannel { -} - -message Rpc_Resp_WifiGetChannel { - int32 resp = 1; - int32 primary = 2; - int32 second = 3; -} - -message Rpc_Req_WifiSetStorage { - int32 storage = 1; -} - -message Rpc_Resp_WifiSetStorage { - int32 resp = 1; -} - -message Rpc_Req_WifiSetCountryCode { - bytes country = 1; - bool ieee80211d_enabled = 2; -} - -message Rpc_Resp_WifiSetCountryCode { - int32 resp = 1; -} - -message Rpc_Req_WifiGetCountryCode { -} - -message Rpc_Resp_WifiGetCountryCode { - int32 resp = 1; - bytes country = 2; -} - -message Rpc_Req_WifiSetCountry { - wifi_country country = 1; -} - -message Rpc_Resp_WifiSetCountry { - int32 resp = 1; -} - -message Rpc_Req_WifiGetCountry { -} - -message Rpc_Resp_WifiGetCountry { - int32 resp = 1; - wifi_country country = 2; -} - -message Rpc_Req_WifiApGetStaList { -} - -message Rpc_Resp_WifiApGetStaList { - int32 resp = 1; - wifi_sta_list sta_list = 2; -} - -message Rpc_Req_WifiApGetStaAid { - bytes mac = 1; -} - -message Rpc_Req_WifiStaGetNegotiatedPhymode { -} - -message Rpc_Resp_WifiStaGetNegotiatedPhymode { - int32 resp = 1; - uint32 phymode = 2; -} - -message Rpc_Resp_WifiApGetStaAid { - int32 resp = 1; - uint32 aid = 2; -} - -message Rpc_Req_WifiStaGetRssi { -} - -message Rpc_Resp_WifiStaGetRssi { - int32 resp = 1; - int32 rssi = 2; -} - -message Rpc_Req_WifiStaGetAid { -} - -message Rpc_Resp_WifiStaGetAid { - int32 resp = 1; - uint32 aid = 2; -} - -message Rpc_Req_WifiSetProtocols { - int32 ifx = 1; - wifi_protocols protocols = 2; -} - -message Rpc_Resp_WifiSetProtocols { - int32 resp = 1; - uint32 ifx = 2; -} - -message Rpc_Req_WifiGetProtocols { - int32 ifx = 1; -} - -message Rpc_Resp_WifiGetProtocols { - int32 resp = 1; - int32 ifx = 2; - wifi_protocols protocols = 3; -} - -message Rpc_Req_WifiSetBandwidths { - int32 ifx = 1; - wifi_bandwidths bandwidths = 2; -} - -message Rpc_Resp_WifiSetBandwidths { - int32 resp = 1; - int32 ifx = 2; -} - -message Rpc_Req_WifiGetBandwidths { - int32 ifx = 1; -} - -message Rpc_Resp_WifiGetBandwidths { - int32 resp = 1; - int32 ifx = 2; - wifi_bandwidths bandwidths = 3; -} - -message Rpc_Req_WifiSetBand { - uint32 band = 1; -} - -message Rpc_Resp_WifiSetBand { - int32 resp = 1; -} - -message Rpc_Req_WifiGetBand { -} - -message Rpc_Resp_WifiGetBand { - int32 resp = 1; - uint32 band = 2; -} - -message Rpc_Req_WifiSetBandMode { - uint32 bandmode = 1; -} - -message Rpc_Resp_WifiSetBandMode { - int32 resp = 1; -} - -message Rpc_Req_WifiGetBandMode { -} - -message Rpc_Resp_WifiGetBandMode { - int32 resp = 1; - uint32 bandmode = 2; -} - -message Rpc_Req_GetCoprocessorFwVersion { -} - -message Rpc_Resp_GetCoprocessorFwVersion { - int32 resp = 1; - uint32 major1 = 2; - uint32 minor1 = 3; - uint32 patch1 = 4; -} - -/** Event structure **/ - -message Rpc_Event_WifiEventNoArgs { - int32 resp = 1; - int32 event_id = 2; -} - -message Rpc_Event_ESPInit { - bytes init_data = 1; -} - -message Rpc_Event_Heartbeat { - int32 hb_num = 1; -} - -message Rpc_Event_AP_StaDisconnected { - int32 resp = 1; - bytes mac = 2; - uint32 aid = 3; - bool is_mesh_child = 4; - uint32 reason = 5; -} - -message Rpc_Event_AP_StaConnected { - int32 resp = 1; - bytes mac = 2; - uint32 aid = 3; - bool is_mesh_child = 4; -} - -message Rpc_Event_StaScanDone { - int32 resp = 1; - wifi_event_sta_scan_done scan_done = 2; -} - -message Rpc_Event_StaConnected { - int32 resp = 1; - wifi_event_sta_connected sta_connected = 2; -} - -message Rpc_Event_StaDisconnected { - int32 resp = 1; - wifi_event_sta_disconnected sta_disconnected = 2; -} - -message Rpc { - /* msg_type could be req, resp or Event */ - RpcType msg_type = 1; - - /* msg id */ - RpcId msg_id = 2; - - /* UID of message */ - uint32 uid = 3; - - /* union of all msg ids */ - oneof payload { - /** Requests **/ - Rpc_Req_GetMacAddress req_get_mac_address = 257; - Rpc_Req_SetMacAddress req_set_mac_address = 258; - Rpc_Req_GetMode req_get_wifi_mode = 259; - Rpc_Req_SetMode req_set_wifi_mode = 260; - - //Rpc_Req_ScanResult req_scan_ap_list = 261; - //Rpc_Req_GetAPConfig req_get_ap_config = 262; - //Rpc_Req_ConnectAP req_connect_ap = 263; - //Rpc_Req_GetStatus req_disconnect_ap = 264; - - //Rpc_Req_GetSoftAPConfig req_get_softap_config = 265; - //Rpc_Req_SetSoftAPVendorSpecificIE req_set_softap_vendor_specific_ie = 266; - //Rpc_Req_StartSoftAP req_start_softap = 267; - //Rpc_Req_SoftAPConnectedSTA req_softap_connected_stas_list = 268; - //Rpc_Req_GetStatus req_stop_softap = 269; - - Rpc_Req_SetPs req_wifi_set_ps = 270; - Rpc_Req_GetPs req_wifi_get_ps = 271; - - Rpc_Req_OTABegin req_ota_begin = 272; - Rpc_Req_OTAWrite req_ota_write = 273; - Rpc_Req_OTAEnd req_ota_end = 274; - - Rpc_Req_WifiSetMaxTxPower req_set_wifi_max_tx_power = 275; - Rpc_Req_WifiGetMaxTxPower req_get_wifi_max_tx_power = 276; - Rpc_Req_ConfigHeartbeat req_config_heartbeat = 277; - - Rpc_Req_WifiInit req_wifi_init = 278; - Rpc_Req_WifiDeinit req_wifi_deinit = 279; - Rpc_Req_WifiStart req_wifi_start = 280; - Rpc_Req_WifiStop req_wifi_stop = 281; - Rpc_Req_WifiConnect req_wifi_connect = 282; - Rpc_Req_WifiDisconnect req_wifi_disconnect = 283; - Rpc_Req_WifiSetConfig req_wifi_set_config = 284; - Rpc_Req_WifiGetConfig req_wifi_get_config = 285; - - Rpc_Req_WifiScanStart req_wifi_scan_start = 286; - Rpc_Req_WifiScanStop req_wifi_scan_stop = 287; - Rpc_Req_WifiScanGetApNum req_wifi_scan_get_ap_num = 288; - Rpc_Req_WifiScanGetApRecords req_wifi_scan_get_ap_records = 289; - Rpc_Req_WifiClearApList req_wifi_clear_ap_list = 290; - - Rpc_Req_WifiRestore req_wifi_restore = 291; - Rpc_Req_WifiClearFastConnect req_wifi_clear_fast_connect = 292; - Rpc_Req_WifiDeauthSta req_wifi_deauth_sta = 293; - Rpc_Req_WifiStaGetApInfo req_wifi_sta_get_ap_info = 294; - - Rpc_Req_WifiSetProtocol req_wifi_set_protocol = 297; - Rpc_Req_WifiGetProtocol req_wifi_get_protocol = 298; - Rpc_Req_WifiSetBandwidth req_wifi_set_bandwidth = 299; - Rpc_Req_WifiGetBandwidth req_wifi_get_bandwidth = 300; - Rpc_Req_WifiSetChannel req_wifi_set_channel = 301; - Rpc_Req_WifiGetChannel req_wifi_get_channel = 302; - Rpc_Req_WifiSetCountry req_wifi_set_country = 303; - Rpc_Req_WifiGetCountry req_wifi_get_country = 304; - - Rpc_Req_WifiApGetStaList req_wifi_ap_get_sta_list = 311; - Rpc_Req_WifiApGetStaAid req_wifi_ap_get_sta_aid = 312; - Rpc_Req_WifiSetStorage req_wifi_set_storage = 313; - - Rpc_Req_WifiSetCountryCode req_wifi_set_country_code = 334; - Rpc_Req_WifiGetCountryCode req_wifi_get_country_code = 335; - Rpc_Req_WifiStaGetAid req_wifi_sta_get_aid = 338; - Rpc_Req_WifiStaGetNegotiatedPhymode req_wifi_sta_get_negotiated_phymode = 339; - - Rpc_Req_WifiStaGetRssi req_wifi_sta_get_rssi = 341; - - Rpc_Req_WifiSetProtocols req_wifi_set_protocols = 342; - Rpc_Req_WifiGetProtocols req_wifi_get_protocols = 343; - Rpc_Req_WifiSetBandwidths req_wifi_set_bandwidths = 344; - Rpc_Req_WifiGetBandwidths req_wifi_get_bandwidths = 345; - - Rpc_Req_WifiSetBand req_wifi_set_band = 346; - Rpc_Req_WifiGetBand req_wifi_get_band = 347; - Rpc_Req_WifiSetBandMode req_wifi_set_bandmode = 348; - Rpc_Req_WifiGetBandMode req_wifi_get_bandmode = 349; - - Rpc_Req_GetCoprocessorFwVersion req_get_coprocessor_fwversion = 350; - - Rpc_Req_WifiScanGetApRecord req_wifi_scan_get_ap_record = 351; - - /** Responses **/ - Rpc_Resp_GetMacAddress resp_get_mac_address = 513; - Rpc_Resp_SetMacAddress resp_set_mac_address = 514; - Rpc_Resp_GetMode resp_get_wifi_mode = 515; - Rpc_Resp_SetMode resp_set_wifi_mode = 516; - - //Rpc_Resp_ScanResult resp_scan_ap_list = 517; - //Rpc_Resp_GetAPConfig resp_get_ap_config = 518; - //Rpc_Resp_ConnectAP resp_connect_ap = 519; - //Rpc_Resp_GetStatus resp_disconnect_ap = 520; - - //Rpc_Resp_GetSoftAPConfig resp_get_softap_config = 521; - //Rpc_Resp_SetSoftAPVendorSpecificIE resp_set_softap_vendor_specific_ie = 522; - //Rpc_Resp_StartSoftAP resp_start_softap = 523; - //Rpc_Resp_SoftAPConnectedSTA resp_softap_connected_stas_list = 524; - //Rpc_Resp_GetStatus resp_stop_softap = 525; - - Rpc_Resp_SetPs resp_wifi_set_ps = 526; - Rpc_Resp_GetPs resp_wifi_get_ps = 527; - - Rpc_Resp_OTABegin resp_ota_begin = 528; - Rpc_Resp_OTAWrite resp_ota_write = 529; - Rpc_Resp_OTAEnd resp_ota_end = 530; - Rpc_Resp_WifiSetMaxTxPower resp_set_wifi_max_tx_power = 531; - Rpc_Resp_WifiGetMaxTxPower resp_get_wifi_max_tx_power = 532; - Rpc_Resp_ConfigHeartbeat resp_config_heartbeat = 533; - - Rpc_Resp_WifiInit resp_wifi_init = 534; - Rpc_Resp_WifiDeinit resp_wifi_deinit = 535; - Rpc_Resp_WifiStart resp_wifi_start = 536; - Rpc_Resp_WifiStop resp_wifi_stop = 537; - Rpc_Resp_WifiConnect resp_wifi_connect = 538; - Rpc_Resp_WifiDisconnect resp_wifi_disconnect = 539; - Rpc_Resp_WifiSetConfig resp_wifi_set_config = 540; - Rpc_Resp_WifiGetConfig resp_wifi_get_config = 541; - - Rpc_Resp_WifiScanStart resp_wifi_scan_start = 542; - Rpc_Resp_WifiScanStop resp_wifi_scan_stop = 543; - Rpc_Resp_WifiScanGetApNum resp_wifi_scan_get_ap_num = 544; - Rpc_Resp_WifiScanGetApRecords resp_wifi_scan_get_ap_records = 545; - Rpc_Resp_WifiClearApList resp_wifi_clear_ap_list = 546; - - Rpc_Resp_WifiRestore resp_wifi_restore = 547; - Rpc_Resp_WifiClearFastConnect resp_wifi_clear_fast_connect = 548; - Rpc_Resp_WifiDeauthSta resp_wifi_deauth_sta = 549; - Rpc_Resp_WifiStaGetApInfo resp_wifi_sta_get_ap_info = 550; - - Rpc_Resp_WifiSetProtocol resp_wifi_set_protocol = 553; - Rpc_Resp_WifiGetProtocol resp_wifi_get_protocol = 554; - Rpc_Resp_WifiSetBandwidth resp_wifi_set_bandwidth = 555; - Rpc_Resp_WifiGetBandwidth resp_wifi_get_bandwidth = 556; - Rpc_Resp_WifiSetChannel resp_wifi_set_channel = 557; - Rpc_Resp_WifiGetChannel resp_wifi_get_channel = 558; - Rpc_Resp_WifiSetCountry resp_wifi_set_country = 559; - Rpc_Resp_WifiGetCountry resp_wifi_get_country = 560; - - Rpc_Resp_WifiApGetStaList resp_wifi_ap_get_sta_list = 567; - Rpc_Resp_WifiApGetStaAid resp_wifi_ap_get_sta_aid = 568; - Rpc_Resp_WifiSetStorage resp_wifi_set_storage = 569; - - Rpc_Resp_WifiSetCountryCode resp_wifi_set_country_code = 590; - Rpc_Resp_WifiGetCountryCode resp_wifi_get_country_code = 591; - Rpc_Resp_WifiStaGetAid resp_wifi_sta_get_aid = 594; - Rpc_Resp_WifiStaGetNegotiatedPhymode resp_wifi_sta_get_negotiated_phymode = 595; - - Rpc_Resp_WifiStaGetRssi resp_wifi_sta_get_rssi = 597; - - Rpc_Resp_WifiSetProtocols resp_wifi_set_protocols = 598; - Rpc_Resp_WifiGetProtocols resp_wifi_get_protocols = 599; - Rpc_Resp_WifiSetBandwidths resp_wifi_set_bandwidths = 600; - Rpc_Resp_WifiGetBandwidths resp_wifi_get_bandwidths = 601; - - Rpc_Resp_WifiSetBand resp_wifi_set_band = 602; - Rpc_Resp_WifiGetBand resp_wifi_get_band = 603; - Rpc_Resp_WifiSetBandMode resp_wifi_set_bandmode = 604; - Rpc_Resp_WifiGetBandMode resp_wifi_get_bandmode = 605; - - Rpc_Resp_GetCoprocessorFwVersion resp_get_coprocessor_fwversion = 606; - - Rpc_Resp_WifiScanGetApRecord resp_wifi_scan_get_ap_record = 607; - - /** Notifications **/ - Rpc_Event_ESPInit event_esp_init = 769; - Rpc_Event_Heartbeat event_heartbeat = 770; - Rpc_Event_AP_StaConnected event_ap_sta_connected = 771; - Rpc_Event_AP_StaDisconnected event_ap_sta_disconnected = 772; - Rpc_Event_WifiEventNoArgs event_wifi_event_no_args = 773; - Rpc_Event_StaScanDone event_sta_scan_done = 774; - Rpc_Event_StaConnected event_sta_connected = 775; - Rpc_Event_StaDisconnected event_sta_disconnected = 776; - } -} - - -//message req_w_set_config { -// int32 iface = 1; -// wifi_config cfg = 2; -//} -// -//message rsp_w_set_config { -// int32 resp = 1; -//} -// -//message req_w_get_config { -// int32 iface = 1; -//} -// -//message rsp_w_get_config { -// int32 resp = 1; -// wifi_config cfg = 2; -//} -// -//message req_w_start { -//} -// -//message rsp_w_start { -// int32 resp = 1; -//} -// -//message evt_w_sta_connected { -// int32 resp = 1; -//} -// -//message evt_w_sta_disconnected { -// int32 resp = 1; -//} -// -//message evt_w_sta_start { -// int32 resp = 1; -//} -// -//message evt_w_sta_stop { -// int32 resp = 1; -//} -// -//message evt_w_ready { -// int32 resp = 1; -//} - -//message { -// int32 resp = 1; -//} - - - - - - - -//message Rpc_Resp_GetMode { -// int32 mode = 1; -// int32 resp = 2; -//} -// -//message Rpc_Req_SetMode { -//} -// -//message Rpc_Resp_SetMode { -// int32 resp = 1; -//} +/* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD */ +/* SPDX-License-Identifier: Apache-2.0 */ + +syntax = "proto3"; + +enum Rpc_WifiBw { + BW_Invalid = 0; + HT20 = 1; + HT40 = 2; +} + +enum Rpc_WifiPowerSave { + PS_Invalid = 0; + MIN_MODEM = 1; + MAX_MODEM = 2; +} + +enum Rpc_WifiSecProt { + Open = 0; + WEP = 1; + WPA_PSK = 2; + WPA2_PSK = 3; + WPA_WPA2_PSK = 4; + WPA2_ENTERPRISE = 5; + WPA3_PSK = 6; + WPA2_WPA3_PSK = 7; +} + +/* enums for Control path */ +enum Rpc_Status { + Connected = 0; + Not_Connected = 1; + No_AP_Found = 2; + Connection_Fail = 3; + Invalid_Argument = 4; + Out_Of_Range = 5; +} + + +enum RpcType { +MsgType_Invalid = 0; + Req = 1; + Resp = 2; + Event = 3; + MsgType_Max = 4; +} + +enum RpcFeature { + Feature_None = 0; + // Bluetooth (BT) Feature + Feature_Bluetooth = 1; + // add additional features here +} + +enum RpcFeatureCommand { + Feature_Command_None = 0; + // Bluetooth (BT) Feature Commands + Feature_Command_BT_Init = 1; + Feature_Command_BT_Deinit = 2; + Feature_Command_BT_Enable = 3; + Feature_Command_BT_Disable = 4; + // add additional feature commands here +} + +enum RpcFeatureOption { + Feature_Option_None = 0; + // Bluetooth (BT) Feature Options + Feature_Option_BT_Deinit_Release_Memory = 1; // release memory when deinit BT + // add additional feature options here +} + +enum RpcId { + MsgId_Invalid = 0; + + /** Request Msgs **/ + Req_Base = 256; //0x100 + + Req_GetMACAddress = 257; //0x101 + Req_SetMacAddress = 258; //0x102 + Req_GetWifiMode = 259; //0x103 + Req_SetWifiMode = 260; //0x104 + + Req_SuppDppInit = 261; //0x105 + Req_SuppDppDeinit = 262; //0x106 + Req_SuppDppBootstrapGen = 263; //0x107 + Req_SuppDppStartListen = 264; //0x108 + Req_SuppDppStopListen = 265; //0x109 + + //Req_SetSoftAPVendorSpecificIE = 266; //0x10a + //Req_StartSoftAP = 267; //0x10b + //Req_GetSoftAPConnectedSTAList = 268; //0x10c + //Req_StopSoftAP = 269; //0x10d + Req_OTAActivate = 266; //0x112 + + Req_WifiSetPs = 270; //0x10e + Req_WifiGetPs = 271; //0x10f + + Req_OTABegin = 272; //0x110 + Req_OTAWrite = 273; //0x111 + Req_OTAEnd = 274; //0x112 + + Req_WifiSetMaxTxPower = 275; //0x113 + Req_WifiGetMaxTxPower = 276; //0x114 + + Req_ConfigHeartbeat = 277; //0x115 + + Req_WifiInit = 278; //0x116 + Req_WifiDeinit = 279; //0x117 + Req_WifiStart = 280; //0x118 + Req_WifiStop = 281; //0x119 + Req_WifiConnect = 282; //0x11a + Req_WifiDisconnect = 283; //0x11b + Req_WifiSetConfig = 284; //0x11c + Req_WifiGetConfig = 285; //0x11d + + Req_WifiScanStart = 286; //0x11e + Req_WifiScanStop = 287; //0x11f + Req_WifiScanGetApNum = 288; //0x120 + Req_WifiScanGetApRecords = 289; //0x121 + Req_WifiClearApList = 290; //0x122 + + Req_WifiRestore = 291; //0x123 + Req_WifiClearFastConnect = 292; //0x124 + Req_WifiDeauthSta = 293; //0x125 + Req_WifiStaGetApInfo = 294; //0x126 + //Req_WifiSetPs = 295; //0x127 + //Req_WifiGetPs = 296; //0x128 + Req_WifiSetProtocol = 297; //0x129 + Req_WifiGetProtocol = 298; //0x12a + Req_WifiSetBandwidth = 299; //0x12b + Req_WifiGetBandwidth = 300; //0x12c + Req_WifiSetChannel = 301; //0x12d + Req_WifiGetChannel = 302; //0x12e + Req_WifiSetCountry = 303; //0x12f + Req_WifiGetCountry = 304; //0x130 + +// Req_WifiSetPromiscuousRxCb = 305; //0x131 + Req_WifiSetPromiscuous = 305; //0x131 + Req_WifiGetPromiscuous = 306; //0x132 + Req_WifiSetPromiscuousFilter = 307; //0x133 + Req_WifiGetPromiscuousFilter = 308; //0x134 + Req_WifiSetPromiscuousCtrlFilter = 309; //0x135 + Req_WifiGetPromiscuousCtrlFilter = 310; //0x136 + + Req_WifiApGetStaList = 311; //0x137 + Req_WifiApGetStaAid = 312; //0x138 + Req_WifiSetStorage = 313; //0x139 + Req_WifiSetVendorIe = 314; //0x13a +// Req_WifiSetVendorIeCb = 315; //0x13b + Req_WifiSetEventMask = 315; //0x13b + Req_WifiGetEventMask = 316; //0x13c + Req_Wifi80211Tx = 317; //0x13d + +// Req_WifiSetCsiRxCb = 318; //0x13e + Req_WifiSetCsiConfig = 318; //0x13e + Req_WifiSetCsi = 319; //0x13f + + Req_WifiSetAntGpio = 320; //0x140 + Req_WifiGetAntGpio = 321; //0x141 + Req_WifiSetAnt = 322; //0x142 + Req_WifiGetAnt = 323; //0x143 + + Req_WifiGetTsfTime = 324; //0x144 + Req_WifiSetInactiveTime = 325; //0x145 + Req_WifiGetInactiveTime = 326; //0x146 + Req_WifiStatisDump = 327; //0x147 + Req_WifiSetRssiThreshold = 328; //0x148 + + Req_WifiFtmInitiateSession = 329; //0x149 + Req_WifiFtmEndSession = 330; //0x14a + Req_WifiFtmRespSetOffset = 331; //0x14b + + Req_WifiConfig11bRate = 332; //0x14c + Req_WifiConnectionlessModuleSetWakeInterval = 333; //0x14d + Req_WifiSetCountryCode = 334; //0x14e + Req_WifiGetCountryCode = 335; //0x14f + Req_WifiConfig80211TxRate = 336; //0x150 + Req_WifiDisablePmfConfig = 337; //0x151 + Req_WifiStaGetAid = 338; //0x152 + Req_WifiStaGetNegotiatedPhymode = 339; //0x153 + Req_WifiSetDynamicCs = 340; //0x154 + Req_WifiStaGetRssi = 341; //0x155 + + Req_WifiSetProtocols = 342; //0x156 + Req_WifiGetProtocols = 343; //0x157 + Req_WifiSetBandwidths = 344; //0x158 + Req_WifiGetBandwidths = 345; //0x159 + + Req_WifiSetBand = 346; //0x15a + Req_WifiGetBand = 347; //0x15b + Req_WifiSetBandMode = 348; //0x15c + Req_WifiGetBandMode = 349; //0x15d + + Req_GetCoprocessorFwVersion = 350; //0x15e + + Req_WifiScanGetApRecord = 351; //0x15f + + Req_SetDhcpDnsStatus = 352; //0x160 + Req_GetDhcpDnsStatus = 353; //0x161 + + Req_WifiStaTwtConfig = 354; //0x162 + Req_WifiStaItwtSetup = 355; //0x163 + Req_WifiStaItwtTeardown = 356; //0x164 + Req_WifiStaItwtSuspend = 357; //0x165 + Req_WifiStaItwtGetFlowIdStatus = 358; //0x166 + Req_WifiStaItwtSendProbeReq = 359; //0x167 + Req_WifiStaItwtSetTargetWakeTimeOffset = 360; //0x168 + + Req_WifiStaEnterpriseEnable = 361; //0x169 + Req_WifiStaEnterpriseDisable = 362; //0x16A + Req_EapSetIdentity = 363; //0x16B + Req_EapClearIdentity = 364; //0x16C + Req_EapSetUsername = 365; //0x16D + Req_EapClearUsername = 366; //0x16E + Req_EapSetPassword = 367; //0x16F + Req_EapClearPassword = 368; //0x170 + Req_EapSetNewPassword = 369; //0x171 + Req_EapClearNewPassword = 370; //0x172 + Req_EapSetCaCert = 371; //0x173 + Req_EapClearCaCert = 372; //0x174 + Req_EapSetCertificateAndKey = 373; //0x175 + Req_EapClearCertificateAndKey = 374; //0x176 + Req_EapGetDisableTimeCheck = 375; //0x177 + Req_EapSetTtlsPhase2Method = 376; //0x178 + Req_EapSetSuitebCertification = 377; //0x179 + Req_EapSetPacFile = 378; //0x17A + Req_EapSetFastParams = 379; //0x17B + Req_EapUseDefaultCertBundle = 380; //0x17C + Req_WifiSetOkcSupport = 381; //0x17D + Req_EapSetDomainName = 382; //0x17E + Req_EapSetDisableTimeCheck = 383; //0x17F + Req_EapSetEapMethods = 384; //0x180 + + Req_IfaceMacAddrSetGet = 385; //0x181 + Req_IfaceMacAddrLenGet = 386; //0x182 + + /* Common RPC to handle simple feature control with one optional parameter + * Supported Features: + * - BT Init/Deinit/Enable/Disable + */ + Req_FeatureControl = 387; //0x183 + + Req_GpioConfig = 388; // 0x184 + Req_GpioResetPin = 389; // 0x185 + Req_GpioSetLevel = 390; // 0x186 + Req_GpioGetLevel = 391; // 0x187 + Req_GpioSetDirection = 392; // 0x188 + Req_GpioInputEnable = 393; // 0x189 + Req_GpioSetPullMode = 394; // 0x18A + + /* Add new control path command response before Req_Max + * and update Req_Max */ + Req_Max = 395; //0x18B + + /** Response Msgs **/ + Resp_Base = 512; + + Resp_GetMACAddress = 513; + Resp_SetMacAddress = 514; + Resp_GetWifiMode = 515; + Resp_SetWifiMode = 516; + + Resp_SuppDppInit = 517; + Resp_SuppDppDeinit = 518; + Resp_SuppDppBootstrapGen = 519; + Resp_SuppDppStartListen = 520; + Resp_SuppDppStopListen = 521; + + //Resp_SetSoftAPVendorSpecificIE = 522; + //Resp_StartSoftAP = 523; + //Resp_GetSoftAPConnectedSTAList = 524; + //Resp_StopSoftAP = 525; + Resp_OTAActivate = 522; + + Resp_WifiSetPs = 526; + Resp_WifiGetPs = 527; + + Resp_OTABegin = 528; + Resp_OTAWrite = 529; + Resp_OTAEnd = 530; + + Resp_WifiSetMaxTxPower = 531; + Resp_WifiGetMaxTxPower = 532; + + Resp_ConfigHeartbeat = 533; + + Resp_WifiInit = 534; + Resp_WifiDeinit = 535; + Resp_WifiStart = 536; + Resp_WifiStop = 537; + Resp_WifiConnect = 538; + Resp_WifiDisconnect = 539; + Resp_WifiSetConfig = 540; + Resp_WifiGetConfig = 541; + + Resp_WifiScanStart = 542; + Resp_WifiScanStop = 543; + Resp_WifiScanGetApNum = 544; + Resp_WifiScanGetApRecords = 545; + Resp_WifiClearApList = 546; + + Resp_WifiRestore = 547; + Resp_WifiClearFastConnect = 548; + Resp_WifiDeauthSta = 549; + Resp_WifiStaGetApInfo = 550; + //Resp_WifiSetPs = 551; + //Resp_WifiGetPs = 552; + Resp_WifiSetProtocol = 553; + Resp_WifiGetProtocol = 554; + Resp_WifiSetBandwidth = 555; + Resp_WifiGetBandwidth = 556; + Resp_WifiSetChannel = 557; + Resp_WifiGetChannel = 558; + Resp_WifiSetCountry = 559; + Resp_WifiGetCountry = 560; + +// Resp_WifiSetPromiscuousRxCb = 561; + Resp_WifiSetPromiscuous = 561; + Resp_WifiGetPromiscuous = 562; + Resp_WifiSetPromiscuousFilter = 563; + Resp_WifiGetPromiscuousFilter = 564; + Resp_WifiSetPromiscuousCtrlFilter = 565; + Resp_WifiGetPromiscuousCtrlFilter = 566; + + Resp_WifiApGetStaList = 567; + Resp_WifiApGetStaAid = 568; + Resp_WifiSetStorage = 569; + Resp_WifiSetVendorIe = 570; +// Resp_WifiSetVendorIeCb = 571; + Resp_WifiSetEventMask = 571; + Resp_WifiGetEventMask = 572; + Resp_Wifi80211Tx = 573; + +// Resp_WifiSetCsiRxCb = 573; + Resp_WifiSetCsiConfig = 574; + Resp_WifiSetCsi = 575; + + Resp_WifiSetAntGpio = 576; + Resp_WifiGetAntGpio = 577; + Resp_WifiSetAnt = 578; + Resp_WifiGetAnt = 579; + + Resp_WifiGetTsfTime = 580; + Resp_WifiSetInactiveTime = 581; + Resp_WifiGetInactiveTime = 582; + Resp_WifiStatisDump = 583; + Resp_WifiSetRssiThreshold = 584; + + Resp_WifiFtmInitiateSession = 585; + Resp_WifiFtmEndSession = 586; + Resp_WifiFtmRespSetOffset = 587; + + Resp_WifiConfig11bRate = 588; + Resp_WifiConnectionlessModuleSetWakeInterval = 589; + Resp_WifiSetCountryCode = 590; + Resp_WifiGetCountryCode = 591; + Resp_WifiConfig80211TxRate = 592; + Resp_WifiDisablePmfConfig = 593; + Resp_WifiStaGetAid = 594; + Resp_WifiStaGetNegotiatedPhymode = 595; + Resp_WifiSetDynamicCs = 596; + Resp_WifiStaGetRssi = 597; + + Resp_WifiSetProtocols = 598; + Resp_WifiGetProtocols = 599; + Resp_WifiSetBandwidths = 600; + Resp_WifiGetBandwidths = 601; + + Resp_WifiSetBand = 602; + Resp_WifiGetBand = 603; + Resp_WifiSetBandMode = 604; + Resp_WifiGetBandMode = 605; + + Resp_GetCoprocessorFwVersion = 606; + + Resp_WifiScanGetApRecord = 607; + + Resp_SetDhcpDnsStatus = 608; + Resp_GetDhcpDnsStatus = 609; + + Resp_WifiStaTwtConfig = 610; + Resp_WifiStaItwtSetup = 611; + Resp_WifiStaItwtTeardown = 612; + Resp_WifiStaItwtSuspend = 613; + Resp_WifiStaItwtGetFlowIdStatus = 614; + Resp_WifiStaItwtSendProbeReq = 615; + Resp_WifiStaItwtSetTargetWakeTimeOffset = 616; + + Resp_WifiStaEnterpriseEnable = 617; + Resp_WifiStaEnterpriseDisable = 618; + Resp_EapSetIdentity = 619; + Resp_EapClearIdentity = 620; + Resp_EapSetUsername = 621; + Resp_EapClearUsername = 622; + Resp_EapSetPassword = 623; + Resp_EapClearPassword = 624; + Resp_EapSetNewPassword = 625; + Resp_EapClearNewPassword = 626; + Resp_EapSetCaCert = 627; + Resp_EapClearCaCert = 628; + Resp_EapSetCertificateAndKey = 629; + Resp_EapClearCertificateAndKey = 630; + Resp_EapGetDisableTimeCheck = 631; + Resp_EapSetTtlsPhase2Method = 632; + Resp_EapSetSuitebCertification = 633; + Resp_EapSetPacFile = 634; + Resp_EapSetFastParams = 635; + Resp_EapUseDefaultCertBundle = 636; + Resp_WifiSetOkcSupport = 637; + Resp_EapSetDomainName = 638; + Resp_EapSetDisableTimeCheck = 639; + Resp_EapSetEapMethods = 640; + + Resp_IfaceMacAddrSetGet = 641; + Resp_IfaceMacAddrLenGet = 642; + Resp_FeatureControl = 643; + + Resp_GpioConfig = 644; + Resp_GpioResetPin = 645; + Resp_GpioSetLevel = 646; + Resp_GpioGetLevel = 647; + Resp_GpioSetDirection = 648; + Resp_GpioInputEnable = 649; + Resp_GpioSetPullMode = 650; + + /* Add new control path command response before Resp_Max + * and update Resp_Max */ + Resp_Max = 651; + + /** Event Msgs **/ + Event_Base = 768; + Event_ESPInit = 769; + Event_Heartbeat = 770; + Event_AP_StaConnected = 771; + Event_AP_StaDisconnected = 772; + Event_WifiEventNoArgs = 773; + Event_StaScanDone = 774; + Event_StaConnected = 775; + Event_StaDisconnected = 776; + Event_DhcpDnsStatus = 777; + + Event_StaItwtSetup = 778; + Event_StaItwtTeardown = 779; + Event_StaItwtSuspend = 780; + Event_StaItwtProbe = 781; + + // Supplicant DPP Events received by dpp callback on host + Event_SuppDppUriReady = 782; + Event_SuppDppCfgRecvd = 783; + Event_SuppDppFail = 784; + // Wifi DPP Events + Event_WifiDppUriReady = 785; + Event_WifiDppCfgRecvd = 786; + Event_WifiDppFail = 787; + + /* Add new control path command notification before Event_Max + * and update Event_Max */ + Event_Max = 788; +} + +message wifi_init_config { + int32 static_rx_buf_num = 1; /**< WiFi static RX buffer number */ + int32 dynamic_rx_buf_num = 2; /**< WiFi dynamic RX buffer number */ + int32 tx_buf_type = 3; /**< WiFi TX buffer type */ + int32 static_tx_buf_num = 4; /**< WiFi static TX buffer number */ + int32 dynamic_tx_buf_num = 5; /**< WiFi dynamic TX buffer number */ + int32 cache_tx_buf_num = 6; /**< WiFi TX cache buffer number */ + int32 csi_enable = 7; /**< WiFi channel state information enable flag */ + int32 ampdu_rx_enable = 8; /**< WiFi AMPDU RX feature enable flag */ + int32 ampdu_tx_enable = 9; /**< WiFi AMPDU TX feature enable flag */ + int32 amsdu_tx_enable = 10; /**< WiFi AMSDU TX feature enable flag */ + int32 nvs_enable = 11; /**< WiFi NVS flash enable flag */ + int32 nano_enable = 12; /**< Nano option for printf/scan family enable flag */ + int32 rx_ba_win = 13; /**< WiFi Block Ack RX window size */ + int32 wifi_task_core_id = 14; /**< WiFi Task Core ID */ + int32 beacon_max_len = 15; /**< WiFi softAP maximum length of the beacon */ + int32 mgmt_sbuf_num = 16; /**< WiFi management short buffer number, the minimum value is 6, the maximum value is 32 */ + uint64 feature_caps = 17; /**< Enables additional WiFi features and capabilities */ + bool sta_disconnected_pm = 18; /**< WiFi Power Management for station at disconnected status */ + int32 espnow_max_encrypt_num = 19; /**< Maximum encrypt number of peers supported by espnow */ + int32 magic = 20; /**< WiFi init magic number, it should be the last field */ + int32 rx_mgmt_buf_type = 21; /**< WiFi RX MGMT buffer type */ + int32 rx_mgmt_buf_num = 22; /**< WiFi RX MGMT buffer number */ + int32 tx_hetb_queue_num = 23; /**< WiFi TX HE TB QUEUE number for STA HE TB PPDU transmission */ + int32 dump_hesigb_enable = 24; /**< enable dump sigb field */ +} + +message wifi_country { + bytes cc = 1; /**< country code string of 3 chars*/ + uint32 schan = 2; /**< start channel */ + uint32 nchan = 3; /**< total channel number */ + int32 max_tx_power = 4; /**< This field is used for getting WiFi maximum transmitting power, + call esp_wifi_set_max_tx_power to set the maximum transmitting power. */ + int32 policy = 5; /**< country policy */ +} + + +message wifi_active_scan_time { + uint32 min = 1; /**< minimum active scan time per channel, units: millisecond */ + uint32 max = 2; /**< maximum active scan time per channel, units: millisecond, values above 1500ms may + cause station to disconnect from AP and are not recommended. */ +} ; + +message wifi_scan_time { + wifi_active_scan_time active = 1; /**< active scan time per channel, units: millisecond. */ + uint32 passive = 2; /**< passive scan time per channel, units: millisecond, values above 1500ms may + cause station to disconnect from AP and are not recommended. */ +} + +message wifi_scan_channel_bitmap { + uint32 ghz_2_channels = 1; /**< Represents 2.4 GHz channels, that bits can be set as wifi_2g_channel_bit_t shown. */ + uint32 ghz_5_channels = 2; /**< Represents 5 GHz channels, that bits can be set as wifi_5g_channel_bit_t shown. */ +} + +message wifi_scan_config { + bytes ssid = 1; /**< SSID of AP 33char*/ + bytes bssid = 2; /**< MAC address of AP 6char */ + uint32 channel = 3; /**< channel, scan the specific channel */ + bool show_hidden = 4; /**< enable to scan AP whose SSID is hidden */ + int32 scan_type = 5; /**< scan type, active or passive */ + wifi_scan_time scan_time = 6; /**< scan time per channel */ + uint32 home_chan_dwell_time = 7; /**< time spent at home channel between scanning consecutive channels.*/ + wifi_scan_channel_bitmap channel_bitmap = 8; /**< Channel bitmap for setting specific channels to be scanned. + Please note that the 'channel' parameter above needs to be set to 0 to allow scanning by bitmap. + Also, note that only allowed channels configured by wifi_country_t can be scanned. */ +} + +message wifi_he_ap_info { + //uint8_t bss_color:6; /**< an unsigned integer whose value is the BSS Color of the BSS corresponding to the AP */ + //uint8_t partial_bss_color:1; /**< indicate if an AID assignment rule based on the BSS color */ + //uint8_t bss_color_disabled:1; /**< indicate if the use of BSS color is disabled */ + uint32 bitmask = 1; /* Manually have to parse for above bits */ + uint32 bssid_index = 2; /**< in M-BSSID set, identifies the nontransmitted BSSID */ +} + +message wifi_ap_record { + bytes bssid = 1; /**< MAC address of AP 6char */ + bytes ssid = 2; /**< SSID of AP 33char */ + uint32 primary = 3; /**< channel of AP */ + int32 second = 4; /**< secondary channel of AP */ + int32 rssi = 5; /**< signal strength of AP */ + int32 authmode = 6; /**< authmode of AP */ + int32 pairwise_cipher = 7; /**< pairwise cipher of AP */ + int32 group_cipher = 8; /**< group cipher of AP */ + int32 ant = 9; /**< antenna used to receive beacon from AP */ + //uint32_t phy_11b:1; /**< bit: 0 flag to identify if 11b mode is enabled or not */ + //uint32_t phy_11g:1; /**< bit: 1 flag to identify if 11g mode is enabled or not */ + //uint32_t phy_11n:1; /**< bit: 2 flag to identify if 11n mode is enabled or not */ + //uint32_t phy_lr:1; /**< bit: 3 flag to identify if low rate is enabled or not */ + //uint32_t wps:1; /**< bit: 4 flag to identify if WPS is supported or not */ + //uint32_t ftm_responder:1; /**< bit: 5 flag to identify if FTM is supported in responder mode */ + //uint32_t ftm_initiator:1; /**< bit: 6 flag to identify if FTM is supported in initiator mode */ + //uint32_t reserved:25; /**< bit: 7..31 reserved */ + uint32 bitmask = 10; /* Manually have to parse for above bits */ + + wifi_country country = 11; /**< country information of AP */ + wifi_he_ap_info he_ap = 12; + uint32 bandwidth = 13; /**< For AP 20 MHz this value is set to 1. For AP 40 MHz this value is set to 2. + For AP 80 MHz this value is set to 3. For AP 160MHz this value is set to 4. + For AP 80+80MHz this value is set to 5*/ + uint32 vht_ch_freq1 = 14; /**< This fields are used only AP bandwidth is 80 and 160 MHz, to transmit the center channel + frequency of the BSS. For AP bandwidth is 80 + 80 MHz, it is the center channel frequency + of the lower frequency segment.*/ + uint32 vht_ch_freq2 = 15; /**< This fields are used only AP bandwidth is 80 + 80 MHz, and is used to transmit the center + channel frequency of the second segment. */ +} + +message wifi_scan_threshold { + int32 rssi = 1; /**< The minimum rssi to accept in the fast scan mode */ + int32 authmode = 2; /**< The weakest authmode to accept in the fast scan mode +Note: Incase this value is not set and password is set as per WPA2 standards(password len >= 8), +it will be defaulted to WPA2 and device won't connect to deprecated WEP/WPA networks. +Please set authmode threshold as WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK to connect to WEP/WPA networks */ + uint32 rssi_5g_adjustment = 3; /**< The RSSI value of the 5G AP is within the rssi_5g_adjustment range compared to the 2G AP, the 5G AP will be given priority for connection. */ +} + +message wifi_pmf_config { + bool capable = 1; /**< Deprecated variable. Device will always connect in PMF mode if other device also advertizes PMF capability. */ + bool required = 2; /**< Advertizes that Protected Management Frame is required. Device will not associate to non-PMF capable devices. */ +} + +message wifi_bss_max_idle_config { + uint32 period = 1; /**< Sets BSS Max idle period (1 Unit = 1000TUs OR 1.024 Seconds). If there are no frames for this period from a STA, SoftAP will disassociate due to inactivity. Setting it to 0 disables the feature */ + bool protected_keep_alive = 2; /**< Requires clients to use protected keep alive frames for BSS Max Idle period */ +} + +message wifi_ap_config { + bytes ssid = 1; /**< SSID of ESP32 soft-AP. If ssid_len field is 0, this must be a Null terminated string. Otherwise, length is set according to ssid_len. 32 char*/ + bytes password = 2; /**< Password of ESP32 soft-AP. 64 char*/ + uint32 ssid_len = 3; /**< Optional length of SSID field. */ + uint32 channel = 4; /**< Channel of ESP32 soft-AP */ + int32 authmode = 5; /**< Auth mode of ESP32 soft-AP. Do not support AUTH_WEP in soft-AP mode */ + uint32 ssid_hidden = 6; /**< Broadcast SSID or not, default 0, broadcast the SSID */ + uint32 max_connection = 7; /**< Max number of stations allowed to connect in */ + uint32 beacon_interval = 8; /**< Beacon interval which should be multiples of 100. Unit: TU(time unit, 1 TU = 1024 us). Range: 100 ~ 60000. Default value: 100 */ + int32 pairwise_cipher = 9; /**< pairwise cipher of SoftAP, group cipher will be derived using this. + cipher values are valid starting from WIFI_CIPHER_TYPE_TKIP, enum values before that will be considered as invalid and default cipher suites(TKIP+CCMP) will be used. + Valid cipher suites in softAP mode are WIFI_CIPHER_TYPE_TKIP, WIFI_CIPHER_TYPE_CCMP and WIFI_CIPHER_TYPE_TKIP_CCMP. */ + bool ftm_responder = 10; /**< Enable FTM Responder mode */ + wifi_pmf_config pmf_cfg = 11; /**< Configuration for Protected Management Frame */ + int32 sae_pwe_h2e = 12; /**< Configuration for SAE PWE derivation method */ + uint32 csa_count = 13; /**< Channel Switch Announcement Count. Notify the station that the channel will switch after the csa_count beacon intervals. Default value: 3 */ + uint32 dtim_period = 14; /**< Dtim period of soft-AP. Range: 1 ~ 10. Default value: 1 */ + uint32 transition_disable = 15; /**< Whether to enable transition disable feature */ + uint32 sae_ext = 16; /**< Enable SAE EXT feature. SOC_GCMP_SUPPORT is required for this feature. */ + wifi_bss_max_idle_config bss_max_idle_cfg = 17; /**< Configuration for bss max idle, effective if CONFIG_WIFI_BSS_MAX_IDLE_SUPPORT is enabled */ + uint32 gtk_rekey_interval = 18; /**< GTK rekeying interval in seconds. If set to 0, GTK rekeying is disabled. Range: 60 ~ 65535 including 0. */ +} + +message wifi_sta_config { + bytes ssid = 1; /**< SSID of target AP. 32char */ + bytes password = 2; /**< Password of target AP. 64char */ + int32 scan_method = 3; /**< do all channel scan or fast scan */ + bool bssid_set = 4; /**< whether set MAC address of target AP or not. Generally, station_config.bssid_set needs to be 0, + and it needs to be 1 only when users need to check the MAC address of the AP.*/ + bytes bssid = 5; /**< MAC address of target AP 6char */ + uint32 channel = 6; /**< channel of target AP. Set to 1~13 to scan starting from the specified channel + before connecting to AP. If the channel of AP is unknown, set it to 0.*/ + uint32 listen_interval = 7; /**< Listen interval for ESP32 station to receive beacon when WIFI_PS_MAX_MODEM is set. +Units: AP beacon intervals. Defaults to 3 if set to 0. */ + int32 sort_method = 8; /**< sort the connect AP in the list by rssi or security mode */ + wifi_scan_threshold threshold = 9; /**< When sort_method is set, only APs which have an auth mode that is more secure + than the selected auth mode and a signal stronger than the minimum RSSI will be used. */ + wifi_pmf_config pmf_cfg = 10; /**< Configuration for Protected Management Frame. Will be advertized in RSN Capabilities in RSN IE. */ + //uint32_t rm_enabled:1; /**< Whether Radio Measurements are enabled for the connection */ + //uint32_t btm_enabled:1; /**< Whether BSS Transition Management is enabled for the connection */ + //uint32_t mbo_enabled:1; /**< Whether MBO is enabled for the connection */ + //uint32_t ft_enabled:1; /**< Whether FT is enabled for the connection */ + //uint32_t owe_enabled:1; /**< Whether OWE is enabled for the connection */ + //uint32_t transition_disable:1; /**< Whether to enable transition disable feature */ + //uint32_t reserved:26; /**< Reserved for future feature set */ + uint32 bitmask = 11; + int32 sae_pwe_h2e = 12; /**< Whether SAE hash to element is enabled */ + uint32 failure_retry_cnt = 13; /**< Number of connection retries station will do before moving to next AP. + scan_method should be set as WIFI_ALL_CHANNEL_SCAN to use this config. + Note: Enabling this may cause connection time to increase incase best AP doesn't behave properly. */ + //uint32_t he_dcm_set:1; /**< Whether DCM max.constellation for transmission and reception is set. */ + //uint32_t he_dcm_max_constellation_tx:2; /**< Indicate the max.constellation for DCM in TB PPDU the STA supported. 0: not supported. 1: BPSK, 2: QPSK, 3: 16-QAM. The default value is 3. */ + //uint32_t he_dcm_max_constellation_rx:2; /**< Indicate the max.constellation for DCM in both Data field and HE-SIG-B field the STA supported. 0: not supported. 1: BPSK, 2: QPSK, 3: 16-QAM. The default value is 3. */ + //uint32_t he_mcs9_enabled:1; /**< Whether to support HE-MCS 0 to 9. The default value is 0. */ + //uint32_t he_su_beamformee_disabled:1; /**< Whether to disable support for operation as an SU beamformee. */ + //uint32_t he_trig_su_bmforming_feedback_disabled:1; /**< Whether to disable support the transmission of SU feedback in an HE TB sounding sequence. */ + //uint32_t he_trig_mu_bmforming_partial_feedback_disabled:1; /**< Whether to disable support the transmission of partial-bandwidth MU feedback in an HE TB sounding sequence. */ + // uint32_t he_trig_cqi_feedback_disabled:1; /**< Whether to disable support the transmission of CQI feedback in an HE TB sounding sequence. */ + // uint32_t vht_su_beamformee_disabled: 1; /**< Whether to disable support for operation as an VHT SU beamformee. */ + // uint32_t vht_mu_beamformee_disabled: 1; /**< Whether to disable support for operation as an VHT MU beamformee. */ + // uint32_t vht_mcs8_enabled: 1; /**< Whether to support VHT-MCS8. The default value is 0. */ + // uint32_t he_reserved:19; /**< Reserved for future feature set */ + uint32 he_bitmask = 14; + bytes sae_h2e_identifier = 15; /**< Password identifier for H2E. this needs to be null terminated string. SAE_H2E_IDENTIFIER_LEN chars */ + uint32 sae_pk_mode = 16; /**< Configuration for SAE-PK (Public Key) Authentication method */ +} + +message wifi_config { + oneof u { + wifi_ap_config ap = 1; /**< configuration of AP */ + wifi_sta_config sta = 2; /**< configuration of STA */ + } +} + +message wifi_sta_info { + bytes mac = 1; /**< mac address 6 char */ + int32 rssi = 2; /**< current average rssi of sta connected */ + //uint32_t phy_11b:1; /**< bit: 0 flag to identify if 11b mode is enabled or not */ + //uint32_t phy_11g:1; /**< bit: 1 flag to identify if 11g mode is enabled or not */ + //uint32_t phy_11n:1; /**< bit: 2 flag to identify if 11n mode is enabled or not */ + //uint32_t phy_lr:1; /**< bit: 3 flag to identify if low rate is enabled or not */ + //uint32_t phy_11x:1; /**< bit: 4 flag to identify identify if 11ax mode is enabled or not */ + //uint32_t is_mesh_child:1; /**< bit: 5 flag to identify mesh child */ + //uint32_t reserved:26; /**< bit: 6..31 reserved */ + uint32 bitmask = 3; +} + +message wifi_sta_list { + repeated wifi_sta_info sta = 1; /**< station list */ + int32 num = 2; /**< number of stations in the list (other entries are invalid) */ +} + +//message vendor_ie_data { +// uint32 element_id = 1; /**< Should be set to WIFI_VENDOR_IE_ELEMENT_ID (0xDD) */ +// uint32 length = 2; /**< Length of all bytes in the element data following this field. Minimum 4. */ +// bytes vendor_oui = 3; /**< Vendor identifier (OUI). 3 chars */ +// uint32 vendor_oui_type = 4; /**< Vendor-specific OUI type. */ +// bytes payload = 5; /**< Payload. Length is equal to value in 'length' field, minus 4. Note: Variable size */ +//} + +message wifi_pkt_rx_ctrl { + int32 rssi = 1; /**< 8bits Received Signal Strength Indicator(RSSI) of packet. unit: dBm */ + uint32 rate = 2; /**< 5bits PHY rate encoding of the packet. Only valid for non HT(11bg) packet */ + //uint32 :1; /**< reserved */ + uint32 sig_mode = 3; /**< 2bits 0: non HT(11bg) packet; 1: HT(11n) packet; 3: VHT(11ac) packet */ + //uint32 :16; /**< reserved */ + uint32 mcs = 4; /**< 7bits Modulation Coding Scheme. If is HT(11n) packet, shows the modulation, range from 0 to 76(MSC0 ~ MCS76) */ + uint32 cwb = 5; /**< 1bit Channel Bandwidth of the packet. 0: 20MHz; 1: 40MHz */ + //uint32 :16; /**< reserved */ + uint32 smoothing = 6; /**< 1bit reserved */ + uint32 not_sounding = 7; /**< 1bit reserved */ + //uint32 :1; /**< reserved */ + uint32 aggregation = 8; /**< 1bit Aggregation. 0: MPDU packet; 1: AMPDU packet */ + uint32 stbc = 9; /**< 2bits Space Time Block Code(STBC). 0: non STBC packet; 1: STBC packet */ + uint32 fec_coding = 10; /**< 1bit Flag is set for 11n packets which are LDPC */ + uint32 sgi = 11; /**< 1bit Short Guide Interval(SGI). 0: Long GI; 1: Short GI */ + int32 noise_floor = 12; /**< 8bits noise floor of Radio Frequency Module(RF). unit: dBm*/ + uint32 ampdu_cnt = 13; /**< 8bits ampdu cnt */ + uint32 channel = 14; /**< 4bits primary channel on which this packet is received */ + uint32 secondary_channel = 15; /**< 4bits secondary channel on which this packet is received. 0: none; 1: above; 2: below */ + //uint32 :8; /**< reserved */ + uint32 timestamp = 16; /**< 32bit timestamp. The local time when this packet is received. It is precise only if modem sleep or light sleep is not enabled. unit: microsecond */ + //uint32 :32; /**< reserved */ + //unsigned :32; /**< reserved */ + //unsigned :31; /**< reserved */ + uint32 ant = 17; /**< 1bit antenna number from which this packet is received. 0: WiFi antenna 0; 1: WiFi antenna 1 */ + uint32 sig_len = 18; /**< 12bits length of packet including Frame Check Sequence(FCS) */ + //unsigned :12; /**< reserved */ + uint32 rx_state = 19; /**< 8bits state of the packet. 0: no error; others: error numbers which are not public */ +} + +message wifi_promiscuous_pkt { + wifi_pkt_rx_ctrl rx_ctrl = 1; /**< metadata header */ + bytes payload = 2; /**< Note: variable length. Data or management payload. Length of payload is described by rx_ctrl.sig_len. Type of content determined by packet type argument of callback. */ +} + +message wifi_promiscuous_filter { + uint32 filter_mask = 1; /**< OR of one or more filter values WIFI_PROMIS_FILTER_* */ +} + +message wifi_csi_config { + bool lltf_en = 1; /**< enable to receive legacy long training field(lltf) data. Default enabled */ + bool htltf_en = 2; /**< enable to receive HT long training field(htltf) data. Default enabled */ + bool stbc_htltf2_en = 3; /**< enable to receive space time block code HT long training field(stbc-htltf2) data. Default enabled */ + bool ltf_merge_en = 4; /**< enable to generate htlft data by averaging lltf and ht_ltf data when receiving HT packet. Otherwise, use ht_ltf data directly. Default enabled */ + bool channel_filter_en = 5; /**< enable to turn on channel filter to smooth adjacent sub-carrier. Disable it to keep independence of adjacent sub-carrier. Default enabled */ + bool manu_scale = 6; /**< manually scale the CSI data by left shifting or automatically scale the CSI data. + If set true, please set the shift bits. false: automatically. true: manually. Default false */ + uint32 shift = 7; /**< manually left shift bits of the scale of the CSI data. The range of the left shift bits is 0~15 */ +} + +message wifi_csi_info { + wifi_pkt_rx_ctrl rx_ctrl = 1; /**< received packet radio metadata header of the CSI data */ + bytes mac = 2; /**< 6bits source MAC address of the CSI data */ + bytes dmac = 3; /**< 6bits destination MAC address of the CSI data */ + bool first_word_invalid = 4; /**< first four bytes of the CSI data is invalid or not */ + bytes buf = 5; /**< Note: variable length. buffer of CSI data */ + uint32 len = 6; /**< length of CSI data */ +} + +message wifi_ant_gpio { + uint32 gpio_select = 1; /**< 1bit Whether this GPIO is connected to external antenna switch */ + uint32 gpio_num = 2; /**< 7bits The GPIO number that connects to external antenna switch */ +} + +message wifi_ant_gpio_config { + repeated wifi_ant_gpio gpio_cfgs = 1; /**< The configurations of GPIOs that connect to external antenna switch */ +} + +message wifi_ant_config { + int32 rx_ant_mode = 1; /**< WiFi antenna mode for receiving */ + int32 rx_ant_default = 2; /**< Default antenna mode for receiving, it's ignored if rx_ant_mode is not WIFI_ANT_MODE_AUTO */ + int32 tx_ant_mode = 3; /**< WiFi antenna mode for transmission, it can be set to WIFI_ANT_MODE_AUTO only if rx_ant_mode is set to WIFI_ANT_MODE_AUTO */ + uint32 enabled_ant0 = 4; /**< 4bits Index (in antenna GPIO configuration) of enabled WIFI_ANT_MODE_ANT0 */ + uint32 enabled_ant1 = 5; /**< 4bits Index (in antenna GPIO configuration) of enabled WIFI_ANT_MODE_ANT1 */ +} + +message wifi_action_tx_req { + int32 ifx = 1; /**< WiFi interface to send request to */ + bytes dest_mac = 2; /**< 6bits Destination MAC address */ + bool no_ack = 3; /**< Indicates no ack required */ + //TODO + //wifi_action_rx_cb_t rx_cb; /**< Rx Callback to receive any response */ + uint32 data_len = 4; /**< Length of the appended Data */ + bytes data = 5; /**< note: variable length. Appended Data payload */ +} + +message wifi_ftm_initiator_cfg { + bytes resp_mac = 1; /**< 6bits MAC address of the FTM Responder */ + uint32 channel = 2; /**< Primary channel of the FTM Responder */ + uint32 frm_count = 3; /**< No. of FTM frames requested in terms of 4 or 8 bursts (allowed values - 0(No pref), 16, 24, 32, 64) */ + uint32 burst_period = 4; /**< Requested time period between consecutive FTM bursts in 100's of milliseconds (0 - No pref) */ +} + +message wifi_event_sta_scan_done { + uint32 status = 1; /**< status of scanning APs: 0 — success, 1 - failure */ + uint32 number = 2; /**< number of scan results */ + uint32 scan_id = 3; /**< scan sequence number, used for block scan */ +} + +message wifi_event_sta_connected { + bytes ssid = 1; /**< 32bytes SSID of connected AP */ + uint32 ssid_len = 2; /**< SSID length of connected AP */ + bytes bssid = 3; /**< 6bytes BSSID of connected AP*/ + uint32 channel = 4; /**< channel of connected AP*/ + int32 authmode = 5; /**< authentication mode used by AP*/ + int32 aid = 6; /**< authentication id assigned by the connected AP*/ +} + +message wifi_event_sta_disconnected { + bytes ssid = 1; /**< SSID of disconnected AP */ + uint32 ssid_len = 2; /**< SSID length of disconnected AP */ + bytes bssid = 3; /**< BSSID of disconnected AP */ + uint32 reason = 4; /**< reason of disconnection */ + int32 rssi = 5; /**< rssi of disconnection */ +} + +message wifi_event_sta_authmode_change { + int32 old_mode = 1; /**< the old auth mode of AP */ + int32 new_mode = 2; /**< the new auth mode of AP */ +} + +message wifi_event_sta_wps_er_pin { + bytes pin_code = 1; /**< 8bytes PIN code of station in enrollee mode */ +} + +message ap_cred { + bytes ssid = 1; /**< 32bytes SSID of AP */ + bytes passphrase = 2; /**< 64bytes Passphrase for the AP */ +} + +message wifi_event_sta_wps_er_success { + uint32 ap_cred_cnt = 1; /**< Number of AP credentials received */ + repeated ap_cred ap_creds = 2; /**< All AP credentials received from WPS handshake */ +} + +/** Argument structure for WIFI_EVENT_AP_PROBEREQRECVED event */ +message wifi_event_ap_probe_req_rx { + int32 rssi = 1; /**< Received probe request signal strength */ + uint32 mac = 2; /**< MAC address of the station which send probe request */ +} + +/** Argument structure for WIFI_EVENT_STA_BSS_RSSI_LOW event */ +message wifi_event_bss_rssi_low { + int32 rssi = 1; /**< RSSI value of bss */ +} + +message wifi_ftm_report_entry { + uint32 dlog_token = 1; /* *< Dialog Token of the FTM frame */ + int32 rssi = 2; /* *< RSSI of the FTM frame received */ + uint32 rtt = 3; /* *< Round Trip Time in pSec with a peer */ + /* TODO: uint32 is supported by proto? */ + uint64 t1 = 4; /* *< Time of departure of FTM frame from FTM Responder in pSec */ + uint64 t2 = 5; /* *< Time of arrival of FTM frame at FTM Initiator in pSec */ + uint64 t3 = 6; /* *< Time of departure of ACK from FTM Initiator in pSec */ + uint64 t4 = 7; /* *< Time of arrival of ACK at FTM Responder in pSec */ +} + +message wifi_event_ftm_report { + bytes peer_mac = 1; /* *< 6bytes MAC address of the FTM Peer */ + int32 status = 2; /* *< Status of the FTM operation */ + uint32 rtt_raw = 3; /* *< Raw average Round-Trip-Time with peer in Nano-Seconds */ + uint32 rtt_est = 4; /* *< Estimated Round-Trip-Time with peer in Nano-Seconds */ + uint32 dist_est = 5; /* *< Estimated one-way distance in Centi-Meters */ + repeated wifi_ftm_report_entry ftm_report_data = 6; /* *< Note var len Pointer to FTM Report with multiple entries, should be freed after use */ + uint32 ftm_report_num_entries = 7; /* *< Number of entries in the FTM Report data */ +} + +message wifi_event_action_tx_status { + int32 ifx = 1; /**< WiFi interface to send request to */ + uint32 context = 2; /**< Context to identify the request */ + bytes da = 3; /**< 6bytes Destination MAC address */ + uint32 status = 4; /**< Status of the operation */ +} + +message wifi_event_roc_done { + uint32 context = 1; /**< Context to identify the request */ +} + +message wifi_event_ap_wps_rg_pin { + bytes pin_code = 1; /**< 8bytes PIN code of station in enrollee mode */ +} + +message wifi_event_ap_wps_rg_fail_reason { + int32 reason = 1; /**< WPS failure reason wps_fail_reason_t */ + bytes peer_macaddr = 2; /**< 6bytes Enrollee mac address */ +} + +message wifi_event_ap_wps_rg_success { + bytes peer_macaddr = 1; /**< 6bytes Enrollee mac address */ +} + +message wifi_protocols { + uint32 ghz_2g = 1; /**< Represents 2.4 GHz protocol, support 802.11b or 802.11g or 802.11n or 802.11ax or LR mode */ + uint32 ghz_5g = 2; /**< Represents 5 GHz protocol, support 802.11a or 802.11n or 802.11ac or 802.11ax */ +} + +message wifi_bandwidths { + uint32 ghz_2g = 1; /* Represents 2.4 GHz bandwidth */ + uint32 ghz_5g = 2; /* Represents 5 GHz bandwidth */ +} + +message wifi_itwt_setup_config { + uint32 setup_cmd = 1; + // uint16_t trigger : 1; /**< 1: a trigger-enabled individual TWT, 0: a non-trigger-enabled individual TWT */ + // uint16_t flow_type : 1; /**< 0: an announced individual TWT, 1: an unannounced individual TWT */ + // uint16_t flow_id : 3; /**< When set up an individual TWT agreement, the flow id will be assigned by AP after a successful agreement setup. + // flow_id could be specified to a value in the range of [0, 7], but it might be changed by AP in the response. + // When change TWT parameters of the existing TWT agreement, flow_id should be an existing one. The value range is [0, 7]. */ + // uint16_t wake_invl_expn : 5; /**< Individual TWT Wake Interval Exponent. The value range is [0, 31]. */ + // uint16_t wake_duration_unit : 1; /**< Individual TWT Wake duration unit, 0: 256us 1: TU (TU = 1024us)*/ + // uint16_t reserved : 5; /**< bit: 11.15 reserved */ + uint32 bitmask_1 = 2; + uint32 min_wake_dura = 3; + uint32 wake_invl_mant = 4; + uint32 twt_id = 5; + uint32 timeout_time_ms = 6; +} + +message wifi_twt_config { + bool post_wakeup_event = 1; /**< post twt wakeup event */ + bool twt_enable_keep_alive = 2; /**< twt enable send qos null to keep alive */ +} + +/* internal supporting structures for Rpc */ +//message ScanResult { +// bytes bssid = 1; +// bytes ssid = 2; +// uint32 chnl = 3; +// int32 rssi = 4; +// int32 sec_prot = 5; +//} + +message ConnectedSTAList { + bytes mac = 1; + int32 rssi = 2; +} + +message eap_fast_config { + int32 fast_provisioning = 1; // Enable or disable Fast Provisioning in EAP-FAST (0 = disabled, 1 = enabled) + int32 fast_max_pac_list_len = 2; // Maximum length of the PAC (Protected Access Credential) list + bool fast_pac_format_binary = 3; // Set to true for binary format PAC, false for ASCII format PAC +} + +/* Control path structures */ +/** Req/Resp structure **/ +message Rpc_Req_GetMacAddress { + int32 mode = 1; +} + +message Rpc_Resp_GetMacAddress { + bytes mac = 1; + int32 resp = 2; +} + +message Rpc_Req_GetMode { +} + +message Rpc_Resp_GetMode { + int32 mode = 1; + int32 resp = 2; +} + +message Rpc_Req_SetMode { + int32 mode = 1; +} + +message Rpc_Resp_SetMode { + int32 resp = 1; +} + +message Rpc_Req_GetPs { +} + +message Rpc_Resp_GetPs { + int32 resp = 1; + int32 type = 2; +} + +message Rpc_Req_SetPs { + int32 type = 1; +} + +message Rpc_Resp_SetPs { + int32 resp = 1; +} + +message Rpc_Req_SetMacAddress { + bytes mac = 1; + int32 mode = 2; +} + +message Rpc_Resp_SetMacAddress { + int32 resp = 1; +} + +message Rpc_Req_OTABegin { +} + +message Rpc_Resp_OTABegin { + int32 resp = 1; +} + +message Rpc_Req_OTAWrite { + bytes ota_data = 1; +} + +message Rpc_Resp_OTAWrite { + int32 resp = 1; +} + +message Rpc_Req_OTAEnd { +} + +message Rpc_Resp_OTAEnd { + int32 resp = 1; +} + +message Rpc_Req_OTAActivate { +} + +message Rpc_Resp_OTAActivate { + int32 resp = 1; +} + +message Rpc_Req_WifiSetMaxTxPower { + int32 power = 1; +} + +message Rpc_Resp_WifiSetMaxTxPower { + int32 resp = 1; +} + +message Rpc_Req_WifiGetMaxTxPower { +} + +message Rpc_Resp_WifiGetMaxTxPower { + int32 power = 1; + int32 resp = 2; +} + +message Rpc_Req_ConfigHeartbeat { + bool enable = 1; + int32 duration = 2; +} + +message Rpc_Resp_ConfigHeartbeat { + int32 resp = 1; +} + +message Rpc_Req_WifiInit { + wifi_init_config cfg = 1; +} + +message Rpc_Resp_WifiInit { + int32 resp = 1; +} + +message Rpc_Req_WifiDeinit { +} + +message Rpc_Resp_WifiDeinit { + int32 resp = 1; +} + +message Rpc_Req_WifiSetConfig { + int32 iface = 1; + wifi_config cfg = 2; +} + +message Rpc_Resp_WifiSetConfig { + int32 resp = 1; +} + +message Rpc_Req_WifiGetConfig { + int32 iface = 1; +} + +message Rpc_Resp_WifiGetConfig { + int32 resp = 1; + int32 iface = 2; + wifi_config cfg = 3; +} + +message Rpc_Req_WifiConnect { +} + +message Rpc_Resp_WifiConnect { + int32 resp = 1; +} + +message Rpc_Req_WifiDisconnect { +} + +message Rpc_Resp_WifiDisconnect { + int32 resp = 1; +} + +message Rpc_Req_WifiStart { +} + +message Rpc_Resp_WifiStart { + int32 resp = 1; +} + +message Rpc_Req_WifiStop { +} + +message Rpc_Resp_WifiStop { + int32 resp = 1; +} + +message Rpc_Req_WifiScanStart { + wifi_scan_config config = 1; + bool block = 2; + int32 config_set = 3; +} + +message Rpc_Resp_WifiScanStart { + int32 resp = 1; +} + +message Rpc_Req_WifiScanStop { +} + +message Rpc_Resp_WifiScanStop { + int32 resp = 1; +} + +message Rpc_Req_WifiScanGetApNum { +} + +message Rpc_Resp_WifiScanGetApNum { + int32 resp = 1; + int32 number = 2; +} + +message Rpc_Req_WifiScanGetApRecords { + int32 number = 1; +} + +message Rpc_Resp_WifiScanGetApRecords { + int32 resp = 1; + int32 number = 2; + repeated wifi_ap_record ap_records = 3; +} + +message Rpc_Req_WifiScanGetApRecord { +} + +message Rpc_Resp_WifiScanGetApRecord { + int32 resp = 1; + wifi_ap_record ap_record = 2; +} + +message Rpc_Req_WifiClearApList { +} + +message Rpc_Resp_WifiClearApList { + int32 resp = 1; +} + +message Rpc_Req_WifiRestore { +} + +message Rpc_Resp_WifiRestore { + int32 resp = 1; +} + +message Rpc_Req_WifiClearFastConnect{ +} + +message Rpc_Resp_WifiClearFastConnect { + int32 resp = 1; +} + +message Rpc_Req_WifiDeauthSta { + int32 aid = 1; +} + +message Rpc_Resp_WifiDeauthSta { + int32 resp = 1; + int32 aid = 2; +} + +message Rpc_Req_WifiStaGetApInfo { +} + +message Rpc_Resp_WifiStaGetApInfo { + int32 resp = 1; + wifi_ap_record ap_record = 2; +} + +message Rpc_Req_WifiSetProtocol { + int32 ifx = 1; + int32 protocol_bitmap = 2; +} + +message Rpc_Resp_WifiSetProtocol { + int32 resp = 1; +} + +message Rpc_Req_WifiGetProtocol { + int32 ifx = 1; +} + +message Rpc_Resp_WifiGetProtocol { + int32 resp = 1; + int32 protocol_bitmap = 2; +} + +message Rpc_Req_WifiSetBandwidth { + int32 ifx = 1; + int32 bw = 2; +} + +message Rpc_Resp_WifiSetBandwidth { + int32 resp = 1; +} + +message Rpc_Req_WifiGetBandwidth { + int32 ifx = 1; +} + +message Rpc_Resp_WifiGetBandwidth { + int32 resp = 1; + int32 bw = 2; +} + +message Rpc_Req_WifiSetChannel { + int32 primary = 1; + int32 second = 2; +} + +message Rpc_Resp_WifiSetChannel { + int32 resp = 1; +} + +message Rpc_Req_WifiGetChannel { +} + +message Rpc_Resp_WifiGetChannel { + int32 resp = 1; + int32 primary = 2; + int32 second = 3; +} + +message Rpc_Req_WifiSetStorage { + int32 storage = 1; +} + +message Rpc_Resp_WifiSetStorage { + int32 resp = 1; +} + +message Rpc_Req_WifiSetCountryCode { + bytes country = 1; + bool ieee80211d_enabled = 2; +} + +message Rpc_Resp_WifiSetCountryCode { + int32 resp = 1; +} + +message Rpc_Req_WifiGetCountryCode { +} + +message Rpc_Resp_WifiGetCountryCode { + int32 resp = 1; + bytes country = 2; +} + +message Rpc_Req_WifiSetCountry { + wifi_country country = 1; +} + +message Rpc_Resp_WifiSetCountry { + int32 resp = 1; +} + +message Rpc_Req_WifiGetCountry { +} + +message Rpc_Resp_WifiGetCountry { + int32 resp = 1; + wifi_country country = 2; +} + +message Rpc_Req_WifiApGetStaList { +} + +message Rpc_Resp_WifiApGetStaList { + int32 resp = 1; + wifi_sta_list sta_list = 2; +} + +message Rpc_Req_WifiApGetStaAid { + bytes mac = 1; +} + +message Rpc_Req_WifiStaGetNegotiatedPhymode { +} + +message Rpc_Resp_WifiStaGetNegotiatedPhymode { + int32 resp = 1; + uint32 phymode = 2; +} + +message Rpc_Resp_WifiApGetStaAid { + int32 resp = 1; + uint32 aid = 2; +} + +message Rpc_Req_WifiStaGetRssi { +} + +message Rpc_Resp_WifiStaGetRssi { + int32 resp = 1; + int32 rssi = 2; +} + +message Rpc_Req_WifiStaGetAid { +} + +message Rpc_Resp_WifiStaGetAid { + int32 resp = 1; + uint32 aid = 2; +} + +message Rpc_Req_WifiSetProtocols { + int32 ifx = 1; + wifi_protocols protocols = 2; +} + +message Rpc_Resp_WifiSetProtocols { + int32 resp = 1; + uint32 ifx = 2; +} + +message Rpc_Req_WifiGetProtocols { + int32 ifx = 1; +} + +message Rpc_Resp_WifiGetProtocols { + int32 resp = 1; + int32 ifx = 2; + wifi_protocols protocols = 3; +} + +message Rpc_Req_WifiSetBandwidths { + int32 ifx = 1; + wifi_bandwidths bandwidths = 2; +} + +message Rpc_Resp_WifiSetBandwidths { + int32 resp = 1; + int32 ifx = 2; +} + +message Rpc_Req_WifiGetBandwidths { + int32 ifx = 1; +} + +message Rpc_Resp_WifiGetBandwidths { + int32 resp = 1; + int32 ifx = 2; + wifi_bandwidths bandwidths = 3; +} + +message Rpc_Req_WifiSetBand { + uint32 band = 1; +} + +message Rpc_Resp_WifiSetBand { + int32 resp = 1; +} + +message Rpc_Req_WifiGetBand { +} + +message Rpc_Resp_WifiGetBand { + int32 resp = 1; + uint32 band = 2; +} + +message Rpc_Req_WifiSetBandMode { + uint32 bandmode = 1; +} + +message Rpc_Resp_WifiSetBandMode { + int32 resp = 1; +} + +message Rpc_Req_WifiGetBandMode { +} + +message Rpc_Resp_WifiGetBandMode { + int32 resp = 1; + uint32 bandmode = 2; +} + +message Rpc_Req_WifiSetInactiveTime { + uint32 ifx = 1; + uint32 sec = 2; +} + +message Rpc_Resp_WifiSetInactiveTime { + int32 resp = 1; +} + +message Rpc_Req_WifiGetInactiveTime { + uint32 ifx = 1; +} + +message Rpc_Resp_WifiGetInactiveTime { + int32 resp = 1; + uint32 sec = 2; +} + +message Rpc_Req_WifiStaItwtSetup { + wifi_itwt_setup_config setup_config = 1; +} + +message Rpc_Resp_WifiStaItwtSetup { + int32 resp = 1; +} + +message Rpc_Req_WifiStaItwtTeardown { + int32 flow_id = 1; +} + +message Rpc_Resp_WifiStaItwtTeardown { + int32 resp = 1; +} + +message Rpc_Req_WifiStaItwtSuspend { + int32 flow_id = 1; + int32 suspend_time_ms = 2; +} + +message Rpc_Resp_WifiStaItwtSuspend { + int32 resp = 1; +} + +message Rpc_Req_WifiStaItwtGetFlowIdStatus { +} + +message Rpc_Resp_WifiStaItwtGetFlowIdStatus { + int32 resp = 1; + int32 flow_id_bitmap = 2; +} + +message Rpc_Req_WifiStaItwtSendProbeReq { + int32 timeout_ms = 1; +} + +message Rpc_Resp_WifiStaItwtSendProbeReq { + int32 resp = 1; +} + +message Rpc_Req_WifiStaItwtSetTargetWakeTimeOffset { + int32 offset_us = 1; +} + +message Rpc_Resp_WifiStaItwtSetTargetWakeTimeOffset { + int32 resp = 1; +} + +message Rpc_Req_WifiStaTwtConfig { + wifi_twt_config config = 1; +} + +message Rpc_Resp_WifiStaTwtConfig { + int32 resp = 1; +} + +message Rpc_Req_GetCoprocessorFwVersion { +} + +message Rpc_Resp_GetCoprocessorFwVersion { + int32 resp = 1; + uint32 major1 = 2; + uint32 minor1 = 3; + uint32 patch1 = 4; +} + +message Rpc_Req_SetDhcpDnsStatus { + int32 iface = 1; + int32 net_link_up = 2; + + int32 dhcp_up = 3; + bytes dhcp_ip = 4; + bytes dhcp_nm = 5; + bytes dhcp_gw = 6; + + int32 dns_up = 7; + bytes dns_ip = 8; + int32 dns_type = 9; +} + +message Rpc_Resp_SetDhcpDnsStatus { + int32 resp = 1; +} + +message Rpc_Req_GetDhcpDnsStatus { + int32 iface = 1; +} + +message Rpc_Resp_GetDhcpDnsStatus { + int32 iface = 1; + int32 net_link_up = 2; + + int32 dhcp_up = 3; + bytes dhcp_ip = 4; + bytes dhcp_nm = 5; + bytes dhcp_gw = 6; + + int32 dns_up = 7; + bytes dns_ip = 8; + int32 dns_type = 9; + int32 resp = 10; +} + +message Rpc_Req_SuppDppInit { + bool cb = 1; // enables sending of Event_SuppDpp to host via callback +} + +message Rpc_Resp_SuppDppInit { + int32 resp = 1; +} + +message Rpc_Req_SuppDppDeinit { +} + +message Rpc_Resp_SuppDppDeinit { + int32 resp = 1; +} + +message Rpc_Req_SuppDppBootstrapGen { + bytes chan_list = 1; // DPP Bootstrapping listen channels separated by commas + int32 type = 2; // Bootstrap method type, only QR Code method is supported for now. + bytes key = 3; // (Optional) 32 byte Raw Private Key for generating a Bootstrapping Public Key + bytes info = 4; // (Optional) Ancillary Device Information like Serial Number +} + +message Rpc_Resp_SuppDppBootstrapGen { + int32 resp = 1; +} + +message Rpc_Req_SuppDppStartListen { +} + +message Rpc_Resp_SuppDppStartListen { + int32 resp = 1; +} + +message Rpc_Req_SuppDppStopListen { +} + +message Rpc_Resp_SuppDppStopListen { + int32 resp = 1; +} + +message Rpc_Req_IfaceMacAddrSetGet { + bool set = 1; + uint32 type = 2; + bytes mac = 3; // only valid for set +}; + +message Rpc_Resp_IfaceMacAddrSetGet { + int32 resp = 1; + bool set = 2; + uint32 type = 3; + bytes mac = 4; +}; + +message Rpc_Req_IfaceMacAddrLenGet { + uint32 type = 1; +}; + +message Rpc_Resp_IfaceMacAddrLenGet { + int32 resp = 1; + uint32 type = 2; + uint32 len = 3; +}; + +message Rpc_Req_FeatureControl { + RpcFeature feature = 1; + RpcFeatureCommand command = 2; + RpcFeatureOption option = 3; +}; + +message Rpc_Resp_FeatureControl { + int32 resp = 1; + RpcFeature feature = 2; + RpcFeatureCommand command = 3; + RpcFeatureOption option = 4; +}; + +/** Event structure **/ + +message Rpc_Event_WifiEventNoArgs { + int32 resp = 1; + int32 event_id = 2; +} + +message Rpc_Event_ESPInit { + bytes init_data = 1; +} + +message Rpc_Event_Heartbeat { + int32 hb_num = 1; +} + +message Rpc_Event_AP_StaDisconnected { + int32 resp = 1; + bytes mac = 2; + uint32 aid = 3; + bool is_mesh_child = 4; + uint32 reason = 5; +} + +message Rpc_Event_AP_StaConnected { + int32 resp = 1; + bytes mac = 2; + uint32 aid = 3; + bool is_mesh_child = 4; +} + +message Rpc_Event_StaScanDone { + int32 resp = 1; + wifi_event_sta_scan_done scan_done = 2; +} + +message Rpc_Event_StaConnected { + int32 resp = 1; + wifi_event_sta_connected sta_connected = 2; +} + +message Rpc_Event_StaDisconnected { + int32 resp = 1; + wifi_event_sta_disconnected sta_disconnected = 2; +} + +message Rpc_Event_DhcpDnsStatus { + int32 iface = 1; + int32 net_link_up = 2; + + int32 dhcp_up = 3; + bytes dhcp_ip = 4; + bytes dhcp_nm = 5; + bytes dhcp_gw = 6; + + int32 dns_up = 7; + bytes dns_ip = 8; + int32 dns_type = 9; + int32 resp = 10; +} + +message Rpc_Event_StaItwtSetup { + int32 resp = 1; + wifi_itwt_setup_config config = 2; + int32 status = 3; + uint32 reason = 4; + uint64 target_wake_time = 5; +} + +message Rpc_Event_StaItwtTeardown { + int32 resp = 1; + uint32 flow_id = 2; + uint32 status = 3; +} + +message Rpc_Event_StaItwtSuspend { + int32 resp = 1; + int32 status = 2; + uint32 flow_id_bitmap = 3; + repeated uint32 actual_suspend_time_ms = 4; // represents uint32_t actual_suspend_time_ms[] +} + +message Rpc_Event_StaItwtProbe { + int32 resp = 1; + int32 status = 2; + uint32 reason = 3; +} + +message Rpc_Req_WifiStaEnterpriseEnable { +} + +message Rpc_Resp_WifiStaEnterpriseEnable { + int32 resp = 1; +} + +message Rpc_Req_WifiStaEnterpriseDisable { +} + +message Rpc_Resp_WifiStaEnterpriseDisable { + int32 resp = 1; +} + +message Rpc_Req_EapSetIdentity { + bytes identity = 1; + int32 len = 2; +} + +message Rpc_Resp_EapSetIdentity { + int32 resp = 1; +} + +message Rpc_Req_EapClearIdentity { +} + +message Rpc_Resp_EapClearIdentity { + int32 resp = 1; +} + +message Rpc_Req_EapSetUsername { + bytes username = 1; + int32 len = 2; +} + +message Rpc_Resp_EapSetUsername { + int32 resp = 1; +} + +message Rpc_Req_EapClearUsername { +} + +message Rpc_Resp_EapClearUsername { + int32 resp = 1; +} + +message Rpc_Req_EapSetPassword { + bytes password = 1; + int32 len = 2; +} + +message Rpc_Resp_EapSetPassword { + int32 resp = 1; +} + +message Rpc_Req_EapClearPassword { +} + +message Rpc_Resp_EapClearPassword { + int32 resp = 1; +} + +message Rpc_Req_EapSetNewPassword { + bytes new_password = 1; + int32 len = 2; +} + +message Rpc_Resp_EapSetNewPassword { + int32 resp = 1; +} + +message Rpc_Req_EapClearNewPassword { +} + +message Rpc_Resp_EapClearNewPassword { + int32 resp = 1; +} + +message Rpc_Req_EapSetCaCert { + bytes ca_cert = 1; + int32 ca_cert_len = 2; +} + +message Rpc_Resp_EapSetCaCert { + int32 resp = 1; +} + +message Rpc_Req_EapClearCaCert { +} + +message Rpc_Resp_EapClearCaCert { + int32 resp = 1; +} + +message Rpc_Req_EapSetCertificateAndKey { + bytes client_cert = 1; + int32 client_cert_len = 2; + bytes private_key = 3; + int32 private_key_len = 4; + bytes private_key_password = 5; + int32 private_key_passwd_len = 6; +} + +message Rpc_Resp_EapSetCertificateAndKey { + int32 resp = 1; +} + +message Rpc_Req_EapClearCertificateAndKey { +} + +message Rpc_Resp_EapClearCertificateAndKey { + int32 resp = 1; +} + +message Rpc_Req_EapSetDisableTimeCheck { + bool disable = 1; +} + +message Rpc_Resp_EapSetDisableTimeCheck { + int32 resp = 1; +} + +message Rpc_Req_EapGetDisableTimeCheck { +} + +message Rpc_Resp_EapGetDisableTimeCheck { + int32 resp = 1; + bool disable = 2; +} + +message Rpc_Req_EapSetTtlsPhase2Method { + int32 type = 1; +} + +message Rpc_Resp_EapSetTtlsPhase2Method { + int32 resp = 1; +} + +message Rpc_Req_EapSetSuiteb192bitCertification { + bool enable = 1; +} + +message Rpc_Resp_EapSetSuiteb192bitCertification { + int32 resp = 1; +} + +message Rpc_Req_EapSetPacFile { + bytes pac_file = 1; + int32 pac_file_len = 2; +} + +message Rpc_Resp_EapSetPacFile { + int32 resp = 1; +} + +message Rpc_Req_EapSetFastParams { + eap_fast_config eap_fast_config = 1; +} + +message Rpc_Resp_EapSetFastParams { + int32 resp = 1; +} + +message Rpc_Req_EapUseDefaultCertBundle { + bool use_default_bundle = 1; +} + +message Rpc_Resp_EapUseDefaultCertBundle { + int32 resp = 1; +} + +message Rpc_Req_WifiSetOkcSupport { + bool enable = 1; +} + +message Rpc_Resp_WifiSetOkcSupport { + int32 resp = 1; +} + +message Rpc_Req_EapSetDomainName { + bytes domain_name = 1; +} + +message Rpc_Resp_EapSetDomainName { + int32 resp = 1; +} + +message Rpc_Req_EapSetEapMethods { + int32 methods = 1; +} + +message Rpc_Resp_EapSetEapMethods { + int32 resp = 1; +} + +message Rpc_Event_SuppDppUriReady { + int32 resp = 1; + bytes qrcode = 2; // QR Code to configure the enrollee +} + +message Rpc_Event_SuppDppCfgRecvd { + int32 resp = 1; + wifi_config cfg = 2; +} + +message Rpc_Event_SuppDppFail { + int32 resp = 1; + int32 reason = 2; // failure reason +} + +message Rpc_Event_WifiDppUriReady { + int32 resp = 1; + bytes qrcode = 2; // QR Code to configure the enrollee +} + +message Rpc_Event_WifiDppCfgRecvd { + int32 resp = 1; + wifi_config cfg = 2; +} + +message Rpc_Event_WifiDppFail { + int32 resp = 1; + int32 reason = 2; // failure reason +} + +enum Rpc_GpioMode { + GPIO_MODE_DISABLE = 0; + GPIO_MODE_INPUT = 1; + GPIO_MODE_OUTPUT = 2; + GPIO_MODE_INPUT_OUTPUT = 3; +} + +enum Rpc_GpioPullMode { + GPIO_PULL_NONE = 0; + GPIO_PULL_UP = 1; + GPIO_PULL_DOWN = 2; +} + +message Rpc_GpioConfig { + uint64 pin_bit_mask = 1; + Rpc_GpioMode mode = 2; + bool pull_up_en = 3; + bool pull_down_en = 4; + int32 intr_type = 5; +} + +message Rpc_Req_GpioConfig { + Rpc_GpioConfig config = 1; +} +message Rpc_Resp_GpioConfig { + int32 resp = 1; +} + +message Rpc_Req_GpioReset { + int32 gpio_num = 1; +} +message Rpc_Resp_GpioResetPin { + int32 resp = 1; +} + +message Rpc_Req_GpioSetLevel { + int32 gpio_num = 1; + uint32 level = 2; // 0 or 1 +} +message Rpc_Resp_GpioSetLevel { + int32 resp = 1; +} + +message Rpc_Req_GpioGetLevel { + int32 gpio_num = 1; +} +message Rpc_Resp_GpioGetLevel { + int32 resp = 1; + uint32 level = 2; +} + +message Rpc_Req_GpioSetDirection { + int32 gpio_num = 1; + Rpc_GpioMode mode = 2; +} +message Rpc_Resp_GpioSetDirection { + int32 resp = 1; +} + +message Rpc_Req_GpioInputEnable { + int32 gpio_num = 1; +} +message Rpc_Resp_GpioInputEnable { + int32 resp = 1; +} + +message Rpc_Req_GpioSetPullMode { + int32 gpio_num = 1; + Rpc_GpioPullMode pull = 2; +} +message Rpc_Resp_GpioSetPullMode { + int32 resp = 1; +} + +message Rpc { + /* msg_type could be req, resp or Event */ + RpcType msg_type = 1; + + /* msg id */ + RpcId msg_id = 2; + + /* UID of message */ + uint32 uid = 3; + + /* union of all msg ids */ + oneof payload { + /** Requests **/ + Rpc_Req_GetMacAddress req_get_mac_address = 257; + Rpc_Req_SetMacAddress req_set_mac_address = 258; + Rpc_Req_GetMode req_get_wifi_mode = 259; + Rpc_Req_SetMode req_set_wifi_mode = 260; + + Rpc_Req_SuppDppInit req_supp_dpp_init = 261; + Rpc_Req_SuppDppDeinit req_supp_dpp_deinit = 262; + Rpc_Req_SuppDppBootstrapGen req_supp_dpp_bootstrap_gen = 263; + Rpc_Req_SuppDppStartListen req_supp_dpp_start_listen = 264; + Rpc_Req_SuppDppStopListen req_supp_dpp_stop_listen = 265; + + //Rpc_Req_StartSoftAP req_start_softap = 267; + //Rpc_Req_SoftAPConnectedSTA req_softap_connected_stas_list = 268; + //Rpc_Req_GetStatus req_stop_softap = 269; + Rpc_Req_OTAActivate req_ota_activate = 266; + + Rpc_Req_SetPs req_wifi_set_ps = 270; + Rpc_Req_GetPs req_wifi_get_ps = 271; + + Rpc_Req_OTABegin req_ota_begin = 272; + Rpc_Req_OTAWrite req_ota_write = 273; + Rpc_Req_OTAEnd req_ota_end = 274; + + Rpc_Req_WifiSetMaxTxPower req_set_wifi_max_tx_power = 275; + Rpc_Req_WifiGetMaxTxPower req_get_wifi_max_tx_power = 276; + Rpc_Req_ConfigHeartbeat req_config_heartbeat = 277; + + Rpc_Req_WifiInit req_wifi_init = 278; + Rpc_Req_WifiDeinit req_wifi_deinit = 279; + Rpc_Req_WifiStart req_wifi_start = 280; + Rpc_Req_WifiStop req_wifi_stop = 281; + Rpc_Req_WifiConnect req_wifi_connect = 282; + Rpc_Req_WifiDisconnect req_wifi_disconnect = 283; + Rpc_Req_WifiSetConfig req_wifi_set_config = 284; + Rpc_Req_WifiGetConfig req_wifi_get_config = 285; + + Rpc_Req_WifiScanStart req_wifi_scan_start = 286; + Rpc_Req_WifiScanStop req_wifi_scan_stop = 287; + Rpc_Req_WifiScanGetApNum req_wifi_scan_get_ap_num = 288; + Rpc_Req_WifiScanGetApRecords req_wifi_scan_get_ap_records = 289; + Rpc_Req_WifiClearApList req_wifi_clear_ap_list = 290; + + Rpc_Req_WifiRestore req_wifi_restore = 291; + Rpc_Req_WifiClearFastConnect req_wifi_clear_fast_connect = 292; + Rpc_Req_WifiDeauthSta req_wifi_deauth_sta = 293; + Rpc_Req_WifiStaGetApInfo req_wifi_sta_get_ap_info = 294; + + Rpc_Req_WifiSetProtocol req_wifi_set_protocol = 297; + Rpc_Req_WifiGetProtocol req_wifi_get_protocol = 298; + Rpc_Req_WifiSetBandwidth req_wifi_set_bandwidth = 299; + Rpc_Req_WifiGetBandwidth req_wifi_get_bandwidth = 300; + Rpc_Req_WifiSetChannel req_wifi_set_channel = 301; + Rpc_Req_WifiGetChannel req_wifi_get_channel = 302; + Rpc_Req_WifiSetCountry req_wifi_set_country = 303; + Rpc_Req_WifiGetCountry req_wifi_get_country = 304; + + Rpc_Req_WifiApGetStaList req_wifi_ap_get_sta_list = 311; + Rpc_Req_WifiApGetStaAid req_wifi_ap_get_sta_aid = 312; + Rpc_Req_WifiSetStorage req_wifi_set_storage = 313; + + Rpc_Req_WifiSetInactiveTime req_wifi_set_inactive_time = 325; + Rpc_Req_WifiGetInactiveTime req_wifi_get_inactive_time = 326; + + Rpc_Req_WifiSetCountryCode req_wifi_set_country_code = 334; + Rpc_Req_WifiGetCountryCode req_wifi_get_country_code = 335; + Rpc_Req_WifiStaGetAid req_wifi_sta_get_aid = 338; + Rpc_Req_WifiStaGetNegotiatedPhymode req_wifi_sta_get_negotiated_phymode = 339; + + Rpc_Req_WifiStaGetRssi req_wifi_sta_get_rssi = 341; + + Rpc_Req_WifiSetProtocols req_wifi_set_protocols = 342; + Rpc_Req_WifiGetProtocols req_wifi_get_protocols = 343; + Rpc_Req_WifiSetBandwidths req_wifi_set_bandwidths = 344; + Rpc_Req_WifiGetBandwidths req_wifi_get_bandwidths = 345; + + Rpc_Req_WifiSetBand req_wifi_set_band = 346; + Rpc_Req_WifiGetBand req_wifi_get_band = 347; + Rpc_Req_WifiSetBandMode req_wifi_set_bandmode = 348; + Rpc_Req_WifiGetBandMode req_wifi_get_bandmode = 349; + + Rpc_Req_GetCoprocessorFwVersion req_get_coprocessor_fwversion = 350; + + Rpc_Req_WifiScanGetApRecord req_wifi_scan_get_ap_record = 351; + + Rpc_Req_SetDhcpDnsStatus req_set_dhcp_dns = 352; + Rpc_Req_GetDhcpDnsStatus req_get_dhcp_dns = 353; + + Rpc_Req_WifiStaTwtConfig req_wifi_sta_twt_config = 354; + Rpc_Req_WifiStaItwtSetup req_wifi_sta_itwt_setup = 355; + Rpc_Req_WifiStaItwtTeardown req_wifi_sta_itwt_teardown = 356; + Rpc_Req_WifiStaItwtSuspend req_wifi_sta_itwt_suspend = 357; + Rpc_Req_WifiStaItwtGetFlowIdStatus req_wifi_sta_itwt_get_flow_id_status = 358; + Rpc_Req_WifiStaItwtSendProbeReq req_wifi_sta_itwt_send_probe_req = 359; + Rpc_Req_WifiStaItwtSetTargetWakeTimeOffset req_wifi_sta_itwt_set_target_wake_time_offset = 360; + + Rpc_Req_WifiStaEnterpriseEnable req_wifi_sta_enterprise_enable = 361; + Rpc_Req_WifiStaEnterpriseDisable req_wifi_sta_enterprise_disable = 362; + Rpc_Req_EapSetIdentity req_eap_set_identity = 363; + Rpc_Req_EapClearIdentity req_eap_clear_identity = 364; + Rpc_Req_EapSetUsername req_eap_set_username = 365; + Rpc_Req_EapClearUsername req_eap_clear_username = 366; + Rpc_Req_EapSetPassword req_eap_set_password = 367; + Rpc_Req_EapClearPassword req_eap_clear_password = 368; + Rpc_Req_EapSetNewPassword req_eap_set_new_password = 369; + Rpc_Req_EapClearNewPassword req_eap_clear_new_password = 370; + Rpc_Req_EapSetCaCert req_eap_set_ca_cert = 371; + Rpc_Req_EapClearCaCert req_eap_clear_ca_cert = 372; + Rpc_Req_EapSetCertificateAndKey req_eap_set_certificate_and_key = 373; + Rpc_Req_EapClearCertificateAndKey req_eap_clear_certificate_and_key = 374; + Rpc_Req_EapGetDisableTimeCheck req_eap_get_disable_time_check = 375; + Rpc_Req_EapSetTtlsPhase2Method req_eap_set_ttls_phase2_method = 376; + Rpc_Req_EapSetSuiteb192bitCertification req_eap_set_suiteb_certification = 377; + Rpc_Req_EapSetPacFile req_eap_set_pac_file = 378; + Rpc_Req_EapSetFastParams req_eap_set_fast_params = 379; + Rpc_Req_EapUseDefaultCertBundle req_eap_use_default_cert_bundle = 380; + Rpc_Req_WifiSetOkcSupport req_wifi_set_okc_support = 381; + Rpc_Req_EapSetDomainName req_eap_set_domain_name = 382; + Rpc_Req_EapSetDisableTimeCheck req_eap_set_disable_time_check = 383; + Rpc_Req_EapSetEapMethods req_eap_set_eap_methods = 384; + + Rpc_Req_IfaceMacAddrSetGet req_iface_mac_addr_set_get = 385; + Rpc_Req_IfaceMacAddrLenGet req_iface_mac_addr_len_get = 386; + + Rpc_Req_FeatureControl req_feature_control = 387; + + Rpc_Req_GpioConfig req_gpio_config = 388; + Rpc_Req_GpioReset req_gpio_reset = 389; + Rpc_Req_GpioSetLevel req_gpio_set_level = 390; + Rpc_Req_GpioGetLevel req_gpio_get_level = 391; + Rpc_Req_GpioSetDirection req_gpio_set_direction = 392; + Rpc_Req_GpioInputEnable req_gpio_input_enable = 393; + Rpc_Req_GpioSetPullMode req_gpio_set_pull_mode = 394; + + /** Responses **/ + Rpc_Resp_GetMacAddress resp_get_mac_address = 513; + Rpc_Resp_SetMacAddress resp_set_mac_address = 514; + Rpc_Resp_GetMode resp_get_wifi_mode = 515; + Rpc_Resp_SetMode resp_set_wifi_mode = 516; + + Rpc_Resp_SuppDppInit resp_supp_dpp_init = 517; + Rpc_Resp_SuppDppDeinit resp_supp_dpp_deinit = 518; + Rpc_Resp_SuppDppBootstrapGen resp_supp_dpp_bootstrap_gen = 519; + Rpc_Resp_SuppDppStartListen resp_supp_dpp_start_listen = 520; + Rpc_Resp_SuppDppStopListen resp_supp_dpp_stop_listen = 521; + + //Rpc_Resp_SetSoftAPVendorSpecificIE resp_set_softap_vendor_specific_ie = 522; + //Rpc_Resp_StartSoftAP resp_start_softap = 523; + //Rpc_Resp_SoftAPConnectedSTA resp_softap_connected_stas_list = 524; + //Rpc_Resp_GetStatus resp_stop_softap = 525; + Rpc_Resp_OTAActivate resp_ota_activate = 522; + + Rpc_Resp_SetPs resp_wifi_set_ps = 526; + Rpc_Resp_GetPs resp_wifi_get_ps = 527; + + Rpc_Resp_OTABegin resp_ota_begin = 528; + Rpc_Resp_OTAWrite resp_ota_write = 529; + Rpc_Resp_OTAEnd resp_ota_end = 530; + Rpc_Resp_WifiSetMaxTxPower resp_set_wifi_max_tx_power = 531; + Rpc_Resp_WifiGetMaxTxPower resp_get_wifi_max_tx_power = 532; + Rpc_Resp_ConfigHeartbeat resp_config_heartbeat = 533; + + Rpc_Resp_WifiInit resp_wifi_init = 534; + Rpc_Resp_WifiDeinit resp_wifi_deinit = 535; + Rpc_Resp_WifiStart resp_wifi_start = 536; + Rpc_Resp_WifiStop resp_wifi_stop = 537; + Rpc_Resp_WifiConnect resp_wifi_connect = 538; + Rpc_Resp_WifiDisconnect resp_wifi_disconnect = 539; + Rpc_Resp_WifiSetConfig resp_wifi_set_config = 540; + Rpc_Resp_WifiGetConfig resp_wifi_get_config = 541; + + Rpc_Resp_WifiScanStart resp_wifi_scan_start = 542; + Rpc_Resp_WifiScanStop resp_wifi_scan_stop = 543; + Rpc_Resp_WifiScanGetApNum resp_wifi_scan_get_ap_num = 544; + Rpc_Resp_WifiScanGetApRecords resp_wifi_scan_get_ap_records = 545; + Rpc_Resp_WifiClearApList resp_wifi_clear_ap_list = 546; + + Rpc_Resp_WifiRestore resp_wifi_restore = 547; + Rpc_Resp_WifiClearFastConnect resp_wifi_clear_fast_connect = 548; + Rpc_Resp_WifiDeauthSta resp_wifi_deauth_sta = 549; + Rpc_Resp_WifiStaGetApInfo resp_wifi_sta_get_ap_info = 550; + + Rpc_Resp_WifiSetProtocol resp_wifi_set_protocol = 553; + Rpc_Resp_WifiGetProtocol resp_wifi_get_protocol = 554; + Rpc_Resp_WifiSetBandwidth resp_wifi_set_bandwidth = 555; + Rpc_Resp_WifiGetBandwidth resp_wifi_get_bandwidth = 556; + Rpc_Resp_WifiSetChannel resp_wifi_set_channel = 557; + Rpc_Resp_WifiGetChannel resp_wifi_get_channel = 558; + Rpc_Resp_WifiSetCountry resp_wifi_set_country = 559; + Rpc_Resp_WifiGetCountry resp_wifi_get_country = 560; + + Rpc_Resp_WifiApGetStaList resp_wifi_ap_get_sta_list = 567; + Rpc_Resp_WifiApGetStaAid resp_wifi_ap_get_sta_aid = 568; + Rpc_Resp_WifiSetStorage resp_wifi_set_storage = 569; + + Rpc_Resp_WifiSetInactiveTime resp_wifi_set_inactive_time = 581; + Rpc_Resp_WifiGetInactiveTime resp_wifi_get_inactive_time = 582; + + Rpc_Resp_WifiSetCountryCode resp_wifi_set_country_code = 590; + Rpc_Resp_WifiGetCountryCode resp_wifi_get_country_code = 591; + Rpc_Resp_WifiStaGetAid resp_wifi_sta_get_aid = 594; + Rpc_Resp_WifiStaGetNegotiatedPhymode resp_wifi_sta_get_negotiated_phymode = 595; + + Rpc_Resp_WifiStaGetRssi resp_wifi_sta_get_rssi = 597; + + Rpc_Resp_WifiSetProtocols resp_wifi_set_protocols = 598; + Rpc_Resp_WifiGetProtocols resp_wifi_get_protocols = 599; + Rpc_Resp_WifiSetBandwidths resp_wifi_set_bandwidths = 600; + Rpc_Resp_WifiGetBandwidths resp_wifi_get_bandwidths = 601; + + Rpc_Resp_WifiSetBand resp_wifi_set_band = 602; + Rpc_Resp_WifiGetBand resp_wifi_get_band = 603; + Rpc_Resp_WifiSetBandMode resp_wifi_set_bandmode = 604; + Rpc_Resp_WifiGetBandMode resp_wifi_get_bandmode = 605; + + Rpc_Resp_GetCoprocessorFwVersion resp_get_coprocessor_fwversion = 606; + + Rpc_Resp_WifiScanGetApRecord resp_wifi_scan_get_ap_record = 607; + + Rpc_Resp_SetDhcpDnsStatus resp_set_dhcp_dns = 608; + Rpc_Resp_GetDhcpDnsStatus resp_get_dhcp_dns = 609; + + Rpc_Resp_WifiStaTwtConfig resp_wifi_sta_twt_config = 610; + Rpc_Resp_WifiStaItwtSetup resp_wifi_sta_itwt_setup = 611; + Rpc_Resp_WifiStaItwtTeardown resp_wifi_sta_itwt_teardown = 612; + Rpc_Resp_WifiStaItwtSuspend resp_wifi_sta_itwt_suspend = 613; + Rpc_Resp_WifiStaItwtGetFlowIdStatus resp_wifi_sta_itwt_get_flow_id_status = 614; + Rpc_Resp_WifiStaItwtSendProbeReq resp_wifi_sta_itwt_send_probe_req = 615; + Rpc_Resp_WifiStaItwtSetTargetWakeTimeOffset resp_wifi_sta_itwt_set_target_wake_time_offset = 616; + + Rpc_Resp_WifiStaEnterpriseEnable resp_wifi_sta_enterprise_enable = 617; + Rpc_Resp_WifiStaEnterpriseDisable resp_wifi_sta_enterprise_disable = 618; + Rpc_Resp_EapSetIdentity resp_eap_set_identity = 619; + Rpc_Resp_EapClearIdentity resp_eap_clear_identity = 620; + Rpc_Resp_EapSetUsername resp_eap_set_username = 621; + Rpc_Resp_EapClearUsername resp_eap_clear_username = 622; + Rpc_Resp_EapSetPassword resp_eap_set_password = 623; + Rpc_Resp_EapClearPassword resp_eap_clear_password = 624; + Rpc_Resp_EapSetNewPassword resp_eap_set_new_password = 625; + Rpc_Resp_EapClearNewPassword resp_eap_clear_new_password = 626; + Rpc_Resp_EapSetCaCert resp_eap_set_ca_cert = 627; + Rpc_Resp_EapClearCaCert resp_eap_clear_ca_cert = 628; + Rpc_Resp_EapSetCertificateAndKey resp_eap_set_certificate_and_key = 629; + Rpc_Resp_EapClearCertificateAndKey resp_eap_clear_certificate_and_key = 630; + Rpc_Resp_EapGetDisableTimeCheck resp_eap_get_disable_time_check = 631; + Rpc_Resp_EapSetTtlsPhase2Method resp_eap_set_ttls_phase2_method = 632; + Rpc_Resp_EapSetSuiteb192bitCertification resp_eap_set_suiteb_certification = 633; + Rpc_Resp_EapSetPacFile resp_eap_set_pac_file = 634; + Rpc_Resp_EapSetFastParams resp_eap_set_fast_params = 635; + Rpc_Resp_EapUseDefaultCertBundle resp_eap_use_default_cert_bundle = 636; + Rpc_Resp_WifiSetOkcSupport resp_wifi_set_okc_support = 637; + Rpc_Resp_EapSetDomainName resp_eap_set_domain_name = 638; + Rpc_Resp_EapSetDisableTimeCheck resp_eap_set_disable_time_check = 639; + Rpc_Resp_EapSetEapMethods resp_eap_set_eap_methods = 640; + + Rpc_Resp_IfaceMacAddrSetGet resp_iface_mac_addr_set_get = 641; + Rpc_Resp_IfaceMacAddrLenGet resp_iface_mac_addr_len_get = 642; + + Rpc_Resp_FeatureControl resp_feature_control = 643; + + Rpc_Resp_GpioConfig resp_gpio_config = 644; + Rpc_Resp_GpioResetPin resp_gpio_reset = 645; + Rpc_Resp_GpioSetLevel resp_gpio_set_level = 646; + Rpc_Resp_GpioGetLevel resp_gpio_get_level = 647; + Rpc_Resp_GpioSetDirection resp_gpio_set_direction = 648; + Rpc_Resp_GpioInputEnable resp_gpio_input_enable = 649; + Rpc_Resp_GpioSetPullMode resp_gpio_set_pull_mode = 650; + + /** Notifications **/ + Rpc_Event_ESPInit event_esp_init = 769; + Rpc_Event_Heartbeat event_heartbeat = 770; + Rpc_Event_AP_StaConnected event_ap_sta_connected = 771; + Rpc_Event_AP_StaDisconnected event_ap_sta_disconnected = 772; + Rpc_Event_WifiEventNoArgs event_wifi_event_no_args = 773; + Rpc_Event_StaScanDone event_sta_scan_done = 774; + Rpc_Event_StaConnected event_sta_connected = 775; + Rpc_Event_StaDisconnected event_sta_disconnected = 776; + Rpc_Event_DhcpDnsStatus event_dhcp_dns = 777; + Rpc_Event_StaItwtSetup event_sta_itwt_setup = 778; + Rpc_Event_StaItwtTeardown event_sta_itwt_teardown = 779; + Rpc_Event_StaItwtSuspend event_sta_itwt_suspend = 780; + Rpc_Event_StaItwtProbe event_sta_itwt_probe = 781; + Rpc_Event_SuppDppUriReady event_supp_dpp_uri_ready = 782; + Rpc_Event_SuppDppCfgRecvd event_supp_dpp_cfg_recvd = 783; + Rpc_Event_SuppDppFail event_supp_dpp_fail = 784; + Rpc_Event_WifiDppUriReady event_wifi_dpp_uri_ready = 785; + Rpc_Event_WifiDppCfgRecvd event_wifi_dpp_cfg_recvd = 786; + Rpc_Event_WifiDppFail event_wifi_dpp_fail = 787; + } +} diff --git a/common/rpc/esp_hosted_bitmasks.h b/common/rpc/esp_hosted_bitmasks.h index 1a432950..c53473b5 100644 --- a/common/rpc/esp_hosted_bitmasks.h +++ b/common/rpc/esp_hosted_bitmasks.h @@ -6,29 +6,12 @@ #ifndef __ESP_HOSTED_BITMASKS__H #define __ESP_HOSTED_BITMASKS__H +#include "esp_idf_version.h" + #define H_SET_BIT(pos, val) (val|=(1<>STA_MAX_USED_BIT) - -#define WIFI_CONFIG_STA_SET_RESERVED_VAL(reserved_in,num_out) \ - (num_out|=(reserved_in << STA_MAX_USED_BIT)); - enum { WIFI_SCAN_AP_REC_phy_11b_BIT = 0, WIFI_SCAN_AP_REC_phy_11g_BIT = 1, @@ -46,10 +29,10 @@ enum { #define WIFI_SCAN_AP_RESERVED_BITMASK 0xFC00 #define WIFI_SCAN_AP_GET_RESERVED_VAL(num) \ - ((num&WIFI_SCAN_AP_RESERVED_BITMASK)>>WIFI_SCAN_AP_REC_MAX_USED_BIT) + ((num & WIFI_SCAN_AP_RESERVED_BITMASK) >> WIFI_SCAN_AP_REC_MAX_USED_BIT) #define WIFI_SCAN_AP_SET_RESERVED_VAL(reserved_in,num_out) \ - (num_out|=(reserved_in << WIFI_SCAN_AP_REC_MAX_USED_BIT)); + (num_out |= (reserved_in << WIFI_SCAN_AP_REC_MAX_USED_BIT)); enum { WIFI_STA_INFO_phy_11b_BIT = 0, @@ -64,10 +47,10 @@ enum { #define WIFI_STA_INFO_RESERVED_BITMASK 0xFFC0 #define WIFI_STA_INFO_GET_RESERVED_VAL(num) \ - ((num&WIFI_STA_INFO_RESERVED_BITMASK)>>WIFI_STA_INFO_MAX_USED_BIT) + ((num & WIFI_STA_INFO_RESERVED_BITMASK) >> WIFI_STA_INFO_MAX_USED_BIT) #define WIFI_STA_INFO_SET_RESERVED_VAL(reserved_in,num_out) \ - (num_out|=(reserved_in << WIFI_STA_INFO_MAX_USED_BIT)); + (num_out |= (reserved_in << WIFI_STA_INFO_MAX_USED_BIT)); /* WIFI HE AP Info bitmasks */ enum { @@ -79,27 +62,80 @@ enum { #define WIFI_HE_AP_INFO_BSS_COLOR_BITS 0x3F -/* WIFI HE Station Config bitmasks */ +/*** There are currently two set of bitfields in wifi_sta_config_t */ + +/* WIFI Station Config Bitfield 1 bitmasks */ enum { - WIFI_HE_STA_CONFIG_he_dcm_set_BIT = 0, - // WIFI_HE_STA_CONFIG_he_dcm_max_constellation_tx is two bits wide - WIFI_HE_STA_CONFIG_he_dcm_max_constellation_tx_BITS = 1, - // WIFI_HE_STA_CONFIG_he_dcm_max_constellation_rx is two bits wide - WIFI_HE_STA_CONFIG_he_dcm_max_constellation_rx_BITS = 3, - WIFI_HE_STA_CONFIG_he_mcs9_enabled_BIT = 5, - WIFI_HE_STA_CONFIG_he_su_beamformee_disabled_BIT = 6, - WIFI_HE_STA_CONFIG_he_trig_su_bmforming_feedback_disabled_BIT = 7, - WIFI_HE_STA_CONFIG_he_trig_mu_bmforming_partial_feedback_disabled_BIT = 8, - WIFI_HE_STA_CONFIG_he_trig_cqi_feedback_disabled_BIT = 9, - WIFI_HE_STA_CONFIG_MAX_USED_BIT = 10, + WIFI_STA_CONFIG_1_rm_enabled = 0, + WIFI_STA_CONFIG_1_btm_enabled = 1, + WIFI_STA_CONFIG_1_mbo_enabled = 2, + WIFI_STA_CONFIG_1_ft_enabled = 3, + WIFI_STA_CONFIG_1_owe_enabled = 4, + WIFI_STA_CONFIG_1_transition_disable = 5, + WIFI_STA_CONFIG_1_MAX_USED_BIT = 6, }; -#define WIFI_HE_STA_CONFIG_BITS 0xFC00 +#define WIFI_STA_CONFIG_1_RESERVED_BITMASK 0xFFFFFFC0 + +#define WIFI_STA_CONFIG_1_GET_RESERVED_VAL(num) \ + ((num & WIFI_STA_CONFIG_1_RESERVED_BITMASK) >> WIFI_STA_CONFIG_1_MAX_USED_BIT) -#define WIFI_HE_STA_GET_RESERVED_VAL(num) \ - ((num&WIFI_HE_STA_CONFIG_BITS)>>WIFI_HE_STA_CONFIG_MAX_USED_BIT) +#define WIFI_STA_CONFIG_1_SET_RESERVED_VAL(reserved_in, num_out) \ + (num_out |= (reserved_in << WIFI_STA_CONFIG_1_MAX_USED_BIT)); -#define WIFI_HE_STA_SET_RESERVED_VAL(reserved_in,num_out) \ - (num_out|=(reserved_in << WIFI_HE_STA_CONFIG_MAX_USED_BIT)); +/* WIFI Station Config Bitfield 2 bitmasks */ +enum { + WIFI_STA_CONFIG_2_he_dcm_set_BIT = 0, + // WIFI_STA_CONFIG_he_dcm_max_constellation_tx is two bits wide + WIFI_STA_CONFIG_2_he_dcm_max_constellation_tx_BITS = 1, + // WIFI_STA_CONFIG_he_dcm_max_constellation_rx is two bits wide + WIFI_STA_CONFIG_2_he_dcm_max_constellation_rx_BITS = 3, + WIFI_STA_CONFIG_2_he_mcs9_enabled_BIT = 5, + WIFI_STA_CONFIG_2_he_su_beamformee_disabled_BIT = 6, + WIFI_STA_CONFIG_2_he_trig_su_bmforming_feedback_disabled_BIT = 7, + WIFI_STA_CONFIG_2_he_trig_mu_bmforming_partial_feedback_disabled_BIT = 8, + WIFI_STA_CONFIG_2_he_trig_cqi_feedback_disabled_BIT = 9, +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 5, 0) + WIFI_STA_CONFIG_2_MAX_USED_BIT = 10, +#else + WIFI_STA_CONFIG_2_vht_su_beamformee_disabled = 10, + WIFI_STA_CONFIG_2_vht_mu_beamformee_disabled = 11, + WIFI_STA_CONFIG_2_vht_mcs8_enabled = 12, + WIFI_STA_CONFIG_2_MAX_USED_BIT = 13, +#endif +}; +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 5, 0) +#define WIFI_STA_CONFIG_2_RESERVED_BITMASK 0xFFFFFC00 +#else +#define WIFI_STA_CONFIG_2_RESERVED_BITMASK 0xFFFFE000 #endif + +#define WIFI_STA_CONFIG_2_GET_RESERVED_VAL(num) \ + ((num & WIFI_STA_CONFIG_2_RESERVED_BITMASK) >> WIFI_STA_CONFIG_2_MAX_USED_BIT) + +#define WIFI_STA_CONFIG_2_SET_RESERVED_VAL(reserved_in,num_out) \ + (num_out |= (reserved_in << WIFI_STA_CONFIG_2_MAX_USED_BIT)); + +#endif + +/* WIFI ITWT Setup Config bitmasks */ + +enum { + WIFI_ITWT_CONFIG_1_trigger_BIT = 0, + WIFI_ITWT_CONFIG_1_flow_type_BIT = 1, + // WIFI_ITWT_CONFIG_1_flow_id_BIT is three bits wide + WIFI_ITWT_CONFIG_1_flow_id_BIT = 2, + // WIFI_ITWT_CONFIG_1_wake_invl_expn_BIT is five bits wide + WIFI_ITWT_CONFIG_1_wake_invl_expn_BIT = 5, + WIFI_ITWT_CONFIG_1_wake_duration_unit_BIT = 10, + WIFI_ITWT_CONFIG_1_MAX_USED_BIT = 11, +}; + +#define WIFI_ITWT_CONFIG_1_RESERVED_BITMASK 0xFFFFF800 + +#define WIFI_ITWT_CONFIG_1_GET_RESERVED_VAL(num) \ + ((num & WIFI_ITWT_CONFIG_1_RESERVED_BITMASK) >> WIFI_ITWT_CONFIG_1_MAX_USED_BIT) + +#define WIFI_ITWT_CONFIG_1_SET_RESERVED_VAL(reserved_in,num_out) \ + (num_out |= (reserved_in << WIFI_ITWT_CONFIG_1_MAX_USED_BIT)); diff --git a/common/transport/esp_hosted_transport.h b/common/transport/esp_hosted_transport.h index 15615077..0fc612da 100644 --- a/common/transport/esp_hosted_transport.h +++ b/common/transport/esp_hosted_transport.h @@ -43,6 +43,8 @@ typedef enum { #define ESP_TRANSPORT_SPI_HD_MAX_BUF_SIZE 1600 #define ESP_TRANSPORT_UART_MAX_BUF_SIZE 1600 +#define MAX_FRAGMENTABLE_PAYLOAD_SIZE 8192 + struct esp_priv_event { uint8_t event_type; uint8_t event_len; diff --git a/common/transport/esp_hosted_transport_init.h b/common/transport/esp_hosted_transport_init.h index ef7e5867..aeb94524 100644 --- a/common/transport/esp_hosted_transport_init.h +++ b/common/transport/esp_hosted_transport_init.h @@ -1,5 +1,9 @@ -// Copyright 2025 Espressif Systems (Shanghai) PTE LTD -/* SPDX-License-Identifier: GPL-2.0-only OR Apache-2.0 */ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + /* Definitions used in ESP-Hosted Transport Initialization */ @@ -10,6 +14,8 @@ typedef enum { ESP_OPEN_DATA_PATH, ESP_CLOSE_DATA_PATH, ESP_RESET, + ESP_POWER_SAVE_ON, + ESP_POWER_SAVE_OFF, ESP_MAX_HOST_INTERRUPT, } ESP_HOST_INTERRUPT; @@ -55,6 +61,7 @@ typedef enum { ESP_PRIV_RX_Q_SIZE, ESP_PRIV_TX_Q_SIZE, ESP_PRIV_CAP_EXT, // extended capability (4 bytes) + ESP_PRIV_FIRMWARE_VERSION, } ESP_PRIV_TAG_TYPE; #endif diff --git a/common/utils/esp_hosted_cli.c b/common/utils/esp_hosted_cli.c new file mode 100644 index 00000000..1446ce87 --- /dev/null +++ b/common/utils/esp_hosted_cli.c @@ -0,0 +1,448 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + + +#include "esp_hosted_cli.h" +#include "sdkconfig.h" +#include "esp_idf_version.h" + +#include "esp_console.h" + +#ifdef CONFIG_ESP_HOSTED_ENABLED +#include "port_esp_hosted_host_config.h" +#include "esp_hosted_power_save.h" +#endif + +#ifdef H_ESP_HOSTED_CLI_ENABLED + +#include +#include +#include +#include + +#ifdef CONFIG_HEAP_TRACING + #include +#endif + + +#include +#include +#include +#include "lwip/sockets.h" + +/* This should be agnostic, later */ +#ifdef CONFIG_ESP_HOSTED_COPROCESSOR + #include "iperf.h" + #include "wifi_cmd.h" + #include "iperf_cmd.h" + #include "ping_cmd.h" +#endif + +static const char *TAG = "esp_cli"; + +static int task_dump_cli_handler(int argc, char *argv[]) +{ + /* Just to go to the next line */ + printf("\n"); +#ifndef CONFIG_FREERTOS_USE_TRACE_FACILITY + printf("%s: To use this utility enable: Component config > FreeRTOS > Kernel > configUSE_TRACEFACILITY\n", TAG); +#else + int num_of_tasks = uxTaskGetNumberOfTasks(); + TaskStatus_t *task_array = calloc(1, num_of_tasks * sizeof(TaskStatus_t)); + if (!task_array) { + ESP_LOGE(TAG, "Memory not allocated for task list."); + return 0; + } + num_of_tasks = uxTaskGetSystemState(task_array, num_of_tasks, NULL); + printf("\tName\tNumber\tPriority\tStackWaterMark\n"); + for (int i = 0; i < num_of_tasks; i++) { + printf("%16s\t%u\t%u\t%u\n", + task_array[i].pcTaskName, + (unsigned) task_array[i].xTaskNumber, + (unsigned) task_array[i].uxCurrentPriority, + (unsigned) task_array[i].usStackHighWaterMark); + } + free(task_array); +#endif + return 0; +} + +static int cpu_dump_cli_handler(int argc, char *argv[]) +{ + /* Just to go to the next line */ + printf("\n"); +#ifndef CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS + printf("%s: To use this utility enable: Component config > FreeRTOS > Kernel > configGENERATE_RUN_TIME_STATS\n", TAG); +#else + char *buf = calloc(1, 2 * 1024); + vTaskGetRunTimeStats(buf); + printf("%s: Run Time Stats:\n%s\n", TAG, buf); + free(buf); +#endif + return 0; +} + +static void print_heap_stats(void) +{ + uint32_t freeSize = esp_get_free_heap_size(); + printf("The available total size of heap:%" PRIu32 "\n", freeSize); + + printf("\tDescription\tInternal\tSPIRAM\n"); + printf("Current Free Memory\t%d\t\t%d\n", + heap_caps_get_free_size(MALLOC_CAP_8BIT) - heap_caps_get_free_size(MALLOC_CAP_SPIRAM), + heap_caps_get_free_size(MALLOC_CAP_SPIRAM)); + printf("Largest Free Block\t%d\t\t%d\n", + heap_caps_get_largest_free_block(MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL), + heap_caps_get_largest_free_block(MALLOC_CAP_SPIRAM)); + printf("Min. Ever Free Size\t%d\t\t%d\n", + heap_caps_get_minimum_free_size(MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL), + heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM)); +} + +static int mem_dump_cli_handler(int argc, char *argv[]) +{ + /* Just to go to the next line */ + printf("\n"); + print_heap_stats(); + return 0; +} + +#ifdef CONFIG_HEAP_TRACING +static int heap_trace_records; +static heap_trace_record_t *heap_trace_records_buf; +static void cli_heap_trace_start(void) +{ + /* Just to go to the next line */ + printf("\n"); + if (!heap_trace_records_buf) { + heap_trace_records_buf = malloc(heap_trace_records * sizeof(heap_trace_record_t)); + if (!heap_trace_records_buf) { + printf("%s: Failed to allocate records buffer\n", TAG); + return; + } + if (heap_trace_init_standalone(heap_trace_records_buf, heap_trace_records) != ESP_OK) { + printf("%s: Failed to initialise tracing\n", TAG); + goto error1; + } + } + if (heap_trace_start(HEAP_TRACE_LEAKS) != ESP_OK) { + printf("%s: Failed to start heap trace\n", TAG); + goto error2; + } + return; +error2: + heap_trace_init_standalone(NULL, 0); +error1: + free(heap_trace_records_buf); + heap_trace_records_buf = NULL; + return; +} + +static void cli_heap_trace_stop(void) +{ + /* Just to go to the next line */ + printf("\n"); + if (!heap_trace_records_buf) { + printf("%s: Tracing not started?\n", TAG); + return; + } + heap_trace_stop(); + heap_trace_dump(); + heap_trace_init_standalone(NULL, 0); + free(heap_trace_records_buf); + heap_trace_records_buf = NULL; +} +#endif + +static int heap_trace_cli_handler(int argc, char *argv[]) +{ + /* Just to go to the next line */ + printf("\n"); +#ifndef CONFIG_HEAP_TRACING + printf("%s: To use this utility enable: Component config --> Heap memory debugging --> Enable heap tracing\n", TAG); +#else + if (argc < 2) { + printf("%s: Incorrect arguments\n", TAG); + return 0; + } + if (strcmp(argv[1], "start") == 0) { +#define DEFAULT_HEAP_TRACE_RECORDS 200 + if (argc != 3) { + heap_trace_records = DEFAULT_HEAP_TRACE_RECORDS; + } else { + heap_trace_records = atoi(argv[2]); + } + printf("%s: Using a buffer to trace %d records\n", TAG, heap_trace_records); + cli_heap_trace_start(); + } else if (strcmp(argv[1], "stop") == 0) { + cli_heap_trace_stop(); + } else { + printf("%s: Invalid argument:%s:\n", TAG, argv[1]); + } +#endif + return 0; +} + +static int reboot_cli_handler(int argc, char *argv[]) +{ + /* Just to go to the next line */ + printf("\n"); + esp_unregister_shutdown_handler((shutdown_handler_t)esp_wifi_stop); + esp_restart(); + return 0; +} + +static int crash_device_handler(int argc, char** argv) +{ + printf("Crashing the device now...\n"); + + // Writing at invalid address + *(int *) (0x0) = 0; + return ESP_OK; +} + +static int sock_dump_cli_handler(int argc, char *argv[]) +{ + printf("\n"); + int i, ret, used_sockets = 0; + + struct sockaddr_in local_sock, peer_sock; + socklen_t local_sock_len = sizeof(struct sockaddr_in), peer_sock_len = sizeof(struct sockaddr_in); + char local_ip_addr[16], peer_ip_addr[16]; + unsigned int local_port, peer_port; + + int sock_type; + socklen_t sock_type_len; + +#define TOTAL_NUM_SOCKETS MEMP_NUM_NETCONN + printf("sock_fd\tprotocol\tlocal_addr\t\tpeer_addr\n"); + for (i = LWIP_SOCKET_OFFSET; i < LWIP_SOCKET_OFFSET + TOTAL_NUM_SOCKETS; i++) { + memset(&local_sock, 0, sizeof(struct sockaddr_in)); + memset(&peer_sock, 0, sizeof(struct sockaddr_in)); + local_sock_len = sizeof(struct sockaddr); + peer_sock_len = sizeof(struct sockaddr); + memset(local_ip_addr, 0, sizeof(local_ip_addr)); + memset(peer_ip_addr, 0, sizeof(peer_ip_addr)); + local_port = 0; + peer_port = 0; + sock_type = 0; + sock_type_len = sizeof(int); + + ret = getsockname(i, (struct sockaddr *)&local_sock, &local_sock_len); + if (ret >= 0) { + used_sockets++; + inet_ntop(AF_INET, &local_sock.sin_addr, local_ip_addr, sizeof(local_ip_addr)); + local_port = ntohs(local_sock.sin_port); + getsockopt(i, SOL_SOCKET, SO_TYPE, &sock_type, &sock_type_len); + printf("%d\t%d:%s\t%16s:%d", i, sock_type, sock_type == SOCK_STREAM ? "tcp" : sock_type == SOCK_DGRAM ? "udp" : "raw", local_ip_addr, local_port); + + ret = getpeername(i, (struct sockaddr *)&peer_sock, &peer_sock_len); + if (ret >= 0) { + inet_ntop(AF_INET, &peer_sock.sin_addr, peer_ip_addr, sizeof(peer_ip_addr)); + peer_port = ntohs(peer_sock.sin_port); + printf("\t%16s:%d", peer_ip_addr, peer_port); + } + printf("\n"); + } + } + printf("Remaining sockets: %d\n", TOTAL_NUM_SOCKETS - used_sockets); + return 0; +} + +#if defined(H_HOST_PS_ALLOWED) +#ifdef H_ESP_HOSTED_HOST +static int power_save_cli_handler(int argc, char *argv[]) +{ + ESP_LOGI(TAG, "Putting ESP32-P4 into power save..."); + esp_hosted_power_save_start(HOSTED_POWER_SAVE_TYPE_DEEP_SLEEP); + return 0; +} +#endif + +#ifdef CONFIG_ESP_HOSTED_COPROCESSOR +static int wakeup_cli_handler(int argc, char *argv[]) +{ + ESP_LOGI(TAG, "Asking host to wake-up..."); + wakeup_host(portMAX_DELAY); + return 0; +} +#endif +#endif + +static esp_console_cmd_t diag_cmds[] = { + { + .command = "crash", + .help = "Crash the device writing at invalid address", + .func = &crash_device_handler, + }, + { + .command = "reboot", + .help = "Reboot the device", + .func = reboot_cli_handler, + }, + { + .command = "mem-dump", + .help = "Prints memory stats", + .func = mem_dump_cli_handler, + }, + { + .command = "task-dump", + .help = "Print task snapshots", + .func = task_dump_cli_handler, + }, + { + .command = "cpu-dump", + .help = "Print CPU consumption data at the moment", + .func = cpu_dump_cli_handler, + }, + { + .command = "heap-trace", + .help = " [trace-buf-size]", + .func = heap_trace_cli_handler, + }, + { + .command = "sock-dump", + .help = "", + .func = sock_dump_cli_handler, + }, + +#if defined(H_HOST_PS_ALLOWED) +#ifdef H_ESP_HOSTED_HOST + { + .command = "host-power-save", + .help = "Put Host into power save", + .func = power_save_cli_handler, + }, +#endif +#ifdef CONFIG_ESP_HOSTED_COPROCESSOR + { + .command = "wake-up-host", + .help = "Wake-up host from power save", + .func = wakeup_cli_handler, + }, +#endif +#endif +}; + +#ifdef CONFIG_ESP_HOSTED_COPROCESSOR + + #if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS || CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS + #include "esp_wifi_he.h" + #endif + + #if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS + extern int wifi_cmd_get_tx_statistics(int argc, char **argv); + extern int wifi_cmd_clr_tx_statistics(int argc, char **argv); + #endif + + #if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS + extern int wifi_cmd_get_rx_statistics(int argc, char **argv); + extern int wifi_cmd_clr_rx_statistics(int argc, char **argv); + #endif + +void iperf_hook_show_wifi_stats(iperf_traffic_type_t type, iperf_status_t status) +{ + if (status == IPERF_STARTED) { + #if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS + if (type != IPERF_UDP_SERVER) { + wifi_cmd_clr_tx_statistics(0, NULL); + } + #endif + #if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS + if (type != IPERF_UDP_CLIENT) { + wifi_cmd_clr_rx_statistics(0, NULL); + } + #endif + } + + if (status == IPERF_STOPPED) { + #if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS + if (type != IPERF_UDP_SERVER) { + wifi_cmd_get_tx_statistics(0, NULL); + } + #endif + #if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS + if (type != IPERF_UDP_CLIENT) { + wifi_cmd_get_rx_statistics(0, NULL); + } + #endif + } + +} +#endif + +int esp_cli_register_cmds(void) +{ + int cmds_num = sizeof(diag_cmds) / sizeof(esp_console_cmd_t); + int i; + +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) + /* esp_console_cmd_deregister was added in ESP-IDF v5.4+ */ + const char* remove_cmd = "deep_sleep"; + ESP_LOGI(TAG, "Remove any existing deep_sleep cmd in cli"); + esp_console_cmd_deregister(remove_cmd); +#endif + + for (i = 0; i < cmds_num; i++) { + ESP_LOGI(TAG, "Registering command: %s", diag_cmds[i].command); + esp_console_cmd_register(&diag_cmds[i]); + } + +#ifdef CONFIG_ESP_HOSTED_COPROCESSOR + + app_register_all_wifi_commands(); + app_register_iperf_commands(); + ping_cmd_register_ping(); + app_register_iperf_hook_func(iperf_hook_show_wifi_stats); +#endif + return 0; +} + + +#ifdef CONFIG_ESP_HOSTED_CLI_NEW_INSTANCE +int esp_hosted_cli_start(void) +{ + static int cli_started; + if (cli_started) { + return 0; + } + + esp_console_repl_t *repl = NULL; + esp_console_repl_config_t repl_config = ESP_CONSOLE_REPL_CONFIG_DEFAULT(); + #ifdef CONFIG_ESP_HOSTED_COPROCESSOR + repl_config.prompt = "coprocessor> "; + #elif defined(H_ESP_HOSTED_HOST) + repl_config.prompt = "host> "; + #endif + esp_console_register_help_command(); + esp_cli_register_cmds(); + + #if defined(CONFIG_ESP_CONSOLE_UART_DEFAULT) || defined(CONFIG_ESP_CONSOLE_UART_CUSTOM) + esp_console_dev_uart_config_t hw_config = ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_console_new_repl_uart(&hw_config, &repl_config, &repl)); + + #elif defined(CONFIG_ESP_CONSOLE_USB_CDC) + esp_console_dev_usb_cdc_config_t hw_config = ESP_CONSOLE_DEV_CDC_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_console_new_repl_usb_cdc(&hw_config, &repl_config, &repl)); + + #elif defined(CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG) + esp_console_dev_usb_serial_jtag_config_t hw_config = ESP_CONSOLE_DEV_USB_SERIAL_JTAG_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_console_new_repl_usb_serial_jtag(&hw_config, &repl_config, &repl)); + #else + #error Unsupported console type + #endif + ESP_ERROR_CHECK(esp_console_start_repl(repl)); + cli_started = 1; + return 0; +} +#else +int esp_hosted_cli_start(void) +{ + return esp_cli_register_cmds(); +} +#endif + +#endif /*ESP_HOSTED_CLI_ENABLED*/ diff --git a/common/utils/esp_hosted_cli.h b/common/utils/esp_hosted_cli.h new file mode 100644 index 00000000..b2bc173b --- /dev/null +++ b/common/utils/esp_hosted_cli.h @@ -0,0 +1,33 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ESP_HOSTED_CLI_H_ +#define _ESP_HOSTED_CLI_H_ + +#include "sdkconfig.h" + +/* host */ +#ifdef CONFIG_ESP_HOSTED_ENABLED + #include "port_esp_hosted_host_config.h" + #include "power_save_drv.h" +#endif + +/* coprocessor */ +#ifdef CONFIG_ESP_HOSTED_COPROCESSOR + + #ifdef CONFIG_ESP_HOSTED_CLI_ENABLED + #include "host_power_save.h" + #define H_ESP_HOSTED_CLI_ENABLED 1 + #endif /*CONFIG_ESP_HOSTED_CLI_ENABLED*/ + +#endif /*CONFIG_ESP_HOSTED_COPROCESSOR*/ + + +#ifdef H_ESP_HOSTED_CLI_ENABLED + int esp_hosted_cli_start(void); +#endif + +#endif /* _ESP_HOSTED_CLI_H_ */ diff --git a/docs/bluetooth_design.md b/docs/bluetooth_design.md index 408f0b2a..77f162e1 100644 --- a/docs/bluetooth_design.md +++ b/docs/bluetooth_design.md @@ -2,31 +2,39 @@ **Table of Contents** +
+ +Table of Contents + - [1. Introduction](#1-introduction) - - [1.1 Choosing a Bluetooth Host stack](#11-choosing-a-bluetooth-host-stack) + - [1.1 Prerequisites](#11-prerequisites) + - [1.2 Choosing a Bluetooth Host stack](#12-choosing-a-bluetooth-host-stack) - [2. Bluetooth Controller](#2-bluetooth-controller) - [3. Bluetooth Interface](#3-bluetooth-interface) + - [3.1 Initializing the Bluetooth Controller](#31-initializing-the-bluetooth-controller) - [4. NimBLE Host Stack](#4-nimble-host-stack) - [4.1. Transporting HCI data using Hosted HCI in NimBLE](#41-transporting-hci-data-using-hosted-hci-in-nimble) - - [4.1.1. Bluetooth Host Hosted HCI Initialization](#411-bluetooth-host-hosted-hci-initialization) - - [4.1.2. Bluetooth Host Sending Data through Hosted HCI in NimBLE](#412-bluetooth-host-sending-data-through-hosted-hci-in-nimble) - - [4.1.3. Bluetooth Host Receiving Data from Hosted HCI in NimBLE](#413-bluetooth-host-receiving-data-from-hosted-hci-in-nimble) + - [4.1.1. Bluetooth Host Hosted HCI Initialization](#411-bluetooth-host-hosted-hci-initialization) + - [4.1.2. Bluetooth Host Sending Data through Hosted HCI in NimBLE](#412-bluetooth-host-sending-data-through-hosted-hci-in-nimble) + - [4.1.3. Bluetooth Host Receiving Data from Hosted HCI in NimBLE](#413-bluetooth-host-receiving-data-from-hosted-hci-in-nimble) - [4.2. Transporting HCI data using UART](#42-transporting-hci-data-using-uart) - [4.2.1. Bluetooth Host HCI Initialization](#421-bluetooth-host-hci-initialization) - - [4.2.2. Bluetooth Host Sending Data using HCI](#422-bluetooth-host-sending-data-using-hci) - - [4.2.3. Bluetooth Host Receiving Data using HCI](#423-bluetooth-host-receiving-data-using-hci) + - [4.2.2. Bluetooth Host Sending Data using HCI](#422-bluetooth-host-sending-data-using-hci) + - [4.2.3. Bluetooth Host Receiving Data using HCI](#423-bluetooth-host-receiving-data-using-hci) - [5. BlueDroid Host Stack](#5-bluedroid-host-stack) - [5.1. Transporting HCI data using Hosted HCI in BlueDroid](#51-transporting-hci-data-using-hosted-hci-in-bluedroid) - [5.1.1. Bluetooth Host Hosted HCI Initialization](#511-bluetooth-host-hosted-hci-initialization) - - [5.1.2. Bluetooth Host Sending Data through Hosted HCI in BlueDroid](#512-bluetooth-host-sending-data-through-hosted-hci-in-bluedroid) - - [5.1.3. Bluetooth Host Receiving Data from Hosted HCI in BlueDroid](#513-bluetooth-host-receiving-data-from-hosted-hci-in-bluedroid) + - [5.1.2. Bluetooth Host Sending Data through Hosted HCI in BlueDroid](#512-bluetooth-host-sending-data-through-hosted-hci-in-bluedroid) + - [5.1.3. Bluetooth Host Receiving Data from Hosted HCI in BlueDroid](#513-bluetooth-host-receiving-data-from-hosted-hci-in-bluedroid) - [5.2. Transporting HCI data using UART](#52-transporting-hci-data-using-uart) - [5.2.1. Bluetooth Host HCI Initialization](#521-bluetooth-host-hci-initialization) - - [5.2.2. Bluetooth Host Sending Data using HCI](#522-bluetooth-host-sending-data-using-hci) - - [5.2.3. Bluetooth Host Receiving Data using HCI](#523-bluetooth-host-receiving-data-using-hci) + - [5.2.2. Bluetooth Host Sending Data using HCI](#522-bluetooth-host-sending-data-using-hci) + - [5.2.3. Bluetooth Host Receiving Data using HCI](#523-bluetooth-host-receiving-data-using-hci) - [6. Configuring the Co-processor for Standard HCI over UART](#6-configuring-the-co-processor-for-standard-hci-over-uart) - [7. References](#7-references) +
+ ## 1. Introduction ESP-Hosted can transport Bluetooth HCI packets between the Bluetooth @@ -35,17 +43,13 @@ Co-processor. The Host MCU implement the Bluetooth app and Bluetooth Host Stack and the co-processor runs the Bluetooth controller and hardware. -> [!NOTE] -> Check that the memory requirement for your preferred Bluetooth host -> stack can be satisfied on the Host. - ESP-Hosted is Bluetooth stack agnostic. To showcase ESP-Hosted's Bluetooth support, both `esp-nimble` and `esp-bluedroid` are used here. Users can use their own preferred Bluetooth stack with some porting effort. `esp-nimble` is a fork of Apache NimBLE and available from -ESP-IDF. The NimBLE Bluetooth slack proves Bluetooth Low Energy (BLE) +ESP-IDF. The NimBLE Bluetooth stack provides Bluetooth Low Energy (BLE) only functionality. `esp-bluedroid` is a fork of the Bluedroid based stack and available @@ -54,7 +58,12 @@ as Bluetooth Low Energy. See [References](#7-references) for links with more information. -### 1.1 Choosing a Bluetooth Host stack +### 1.1 Prerequisites + +- check that the memory requirement for your preferred Bluetooth host stack can be satisfied on the Host. +- the ESP32 only supports Bluetooth v4.2. If you are using a ESP32 as the co-processor, the host Bluetooth stack must also be v4.2. + +### 1.2 Choosing a Bluetooth Host stack For usecases involving classic Bluetooth as well as Bluetooth Low Energy, BlueDroid should be used. @@ -125,6 +134,48 @@ Use this option if you want: > Bluetooth over Standard HCI configuration must be disabled, and vice > versa. +### 3.1 Initializing the Bluetooth Controller + +> [!NOTE] +> Before ESP-Hosted-MCU v2.5.2, the Bluetooth Controller on the +> co-processor was **enabled** by default. This section on +> initializing the Bluetooth Controller applies to ESP-Hosted-MCU +> v2.5.2 and after. + +The Bluetooth Controller on the co-processor is disabled by +default. This allows the BT Mac Address to be set, which must be done +before the controller is enabled. The BT Controller should be enabled +before initialzing the BT Host Stack. + +To get and set the BT Controller MAC address: + +1. Call `esp_hosted_connect_to_slave()` to intialise the transport +2. (Optional) Call `esp_hosted_iface_mac_addr_len_get` to get the length of the BT MAC address +3. (Optional) Call `esp_hosted_iface_mac_addr_get` to get the current BT MAC address +4. Call `esp_hosted_iface_mac_addr_set` to set the current BT MAC address + +After setting the BT Controller MAC address, you can now enable the BT Controller. + +> [!NOTE] +> This MAC address setting is temporary and will revert after device +> reset. For permanent MAC address change, modify during hardware +> provisioning or burn directly into eFuse using appropriate commands + +To enable the BT Controller: + +1. Call `esp_hosted_connect_to_slave()` to intialise the transport. (Skip this if already called while seting the BT MAC Address above.) +2. (Optional) Call `esp_hosted_iface_mac_addr_get()` and + `esp_hosted_iface_mac_addr_set()` to get and set the BT Mac Address +3. Call `esp_hosted_bt_controller_init()` to initialise the BT Controller +4. Call `esp_hosted_bt_controller_enable()` to enable the BT Controller +5. Initialise the BT Host stack + +To disable the Controller: + +1. Deinitialise the BT Host stack +2. Call `esp_hosted_bt_controller_disable()` to disable the BT Controller +3. Call `esp_hosted_bt_controller_deinit()` to deinit the BT Controller + ## 4. NimBLE Host Stack The ESP-Hosted Master implements the set of API calls required by the @@ -158,11 +209,11 @@ sequenceDiagram end ble ->> +hhci : hci_drv_init() - Note over hhci: do any init required + Note over hhci: do any init required hhci -->> -ble : ble ->> +hhci : ble_transport_ll_init() - Note over hhci : do any transport init required + Note over hhci : do any transport init required hhci -->> -ble : ``` @@ -223,12 +274,12 @@ sequenceDiagram alt Receive Event Data Note over hhci: convert HCI data to Event - hhci ->> ble : ble_transport_to_hs_evt() - ble -->> hhci : + hhci ->> ble : ble_transport_to_hs_evt() + ble -->> hhci : else Receive ACL Data Note over hhci: convert HCI data to ACL - hhci ->> ble : ble_transport_to_hs_acl() - ble -->> hhci : + hhci ->> ble : ble_transport_to_hs_acl() + ble -->> hhci : end hhci -->> -master : @@ -302,12 +353,12 @@ sequenceDiagram alt Receive Event Data Note over huart : convert HCI data to Event - huart ->> ble : ble_transport_to_hs_evt() - ble -->> huart : + huart ->> ble : ble_transport_to_hs_evt() + ble -->> huart : else Receive ACL Data Note over huart : convert HCI data to ACL - huart ->> ble : ble_transport_to_hs_acl() - ble -->> huart : + huart ->> ble : ble_transport_to_hs_acl() + ble -->> huart : end ``` @@ -353,7 +404,7 @@ sequenceDiagram end bt ->> +hhci : hosted_hci_bluedroid_open() - Note over hhci: do any init required + Note over hhci: do any init required hhci -->> -bt : ``` @@ -447,7 +498,7 @@ sequenceDiagram end bt ->> +huart : uart_open() - Note over huart: do any uart init required + Note over huart: do any uart init required huart -->> -bt : ``` diff --git a/docs/esp32_p4_function_ev_board.md b/docs/esp32_p4_function_ev_board.md index 368519b4..7b4c41a1 100644 --- a/docs/esp32_p4_function_ev_board.md +++ b/docs/esp32_p4_function_ev_board.md @@ -3,26 +3,25 @@
Table of Contents -- [Introduction](#1-introduction) -- [Set-Up ESP-IDF](#2-set-up-esp-idf) -- [Building Host for the P4](#3-building-host-for-the-p4) +- [1. Introduction](#1-introduction) +- [2. Set-Up ESP-IDF](#2-set-up-esp-idf) +- [3. Building Host for the P4](#3-building-host-for-the-p4) - [Adding Components](#31-adding-components) - [Configuring Defaults](#32-configuring-defaults) - [Building Firmware](#33-building-firmware) -- [Checking ESP-Hosted](#4-checking-esp-hosted) -- [Flashing ESP32-C6](#5-flashing-esp32-c6) - - [Using ESP-Prog](#51-using-esp-prog) - - [OTA Updates](#52-ota-updates) -- [Troubleshooting](#6-troubleshooting) -- [Flashing the On-board ESP32-P4 through the ESP-Prog](#7-flashing-esp32-p4) -- [Testing ESP-Hosted with SPI-FD with other MCUs](#8-testing-esp-hosted-with-spi-fd-with-other-mcus) -- [References](#9-references) - +- [4. Checking ESP-Hosted](#4-checking-esp-hosted) +- [5. Flashing ESP32-C6](#5-flashing-esp32-c6) + - [Using ESP-Prog](#51-serial-flashing-using-esp-prog-initial-setup) + - [OTA Updates](#52-esp-hosted-slave-ota-updates-recommended) +- [6. Troubleshooting](#6-troubleshooting) +- [7. Flashing the On-board ESP32-P4 through the ESP-Prog](#7-flashing-esp32-p4) +- [8. Testing ESP-Hosted with SPI-FD with other MCUs](#8-testing-esp-hosted-with-spi-fd-with-other-mcus) +- [9. References](#10-references)
## 1. Introduction -This page documents using ESP-Hosted-MCU on the ESP32-P4-Function-EV-Board. The board comes with an on-board ESP32-C6 module, pre-flashed with ESP-Hosted-MCU slave code (v0.0.6). The board provides a Wi-Fi connection to the on-board ESP32-P4, which acts as the host. +This guide covers using ESP-Hosted-MCU on the ESP32-P4-Function-EV-Board. The board includes an on-board ESP32-C6 module that comes pre-flashed with ESP-Hosted-MCU slave firmware (v0.0.6). This provides Wi-Fi/Bluetooth connectivity to the on-board ESP32-P4, which acts as the host. The image below shows the board. @@ -34,15 +33,13 @@ The ESP32-P4 communicates with the ESP32-C6 module using SDIO. ## 2. Set-Up ESP-IDF -As you have reached here, it is highly likely that you have already setup ESP-IDF. - -If not done, Please set up ESP-IDF: +If you haven't already set up ESP-IDF, choose one of the following options: -#### Option 1: Installer Way +#### Option 1: Installer Way (Recommended) - **Windows** - - Install and setup ESP-IDF on Windows as documented in the [Standard Setup of Toolchain for Windows](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html). - - Use the ESP-IDF [Powershell Command Prompt](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html#using-the-command-prompt) for subsequent commands. + - Follow the [Standard Setup of Toolchain for Windows](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html) + - Use the ESP-IDF [Powershell Command Prompt](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html#using-the-command-prompt) for all commands - **Linux or MacOS** - For bash: @@ -56,23 +53,24 @@ If not done, Please set up ESP-IDF: #### Option 2: Manual Way -Please follow the [ESP-IDF Get Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html) for manual installation. +Follow the [ESP-IDF Get Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html) for manual installation. ## 3. Building Host for the P4 ### 3.1. Adding Components -Add `esp_wifi_remote` and `esp_hosted` components to the project: +Add the required components to your project: -``` +```bash idf.py add-dependency "espressif/esp_wifi_remote" idf.py add-dependency "espressif/esp_hosted" ``` -Remove 'esp-extconn' if present in `main/idf_component.yml`, as esp-extconn and esp-hosted cannot work together. -Open the `main/idf_component.yml` file and remove/comment the following block if present: +**Important:** Remove `esp-extconn` if present, as it conflicts with `esp-hosted`. -``` +Open `main/idf_component.yml` and remove or comment out this block if it exists: + +```yaml # ------- Delete or comment this block --------- espressif/esp-extconn: version: "~0.1.0" @@ -81,32 +79,28 @@ espressif/esp-extconn: # ----------------------------------- ``` -It is always good to use `esp_wifi_remote` as it provides all the Wi-Fi config and a wrapper abstraction layer. -But you can also evaluate without using it. - > [!IMPORTANT] -> Co-processor selection is done by wifi-remote. Ensure the correct -> co-processor chip is selected in `Component config` -> `Wi-Fi -> Remote` -> `choose slave target`. The target selected will affect -> the ESP-Hosted transport options and default GPIOs used. +> The co-processor is selected through `esp_wifi_remote`. Make sure to select the correct slave target in: +> `Component config` → `Wi-Fi Remote` → `choose slave target` +> +> This selection determines the ESP-Hosted transport options and default GPIOs. ### 3.2. Configuring Defaults -Edit the `sdkconfig.defaults.esp32p4` file such that, it would have following content: +Edit `sdkconfig.defaults.esp32p4` to include the following configuration: ``` -#### Comment below two lines if present: -# CONFIG_ESP_HOST_WIFI_ENABLED=y -# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y - -#### Add Wi-Fi Remote config for better performance: -CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=16 -CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=64 -CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=64 -CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y -CONFIG_ESP_WIFI_TX_BA_WIN=32 -CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y -CONFIG_ESP_WIFI_RX_BA_WIN=32 +### sdkconfig for ESP32-P4 + C6 Dev board +CONFIG_SLAVE_IDF_TARGET_ESP32C6=y +CONFIG_ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD=y + +CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16 +CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=64 +CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=64 +CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y +CONFIG_WIFI_RMT_TX_BA_WIN=32 +CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y +CONFIG_WIFI_RMT_RX_BA_WIN=32 CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 CONFIG_LWIP_TCP_WND_DEFAULT=65534 @@ -117,20 +111,23 @@ CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 CONFIG_LWIP_TCP_SACK_OUT=y ``` +For optimized parameters when using other co-processors, see the [Performance Optimization Guide](performance_optimization.md). + ### 3.3. Building Firmware -Set the ESP32-P4 as the target, build, flash the firmware and -(optionally) monitor ESP32-P4 console output: +Build and flash the firmware: ```sh idf.py set-target esp32p4 idf.py build -idf.py -p flash monitor +idf.py -p flash monitor ``` +Replace `` with your actual serial port (e.g., `COM3` on Windows or `/dev/ttyUSB0` on Linux). + ## 4. Checking ESP-Hosted -When the P4 is running with Hosted, you should see console output similar to this after start-up: +After flashing, you should see output similar to this on the console: ``` I (498) H_API: esp_wifi_remote_init @@ -186,89 +183,45 @@ I (1848) H_SDIO_DRV: Received INIT event I (1868) rpc_wrap: Received Slave ESP Init ``` -## 5. Flashing ESP32-C6 -ESP32-C6 flashing is totally **optional**, as C6 is expected to be pre-flashed with ESP-Hosted slave firmware, 0.0.6. If you wish to get updated ESP-Hosted slave firmware, you can flash it using two ways, Either with ESP-Prog on ESP32-C6, or using OTA update configured using web server. - -### 5.1 OTA Updates - -To update the ESP32-C6 slave module using Over-The-Air (OTA) updates, follow these steps: - -1. Build the ESP-Hosted slave firmware for the ESP32-C6 module: - -``` -idf.py create-project-from-example "espressif/esp_hosted:slave" -``` - -2. Set the target and start `Menuconfig`: - -```sh -idf.py set-target esp32c6 -idf.py menuconfig -``` - -3. Under **Example Configuration**, ensure that the Hosted transport - selected is `SDIO`. - -4. Build the firmware: - -```sh -idf.py build -``` - -5. Upload the firmware (the build/network_adapter.bin file) to a server or a local directory accessible via HTTP. - -6. On the ESP32-P4 host, add the following code to your application to initiate the OTA update: - -``` -#include "esp_hosted.h" - -esp_err_t esp_hosted_slave_ota(const char *url); -``` - -7. Call the `esp_hosted_slave_ota` function with the URL of the firmware binary: +This confirms that ESP-Hosted is running correctly. -``` -esp_err_t err = esp_hosted_slave_ota("http://example.com/path/to/network_adapter.bin"); -if (err != ESP_OK) { - ESP_LOGE(TAG, "Failed to start OTA update: %s", esp_err_to_name(err)); -} -``` +## 5. Flashing ESP32-C6 -8. Monitor the console output to see the OTA update progress. +Note: The ESP32-C6 comes pre-flashed with ESP-Hosted slave firmware v0.0.6, so this step is optional unless you need to update the firmware. However, it is **recommended** to upgrade to the latest slave firmware to get updated features and performance optimizations. -### 5.2 Using ESP-Prog +### 5.1 Serial Flashing Using ESP-Prog (Initial Setup) -> [!NOTE] -> ESP-Prog is only required if you want to flash firmware to the -> ESP32-C6 module using the standard ESP Tools. +> [!TIP] +> For firmware updates after initial setup, use the OTA method described in section 5.2 -This step is optional, as C6 is expected to be pre-flashed with ESP-Hosted slave firmware, 0.0.6. - -The image below shows the board with an ESP-Prog connected to the -header to communicate with the on-board ESP32-C6.. +You'll need an ESP-Prog or similar UART adapter for serial flashing. ESP32-P4-Function-EV-Board with ESP-Prog Connected to ESP32-C6 *ESP32-P4-Function-EV-Board with ESP-Prog Connected to ESP32-C6* -If you need to update the ESP-Hosted slave firmware on the on-board -ESP32-C6 module using ESP-Prog, follow these steps: +**Steps:** -1. Check out the ESP-Hosted slave example project: +1. Get the ESP-Hosted slave example: -``` +```bash idf.py create-project-from-example "espressif/esp_hosted:slave" ``` -2. Set the target and start `Menuconfig`: +2. Configure the project: ```sh idf.py set-target esp32c6 idf.py menuconfig ``` -3. Under **Example Configuration**, ensure that the Hosted transport - selected is `SDIO`. +3. Verify SDIO is enabled (it should be by default): + ``` + Example Configuration + └── Bus Config in between Host and Co-processor + └── Transport layer + └── Select "SDIO" + ``` 4. Build the firmware: @@ -276,67 +229,55 @@ idf.py menuconfig idf.py build ``` -5. Connect the Program Header on the ESP-Prog to the `PROG_C6` header - on the board. The connections are as follows: - -| ESP-Prog | PROG_C6 | Notes | -| --- | --- | --- | -| ESP\_EN | EN | | -| ESP\_TXD | TXD | | -| ESP\_RXD | RXD | | -| VDD | - | Do not connect | -| GND | GND | | -| ESP\_IO0 | IO0 | | - +5. Connect ESP-Prog to the `PROG_C6` header: -6. Flashing the firmware +| ESP-Prog | PROG_C6 | Notes | +| --- | --- | --- | +| ESP\_EN | EN | | +| ESP\_TXD | TXD | | +| ESP\_RXD | RXD | | +| VDD | - | **Do not connect** | +| GND | GND | | +| ESP\_IO0 | IO0 | | -The on-board ESP32-P4 controls the reset signal for the ESP32-C6. To -prevent the P4 interfering with the C6 while flashing (by asserting -the C6 Reset signal during the firmware download), set the P4 into -Bootloader mode before flashing the firmware to the C6: +6. Put the ESP32-P4 into bootloader mode to prevent interference: -###### Manual Way - 1. hold down the `BOOT` button on the board - 2. press and release the `RST` button on the board - 3. release the `BOOT` button + **Manual method:** + - Hold down the `BOOT` button + - Press and release the `RST` button + - Release the `BOOT` button -###### Script Way - -```sh -esptool.py -p --before default_reset --after no_reset run -``` + **Script method:** + ```sh + esptool.py -p --before default_reset --after no_reset run + ``` -You can now flash the firmware to the C6 (and monitor the console -output): +7. Flash the C6: ```sh idf.py -p flash monitor ``` -## 6. Troubleshooting +### 5.2 ESP-Hosted Slave OTA Updates (Recommended) -If you encounter issues with using ESP-Hosted, see the following guide: +The ESP-Hosted link comes pre-configured and ready to use on first boot. You can update the slave firmware remotely from the host MCU using OTA (Over-The-Air) updates: **No** ESP-Prog, serial cable, or extra GPIO connections are required. -- [Troubleshooting Guide](troubleshooting.md) +For step-by-step instructions, see the [Host Performs Slave OTA Example](../examples/host_performs_slave_ota/README.md). -
-Flashing the On-board ESP32-P4 through the Serial Interface +## 6. Troubleshooting -## 7. Flashing the On-board ESP32-P4 through the ESP-Prog +If you encounter any issues, refer to the [Troubleshooting Guide](troubleshooting.md). -The USB connector on the board is the standard method for flashing the -firmware to the P4. An alternative method is to flash the P4 through -its serial interface using a ESP-Prog. +
+7. Flashing the On-board ESP32-P4 through the ESP-Prog -The image below shows the connection between the ESP-Prog and the -serial port pins on the P4 header for programming. +The standard way to flash the P4 is through the **USB connector with Type-C cable** inserted into USB-UART port on ESP32-P4. However, you can also use an ESP-Prog connected to the serial interface. ESP32-P4 Serial Connection with ESP-Prog *ESP32-P4 Serial Connection with ESP-Prog* -The connection between the ESP-Prog and the P4 header is as follows: +**Connections:** | ESP-Prog | P4 Header | | --- | --- | @@ -344,30 +285,31 @@ The connection between the ESP-Prog and the P4 header is as follows: | ESP\_RXD | U0RXD (GPIO 38) | | GND | GND | -Leave the other ESP-Prog connected unconnected. +Leave other ESP-Prog pins disconnected. -To flash the P4: +**Flashing steps:** -1. hold down the `BOOT` button on the board -2. press and release the `RST` button on the board -3. release the `BOOT` button +1. Hold down the `BOOT` button +2. Press and release the `RST` button +3. Release the `BOOT` button -You can now flash the firmware (and monitor the console output): +4. Flash the firmware: ```sh idf.py -p flash monitor ``` -To restart the P4 after flashing, press and release the `RST` button -on the board. +5. Press the `RST` button to restart the P4 after flashing.
## 8. Testing ESP-Hosted with SPI-FD with other MCUs -You can use SPI-FD (Full Duplex) on the ESP32-P4 to test ESP-Hosted with other ESP32s. Do this by connecting the ESP32 to the P4 through the J1 GPIO header on the ESP32-P4 DevKit. +You can test ESP-Hosted using SPI Full Duplex (SPI-FD) by connecting another ESP-Dev-Kit or ESP Chipset to the P4 through the J1 GPIO header. + +**Important:** Use GPIO 36 or lower to avoid LDO power issues with higher-numbered GPIOs. -Use GPIOs 36 or lower on the P4 DevKit to avoid LDO power issues with high numbered GPIOs. Here is one combination on GPIOs that can be used on the P4: +**Recommended GPIO configuration:** | Function | GPIO | |------------|------| @@ -380,11 +322,14 @@ Use GPIOs 36 or lower on the P4 DevKit to avoid LDO power issues with high numbe | Reset | 2 | > [!NOTE] -> Avoid using GPIO 35 and 36 as they affect the ESP32-P4 Bootloader Mode. See [ESP32-P4 Boot Mode Selection](https://docs.espressif.com/projects/esptool/en/latest/esp32p4/advanced-topics/boot-mode-selection.html#select-bootloader-mode) for more information. +> Avoid using GPIO 35 and 36, as they affect bootloader mode. See [ESP32-P4 Boot Mode Selection](https://docs.espressif.com/projects/esptool/en/latest/esp32p4/advanced-topics/boot-mode-selection.html#select-bootloader-mode) for details. + +> [!TIP] +> For optimal performance testing, check out the [Shield Box Test Setup](shield-box-test-setup.md). ## 9. References -- ESP32-P4-Function-EV-Board: https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32p4/esp32-p4-function-ev-board/ -- ESP-Prog: https://docs.espressif.com/projects/esp-iot-solution/en/latest/hw-reference/ESP-Prog_guide.html -- `esp_wifi_remote` component: https://components.espressif.com/components/espressif/esp_wifi_remote/ -- `esp_hosted` component: https://components.espressif.com/components/espressif/esp_hosted/ +- [ESP32-P4-Function-EV-Board Documentation](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32p4/esp32-p4-function-ev-board/) +- [ESP-Prog Guide](https://docs.espressif.com/projects/esp-iot-solution/en/latest/hw-reference/ESP-Prog_guide.html) +- [`esp_wifi_remote` component](https://components.espressif.com/components/espressif/esp_wifi_remote/) +- [`esp_hosted` component](https://components.espressif.com/components/espressif/esp_hosted/) diff --git a/docs/feature_host_power_save.md b/docs/feature_host_power_save.md new file mode 100644 index 00000000..3aaa456d --- /dev/null +++ b/docs/feature_host_power_save.md @@ -0,0 +1,388 @@ +# Host Power Save (ESP-Hosted MCU) + +## Overview + +The **Host Power Save** feature allows the host MCU to enter low-power states while the ESP slave maintains network connectivity. This enables efficient power usage in battery-operated devices. + +**Host Power Save Modes:** +- **Deep Sleep at Host**: Ultra-low power consumption with GPIO wake-up +- **Light Sleep at Host**: *(Coming Soon)* Faster wake-up with reduced power savings + +Key features include: +- Host enters power save mode, network stays online +- Slave intelligently wakes host when needed +- Power state synchronization between host and slave +- Seamless network handover during power save +- Integration with Network Split + +--- +## Configuration + +### Host Configuration + +In host example project, run `idf.py menuconfig` and Enable `Allow host to power save` +``` +# Host side kconfig +Component config + └── ESP-Hosted config + └── [*] Allow host to power save <== Enable This + └── [*] Allow host to enter deep sleep. ─┐ + ├── () Host in: Host Wakeup GPIO │ + └── Host Wakeup GPIO Level ├── Default config (No change) + └── (X) High ─┘ +``` +> [!NOTE] +> 1. The wakeup GPIO number must be an RTC-capable GPIO. +> 2. Ensure the wake up GPIO is unused + +### Slave Configuration + +In slave project, run `idf.py menuconfig` and Enable `Allow host to power save` + +``` +# Slave side kconfig +Example Configuration +└── [*] Allow host to power save <== Enable This + └── [*] Allow host to enter deep sleep. ─┐ + ├── () Slave out: Host wakeup GPIO │ + └── Host Wakeup GPIO Level ├── Default config (No change) + └── (X) High ─┘ +``` + +--- +## High Level Overview + +The power management system coordinates between the host MCU and ESP slave to ensure smooth transitions between active and power save states. + +```mermaid +sequenceDiagram + participant Host as Host MCU + participant Slave as ESP Slave + participant Network as Network/WiFi + + Host->>Slave: Power Save Start Signal + Note over Slave: Slave takes over network operations + Host->>Host: Enter Power Save Mode + + Network->>Slave: Incoming packets + Slave->>Slave: Packet needs host + Slave->>Host: Trigger Wake-up GPIO + Host->>Host: Exit Power Save Mode + Host->>Slave: Power Save Stop Signal + Slave->>Slave: Resume packet delivery +``` + +### Wake-up Mechanisms + +The slave initiates a wake-up by toggling a dedicated GPIO line to the host when one of the following triggers occurs: + +* Periodic Timer-based Wake-up +* CLI-based Wake-up +* Network-triggered Wake-up + +```mermaid +flowchart TD + A[💤 Host in Power Save Mode] --> B{⏱️ Trigger on Slave?} + B -->|🕒 Timer Expired| C[🔔 Send Wake-up GPIO] + B -->|🧑‍💻 CLI Command| C + B -->|🌐 Network Packet| C + C --> D[⚡ Host Wakes Up] + D --> E[▶️ Resume Operations] + + classDef sleep fill:#f5f5f5,stroke:#888,font-size:14px; + classDef event fill:#e3f2fd,stroke:#2196f3,font-size:14px; + classDef action fill:#e0f7e9,stroke:#4caf50,font-size:14px; + + class A sleep + class B,C event + class D,E action +``` + +### State transitions + +- Active → Preparing: Host prepares (notifies slave, configures GPIO) +- Preparing → PowerSave: Host enters power save mode; slave handles network +- PowerSave → Waking: Slave triggers wakeup on event (timer/packet/CLI) +- Waking → Active: Host re-inits system, syncs with slave + +```mermaid +stateDiagram + [*] --> Active + Active --> Preparing: 🥱 start_host_power_save() + Preparing --> PowerSave: 😴 Power Save Entry + PowerSave --> Waking: 😳 Wake Event + Waking --> Active: 😊 Slave sync-up complete + +``` +--- +## Deep Dive + +### 💤 Host Enters Power Save Mode + +When the host application initiates power save mode, the following function sequence occurs to safely coordinate with the slave. + +```mermaid +sequenceDiagram + participant App as Host Application (or CLI) + participant PowerSaveDrv as power_save_drv.c + participant TransportDrv as transport_drv.c + participant Slave as Slave MCU + + App->>PowerSaveDrv: start_host_power_save() + PowerSaveDrv->>TransportDrv: notify_slave_host_power_save_start() + TransportDrv->>Slave: bus_inform_slave_host_power_save_start() + Slave-->>TransportDrv: Ack + TransportDrv-->>PowerSaveDrv: Ack + Note right of TransportDrv: Slave is now aware
host is entering power save. + PowerSaveDrv->>PowerSaveDrv: hold_slave_reset_gpio_pre_power_save() + Note right of PowerSaveDrv: Prevents slave from resetting. + PowerSaveDrv->>PowerSaveDrv: _h_config_host_power_save_hal_impl() + Note right of PowerSaveDrv: Configures wakeup GPIO. + PowerSaveDrv->>PowerSaveDrv: _h_start_host_power_save_hal_impl() + Note right of PowerSaveDrv: Host enters power save mode. +``` + +### Host Wake-up and Synchronization Sequence + +The slave wakes the host using a GPIO signal. Upon rebooting, the host detects the wake-up reason and synchronizes with the slave through a handshake mechanism, after which normal operation resumes. + +```mermaid +sequenceDiagram + participant SlaveApp as Slave
(App/CLI) + participant SlavePS as Slave
(host_power_save.c) + participant HostHW as Host MCU
(Hardware) + participant HostTransport as Host
(transport_drv.c) + participant HostPS as Host
(power_save_drv.c) + + SlaveApp->>SlavePS: wakeup_host() + SlavePS->>SlavePS: wakeup_host_mandate() + SlavePS->>HostHW: Toggles Wake-up GPIO + Note over SlavePS: Now blocks, waiting
for wakeup_sem. + + HostHW-->>HostTransport: Host wakes from power save + Note over HostTransport: esp_hosted_init() is called,
which calls transport_drv_reconfigure(). + + HostTransport->>HostPS: esp_hosted_woke_from_power_save() + HostPS-->>HostTransport: Returns true + + HostTransport->>HostPS: stop_host_power_save() + HostPS->>HostTransport: notify_slave_host_power_save_stop() + HostTransport-->>SlavePS: Sends "Power Save Off" event
via transport layer. + + Note over SlavePS: host_power_save_alert() handles the event. + SlavePS->>SlavePS: Gives wakeup_sem. + Note over SlavePS: Handshake complete. + SlavePS-->>SlaveApp: wakeup_host_mandate() returns,
unblocking the application. + + Note over HostTransport, SlavePS: System is now fully active. + SlavePS->>HostTransport: Resume packet delivery for Network Packet Wake-up case +``` +--- +## APIs + +### Sources + +#### Host Files + +- `host/api/include/esp_hosted_power_save.h`: enums and APIs +- `host/drivers/power_save/power_save_drv.c`: power save logic +- `host/drivers/transport/transport_drv.c`: slave communication +- `host/drivers/transport/{sdio,spi}/...`: bus specific power save hooks + +#### Slave Files + +- `slave/main/host_power_save.h`: slave enums and APIs +- `slave/main/host_power_save.c`: wake-up management +- `slave/main/lwip_filter.c`: packet inspection (for wake-up) + +### Functions + +#### Host APIs + +```c +/* Power save driver APIs (host side) */ +int esp_hosted_power_save_enabled(void); +int esp_hosted_power_save_init(void); +int esp_hosted_woke_from_power_save(void); +int esp_hosted_power_saving(void); +int esp_hosted_power_save_start(esp_hosted_power_save_type_t power_save_type); +int esp_hosted_power_save_timer_start(uint32_t time_ms, int timer_type); +int esp_hosted_power_save_timer_stop(void); + +/* Retain GPIO during power save */ +int hold_slave_reset_gpio_pre_power_save(void); +int release_slave_reset_gpio_post_wakeup(void); +``` + +#### Slave APIs + + +```c +/* Slave-side power save APIs */ +int host_power_save_init(void (*host_wakeup_callback)(void)); +int is_host_power_saving(void); +int is_host_wakeup_needed(interface_buffer_handle_t *buf_handle); +int wakeup_host_mandate(uint32_t timeout_ms); +int wakeup_host(uint32_t timeout_ms); +int host_power_save_alert(uint32_t ps_evt); +``` + +--- + +## CLI Demo + +### Enter Power Save Mode + +1. **Enable CLI**: Ensure `ESP_HOSTED_CLI_ENABLED` is enabled in the host's `menuconfig`. +2. **Start the CLI**: The CLI starts automatically when `esp_hosted_init()` is called. +3. **Enter the command**: At the `host>` prompt, type the `power_save` command. + +```sh +host> host-power-save +I (11147) esp_cli: Putting ESP32-P4 into power save mode... +I (11147) H_power_save: Inform slave: Host PS start +I (11148) H_SDIO_DRV: Inform slave, host power save is started +ESP-ROM:esp32p4... +... +``` +This command calls `esp_hosted_power_save_start()`, which signals the slave and puts the host into the configured power save mode. If it is deep sleep power save, The host would not be able to execute any further code until it is woken up. + +### Wake-up from Slave + +The host can be woken up by the slave under several conditions, such as receiving a specific network packet. On the slave, a CLI command `wake-up` is available for demonstration. + +1. **Network Packet Wake-up**: By default, the slave is configured to wake the host upon receiving certain network traffic (e.g., on priority ports like SSH, or MQTT messages containing a "wakeup-host" payload). +2. **Manual Wake-up (Demo)**: Use the `wake-up` command in the slave's terminal. + +**Slave Log:** +```sh +coprocessor> wake-up-host +I (13730) esp_cli: Asking P4 to wake-up... +I (13730) host_ps: WAKE UP Host!!!!! +I (13741) host_ps: Cleared wakeup gpio, IO2 +... +I (15543) host_ps: Wakeup semaphore given +I (15543) host_ps: host woke up +``` + +**Host Log (After Wake-up):** +```sh +... +I (430) H_power_save: Wakeup from power save +I (432) transport: Waiting for power save to be off +I (1137) H_SDIO_DRV: Host woke up from power save +... +``` +When the host wakes up, checks wake-up reason, and re-establishes slave connectivity automatically. + +--- + +## Coding Example + +While the CLI provides an easy demo, most applications would trigger power save modes using the power save APIs. + +### Host example + +The example below shows how to check wake-up reason and enter power save mode programmatically: + +```c +#include "esp_hosted.h" +#include "esp_hosted_power_save.h" + +static const char* TAG = "HOST_APP"; + +void app_main(void) +{ + /* First, check the reason of host bootup. is it deep sleep? */ + if (esp_hosted_woke_from_power_save()) { + ESP_LOGI(TAG, "Host woke up from power save mode."); + } + + esp_hosted_init(); + esp_hosted_power_save_init(); + + /* + * The call to esp_hosted_init() automatically handles informing the + * slave that the host has woken up. No explicit call to + * stop_host_power_save() is needed here. + */ + + ESP_LOGI(TAG, "Application running. Entering power save in 15 seconds."); + vTaskDelay(pdMS_TO_TICKS(15000)); + + ESP_LOGI(TAG, "Initiating power save now."); + /* This function does not return. The host will enter power save mode + * and wake up from app_main upon wake-up event. */ + esp_hosted_power_save_start(HOSTED_POWER_SAVE_TYPE_DEEP_SLEEP); +} +``` + +### Slave Example + +The slave wakes the host automatically for host destined network packets. +The example below demonstrates manual wake-up using timer + +```c +#include "host_power_save.h" + +static const char* TAG = "SLAVE_APP"; + +void wake_host_task(void *pvParameters) +{ + /* Wait for a while before attempting to wake the host */ + vTaskDelay(pdMS_TO_TICKS(30000)); + + ESP_LOGI(TAG, "Checking host power state."); + + /* Check if the host is actually sleeping */ + if (is_host_power_saving()) { + ESP_LOGI(TAG, "Host is in power save mode. Sending wake-up signal."); + + /* + * Attempt to wake the host. The timeout (in ms) is for the + * handshake to complete after the host wakes up. + */ + int ret = wakeup_host(5000); + if (ret == 0) { + ESP_LOGI(TAG, "Host wake-up process initiated successfully."); + } else { + ESP_LOGE(TAG, "Failed to wake up host. Error: %d", ret); + } + } else { + ESP_LOGI(TAG, "Host is already awake."); + } + + vTaskDelete(NULL); +} + +void app_main(void) +{ + /* + * Initialize slave-side components... + * host_power_save_init() is called internally by the ESP-Hosted component. + */ + + /* Create a task to wake up the host */ + xTaskCreate(wake_host_task, "wake_host_task", 2048, NULL, 5, NULL); +} +``` + +--- + +## Troubleshooting + +1. **Wake-up Failures** + - Check GPIO configuration and physical connections. + - Verify `CONFIG_ESP_HOSTED_HOST_WAKEUP_GPIO` is set correctly on both host and slave. + - Check that the GPIO level configuration (High/Low) matches on both devices. + +2. **Conflicting GPIOs** + - Ensure you use Host Wakeup GPIO different from the GPIOs used in communication bus underlying + +3. **Network Connectivity Loss** + - Verify the slave maintains its WiFi connection while the host is asleep. + - Check the Network Split configuration if enabled. + +4. **Transport Synchronization Issues** + - Ensure the correct power state signals are being sent. After wake-up, the host should log that it is informing the slave it has woken up. + diff --git a/docs/feature_network_split.md b/docs/feature_network_split.md new file mode 100644 index 00000000..d7d7f79a --- /dev/null +++ b/docs/feature_network_split.md @@ -0,0 +1,229 @@ +# Network Split Feature for ESP-Hosted MCU + + +| Supported Slave Targets | ESP32-C5 | ESP32-C6 | ESP32-S2 | ESP32-S3 | +|------------------------|:--------:|:--------:|:--------:|:--------:| + + +## Overview + +**Network Split** allows the **Host MCU** and **ESP32 Slave** to share one IP address and split traffic between them. + +It is especially useful when the host sleeps — the ESP continues handling selected network activity (e.g., MQTT, DNS). + +**Highlights:** + +* Port-based traffic routing +* Shared IP address +* Packet filtering and DPI +* Wake-on-packet support (e.g., MQTT) +* Power management integration +* **Supported Slave Targets:** ESP32-C5/C6/S2/S3 only + +--- + +## Configuration + +### On the Slave + +1. Run: + + ```bash + idf.py menuconfig + ``` +2. Enable: + + ``` + Example Configuration + └── [*] Enable Network Split + ``` +3. (Optional) Customize under `Network Split Configuration`: + + ``` + ├── Host Static Port Forwarding + │ ├── TCP dst: 22,80,443,8080,8554 + │ └── UDP dst: 53,123 + ├── Port Ranges + │ ├── Host: 49152–61439 + │ └── Slave: 61440–65535 + └── Default Destination: slave / host / both + ``` + +### On the Host + +1. Run: + + ```bash + idf.py menuconfig + ``` +2. Enable: + + ``` + Component config + └── ESP-Hosted config + └── [*] Enable Network Split + ``` +3. Match **port ranges** with the slave: + + ``` + └── LWIP port config + ├── Host LWIP: 49152–61439 + └── Slave LWIP: 61440–65535 + ``` +4. Integrate into your app: + ```c + #include "esp_hosted.h" + + void app_main(void) { + esp_hosted_init(); + // Host now shares IP and splits traffic with slave + } + ``` + +> [!TIP] +> +> The port ranges on the host and slave must match perfectly to avoid routing issues. + +--- + +## Packet Routing Decisions + +All incoming network packets arriving at the slave device are evaluated by the logic in `lwip_filter.c`. For each packet received from the WiFi router, the slave determines whether it should be processed locally, forwarded to the host, or handled by both network stacks, according to defined routing rules. + +| Packet Type | Destination Port Condition | Routed To | +|--------------------------------------- |--------------------------------------------|------------------------------------| +| Broadcast, ARP Request, ICMP Request | N/A | Slave Network Stack | +| ARP Response, ICMP Response | N/A | Both Network Stacks | +| DHCP | Any | Both Network Stacks | +| TCP/UDP | Listed in Static Port Forwarding | Host Network Stack | +| TCP/UDP | Within Host Port Range | Host Network Stack | +| TCP/UDP | Within Slave Port Range | Slave Network Stack | +| TCP/UDP | Port 5001 (iperf) | Both Network Stacks | +| MQTT (Port 1883) | Payload contains `"wakeup-host"` | Host Network Stack (Wake-up) | +| Others | Not matched by any rule | Default Destination (as configured)| +| Packet destined for Host Network Stack | Host is in deep sleep | Dropped (unless wake-up packet) | + +> [!TIP] +> +> The packet routing logic is fully customizable within the `lwip_filter.c` file, allowing users to adapt the network management behavior to their specific requirements. + +The following diagrams illustrate the decision-making process for packet routing in the Network Split feature. + +```mermaid +flowchart TD + A[New Packet] --> B{MAC Broadcast?} + B -->|Yes| C[Send to
Slave Network Stack] + B -->|No| D{IP Packet?} + D -->|Yes| E[Protocol Processing] + D -->|No| F[ARP Processing] + + E --> G{TCP?} + E --> H{UDP?} + E --> I{ICMP?} + + classDef slaveNode fill:#d9f7be,stroke:#389e0d + classDef hostNode fill:#d6e4ff,stroke:#1d39c4 + classDef invalidNode fill:#ffccc7,stroke:#cf1322 + classDef bothNode fill:#fff1b8,stroke:#d4b106 + + class C slaveNode +``` + +#### TCP/UDP Packet Processing + +Specific case of UDP/TCP packet processing is illustrated below + +```mermaid +flowchart TD + G[TCP/UDP Packet] --> G1{Port config in
Host Static Forwarding List?
} + G1 -->|Yes| K[Send to
Host Network Stack] + + G1 -->|No| G2{Dest Port in
Slave Range?} + G2 -->|Yes| C[Send to
Slave Network Stack] + + G2 -->|No| G3{Dest Port in
Host Range?} + G3 -->|Yes| G4{Host Awake?} + G4 -->|Yes| K + G4 -->|No| G5{MQTT with
wakeup signal?} + G5 -->|Yes| K + G5 -->|No| L[Drop Packet] + + G3 -->|No| D[Send to
Default Network Stack
from config] + + classDef slaveNode fill:#d9f7be,stroke:#389e0d + classDef hostNode fill:#d6e4ff,stroke:#1d39c4 + classDef invalidNode fill:#ffccc7,stroke:#cf1322 + classDef defaultNode fill:#fff,stroke:#333 + + class K hostNode + class C slaveNode + class L invalidNode + class D defaultNode +``` + +--- + +## Internals + +### Core Routing API + +```c +// lwip_filter.c +hosted_l2_bridge filter_and_route_packet(void *frame_data, uint16_t frame_length); + +typedef enum { + SLAVE_LWIP_BRIDGE = 0, + HOST_LWIP_BRIDGE = 1, + BOTH_LWIP_BRIDGE = 2, + INVALID_BRIDGE = 3 +} hosted_l2_bridge; +``` + +### Wake-Up on MQTT + +```c +static bool host_mqtt_wakeup_triggered(const void *payload, uint16_t length) { + return memcmp(payload, "wakeup-host", strlen("wakeup-host")) == 0; +} +``` + +--- + +## Extras + +### Use Same Port on Both Sides? + +Yes — port 5001 (iperf) is a working example. Others can be added similarly in `lwip_filter.c`. + +--- + +## Files of Interest + +| Purpose | File | +| ---------------- | -------------------------------------- | +| Routing logic | `slave/main/lwip_filter.c` | +| Host-side config | `host/api/include/esp_hosted_config.h` | +| Slave control | `slave/main/interface.h` | +| API entry point | `esp_hosted_init()` | + + +## Debugging & Tips + +### Checklist + +- Port ranges must not overlap +- Logs from `lwip_filter.c` help debug routing +- Static forwarding can override port ranges +- Only supported on ESP32-C5/C6/S2/S3 + +### Debug Logging + +Enable verbose logs in `lwip_filter.c`: + +```c +esp_log_level_set("lwip_filter", ESP_LOG_VERBOSE); +``` + +Wi-Fi sniffer to inspect raw traffic (if really needed) + +--- diff --git a/docs/features.md b/docs/features.md new file mode 100644 index 00000000..61348077 --- /dev/null +++ b/docs/features.md @@ -0,0 +1,29 @@ +# Features Implmented in ESP-Hosted-MCU + +This page documents the features implemented by ESP-Hosted-MCU. + +## Wi-Fi + +1. **Station** (scan, connect to an AP) +2. **SoftAP** (configure, start, stop) +3. **SoftAP+Station** +4. (Optional) [**Network Split**](feature_network_split.md) for splitting network traffic support between the co-processor and the host +5. (Optional) **iTWT** (individual Target Wake Time) Wi-Fi 6 (802.11ax) feature that lets a station negotiate its own wake/sleep schedule with an iTWT supporting AP to reduce power consumption + - only works with co-processors that support iTWT like the ESP32-C6 and ESP32-C5 +6. (Optional) **Wi-Fi Enterprise** security mode for enhanced security in business environments +7. (Optional) **Wi-Fi Easy Connect (DPP)** to securely onboard devices by scanning a QR code (displayed by the host) without entering a Wi-Fi password + - requires a smartphone that supports Wi-Fi Easy Connect to scan the QR code and start the onboarding operation + - APIs added: + - `esp_supp_dpp_init` + - `esp_supp_dpp_deinit` + - `esp_supp_dpp_bootstrap_gen` + - `esp_supp_dpp_start_listen` + - `esp_supp_dpp_stop_listen` + +## Bluetooth + +1. **ESP-Hosted / UART HCI** support for ESP-Nimble and ESP-Bluedroid. See [Bluetooth Design](bluetooth_design.md) for more information + +## Miscelaneous + +1. (Optional) [**Host Power Save**](feature_host_power_save.md) to allow Host to go to sleep and be waken by co-processor diff --git a/docs/images/PerformanceSetup-ShieldBox.png b/docs/images/PerformanceSetup-ShieldBox.png new file mode 100644 index 00000000..6fe02fa4 Binary files /dev/null and b/docs/images/PerformanceSetup-ShieldBox.png differ diff --git a/docs/implemented_rpcs.md b/docs/implemented_rpcs.md new file mode 100644 index 00000000..b8ab9463 --- /dev/null +++ b/docs/implemented_rpcs.md @@ -0,0 +1,134 @@ +# List of RPC Commands implmenented in ESP-Hosted + +A list of RPC Commands implemented in ESP-Hosted based on release version. + +The RPC IDs listed here are for requests and events. Each request will have a corresponding response. + +## List of RPC Requests + +| No. | RPC ID | RPC Command | Added in Release | +|----:|-------:|------------------------------------|------------------| +| 1 | 257 | GetMacAddress | 0.0.6 | +| 2 | 258 | SetMacAddress | 0.0.6 | +| 3 | 259 | GetMode | 0.0.6 | +| 4 | 260 | SetMode | 0.0.6 | +| 5 | 261 | SuppDppInit | 2.4.3 | +| 6 | 262 | SuppDppDeinit | 2.4.3 | +| 7 | 263 | SuppDppBootstrapGen | 2.4.3 | +| 8 | 264 | SuppDppStartListen | 2.4.3 | +| 9 | 265 | SuppDppStopListen | 2.4.3 | +| 10 | 270 | SetPs | 0.0.6 | +| 11 | 271 | GetPs | 0.0.6 | +| 12 | 272 | OTABegin | 0.0.6 | +| 13 | 273 | OTAWrite | 0.0.6 | +| 14 | 274 | OTAEnd | 0.0.6 | +| 15 | 275 | WifiSetMaxTxPower | 0.0.6 | +| 16 | 276 | WifiGetMaxTxPower | 0.0.6 | +| 17 | 277 | ConfigHeartbeat | 0.0.6 | +| 18 | 278 | WifiInit | 0.0.6 | +| 19 | 279 | WifiDeinit | 0.0.6 | +| 20 | 280 | WifiStart | 0.0.6 | +| 21 | 281 | WifiStop | 0.0.6 | +| 22 | 282 | WifiConnect | 0.0.6 | +| 23 | 283 | WifiDisconnect | 0.0.6 | +| 24 | 284 | WifiSetConfig | 0.0.6 | +| 25 | 285 | WifiGetConfig | 0.0.6 | +| 26 | 286 | WifiScanStart | 0.0.6 | +| 27 | 287 | WifiScanStop | 0.0.6 | +| 28 | 288 | WifiScanGetApNum | 0.0.6 | +| 29 | 289 | WifiScanGetApRecords | 0.0.6 | +| 30 | 290 | WifiClearApList | 0.0.6 | +| 31 | 291 | WifiRestore | 0.0.6 | +| 32 | 292 | WifiClearFastConnect | 0.0.6 | +| 33 | 293 | WifiDeauthSta | 0.0.6 | +| 34 | 294 | WifiStaGetApInfo | 0.0.6 | +| 35 | 297 | WifiSetProtocol | 0.0.6 | +| 36 | 298 | WifiGetProtocol | 0.0.6 | +| 37 | 299 | WifiSetBandwidth | 0.0.6 | +| 38 | 300 | WifiGetBandwidth | 0.0.6 | +| 39 | 301 | WifiSetChannel | 0.0.6 | +| 40 | 302 | WifiGetChannel | 0.0.6 | +| 41 | 303 | WifiSetCountry | 0.0.6 | +| 42 | 304 | WifiGetCountry | 0.0.6 | +| 43 | 311 | WifiApGetStaList | 0.0.6 | +| 44 | 312 | WifiApGetStaAid | 0.0.6 | +| 45 | 313 | WifiSetStorage | 0.0.6 | +| 46 | 325 | WifiSetInactiveTime | 2.2.3 | +| 47 | 326 | WifiGetInactiveTime | 2.2.3 | +| 48 | 334 | WifiSetCountryCode | 0.0.6 | +| 49 | 335 | WifiGetCountryCode | 0.0.6 | +| 50 | 338 | WifiStaGetAid | 0.0.10 | +| 51 | 339 | WifiStaGetNegotiatedPhymode | 1.1.3 | +| 52 | 341 | WifiStaGetRssi | 0.0.6 | +| 53 | 342 | WifiSetProtocols | 0.0.10 | +| 54 | 343 | WifiGetProtocols | 0.0.10 | +| 55 | 344 | WifiSetBandwidths | 0.0.10 | +| 56 | 345 | WifiGetBandwidths | 0.0.10 | +| 57 | 346 | WifiSetBand | 0.0.10 | +| 58 | 347 | WifiGetBand | 0.0.10 | +| 59 | 348 | WifiSetBandMode | 0.0.10 | +| 60 | 349 | WifiGetBandMode | 0.0.10 | +| 61 | 350 | GetCoprocessorFwVersion | 1.0.0 | +| 62 | 351 | WifiScanGetApRecord | 1.1.3 | +| 63 | 352 | SetDhcpDnsStatus | 2.1.0 | +| 64 | 353 | GetDhcpDnsStatus | 2.1.0 | +| 65 | 354 | WifiStaTwtConfig | 2.1.2 | +| 66 | 355 | WifiStaItwtSetup | 2.1.2 | +| 67 | 356 | WifiStaItwtTeardown | 2.1.2 | +| 68 | 357 | WifiStaItwtSuspend | 2.1.2 | +| 69 | 358 | WifiStaItwtGetFlowIdStatus | 2.1.2 | +| 70 | 359 | WifiStaItwtSendProbeReq | 2.1.2 | +| 71 | 360 | WifiStaItwtSetTargetWakeTimeOffset | 2.1.2 | +| 72 | 361 | WifiStaEnterpriseEnable | 2.4.0 | +| 73 | 362 | WifiStaEnterpriseDisable | 2.4.0 | +| 74 | 363 | EapSetIdentity | 2.4.0 | +| 75 | 364 | EapClearIdentity | 2.4.0 | +| 76 | 365 | EapSetUsername | 2.4.0 | +| 77 | 366 | EapClearUsername | 2.4.0 | +| 78 | 367 | EapSetPassword | 2.4.0 | +| 79 | 368 | EapClearPassword | 2.4.0 | +| 80 | 369 | EapSetNewPassword | 2.4.0 | +| 81 | 370 | EapClearNewPassword | 2.4.0 | +| 82 | 371 | EapSetCaCert | 2.4.0 | +| 83 | 372 | EapClearCaCert | 2.4.0 | +| 84 | 373 | EapSetCertificateAndKey | 2.4.0 | +| 85 | 374 | EapClearCertificateAndKey | 2.4.0 | +| 86 | 375 | EapGetDisableTimeCheck | 2.4.0 | +| 87 | 376 | EapSetTtlsPhase2Method | 2.4.0 | +| 88 | 377 | EapSetSuiteb192bitCertification | 2.4.0 | +| 89 | 378 | EapSetPacFile | 2.4.0 | +| 90 | 379 | EapSetFastParams | 2.4.0 | +| 91 | 380 | EapUseDefaultCertBundle | 2.4.0 | +| 92 | 381 | WifiSetOkcSupport | 2.4.0 | +| 93 | 382 | EapSetDomainName | 2.4.0 | +| 94 | 383 | EapSetDisableTimeCheck | 2.4.0 | +| 95 | 384 | EapSetEapMethods | 2.4.0 | +| 96 | 385 | IfaceMacAddrSetGet | 2.5.2 | +| 97 | 386 | IfaceMacAddrLenGet | 2.5.2 | +| 98 | 387 | FeatureControl | 2.5.2 | +| 99 | 266 | OTAActivate | 2.6.0 | + + +## List of RPC Events + +| No. | RPC ID | RPC Command | Added in Release | +|----:|-------:|--------------------|------------------| +| 1 | 769 | ESPInit | 0.0.6 | +| 2 | 770 | Heartbeat | 0.0.6 | +| 3 | 771 | AP_StaConnected | 0.0.6 | +| 4 | 772 | AP_StaDisconnected | 0.0.6 | +| 5 | 773 | WifiEventNoArgs | 0.0.6 | +| 6 | 774 | StaScanDone | 0.0.6 | +| 7 | 775 | StaConnected | 0.0.6 | +| 8 | 776 | StaDisconnected | 0.0.6 | +| 9 | 777 | DhcpDnsStatus | 2.0.17 | +| 10 | 778 | StaItwtSetup | 2.2.2 | +| 11 | 779 | StaItwtTeardown | 2.2.2 | +| 12 | 780 | StaItwtSuspend | 2.2.2 | +| 13 | 781 | StaItwtProbe | 2.2.2 | +| 14 | 782 | SuppDppUriReady | 2.4.3 | +| 15 | 783 | SuppDppCfgRecvd | 2.4.3 | +| 16 | 784 | SuppDppFail | 2.4.3 | +| 17 | 785 | WifiDppUriReady | 2.4.3 | +| 18 | 786 | WifiDppCfgRecvd | 2.4.3 | +| 19 | 787 | WifiDppFail | 2.4.3 | diff --git a/docs/migration_guide.md b/docs/migration_guide.md new file mode 100644 index 00000000..e72c4c1a --- /dev/null +++ b/docs/migration_guide.md @@ -0,0 +1,226 @@ +This migration guide documents key changes in ESP-Hosted that users must be aware of when migrating from older versions. + +#### Index +1. [2.6.0 - ESP-Hosted Slave OTA](#coloryellow-text2512---esp-hosted-slave-ota) +2. [2.5.2 - Bluetooth Controller on Co-Processor Disabled by Default](#coloryellow-text252---bluetooth-controller-on-co-processor-disabled-by-default) + + +# $${\color{yellow} \text{2.6.0 - ESP-Hosted Slave OTA}}$$ + + +## Migration needed from versions + +| Slave version | Host version | +| ------------- | ------------ | +| > 2.5.X | > 2.5.X | + +## Reason for change + +1. The existing `esp_hosted_slave_ota()` API was restrictive, supporting only HTTP-based OTA updates. + The OTA APIs are now exposed so developers can implement their own OTA mechanisms. +2. The port layer previously contained OTA logic, which forced inclusion of the HTTP client in the host codebase even when not required. + +## Changes required on host + +If you are migrating from the old `esp_hosted_slave_ota()` function, update your code as follows. + +### Old API (deprecated) + +```c +#include "esp_hosted.h" + +const char *image_url = "http://example.com/network_adapter.bin"; +esp_err_t ret = esp_hosted_slave_ota(image_url); +if (ret == ESP_OK) { + printf("OTA update failed[%d]\n", ret); +} +``` + +## New APIs + +The slave OTA process is now performed using the following APIs. + +### `esp_hosted_slave_ota_begin()` + +```c +esp_err_t esp_hosted_slave_ota_begin(void); +``` + +Initializes the OTA process on the slave. + +* Arguments: None +* Returns: `ESP_OK` on success, or an error code on failure +* What it does: + + * Prepares the slave for firmware reception + * Allocates OTA buffers + * Sets up the OTA partition on the slave + +### `esp_hosted_slave_ota_write()` + +```c +esp_err_t esp_hosted_slave_ota_write(const void *data, size_t size); +``` + +Sends firmware data chunks to the slave. + +* Arguments: + + * `data`: Pointer to firmware data chunk + * `size`: Size of the data chunk (typically 1400–1500 bytes) +* Returns: `ESP_OK` on success, or an error code on failure +* What it does: + + * Transmits firmware data over ESP-Hosted transport (SDIO/SPI/UART) + * The slave writes data to its OTA partition + * Can be called multiple times for large firmware images + +### `esp_hosted_slave_ota_end()` + +```c +esp_err_t esp_hosted_slave_ota_end(void); +``` + +Finalizes the OTA process. + +* Arguments: None +* Returns: `ESP_OK` on success, or an error code on failure +* What it does: + + * Validates the complete firmware image on the slave + * Calculates and verifies checksums + * Marks the new firmware as valid but not yet active + +### `esp_hosted_slave_ota_activate()` + +```c +esp_err_t esp_hosted_slave_ota_activate(void); +``` + +Activates the newly flashed firmware. + +* Arguments: None +* Returns: `ESP_OK` on success, or an error code on failure +* What it does: + + * Switches the slave’s boot partition to the new firmware + * Triggers slave reboot with the new firmware + * Note: After this call, the slave restarts with the new firmware + +## How to use the new APIs + +A dedicated example demonstrates the usage of the new OTA APIs: +[Slave OTA using ESP-Hosted transport](../examples/host_performs_slave_ota/README.md) + +> [!TIP] +> The example uses the new ESP-Hosted-MCU Slave OTA APIs. +> You can reuse or customize it for your own OTA workflow. + +Example methods supported: + +| Method | Description | +| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| Partition method | Slave firmware binary stored in Host’s partition table (`slave_fw` partition). Requires an extra host partition, but no Wi-Fi connectivity. | +| LittleFS method | Host partition formatted as LittleFS and stores the slave firmware. Requires an extra host partition, but no Wi-Fi connectivity. | +| HTTPS method | Slave firmware binary hosted on an HTTPS server. No extra host partition needed, but requires Wi-Fi connectivity. | + +# $${\color{yellow} \text{2.5.2 - Bluetooth Controller on Co-Processor Disabled by Default}}$$ + +## Migration needed from versions + +| Slave version | Host version | +| ------------- | ------------ | +| > 2.5.1 | > 2.5.1 | + +Before v2.5.2, the Bluetooth controller on the co-processor was initialized and enabled by default. +From v2.5.2 onwards, it starts in a disabled state. + +## Reason for change + +This allows users to modify the Bluetooth MAC address before the controller is initialized, as it can only be changed prior to enabling the controller. + +## New APIs + +### `esp_hosted_bt_controller_init()` + +```c +esp_err_t esp_hosted_bt_controller_init(void); +``` + +Initializes the Bluetooth controller on the co-processor. + +* Arguments: None +* Returns: `ESP_OK` on success, or an error code on failure +* What it does: + + * Allocates and initializes controller resources + * Prepares the controller for activation + +### `esp_hosted_bt_controller_deinit()` + +```c +esp_err_t esp_hosted_bt_controller_deinit(bool mem_release); +``` + +Deinitializes the Bluetooth controller on the co-processor. + +* Arguments: + + * `mem_release`: If true, releases controller memory (cannot be reused) +* Returns: `ESP_OK` on success, or an error code on failure +* What it does: + + * Stops the Bluetooth controller + * Optionally releases memory used by the controller + * Once released, the controller cannot be reinitialized without reboot + +### `esp_hosted_bt_controller_enable()` + +```c +esp_err_t esp_hosted_bt_controller_enable(void); +``` + +Enables the Bluetooth controller on the co-processor. + +* Arguments: None +* Returns: `ESP_OK` on success, or an error code on failure +* What it does: + + * Starts the Bluetooth controller task + * Enables radio and HCI interfaces for Bluetooth operation + +### `esp_hosted_bt_controller_disable()` + +```c +esp_err_t esp_hosted_bt_controller_disable(void); +``` + +Disables the Bluetooth controller on the co-processor. + +* Arguments: None +* Returns: `ESP_OK` on success, or an error code on failure +* What it does: + + * Gracefully stops the controller + * Disables the Bluetooth radio + * Must be called before deinitializing the controller + +## Changes required on host + +Before starting the Bluetooth stack on the host: + +1. Call `esp_hosted_connect_to_slave()` to establish a connection with the slave. +2. (Optional) Set the Bluetooth MAC address using `esp_hosted_iface_mac_addr_set()`. +3. Initialize the Bluetooth controller using `esp_hosted_bt_controller_init()`. +4. Enable the Bluetooth controller using `esp_hosted_bt_controller_enable()`. + +See [Initializing the Bluetooth Controller](bluetooth_design.md#31-initializing-the-bluetooth-controller) for more details. + +## How to use the new APIs + +You can now start the host Bluetooth stack and use Bluetooth as usual. +All ESP-Hosted Bluetooth host examples (NimBLE and BlueDroid) have been updated accordingly. + +For an example showing how to change the BT MAC address before starting the controller, refer to: +[BT Controller Example](../examples/host_bt_controller_mac_addr/) + diff --git a/docs/performance_optimization.md b/docs/performance_optimization.md new file mode 100644 index 00000000..a3811a73 --- /dev/null +++ b/docs/performance_optimization.md @@ -0,0 +1,268 @@ +# ESP-Hosted Performance Optimization Guide + +Quick reference for optimizing ESP-Hosted performance across co-processors and different transport interfaces. + +
+Table of Contents + +1. [Quick Start - High Performance Config](#1-quick-start---high-performance-config) + + 1.1 [ESP32-C6 as Co-Procesor](#11-esp32-c6-as-co-procesor) + + 1.2 [ESP32-C5 as Co-Processor](#12-esp32-c5-as-co-processor) + + 1.3 [ESP32-C61 as Co-Processor](#13-esp32-c61-as-co-processor) + + 1.4 [ESP32-C2 as Co-Processor](#14-esp32-c2-as-co-processor) + +2. [Transport Optimization](#2-transport-optimization) + + 2.1 [SDIO (Highest Performance)](#21-sdio-highest-performance) + + 2.2 [SPI Full-Duplex](#22-spi-full-duplex) + + 2.3 [2.3 SPI Half-Duplex](#23-spi-half-duplex) + + 2.4 [UART (Lowest Performance)](#24-uart-lowest-performance) + +3. [Memory Optimization](#3-memory-optimization) + +4. [Hardware Guidelines](#4-hardware-guidelines) + + 4.1 [Critical Requirements](#41-critical-requirements) + + 4.2 [PCB Design Checklist](#42-pcb-design-checklist) + + 4.3 [Development Workflow](#43-development-workflow) + +
+ +## 1 Quick Start - High Performance Config + +For immediate performance gains, add these to your host's `sdkconfig.defaults.esp32XX` file based on the co-processor you are using. + +> [!NOTE] +> Adjust the values based on your MCU host's and co-processor memory capacity. These values may change when more testing shows better performance figures. + +Test conditions for throughput numbers using the performance settings: + +- raw: data transferred from sender to receiver over transport +- iPerf: `` <--`open air`--> `` <--`Lan Cable`--> `` + +### 1.1 ESP32-C6 as Co-Procesor + +``` +### sdkconfig for ESP32-P4 + C6 as co-processor +# Wi-Fi Performance +CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16 +CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=64 +CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=64 +CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y +CONFIG_WIFI_RMT_TX_BA_WIN=32 +CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y +CONFIG_WIFI_RMT_RX_BA_WIN=32 + +# TCP/IP Performance +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 +CONFIG_LWIP_TCP_WND_DEFAULT=65534 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCP_SACK_OUT=y +``` + +**Throughput using the settings.** + +Using SDIO Transport, 4-bits, running at 40MHz, connected to a 2.4GHz network over the air + +| Type | Direction | MBits/s | +|------------|---------------|--------:| +| Raw | P4 to C6 | 72 | +| Raw | C6 to P4 | 80 | +| iPerf, TCP | P4 to Test PC | 32 | +| iPerf, UDP | P4 to Test PC | 50 | +| iPerf, TCP | Test PC to P4 | 30 | +| iPerf, UDP | Test PC to P4 | 49 | + +### 1.2 ESP32-C5 as Co-Processor + +``` +### sdkconfig for ESP32-P4 + C5 as co-processor +# Wi-Fi Performance +CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=10 +CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=32 +CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y +CONFIG_WIFI_RMT_TX_BA_WIN=32 +CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y +CONFIG_WIFI_RMT_RX_BA_WIN=16 + +# TCP/IP Performance +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=11520 +CONFIG_LWIP_TCP_WND_DEFAULT=32768 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=48 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=48 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=48 + +CONFIG_LWIP_TCP_SACK_OUT=y +``` + +**Throughput using the settings.** + +Using SDIO Transport, 4-bits, running at 40MHz, connected to a 5GHz network over the air + +| Type | Direction | MBits/s | +|------------|---------------|--------:| +| Raw | P4 to C5 | 72 | +| Raw | C5 to P4 | 81 | +| iPerf, TCP | P4 to Test PC | 23 | +| iPerf, UDP | P4 to Test PC | 67 | +| iPerf, TCP | Test PC to P4 | 32 | +| iPerf, UDP | Test PC to P4 | 68 | + +### 1.3 ESP32-C61 as Co-Processor + +``` +### sdkconfig for ESP32-P4 + C61 as co-processor +# Wi-Fi Performance +CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=10 +CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=16 +CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=16 +CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y +CONFIG_WIFI_RMT_TX_BA_WIN=16 +CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y +CONFIG_WIFI_RMT_RX_BA_WIN=16 + +# TCP/IP Performance +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=20480 +CONFIG_LWIP_TCP_WND_DEFAULT=20480 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=48 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=48 + +CONFIG_LWIP_TCP_SACK_OUT=y +``` + +**Throughput using the settings.** + +Using SPI-FD Transport, running at 40MHz, connected to a 2.4GHz network over the air + +| Type | Direction | MBits/s | +|------------|---------------|--------:| +| Raw | P4 to C61 | 25 | +| Raw | C61 to P4 | 26 | +| iPerf, TCP | P4 to Test PC | 12 | +| iPerf, UDP | P4 to Test PC | 18 | +| iPerf, TCP | Test PC to P4 | 15 | +| iPerf, UDP | Test PC to P4 | 23 | + +### 1.4 ESP32-C2 as Co-Processor + +``` +### sdkconfig for ESP32-P4 + C2 as co-processor +# Wi-Fi Performance +CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=10 +CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=32 +CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y +CONFIG_WIFI_RMT_TX_BA_WIN=6 +CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y +CONFIG_WIFI_RMT_RX_BA_WIN=6 + +# TCP/IP Performance +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=16384 +CONFIG_LWIP_TCP_WND_DEFAULT=32768 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=20 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=20 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=20 + +CONFIG_LWIP_TCP_SACK_OUT=y +``` + +**Throughput using the settings.** + +Using SPI-FD Transport, running at 40MHz, connected to a 2.4GHz network over the air + +| Type | Direction | MBits/s | +|------------|---------------|--------:| +| Raw | P4 to C2 | 25 | +| Raw | C2 to P4 | 26 | +| iPerf, TCP | P4 to Test PC | 12 | +| iPerf, UDP | P4 to Test PC | 18 | +| iPerf, TCP | Test PC to P4 | 13 | +| iPerf, UDP | Test PC to P4 | 15 | + +## 2 Transport Optimization + +### 2.1 SDIO (Highest Performance) +- **Clock Speed**: Start at 20 MHz, optimize up to 50 MHz +- **Bus Width**: Use 4-bit mode +- **Hardware**: Use PCB with controlled impedance, external pull-ups (51kΩ) +- **Checksum**: Optional (SDIO hardware handles verification) + +``` +CONFIG_ESP_HOSTED_SDIO_CLOCK_FREQ_KHZ=40000 +CONFIG_ESP_HOSTED_SDIO_BUS_WIDTH=4 +``` + +> [!NOTE] +> See [Performance and Memory Usage](sdio.md#9-performance-and-memory-usage) on the trade-off between SDIO Performance and Memory Use + +### 2.2 SPI Full-Duplex +- **Clock Speed**: ESP32: ≤10 MHz, Others: ≤40 MHz +- **Hardware**: Use IO_MUX pins, short traces (≤10cm for jumpers) +- **Checksum**: Mandatory (SPI hardware lacks error detection) + +``` +CONFIG_ESP_HOSTED_SPI_CLK_FREQ=40 +``` + +### 2.3 SPI Half-Duplex +- **Data Lines**: Use 4-line (Quad SPI) mode +- **Similar optimizations as SPI Full-Duplex** + +### 2.4 UART (Lowest Performance) +- **Baud Rate**: Use 921600 (highest stable rate) +- **Best for**: Low-throughput applications, debugging + +## 3 Memory Optimization + +- Reduce memory footprint for resource-constrained applications: + + ``` + # Reduce queue sizes + CONFIG_ESP_HOSTED_SDIO_TX_Q_SIZE=10 # Default: 20 + CONFIG_ESP_HOSTED_SDIO_RX_Q_SIZE=10 # Default: 20 + + # Enable memory pooling + CONFIG_ESP_HOSTED_USE_MEMPOOL=y + ``` + +- Disable the not-in-use features + - For example, disable bluetooth if not needed +- Use external RAM, for higher memory (PSRAM is supported) +- Optimise internal RAM using [ESP-IDF iram optimization tricks](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/performance/ram-usage.html) +## 4 Hardware Guidelines + +### 4.1 Critical Requirements +1. **Signal Integrity**: Use PCB designs for production, jumpers only for prototyping +2. **Power Supply**: Stable 3.3V, proper decoupling capacitors +3. **Trace Length**: Match lengths, especially clock vs data lines +4. **Pull-ups**: Required for SDIO (51kΩ) on CMD, D0-D3 lines + +### 4.2 PCB Design Checklist +- [ ] Equal trace lengths for communication signals +- [ ] Ground plane for signal stability +- [ ] Controlled impedance traces (50Ω typical) +- [ ] Series termination resistors for high-speed signals +- [ ] Extra GPIOs reserved for future features (deep sleep, etc.) + +### 4.3 Development Workflow +1. **Proof of Concept**: Start with jumper wires, low clock speeds +2. **Incremental Optimization**: Increase transport clock step by step +3. **Hardware Validation**: Move to PCB for final validation +4. **Performance Tuning**: Optimize buffers and configurations +5. **Disable features**: Any unsued components from ESP-IDF or + +ESP-Hosted-MCU features could be disabled for more memory +availability. diff --git a/docs/sdio.md b/docs/sdio.md index 1d48c035..9c324e25 100644 --- a/docs/sdio.md +++ b/docs/sdio.md @@ -8,6 +8,7 @@ If you wish to skip the theory, you can refer the [Quick Start Guide](#1-quick-s
Table of Contents + 1. [Quick Start Guide](#1-quick-start-guide) 2. [Introduction](#2-introduction) @@ -24,7 +25,9 @@ If you wish to skip the theory, you can refer the [Quick Start Guide](#1-quick-s 8. [Testing and Troubleshooting](#8-testing-and-troubleshooting) -9. [References](#9-references) +9. [Performance and Memory Usage](#9-performance-and-memory-usage) || [9.1 Stream and Packet Mode](#91-stream-and-packet-mode) || [9.2 Double Buffering on the Host](#92-double-buffering-on-the-host) || [9.3 Reducing Memory Usage](#93-reducing-memory-usage) || [9.4 Switching to Packet Mode](#94-switching-to-packet-mode) + +10. [References](#10-references)
@@ -37,6 +40,7 @@ This section provides a brief overview of how to get started with ESP-Hosted usi - [6. Flashing the Co-processor](#6-flashing-the-co-processor) - [7. Flashing the Host](#7-flashing-the-host) - [8. Testing and Troubleshooting](#8-testing-and-troubleshooting) +- [9. Performance and Memory Usage](#9-performance-and-memory-usage) These sections will guide you through the process of flashing both the co-processor and host devices, setting up the hardware connections, and verifying successful communication. @@ -127,41 +131,61 @@ For optimal performance and reliability in production designs: Setting up the hardware involves connecting the master and co-processor devices via the SDIO pins and ensuring all extra GPIO signals are properly connected. Below is the table of connections for the SDIO setup between a host ESP chipset and another ESP chipset as co-processor: +### Host Connections + +SDIO-capable host microcontrollers (MCUs) can connect their GPIO lines to the co-processor as detailed in the table below. + +#### GPIO Flexibility + +- The ESP32 supports SDIO host on fixed GPIOs. +- The ESP32-S3 supports SDIO host on flexible GPIOs. +- For the ESP32-P4, Slot 0 supports fixed GPIOs, while Slot 1 supports flexible GPIOs. +By default, Slot 1 is used on the ESP32-P4 to take advantage of its flexible pin mapping; however, Slot 0 is also supported. Parallel access to both Slot 0 and Slot 1 is supported for all hosts. -### Host connections -| Signal | ESP32 | ESP32-S3 | ESP32-P4-Function-EV-Board | -|-------------|-------|----------|----------| -| CLK | 14 | 19 | 18 | -| Reset Out | 5 | 42 | 54 | -| CMD | 15+[ext-pull-up](#34-pull-up-resistors) | 47+[ext-pull-up](#34-pull-up-resistors) | 19+[ext-pull-up](#34-pull-up-resistors) | -| DAT0 | 2+[ext-pull-up](#34-pull-up-resistors) | 13+[ext-pull-up](#34-pull-up-resistors) | 14+[ext-pull-up](#34-pull-up-resistors) | -| DAT1 | 4+[ext-pull-up](#34-pull-up-resistors) | 35+[ext-pull-up](#34-pull-up-resistors) | 15+[ext-pull-up](#34-pull-up-resistors) | -| DAT2 | 12+[ext-pull-up](#34-pull-up-resistors) | 20+[ext-pull-up](#34-pull-up-resistors) | 16+[ext-pull-up](#34-pull-up-resistors) | -| DAT3 | 13+[ext-pull-up](#34-pull-up-resistors) | 9+[ext-pull-up](#34-pull-up-resistors) | 17+[ext-pull-up](#34-pull-up-resistors) | +| Signal | ESP32 | ESP32-S3 | +|-----------|-------|----------| +| CLK | 14 | 19 | +| CMD | 15+[ext-pull-up](#34-pull-up-resistors) | 47+[ext-pull-up](#34-pull-up-resistors) | +| D0 | 2+[ext-pull-up](#34-pull-up-resistors) | 13+[ext-pull-up](#34-pull-up-resistors) | +| D1 | 4+[ext-pull-up](#34-pull-up-resistors) | 35+[ext-pull-up](#34-pull-up-resistors) | +| D2 | 12+[ext-pull-up](#34-pull-up-resistors) | 20+[ext-pull-up](#34-pull-up-resistors) | +| D3 | 13+[ext-pull-up](#34-pull-up-resistors) | 9+[ext-pull-up](#34-pull-up-resistors) | +| Reset Out | 5 | 42 | +### ESP32-P4-Function-EV-Board Host Pin Mapping + +| Signal | ESP32-P4 with ESP32-C6 Co-processor | ESP32-P4 with ESP32-C5 Co-processor | +|-----------|-------------------------------------|-------------------------------------| +| CLK | 18 | 33 | +| CMD | 19+[ext-pull-up](#34-pull-up-resistors) | 4+[ext-pull-up](#34-pull-up-resistors) | +| D0 | 14+[ext-pull-up](#34-pull-up-resistors) | 20+[ext-pull-up](#34-pull-up-resistors) | +| D1 | 15+[ext-pull-up](#34-pull-up-resistors) | 23+[ext-pull-up](#34-pull-up-resistors) | +| D2 | 16+[ext-pull-up](#34-pull-up-resistors) | 21+[ext-pull-up](#34-pull-up-resistors) | +| D3 | 17+[ext-pull-up](#34-pull-up-resistors) | 22+[ext-pull-up](#34-pull-up-resistors) | +| Reset Out | 54 | 53 | + +> ### Co-processor connections -| Signal | ESP32 | ESP32-C6 | -|-------------|-------|----------| -| CLK | 14 | 19 | -| CMD | 15 | 18 | -| DAT0 | 2 | 20 | -| DAT1 | 4 | 21 | -| DAT2 | 12 | 22 | -| DAT3 | 13 | 23 | -| Reset In | EN | EN/RST | +SDIO slave provider ESP chips are : ESP32, ESP32-C5, ESP32-C6.\ +All these chips have fixed GPIOs SDIO support. +| Signal | ESP32 | ESP32-C6 | ESP32-C5 | +|----------|-------|----------|----------| +| CLK | 14 | 19 | 9 | +| CMD | 15 | 18 | 10 | +| D0 | 2 | 20 | 8 | +| D1 | 4 | 21 | 7 | +| D2 | 12 | 22 | 14 | +| D3 | 13 | 23 | 13 | +| Reset In | EN | EN/RST | RST | > [!NOTE] > -> A. Try to use IO_MUX pins from the datasheet for optimal performance on both sides. \ -> B. These GPIO assignments are based on default Kconfig configurations. You can modify these in the menuconfig for both host and co-processor if needed. \ -> C. Once ported, any other host with standard SDIO can be used. \ -> D. ESP32, ESP32-S3, and ESP32-P4 can be used as hosts; ESP32 and ESP32-C6 can be used as co-processors in SDIO mode. \ -> E. External pull-ups are mandatory +> - External pull-ups are mandatory ## 5 Set-Up ESP-IDF @@ -189,8 +213,8 @@ Please follow the [ESP-IDF Get Started Guide](https://docs.espressif.com/project ## 6. Flashing the Co-processor -| Supported Co-processor Targets | ESP32 | ESP32-C6 | -| ------------------------------ | ----- | -------- | +| Supported Co-processor Targets | ESP32 | ESP32-C6 | ESP32-C5 | +| ------------------------------ | ----- | -------- | -------- | There are four steps to flash the ESP-Hosted co-processor firmware: @@ -215,11 +239,11 @@ There are four steps to flash the ESP-Hosted co-processor firmware: ``` #### 6.2.1 Transport config - - Navigate to "Example configuration" -> "Transport layer" - - Select "SDIO" + - Navigate to "Example configuration" -> "Bus Config in between Host and Co-processor" + - In "Transport layer", select "SDIO" #### 6.2.2 Any other config - - Optionally, Configure any additional SDIO-specific settings like co-processor GPIOs, SDIO Mode, SDIO timing,etc. + - Optionally, Configure any additional SDIO-specific settings in the "SDIO Configuration" menu, like co-processor GPIOs, SDIO Mode, SDIO timing,etc. ###### Generated files - Generated config files are (1) `sdkconfig` file and (2) internal `sdkconfig.h` file. @@ -238,7 +262,13 @@ There are four steps to flash the ESP-Hosted co-processor firmware: ### 6.4 Co-processor Flashing -There are two methods to flash the ESP-Hosted co-processor firmware: +It is **recommended** to periodically upgrade the slave firmware to leverage new features, bug fixes, and performance improvements. + +| Method | Description | Recommended Use | +| -------------------------- | -------------------------------------------------- | ----------------------------------------------------- | +| **Direct Serial Flashing** | Uses UART pins for direct firmware installation | First-time setup to install ESP-Hosted slave firmware | +| **Slave OTA Update** | Performs slave firmware updates directly from Host | All subsequent updates after initial installation | + #### 6.4.1 Serial Flashing (Initial Setup) @@ -255,60 +285,20 @@ idf.py -p flash > > Put host in bootloader mode using following command and then retry flashing the co-processor > -> ```bash -> esptool.py -p **** --before default_reset --after no_reset run -> ``` - -Monitor the output (optional): -``` -idf.py -p monitor -``` +> `esptool.py -p **** --before default_reset --after no_reset run` +> +> Flash the co-processor and log the output: +> +> `idf.py -p flash monitor` ##### 6.4.2 Co-processor OTA Flashing (Subsequent Updates) -For subsequent updates, you can re-use ESP-Hosted-MCU transport, as it should be already working. While doing OTA, Complete co-processor firmware image is not needed and only co-processor application partition, 'network_adapter.bin' need to be re-flashed remotely from host. - -1. Ensure your co-processor device is connected and communicating with the host with existing ESP-Hosted-MCU. - -2. Create a web server -You can re-use your existing web server or create a new locally for testing. Below is example to do it. - - Make a new directory so that web server can be run into it and navigate into it - - Create simple local web server using python3 - - ```bash - python3 -m http.server 8080 - ``` -3. Copy the co-processor app partition `network_adapter.bin` in the directory where you created the web server. - - The `network_adapter.bin` can be found in your co-processor project build at `/build/network_adapter.bin` - -4. Verify if web server is set-up correctly - - Open link `http://127.0.0.1:8080` in the browser and check if network_adapter.bin is available. - - Right click and copy the complete URL of this network_adapter.bin and note somewhere. - -5. On the **host side**, use the `esp_hosted_slave_ota` function to initiate the OTA update: +The ESP-Hosted link comes pre-configured and ready to use on first boot. You can update the slave firmware remotely from the host MCU using OTA (Over-The-Air) updates: **No** ESP-Prog, serial cable, or extra GPIO connections are required. - ```c - #include "esp_hosted_api.h" - - const char* image_url = "http://example.com/path/to/network_adapter.bin"; //web server full url - esp_err_t ret = esp_hosted_slave_ota(image_url); - if (ret == ESP_OK) { - printf("co-processor OTA update failed[%d]\n", ret); - } - ``` +For step-by-step instructions, see the [Host Performs Slave OTA Example](../examples/host_performs_slave_ota/README.md). - This function will download the firmware in chunk by chunk as http client from the specified URL and flash it to the co-processor device through the established transport. - In above web server example, You can paste the copied url earlier. -6. Monitor the OTA progress through the console output on both the host and co-processor devices. - -> [!NOTE] -> -> A. The `esp_hosted_slave_ota` function is part of the ESP-Hosted-MCU API and handles the OTA process through the transport layer. \ -> B. Ensure that your host application has web server connectivity to download the firmware file. \ -> C. The co-processor device doesn't need to be connected to the web server for this OTA method. - ## 7 Flashing the Host | Supported Host Targets | Any ESP chipset | Any Non-ESP chipset | @@ -365,30 +355,36 @@ Now that ESP-IDF is set up, follow these steps to prepare the host: ### 7.3 Menuconfig, Build and Flash Host ##### 1. High performance configurations - This is optional step, suggested for high performance applications. +This is optional step, suggested for high performance applications. - If using ESP32-P4 as host: - - Remove the default `sdkconfig.defaults.esp32p4` file. - - Create a new `sdkconfig.defaults.esp32p4` file with the following content: - ``` - CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=16 - CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=64 - CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=64 - CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y - CONFIG_ESP_WIFI_TX_BA_WIN=32 - CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y - CONFIG_ESP_WIFI_RX_BA_WIN=32 - - CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 - CONFIG_LWIP_TCP_WND_DEFAULT=65534 - CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 - CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 - CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 - - CONFIG_LWIP_TCP_SACK_OUT=y - ``` +If using ESP32-P4 as host and the ESP32-C6 as the co-processor: + +- Remove all `CONFIG_ESP_WIFI_` settings. They do not apply to ESP-Hosted. +- Add the following settings to your `sdkconfig.defaults.esp32p4` file: + ``` + ### sdkconfig for ESP32-P4 + C6 Dev board + CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16 + CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=64 + CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=64 + CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y + CONFIG_WIFI_RMT_TX_BA_WIN=32 + CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y + CONFIG_WIFI_RMT_RX_BA_WIN=32 + + CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 + CONFIG_LWIP_TCP_WND_DEFAULT=65534 + CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 + CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 + CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 + + CONFIG_LWIP_TCP_SACK_OUT=y + ``` - For other hosts also, you can merge above configs in corresponding `sdkconfig.defaults.esp32XX` file. +For other ESP32 hosts, you can merge above configs into the corresponding `sdkconfig.defaults.esp32XX` file. + +To adjust other Wi-Fi parameters, run `idf.py menuconfig` and go to `Component config` ---> `Wi-Fi Remote` ---> `Wi-Fi configuration`. + +Optimised parameters for other co-processors can be found in the [Performance Optimization Guide](performance_optimization.md). ###### 2. Set environment for your host ESP chip: @@ -524,6 +520,10 @@ After flashing both the co-processor and host devices, follow these steps to con Note: Replace `` with the IP address of the external STA, and `` with the IP address of the ESP-Hosted device. +> [!TIP] +> +> To measure the optimal performance, check out the [Shield Box Test Setup](shield-box-test-setup.md). + 8. Troubleshooting: - Consider using a lower clock speed or checking your [hardware setup](docs/sdio.md#7-hardware-setup) if you experience communication problems. - ESP-Hosted-MCU troubleshooting guide: [docs/troubleshooting.md](docs/troubleshooting.md) @@ -534,10 +534,105 @@ After flashing both the co-processor and host devices, follow these steps to con - Use a logic analyzer or oscilloscope to verify the SDIO signals. - Ensure that the power supply to both devices is stable and within the required voltage levels. -## 9 References +## 9 Performance and Memory Usage + +Quick summary: + +- for maximum network performance, at the cost of more memory usage on host and co-processor, use SDIO Streaming Mode (default mode of operation) +- for lower memory usage, at the cost of lower network performance, use [SDIO Packet Mode](#94-switching-to-packet-mode) + +### 9.1 Stream and Packet Mode + +The co-processor SDIO can operate in two modes: Streaming Mode and Packet Mode. + +| **Streaming Mode** | **Packet Mode** | +| --- | --- | +| Co-processor combines multiple queued Tx packets together into one large packet | Co-processor queues individual Tx packets | +| Host fetches the large packet as one SDIO transfer | Host fetches each packet one at a time | +| Host breaks the large packet back into individual packets to send to the Rx queue | Host sends each packet to the Rx queue | +| More efficient (less SDIO overhead), but requires more memory at Host to hold the large packet | Less efficient (higher SDIO overhead for each packet), but minimises memory required at Host | + +### 9.2 Double Buffering on the Host + +The Host implements a double-buffering scheme to receive data. One thread fetches data (using hardware DMA) from the co-processor and stores it in one Rx buffer, while another thread breaks up previously received data into packets for processing. + +### 9.3 Reducing Memory Usage in Streaming Mode + +#### 9.3.1 Host Receive + +> [!NOTE] +> **Host Receive**: Router --Network Data--> Co-processor --SDIO--> Host + +In SDIO streaming mode, the host receives SDIO data from the co-processor in one large SDIO transfer. For this reason, **Streaming mode consumes more heap memory** compared to Packet mode, and has a higher throughput (less SDIO overhead). + +For Host systems with high heap memory usage, you can reduce the amount of heap memory used by ESP-Hosted for buffers, at the cost of reduced throughput, by adjusting the number of Tx buffers used by the co-processor. + +**On the co-processor**: run `idf.py menuconfig` -> `Example Configuration` -> `Bus Config in between Host and Co-processor` -> `SDIO Configuration` and adjust `SDIO Tx queue size`. The default queue size is `20`. + +The table below shows the effect of changing `SDIO Tx queue size` on throughput and memory usage on the Host. The throughput numbers are obtained by using the RawTP option in ESP-Hosted to send / receive raw SDIO data. + +| SDIO Tx queue size | Host Rx Raw Throughput (Mbits/s) | Memory Used by Buffers (Tested) | Memory Used by Buffers (Theoretical) | +| ---: | ---: | ---: | ---: | +| 5 | 54 | 12,288 | 15,360 | +| 10 | 70 | 26,624 | 30,720 | +| 15 | 76 | 41,984 | 46,080 | +| 20 | 80 | 56,320 | 61,440 | +| 25 | 82 | 65,536 | 76,800 | +| 30 | 84 | 65,536 | 92,160 | + +> [!NOTE] +> The SDIO packet size is 1536 bytes. The co-processor can send at most `(Tx queue size) * 1536` bytes. Since the Host does double buffering, the theoretical Buffer Size needed is `2 * (Tx queue size) * 1536`. + +From the table above, throughput is more or less stagnant on and above Rx queue size of `25`. For a good trade off between memory consumption vs performance, the Rx queue sizes are currently defaulted to `20`. + +#### 9.3.2 Host Transmit + +> [!NOTE] +> **Host Transmit**: Host --SDIO--> Co-Processor --Network Data--> Router + +To reduce memory usage on the co-processor, you can reduce the number of buffers the co-processor uses to receive data from the Host. + +**On the co-processor**: run `idf.py menuconfig` + +``` +Example Configuration +└── Bus Config in between Host and Co-processor + └── SDIO Configuration + └── SDIO Rx queue size (default: 20) +``` + +Reducing the number of Rx buffers on the co-processor can affect the Tx throughput from the Host if the number of Rx buffers is set to a small value. + +### 9.4 Switching to Packet Mode + +For mimimal memory usage with a lower throughput, you can switch to Packet Mode. To do this: + +- on the co-processor: run `idf.py menuconfig` + + ``` + Example Configuration + └── Bus Config in between Host and Co-processor + └── SDIO Configuration + └── Enable SDIO Streaming Mode [Deselect this option] + ``` + +- on the host: run `idf.py menuconfig` + ``` + ── Component config + └── ESP-Hosted config + └── Hosted SDIO Configuration + └── SDIO Receive Optimization + ├── No optimization + ├── Always Rx Max Packet size [Change to this, preferably] + └── Use Streaming Mode [Default was selected, change to one of above] + ``` +In Packet Mode, the host uses `2 * 1536` or `3,072` bytes of memory for Rx buffers. +- with `No optimization`, Rx Raw Throughput is 33.0 Mbits/s +- with `Always Rx Max Packet size`, Rx Raw Throughput is 33.2 Mbits/s + +## 10 References - [ESP-IDF Programming Guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/) - [ESP32 Hardware Design Guidelines](https://www.espressif.com/en/products/hardware/esp32/resources) -- [SDIO Protocol Basics](https://en.wikipedia.org/wiki/Serial_Peripheral_Interface) -- [ESP SDIO Slave Communication](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/protocols/esp_sdio_slave_protocol.html) - +- [ESP SDIO Slave Communication](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/protocols/esp_sdio_slave_protocol.html) +- [ESP SDIO Card Slave Driver](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/sdio_slave.html) diff --git a/docs/shield-box-test-setup.md b/docs/shield-box-test-setup.md new file mode 100644 index 00000000..c107a3a5 --- /dev/null +++ b/docs/shield-box-test-setup.md @@ -0,0 +1,75 @@ +# Shield Box Test Setup for ESP-Hosted + +Controlled RF environment for consistent throughput measurements and performance evaluation. + +## Overview + +**Shield Box Testing** uses RF-shielded enclosure to eliminate external interference and provide repeatable test conditions. + +**Key Benefits:** +- Controlled RF environment (no external Wi-Fi/cellular interference) +- Repeatable, consistent results +- Better measurement accuracy vs open air + + +## Equipment Required + +### Essential Components +- **RF Shield Box/Chamber**: Faraday cage enclosure +- **ESP32-P4 Function EV Board**: Host device +- **ESP32-C6/C5 Test Board**: Co-processor device +- **External PC**: For iPerf client/server +- **Router/Access Point**: Wi-Fi infrastructure +- **Ethernet Connection**: Wired backhaul to PC + +Please change the host and co-processor nodes as per current use-case under test. + +## Test Setup + +### Physical Configuration + +Shield box testing setup + +### Data Flow +- **PC to MCU Host**: + ``` + PC -> Router -> ESP Co-processor == SDIO/SPI/UART ==> ESP32-P4 + ``` +- **MCU Host to PC**: + ``` + PC <- Router <- ESP Co-processor <== SDIO/SPI/UART == ESP32-P4 + ``` + +**Traffic route:** +- PC-to-Router: Ethernet with static IP (eliminates wireless variables) +- Router-to-ESP: Wi-Fi connection (only wireless link in test chain) + +## Transport Configurations + +### SDIO (Highest Performance) +- **Clock**: 20-50 MHz (start low, optimize up) +- **Bus Width**: 4-bit mode +- **Hardware**: External pull-ups (51kΩ) on CMD, D0-D3 + +### SPI +- **Clock**: ESP32: ≤10 MHz, Others: ≤40 MHz +- **Mode**: Full-duplex (simple) or Quad SPI (highest throughput) + +### UART +- **Baud Rate**: 921600 (highest stable rate) +- **Use Case**: Low-throughput validation, debugging + + +## Shield Box vs Open Air + +| Aspect | Shield Box | Open Air | +|--------|------------|----------| +| **Repeatability** | High | Variable | +| **Interference** | Eliminated | Present | +| **Debugging** | Easier | Complex | +| **Reality** | Lower | Higher | + + +--- + +*For transport setup details: [SDIO](sdio.md) | [SPI Full-Duplex](spi_full_duplex.md) | [SPI Half-Duplex](spi_half_duplex.md) | [UART](uart.md)* \ No newline at end of file diff --git a/docs/spi_full_duplex.md b/docs/spi_full_duplex.md index 3846e4ec..d1f2a947 100644 --- a/docs/spi_full_duplex.md +++ b/docs/spi_full_duplex.md @@ -177,32 +177,34 @@ For optimal performance and reliability in production designs: Setting up the hardware involves connecting the master and co-processor devices via the SPI pins and ensuring all extra GPIO signals are properly connected. Below is the table of connections for the SPI full duplex setup between an host ESP chipset and another ESP chipset as co-processor: - ### Host connections -| Signal | ESP32 | ESP32-S2/S3 | ESP32-C2/C3/C5/C6 | ESP32-P4 (ESP32-P4-Function-EV-Board) | -|-------------|-------|-------------|-------------------|---------------------------------------| -| CLK | 14 | 12 | 6 | 18 | -| MOSI | 13 | 11 | 7 | 14 | -| MISO | 12 | 13 | 2 | 15 | -| CS | 15 | 10 | 10 | 19 | -| Handshake | 26 | 17 | 3 | 16 | -| Data Ready | 4 | 4 | 4 | 17 | -| Reset Out | 5 | 5 | 5 | 54 | +| Signal | ESP32 | ESP32-S2/S3 | ESP32-C2/C3/C5/C6 | ESP32-P4 | +|-------------|-------|-------------|-------------------|----------| +| CLK | 14 | 12 | 6 | 9 | +| MOSI | 13 | 11 | 7 | 8 | +| MISO | 12 | 13 | 2 | 10 | +| CS | 15 | 10 | 10 | 7 | +| Handshake | 26 | 17 | 3 | 6 | +| Data Ready | 4 | 4 | 4 | 11 | +| Reset Out | 5 | 5 | 5 | 12 | +> [!NOTE] +> The GPIOs pins on the ESP32-P4 are SPI IO_MUX pins and powered by the `VDD_LP` pin. If you use a different set of GPIOs, check that they are powered to 3.3V by the pin(s) providing power for the GPIOs based on your ESP32-P4 schematic. See the ESP32-P4 Datasheet, [Table 2-1. Pin Overview](https://www.espressif.com/sites/default/files/documentation/esp32-p4_datasheet_en.pdf#table.2.1), for a list of GPIO pins and the pins providing the power for the GPIOs. +> +> If the pins providing power are connected to an internal Low Dropout Voltage Regulator (LDO), set the LDO to output 3.3V. See [Low Dropout Voltage Regulator (LDO)](https://docs.espressif.com/projects/esp-idf/en/latest/esp32p4/api-reference/peripherals/ldo_regulator.html) for more information on programming the internal LDOs. ### Co-processor connections | Signal | ESP32 | ESP32-C2/C3/C5/C6 | ESP32-S2/S3 | ESP32-C6 on ESP32-P4-Function-EV-Board | -|-------------|-------|-------------------|-------------|---------------------------------------| -| CLK | 14 | 6 | 12 | 19 | -| MOSI | 13 | 7 | 11 | 20 | -| MISO | 12 | 2 | 13 | 21 | -| CS | 15 | 10 | 10 | 18 | -| Handshake | 26 | 3 | 17 | 22 | -| Data Ready | 4 | 4 | 5 | 23 | -| Reset In | EN | EN/RST | EN/RST | EN/RST | - +|-------------|-------|-------------------|-------------|----------------------------------------| +| CLK | 14 | 6 | 12 | 19 | +| MOSI | 13 | 7 | 11 | 20 | +| MISO | 12 | 2 | 13 | 21 | +| CS | 15 | 10 | 10 | 18 | +| Handshake | 26 | 3 | 17 | 22 | +| Data Ready | 4 | 4 | 5 | 23 | +| Reset In | EN | EN/RST | EN/RST | EN/RST | > [!NOTE] > - Always try to use IO_MUX pins from the datasheet for optimal performance on both sides. @@ -269,13 +271,17 @@ idf.py menuconfig ``` #### 7.2.1 Transport config - - Navigate to "Example configuration" -> "Transport layer" - - Select "SPI Full-duplex" - +Navigate & change to following +``` +-- "Example configuration" + └── "Bus Config in between Host and Co-processor" + └── "Transport layer" + └── Select "SPI Full-duplex" +``` #### 7.2.2 Any other config Optionally, configure any additional SPI-specific settings under "SPI Full-duplex" - Set the GPIO pins for SPI signals (MOSI, MISO, CLK, CS), Handshake, Data Ready, Reset - - Configure SPI mode (0, 1, 2, or 3) + - Configure SPI mode (1, 2, or 3) - Set the SPI clock frequency - Checksum enable/disable (Checksum is recommended to be enabled as spi hardware doesn't have any error detection) @@ -296,6 +302,13 @@ idf.py build ### 7.4 Co-processor Flashing +It is **recommended** to periodically upgrade the slave firmware to leverage new features, bug fixes, and performance improvements. + +| Method | Description | Recommended Use | +| -------------------------- | -------------------------------------------------- | ----------------------------------------------------- | +| **Direct Serial Flashing** | Uses UART pins for direct firmware installation | First-time setup to install ESP-Hosted slave firmware | +| **Slave OTA Update** | Performs slave firmware updates directly from Host | All subsequent updates after initial installation | + ##### 7.4.1 Serial Flashing (Initial Setup) For the initial setup or when OTA is not available, use serial flashing. @@ -310,59 +323,17 @@ idf.py -p flash > > Put host in bootloader mode using following command and then retry flashing the co-processor > -> ```bash -> esptool.py -p --before default_reset --after no_reset run -> ``` - -Monitor the output (optional): -``` -idf.py -p monitor -``` +> `esptool.py -p **** --before default_reset --after no_reset run` +> +> Flash the co-processor and log the output: +> +> `idf.py -p flash monitor` ##### 7.4.2 Co-processor OTA Flashing (Subsequent Updates) -For subsequent updates, you can re-use ESP-Hosted-MCU transport, as it should be already working. While doing OTA, Complete co-processor firmware image is not needed and only co-processor application partition, 'network_adapter.bin' need to be re-flashed remotely from host. - -1. Ensure your co-processor device is connected and communicating with the host with existing ESP-Hosted-MCU. - -2. Create a web server -You can re-use your existing web server or create a new locally for testing. Below is example to do it. - - Make a new directory so that web server can be run into it and navigate into it - - Create simple local web server using python3 - - ```bash - python3 -m http.server 8080 - ``` -3. Copy the co-processor app partition `network_adapter.bin` in the directory where you created the web server. - - The `network_adapter.bin` can be found in your co-processor project build at `/build/network_adapter.bin` - -4. Verify if web server is set-up correctly - - Open link `http://127.0.0.1:8080` in the browser and check if network_adapter.bin is available. - - Right click and copy the complete URL of this network_adapter.bin and note somewhere. +The ESP-Hosted link comes pre-configured and ready to use on first boot. You can update the slave firmware remotely from the host MCU using OTA (Over-The-Air) updates: **No** ESP-Prog, serial cable, or extra GPIO connections are required. -5. On the **host side**, use the `esp_hosted_slave_ota` function to initiate the OTA update: - - ```c - #include "esp_hosted_api.h" - - const char* image_url = "http://example.com/path/to/network_adapter.bin"; //web server full url - esp_err_t ret = esp_hosted_slave_ota(image_url); - if (ret == ESP_OK) { - printf("co-processor OTA update failed[%d]\n", ret); - } - ``` - - This function will download the firmware in chunk by chunk as http client from the specified URL and flash it to the co-processor device through the established transport. - In above web server example, You can paste the copied url earlier. - - -6. Monitor the OTA progress through the console output on both the host and co-processor devices. - -> [!NOTE] -> -> A. The `esp_hosted_slave_ota` function is part of the ESP-Hosted-MCU API and handles the OTA process through the transport layer. \ -> B. Ensure that your host application has web server connectivity to download the firmware file. \ -> C. The co-processor device doesn't need to be connected to the web server for this OTA method. +For step-by-step instructions, see the [Host Performs Slave OTA Example](../examples/host_performs_slave_ota/README.md). ## 8 Flashing the Host @@ -409,30 +380,36 @@ If you happen to have both, host and co-processor as same ESP chipset type (for ### 8.3 Menuconfig, Build and Flash Host ##### 1. High performance configurations - This is optional step, suggested for high performance applications. +This is optional step, suggested for high performance applications. - If using ESP32-P4 as host: - - Remove the default `sdkconfig.defaults.esp32p4` file. - - Create a new `sdkconfig.defaults.esp32p4` file with the following content: - ``` - CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=16 - CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=64 - CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=64 - CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y - CONFIG_ESP_WIFI_TX_BA_WIN=32 - CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y - CONFIG_ESP_WIFI_RX_BA_WIN=32 - - CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 - CONFIG_LWIP_TCP_WND_DEFAULT=65534 - CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 - CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 - CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 - - CONFIG_LWIP_TCP_SACK_OUT=y - ``` +If using ESP32-P4 as host and the ESP32-C6 as the co-processor: + +- Remove all `CONFIG_ESP_WIFI_` settings. They do not apply to ESP-Hosted. +- Add the following settings to your `sdkconfig.defaults.esp32p4` file: + ``` + ### sdkconfig for ESP32-P4 + C6 Dev board + CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16 + CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=64 + CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=64 + CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y + CONFIG_WIFI_RMT_TX_BA_WIN=32 + CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y + CONFIG_WIFI_RMT_RX_BA_WIN=32 + + CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 + CONFIG_LWIP_TCP_WND_DEFAULT=65534 + CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 + CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 + CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 + + CONFIG_LWIP_TCP_SACK_OUT=y + ``` - For other hosts also, you can merge above configs in corresponding `sdkconfig.defaults.esp32XX` file. +For other ESP32 hosts, you can merge above configs into the corresponding `sdkconfig.defaults.esp32XX` file. + +To adjust other Wi-Fi parameters, run `idf.py menuconfig` and go to `Component config` ---> `Wi-Fi Remote` ---> `Wi-Fi configuration`. + +Optimised parameters for other co-processors can be found in the [Performance Optimization Guide](performance_optimization.md). ###### 2. Set environment for your host ESP chip: @@ -448,7 +425,7 @@ If you happen to have both, host and co-processor as same ESP chipset type (for ESP-Hosted-MCU host configurations are available under "Component config" -> "ESP-Hosted config" 1. Select "SPI Full-duplex" as the transport layer 2. Change co chipset to connect to under "slave chipset to be used" - 3. Optionally, configure SPI-specific settings like + 3. Optionally, configure SPI-specific settings in the "SPI Configuration" menu, like: - SPI Clock Freq (MHz) - SPI Mode - SPI Pins @@ -538,7 +515,7 @@ After flashing both the co-processor and host devices, follow these steps to con - Set Wi-Fi mode: `wifi_mode ` (where mode can be 'sta', 'ap', or 'apsta') 7. Advanced iperf testing: - Once connected, you can run iperf tests: + Once connected, you can run iperf tests to verify performance: | Test Case | Host Command | External STA Command | |-----------|--------------|----------------------| @@ -549,6 +526,10 @@ After flashing both the co-processor and host devices, follow these steps to con Note: Replace `` with the IP address of the external STA, and `` with the IP address of the ESP-Hosted device. +> [!TIP] +> +> To measure the optimal performance, check out the [Shield Box Test Setup](shield-box-test-setup.md). + 8. Troubleshooting: - If you encounter issues, refer to section 6.3 for testing the SPI connection. - Consider using a lower clock speed or checking your [hardware connections](#5-hardware-setup) if you experience communication problems. diff --git a/docs/spi_half_duplex.md b/docs/spi_half_duplex.md index 1b524321..811b7e22 100644 --- a/docs/spi_half_duplex.md +++ b/docs/spi_half_duplex.md @@ -507,11 +507,15 @@ idf.py menuconfig ``` #### 9.2.1 Transport config - - Navigate to "Example configuration" -> "Transport layer" - - Select "SPI Half-duplex" - +Navigate and change as following: + ``` + Example Configuration + └── Bus Config in between Host and Co-processor + └── Transport layer + └── Select "SPI Half-duplex" + ``` #### 9.2.2 Any other config - - Optionally, Configure any additional SPI-specific settings like co-processor GPIOs, SPI mode, etc. + - Optionally, Configure any additional SPI-specific settings in the "SPI Half-duplex Configuration" menu, like co-processor GPIOs, SPI mode, etc. ###### Generated files - Generated config files are (1) `sdkconfig` file and (2) internal `sdkconfig.h` file. @@ -530,7 +534,15 @@ idf.py build ### 9.4 Co-processor Flashing -There are two methods to flash the ESP-Hosted co-processor firmware: +## Firmware Upgrade Guidelines + +It is **recommended** to periodically upgrade the slave firmware to leverage new features, bug fixes, and performance improvements. + +| Method | Description | Recommended Use | +| -------------------------- | -------------------------------------------------- | ----------------------------------------------------- | +| **Direct Serial Flashing** | Uses UART pins for direct firmware installation | First-time setup to install ESP-Hosted slave firmware | +| **Slave OTA Update** | Performs slave firmware updates directly from Host | All subsequent updates after initial installation | + ##### 9.4.1 Serial Flashing (Initial Setup) @@ -547,59 +559,17 @@ idf.py -p flash > > Put host in bootloader mode using following command and then retry flashing the co-processor > -> ```bash -> esptool.py -p **** --before default_reset --after no_reset run -> ``` - -Monitor the output (optional): -``` -idf.py -p monitor -``` +> `esptool.py -p **** --before default_reset --after no_reset run` +> +> Flash the co-processor and log the output: +> +> `idf.py -p flash monitor` ##### 9.4.2 Co-processor OTA Flashing (Subsequent Updates) -For subsequent updates, you can re-use ESP-Hosted-MCU transport, as it should be already working. While doing OTA, Complete co-processor firmware image is not needed and only co-processor application partition, 'network_adapter.bin' need to be re-flashed remotely from host. - -1. Ensure your co-processor device is connected and communicating with the host with existing ESP-Hosted-MCU. - -2. Create a web server -You can re-use your existing web server or create a new locally for testing. Below is example to do it. - - Make a new directory so that web server can be run into it and navigate into it - - Create simple local web server using python3 - - ```bash - python3 -m http.server 8080 - ``` -3. Copy the co-processor app partition `network_adapter.bin` in the directory where you created the web server. - - The `network_adapter.bin` can be found in your co-processor project build at `/build/network_adapter.bin` - -4. Verify if web server is set-up correctly - - Open link `http://127.0.0.1:8080` in the browser and check if network_adapter.bin is available. - - Right click and copy the complete URL of this network_adapter.bin and note somewhere. - -5. On the **host side**, use the `esp_hosted_slave_ota` function to initiate the OTA update: - - ```c - #include "esp_hosted_api.h" +The ESP-Hosted link comes pre-configured and ready to use on first boot. You can update the slave firmware remotely from the host MCU using OTA (Over-The-Air) updates: **No** ESP-Prog, serial cable, or extra GPIO connections are required. - const char* image_url = "http://example.com/path/to/network_adapter.bin"; //web server full url - esp_err_t ret = esp_hosted_slave_ota(image_url); - if (ret == ESP_OK) { - printf("co-processor OTA update failed[%d]\n", ret); - } - ``` - - This function will download the firmware in chunk by chunk as http client from the specified URL and flash it to the co-processor device through the established transport. - In above web server example, You can paste the copied url earlier. - - -6. Monitor the OTA progress through the console output on both the host and co-processor devices. - -> [!NOTE] -> -> - The `esp_hosted_slave_ota` function is part of the ESP-Hosted-MCU API and handles the OTA process through the transport layer. -> - Ensure that your host application has web server connectivity to download the firmware file. -> - The co-processor device doesn't need to be connected to the web server for this OTA method. +For step-by-step instructions, see the [Host Performs Slave OTA Example](../examples/host_performs_slave_ota/README.md). ## 10 Flashing the Host @@ -654,30 +624,36 @@ Now that ESP-IDF is set up, follow these steps to prepare the host: ### 10.3 Menuconfig, Build and Flash Host ###### 1. High performance configurations - This is optional step, suggested for high performance applications. +This is optional step, suggested for high performance applications. - If using ESP32-P4 as host: - - Remove the default `sdkconfig.defaults.esp32p4` file. - - Create a new `sdkconfig.defaults.esp32p4` file with the following content: - ``` - CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=16 - CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=64 - CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=64 - CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y - CONFIG_ESP_WIFI_TX_BA_WIN=32 - CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y - CONFIG_ESP_WIFI_RX_BA_WIN=32 - - CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 - CONFIG_LWIP_TCP_WND_DEFAULT=65534 - CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 - CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 - CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 - - CONFIG_LWIP_TCP_SACK_OUT=y - ``` +If using ESP32-P4 as host and the ESP32-C6 as the co-processor: + +- Remove all `CONFIG_ESP_WIFI_` settings. They do not apply to ESP-Hosted. +- Add the following settings to your `sdkconfig.defaults.esp32p4` file: + ``` + ### sdkconfig for ESP32-P4 + C6 Dev board + CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16 + CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=64 + CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=64 + CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y + CONFIG_WIFI_RMT_TX_BA_WIN=32 + CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y + CONFIG_WIFI_RMT_RX_BA_WIN=32 + + CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 + CONFIG_LWIP_TCP_WND_DEFAULT=65534 + CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 + CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 + CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 + + CONFIG_LWIP_TCP_SACK_OUT=y + ``` - For other hosts also, you can merge above configs in corresponding `sdkconfig.defaults.esp32XX` file. +For other ESP32 hosts, you can merge above configs into the corresponding `sdkconfig.defaults.esp32XX` file. + +To adjust other Wi-Fi parameters, run `idf.py menuconfig` and go to `Component config` ---> `Wi-Fi Remote` ---> `Wi-Fi configuration`. + +Optimised parameters for other co-processors can be found in the [Performance Optimization Guide](performance_optimization.md). ###### 2. Set environment for your host ESP chip: @@ -695,7 +671,7 @@ Now that ESP-IDF is set up, follow these steps to prepare the host: 1. Select "SPI Half-duplex" as the transport layer 2. Change co-processor chipset to connect to under "Slave chipset to be used" 3. Change Number of data lines to 2 or 4 based on the co-processor using "SPI Half-duplex Configuration" -> "Num Data Lines to use" - 4. Optionally, Configure SPI-specific settings like + 4. Optionally, Configure SPI-specific settings in the "SPI Half-duplex Configuration" menu, like: - SPI Clock Freq (MHz) - SPI Mode - SPI Host GPIO Pins @@ -784,7 +760,7 @@ After flashing both the co-processor and host devices, follow these steps to con - Set Wi-Fi mode: `wifi_mode ` (where mode can be 'sta', 'ap', or 'apsta') 7. Advanced iperf testing: - Once connected, you can run iperf tests: + Once connected, you can run iperf tests to verify performance: | Test Case | Host Command | External STA Command | | :-------: | :----------: | :------------------: | @@ -795,6 +771,10 @@ After flashing both the co-processor and host devices, follow these steps to con Note: Replace `` with the IP address of the external STA, and `` with the IP address of the ESP-Hosted device. +> [!TIP] +> +> To measure the optimal performance, check out the [Shield Box Test Setup](shield-box-test-setup.md). + 8. Troubleshooting: - If you encounter issues, refer to section 6.3 for testing the SPI connection. - Consider using a lower clock speed or checking your [hardware setup](#7-hardware-setup) if you experience communication problems. diff --git a/docs/uart.md b/docs/uart.md index 725139eb..c6fa0845 100644 --- a/docs/uart.md +++ b/docs/uart.md @@ -147,11 +147,11 @@ idf.py menuconfig ``` #### 6.2.1 Transport config - - Navigate to "Example configuration" -> "Transport layer" - - Select "UART" + - Navigate to "Example configuration" -> "Bus Config in between Host and Co-processor" + - In "Transport layer", select "UART" #### 6.2.2 Any other config - - Optionally, Configure any additional UART-specific settings like TX and Rx GPIOs, baud rate, etc. + - Optionally, Configure any additional UART-specific settings in the "UART Configuration" menu, like TX and Rx GPIOs, baud rate, etc. ###### Generated files - Generated config files are (1) `sdkconfig` file and (2) internal `sdkconfig.h` file. @@ -170,7 +170,13 @@ idf.py build ### 6.4 Co-processor Flashing -There are two methods to flash the ESP-Hosted co-processor firmware: +It is **recommended** to periodically upgrade the slave firmware to leverage new features, bug fixes, and performance improvements. + +| Method | Description | Recommended Use | +| -------------------------- | -------------------------------------------------- | ----------------------------------------------------- | +| **Direct Serial Flashing** | Uses UART pins for direct firmware installation | First-time setup to install ESP-Hosted slave firmware | +| **Slave OTA Update** | Performs slave firmware updates directly from Host | All subsequent updates after initial installation | + ##### 6.4.1 Serial Flashing (Initial Setup) @@ -187,58 +193,17 @@ idf.py -p flash > > Put host in bootloader mode using following command and then retry flashing the co-processor > -> ```bash -> esptool.py -p **** --before default_reset --after no_reset run -> ``` - -Monitor the output (optional): -``` -idf.py -p monitor -``` +> `esptool.py -p **** --before default_reset --after no_reset run` +> +> Flash the co-processor and log the output: +> +> `idf.py -p flash monitor` ##### 6.4.2 Co-processor OTA Flashing (Subsequent Updates) -For subsequent updates, you can re-use ESP-Hosted-MCU transport, as it should be already working. While doing OTA, Complete co-processor firmware image is not needed and only co-processor application partition, 'network_adapter.bin' need to be re-flashed remotely from host. - -1. Ensure your co-processor device is connected and communicating with the host with existing ESP-Hosted-MCU. +The ESP-Hosted link comes pre-configured and ready to use on first boot. You can update the slave firmware remotely from the host MCU using OTA (Over-The-Air) updates: **No** ESP-Prog, serial cable, or extra GPIO connections are required. -2. Create a web server -You can re-use your existing web server or create a new locally for testing. Below is example to do it. - - Make a new directory so that web server can be run into it and navigate into it - - Create simple local web server using python3 - - ```bash - python3 -m http.server 8080 - ``` -3. Copy the co-processor app partition `network_adapter.bin` in the directory where you created the web server. - - The `network_adapter.bin` can be found in your co-processor project build at `/build/network_adapter.bin` - -4. Verify if web server is set-up correctly - - Open link `http://127.0.0.1:8080` in the browser and check if network_adapter.bin is available. - - Right click and copy the complete URL of this network_adapter.bin and note somewhere. - -5. On the **host side**, use the `esp_hosted_slave_ota` function to initiate the OTA update: - - ```c - #include "esp_hosted_api.h" - - const char* image_url = "http://example.com/path/to/network_adapter.bin"; //web server full url - esp_err_t ret = esp_hosted_slave_ota(image_url); - if (ret == ESP_OK) { - printf("co-processor OTA update failed[%d]\n", ret); - } - ``` - - This function will download the firmware in chunk by chunk as http client from the specified URL and flash it to the co-processor device through the established transport. - In above web server example, You can paste the copied url earlier. - -6. Monitor the OTA progress through the console output on both the host and co-processor devices. - -> [!NOTE] -> -> - The `esp_hosted_slave_ota` function is part of the ESP-Hosted-MCU API and handles the OTA process through the transport layer. -> - Ensure that your host application has web server connectivity to download the firmware file. -> - The co-processor device doesn't need to be connected to the web server for this OTA method. +For step-by-step instructions, see the [Host Performs Slave OTA Example](../examples/host_performs_slave_ota/README.md). ## 7 Flashing the Host @@ -290,30 +255,36 @@ Now that ESP-IDF is set up, follow these steps to prepare the host: ### 7.3 Menuconfig, Build and Flash Host ###### 1. High performance configurations - This is optional step, suggested for high performance applications. +This is optional step, suggested for high performance applications. - If using ESP32-P4 as host: - - Remove the default `sdkconfig.defaults.esp32p4` file. - - Create a new `sdkconfig.defaults.esp32p4` file with the following content: - ``` - CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=16 - CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=64 - CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=64 - CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y - CONFIG_ESP_WIFI_TX_BA_WIN=32 - CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y - CONFIG_ESP_WIFI_RX_BA_WIN=32 - - CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 - CONFIG_LWIP_TCP_WND_DEFAULT=65534 - CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 - CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 - CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 - - CONFIG_LWIP_TCP_SACK_OUT=y - ``` +If using ESP32-P4 as host and the ESP32-C6 as the co-processor: - For other hosts also, you can merge above configs in corresponding `sdkconfig.defaults.esp32XX` file. +- Remove all `CONFIG_ESP_WIFI_` settings. They do not apply to ESP-Hosted. +- Add the following settings to your `sdkconfig.defaults.esp32p4` file: + ``` + ### sdkconfig for ESP32-P4 + C6 Dev board + CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16 + CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=64 + CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=64 + CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y + CONFIG_WIFI_RMT_TX_BA_WIN=32 + CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y + CONFIG_WIFI_RMT_RX_BA_WIN=32 + + CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 + CONFIG_LWIP_TCP_WND_DEFAULT=65534 + CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 + CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 + CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 + + CONFIG_LWIP_TCP_SACK_OUT=y + ``` + +For other ESP32 hosts, you can merge above configs into the corresponding `sdkconfig.defaults.esp32XX` file. + +To adjust other Wi-Fi parameters, run `idf.py menuconfig` and go to `Component config` ---> `Wi-Fi Remote` ---> `Wi-Fi configuration`. + +Optimised parameters for other co-processors can be found in the [Performance Optimization Guide](performance_optimization.md). ###### 2. Set environment for your host ESP chip: @@ -330,7 +301,7 @@ Now that ESP-IDF is set up, follow these steps to prepare the host: ESP-Hosted-MCU host configurations are available under "Component config" -> "ESP-Hosted config" 1. Select "UART" as the transport layer 2. Change co-processor chipset to connect to under "Slave chipset to be used" - 3. Optionally, Configure UART-specific settings like + 3. Optionally, Configure UART-specific settings in the "UART Configuration" menu, like: - UART Tx and Rx GPIOs - UART baud rate - UART Checksum Enable/Disable (Checksum is recommended to be enabled) @@ -424,7 +395,7 @@ After flashing both the co-processor and host devices, follow these steps to con - Set Wi-Fi mode: `wifi_mode ` (where mode can be 'sta', 'ap', or 'apsta') 7. Advanced iperf testing: - Once connected, you can run iperf tests: + Once connected, you can run iperf tests to verify performance: | Test Case | Host Command | External STA Command | |-----------|--------------|----------------------| @@ -435,6 +406,10 @@ After flashing both the co-processor and host devices, follow these steps to con Note: Replace `` with the IP address of the external STA, and `` with the IP address of the ESP-Hosted device. +> [!TIP] +> +> To measure the optimal performance, check out the [Shield Box Test Setup](shield-box-test-setup.md). + 8. Troubleshooting: - If you encounter issues, refer to section 3.3 for checking the UART connection. - Consider using a lower baud rate or checking your [hardware setup](#4-hardware-setup) if you experience communication problems. diff --git a/examples/host_bluedroid_ble_compatibility_test/README.md b/examples/host_bluedroid_ble_compatibility_test/README.md index 63a40d74..18e96917 100644 --- a/examples/host_bluedroid_ble_compatibility_test/README.md +++ b/examples/host_bluedroid_ble_compatibility_test/README.md @@ -1,5 +1,8 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-S3 | ESP32-P4 | ESP32-H2 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | -------- | -------- | +| Supported Hosts | ESP32 | ESP32-P Series | ESP32-H Series | ESP32-C Series | ESP32-S Series | Any other MCU hosts | +| --------------- | ----- | -------------- | -------------- | -------------- | -------------- | ------------------- | + +| Supported Co-Processors | ESP32 | ESP32-C Series | ESP32-S Series | +| ----------------------- | ----- | -------------- | -------------- | # ESP-IDF BLE Compatibility Test Example diff --git a/examples/host_bluedroid_ble_compatibility_test/main/ble_compatibility_test.c b/examples/host_bluedroid_ble_compatibility_test/main/ble_compatibility_test.c index d3fbb58c..9bceee9c 100644 --- a/examples/host_bluedroid_ble_compatibility_test/main/ble_compatibility_test.c +++ b/examples/host_bluedroid_ble_compatibility_test/main/ble_compatibility_test.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ @@ -26,7 +26,8 @@ #include "ble_compatibility_test.h" #include "esp_gatt_common_api.h" -#include "esp_hosted_bt.h" +#include "esp_hosted.h" +#include "esp_hosted_bluedroid.h" #define DEBUG_ON 0 @@ -509,7 +510,7 @@ static void gatts_profile_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_ ESP_LOGE(EXAMPLE_TAG, "create attr table failed, error code = %x", create_attr_ret); } } - break; + break; case ESP_GATTS_READ_EVT: //ESP_LOGE(EXAMPLE_TAG, "ESP_GATTS_READ_EVT, handle=0x%d, offset=%d", param->read.handle, param->read.offset); if(gatt_db_handle_table[IDX_CHAR_VAL_A] == param->read.handle) { @@ -518,7 +519,7 @@ static void gatts_profile_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_ if(gatt_db_handle_table[IDX_CHAR_VAL_B] == param->read.handle) { ESP_LOGE(EXAMPLE_TAG, "(5) ***** read char2 ***** "); } - break; + break; case ESP_GATTS_WRITE_EVT: if (!param->write.is_prep){ // the data length of gattc write must be less than GATTS_EXAMPLE_CHAR_VAL_LEN_MAX. @@ -561,7 +562,7 @@ static void gatts_profile_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_ /* handle prepare write */ example_prepare_write_event_env(gatts_if, &prepare_write_env, param); } - break; + break; case ESP_GATTS_EXEC_WRITE_EVT: // the length of gattc prepare write data must be less than GATTS_EXAMPLE_CHAR_VAL_LEN_MAX. ESP_LOGI(EXAMPLE_TAG, "ESP_GATTS_EXEC_WRITE_EVT, Length=%d", prepare_write_env.prepare_len); @@ -645,7 +646,29 @@ void app_main(void) } ESP_ERROR_CHECK( ret ); - /* initialize TRANSPORT first */ + // initialise connection to co-processor + esp_hosted_connect_to_slave(); + + // get fw version + ESP_LOGI("INFO", "getting fw version"); + esp_hosted_coprocessor_fwver_t fwver; + if (ESP_OK == esp_hosted_get_coprocessor_fwversion(&fwver)) { + ESP_LOGI("INFO", "FW Version: %" PRIu32 ".%" PRIu32 ".%" PRIu32, + fwver.major1, fwver.minor1, fwver.patch1); + } else { + ESP_LOGW("INFO", "failed to get fw version"); + } + + // init bt controller + if (ESP_OK != esp_hosted_bt_controller_init()) { + ESP_LOGW("INFO", "failed to init bt controller"); + } + + // enable bt controller + if (ESP_OK != esp_hosted_bt_controller_enable()) { + ESP_LOGW("INFO", "failed to enable bt controller"); + } + hosted_hci_bluedroid_open(); /* get HCI driver operations */ @@ -656,7 +679,6 @@ void app_main(void) }; esp_bluedroid_attach_hci_driver(&operations); - #if 0 ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT)); diff --git a/examples/host_bluedroid_ble_compatibility_test/main/idf_component.yml b/examples/host_bluedroid_ble_compatibility_test/main/idf_component.yml index 57b37833..50ffd415 100644 --- a/examples/host_bluedroid_ble_compatibility_test/main/idf_component.yml +++ b/examples/host_bluedroid_ble_compatibility_test/main/idf_component.yml @@ -1,5 +1,9 @@ dependencies: espressif/esp_wifi_remote: - version: "~0.5.1" + version: ">=0.10" + rules: + - if: "target in [esp32p4, esp32h2]" + espressif/esp_hosted: + version: "~2" rules: - if: "target in [esp32p4, esp32h2]" diff --git a/examples/host_bluedroid_ble_compatibility_test/sdkconfig.defaults b/examples/host_bluedroid_ble_compatibility_test/sdkconfig.defaults index 5b03a89c..4e03dba3 100644 --- a/examples/host_bluedroid_ble_compatibility_test/sdkconfig.defaults +++ b/examples/host_bluedroid_ble_compatibility_test/sdkconfig.defaults @@ -1,7 +1,12 @@ +CONFIG_FREERTOS_HZ=1000 + # # BT config +# - ESP32 co-processor only supports BLE 4.2 # CONFIG_BT_ENABLED=y +CONFIG_BT_CONTROLLER_DISABLED=y +CONFIG_BT_BLUEDROID_ENABLED=y CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. diff --git a/examples/host_bluedroid_bt_hid_mouse_device/README.md b/examples/host_bluedroid_bt_hid_mouse_device/README.md index b6fe73e1..8f7e4da4 100644 --- a/examples/host_bluedroid_bt_hid_mouse_device/README.md +++ b/examples/host_bluedroid_bt_hid_mouse_device/README.md @@ -1,5 +1,8 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-S3 | ESP32-P4 | ESP32-H2 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | -------- | -------- | +| Supported Hosts | ESP32 | ESP32-P Series | ESP32-H Series | ESP32-C Series | ESP32-S Series | Any other MCU hosts | +| --------------- | ----- | -------------- | -------------- | -------------- | -------------- | ------------------- | + +| Supported Co-Processors | ESP32 | +| ----------------------- | ----- | # Bluetooth HID Device example diff --git a/examples/host_bluedroid_bt_hid_mouse_device/main/idf_component.yml b/examples/host_bluedroid_bt_hid_mouse_device/main/idf_component.yml index 57b37833..50ffd415 100644 --- a/examples/host_bluedroid_bt_hid_mouse_device/main/idf_component.yml +++ b/examples/host_bluedroid_bt_hid_mouse_device/main/idf_component.yml @@ -1,5 +1,9 @@ dependencies: espressif/esp_wifi_remote: - version: "~0.5.1" + version: ">=0.10" + rules: + - if: "target in [esp32p4, esp32h2]" + espressif/esp_hosted: + version: "~2" rules: - if: "target in [esp32p4, esp32h2]" diff --git a/examples/host_bluedroid_bt_hid_mouse_device/main/main.c b/examples/host_bluedroid_bt_hid_mouse_device/main/main.c index 89266f04..0e11588b 100644 --- a/examples/host_bluedroid_bt_hid_mouse_device/main/main.c +++ b/examples/host_bluedroid_bt_hid_mouse_device/main/main.c @@ -19,7 +19,10 @@ #include "freertos/task.h" #include "freertos/semphr.h" -#include "esp_hosted_bt.h" +#include "esp_idf_version.h" + +#include "esp_hosted.h" +#include "esp_hosted_bluedroid.h" #define REPORT_PROTOCOL_MOUSE_REPORT_SIZE (4) #define REPORT_BUFFER_SIZE REPORT_PROTOCOL_MOUSE_REPORT_SIZE @@ -404,7 +407,19 @@ void app_main(void) } ESP_ERROR_CHECK( ret ); - /* initialize TRANSPORT first */ + // initialise connection to co-processor + esp_hosted_connect_to_slave(); + + // init bt controller + if (ESP_OK != esp_hosted_bt_controller_init()) { + ESP_LOGE("INFO", "failed to init bt controller"); + } + + // enable bt controller + if (ESP_OK != esp_hosted_bt_controller_enable()) { + ESP_LOGE("INFO", "failed to enable bt controller"); + } + hosted_hci_bluedroid_open(); /* get HCI driver operations */ @@ -436,7 +451,9 @@ void app_main(void) ESP_LOGI(TAG, "setting cod major, peripheral"); esp_bt_cod_t cod = {0}; cod.major = ESP_BT_COD_MAJOR_DEV_PERIPHERAL; +#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 3, 1) cod.minor = ESP_BT_COD_MINOR_PERIPHERAL_POINTING; +#endif esp_bt_gap_set_cod(cod, ESP_BT_SET_COD_MAJOR_MINOR); vTaskDelay(2000 / portTICK_PERIOD_MS); diff --git a/examples/host_bluedroid_bt_hid_mouse_device/sdkconfig.defaults b/examples/host_bluedroid_bt_hid_mouse_device/sdkconfig.defaults index f4e3f497..3fdc4b75 100644 --- a/examples/host_bluedroid_bt_hid_mouse_device/sdkconfig.defaults +++ b/examples/host_bluedroid_bt_hid_mouse_device/sdkconfig.defaults @@ -1,18 +1,27 @@ +CONFIG_FREERTOS_HZ=1000 + # # BT config +# - ESP32 co-processor only supports BLE 4.2 # CONFIG_BT_ENABLED=y -CONFIG_BTDM_CTRL_MODE_BLE_ONLY=n -CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y -CONFIG_BTDM_CTRL_MODE_BTDM=n +CONFIG_BT_CONTROLLER_DISABLED=y +CONFIG_BT_BLUEDROID_ENABLED=y CONFIG_BT_CLASSIC_ENABLED=y CONFIG_BT_HID_ENABLED=y CONFIG_BT_HID_DEVICE_ENABLED=y +CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=n +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y +CONFIG_BTDM_CTRL_MODE_BTDM=n # # Wi-Fi Remote +# - set ESP32 as default co-processor # CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED=y +CONFIG_SLAVE_IDF_TARGET_ESP32=y # # Enable ESP Hosted BT diff --git a/examples/host_bluedroid_bt_hid_mouse_device/sdkconfig.defaults.esp32h2 b/examples/host_bluedroid_bt_hid_mouse_device/sdkconfig.defaults.esp32h2 new file mode 100644 index 00000000..1686559d --- /dev/null +++ b/examples/host_bluedroid_bt_hid_mouse_device/sdkconfig.defaults.esp32h2 @@ -0,0 +1 @@ +CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y diff --git a/examples/host_bluedroid_bt_hid_mouse_device/sdkconfig.defaults.esp32p4 b/examples/host_bluedroid_bt_hid_mouse_device/sdkconfig.defaults.esp32p4 new file mode 100644 index 00000000..1686559d --- /dev/null +++ b/examples/host_bluedroid_bt_hid_mouse_device/sdkconfig.defaults.esp32p4 @@ -0,0 +1 @@ +CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y diff --git a/examples/host_bluedroid_host_only/README.md b/examples/host_bluedroid_host_only/README.md index 71b1e5ff..27b1e9a9 100644 --- a/examples/host_bluedroid_host_only/README.md +++ b/examples/host_bluedroid_host_only/README.md @@ -1,5 +1,8 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-S3 | ESP32-P4 | ESP32-H2 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | -------- | -------- | +| Supported Hosts | ESP32 | ESP32-P Series | ESP32-H Series | ESP32-C Series | ESP32-S Series | Any other MCU hosts | +| --------------- | ----- | -------------- | -------------- | -------------- | -------------- | ------------------- | + +| Supported Co-Processors | ESP32 | +| ----------------------- | ----- | ESP-IDF ESP-Hosted Hosted HCI Host ================================== @@ -79,9 +82,15 @@ See the ESP-IDF [UART HCI Host example](https://github.com/espressif/esp-idf/tre ### Configure the project +First, set the host target to ESP32-P4: + +``` +idf.py set-target esp32p4 +``` + For the ESP32 co-processor, run `idf.py menuconfig` and configure `Example Configuration` for SPI Full-duplex with the correct SPI mode and GPIOs. -For the ESP32-P4 co-processor, run `idf.py menuconfig` and under `Component config ---> ESP-Hosted config`: +For the ESP32-P4 host, run `idf.py menuconfig` and under `Component config ---> ESP-Hosted config`: * set the transport to be `SPI Full-duplex` with the correct SPI modem GPIOs (see above table) and SPI Clock frequency (10 MHz max). * set the Slave chipset used as `ESP32`. @@ -89,7 +98,7 @@ For the ESP32-P4 co-processor, run `idf.py menuconfig` and under `Component conf ### Build and Flash -Build and flash the co-processor and host projects, then run monitor tool to view serial output on both the ESP32 and ESP32-P4: +After setting the host target and configuring the project, build and flash the co-processor and host projects, then run monitor tool to view serial output on both the ESP32 and ESP32-P4: ``` idf.py -p PORT flash monitor diff --git a/examples/host_bluedroid_host_only/main/idf_component.yml b/examples/host_bluedroid_host_only/main/idf_component.yml index 57b37833..50ffd415 100644 --- a/examples/host_bluedroid_host_only/main/idf_component.yml +++ b/examples/host_bluedroid_host_only/main/idf_component.yml @@ -1,5 +1,9 @@ dependencies: espressif/esp_wifi_remote: - version: "~0.5.1" + version: ">=0.10" + rules: + - if: "target in [esp32p4, esp32h2]" + espressif/esp_hosted: + version: "~2" rules: - if: "target in [esp32p4, esp32h2]" diff --git a/examples/host_bluedroid_host_only/main/main.c b/examples/host_bluedroid_host_only/main/main.c index 187bdf97..b5f53e6d 100644 --- a/examples/host_bluedroid_host_only/main/main.c +++ b/examples/host_bluedroid_host_only/main/main.c @@ -26,7 +26,8 @@ #include "esp_gap_bt_api.h" #include "esp_bluedroid_hci.h" -#include "esp_hosted_bt.h" +#include "esp_hosted.h" +#include "esp_hosted_bluedroid.h" #define GAP_TAG "GAP" @@ -163,7 +164,7 @@ static void update_device_info(esp_bt_gap_cb_param_t *param) } if (!esp_bt_gap_is_valid_cod(cod) || - (!(esp_bt_gap_get_cod_major_dev(cod) == ESP_BT_COD_MAJOR_DEV_PHONE) && + (!(esp_bt_gap_get_cod_major_dev(cod) == ESP_BT_COD_MAJOR_DEV_PHONE) && !(esp_bt_gap_get_cod_major_dev(cod) == ESP_BT_COD_MAJOR_DEV_AV))) { return; } @@ -282,7 +283,19 @@ void app_main(void) } ESP_ERROR_CHECK( ret ); - /* initialize TRANSPORT first */ + // initialise connection to co-processor + esp_hosted_connect_to_slave(); + + // init bt controller + if (ESP_OK != esp_hosted_bt_controller_init()) { + ESP_LOGW("INFO", "failed to init bt controller"); + } + + // enable bt controller + if (ESP_OK != esp_hosted_bt_controller_enable()) { + ESP_LOGW("INFO", "failed to enable bt controller"); + } + hosted_hci_bluedroid_open(); /* get HCI driver operations */ diff --git a/examples/host_bluedroid_host_only/sdkconfig.defaults b/examples/host_bluedroid_host_only/sdkconfig.defaults index 2cc253b9..245d48a6 100644 --- a/examples/host_bluedroid_host_only/sdkconfig.defaults +++ b/examples/host_bluedroid_host_only/sdkconfig.defaults @@ -1,15 +1,22 @@ +CONFIG_FREERTOS_HZ=1000 + # # BT config +# - ESP32 co-processor only supports BLE 4.2 # -CONFIG_BT_CONTROLLER_DISABLED=y CONFIG_BT_ENABLED=y +CONFIG_BT_CONTROLLER_DISABLED=y CONFIG_BT_BLUEDROID_ENABLED=y CONFIG_BT_CLASSIC_ENABLED=y +CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # # Wi-Fi Remote +# - set ESP32 as default co-processor # CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED=y +CONFIG_SLAVE_IDF_TARGET_ESP32=y # # Enable ESP Hosted BT diff --git a/examples/host_bluedroid_host_only/sdkconfig.defaults.esp32h2 b/examples/host_bluedroid_host_only/sdkconfig.defaults.esp32h2 new file mode 100644 index 00000000..1686559d --- /dev/null +++ b/examples/host_bluedroid_host_only/sdkconfig.defaults.esp32h2 @@ -0,0 +1 @@ +CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y diff --git a/examples/host_bluedroid_host_only/sdkconfig.defaults.esp32p4 b/examples/host_bluedroid_host_only/sdkconfig.defaults.esp32p4 new file mode 100644 index 00000000..1686559d --- /dev/null +++ b/examples/host_bluedroid_host_only/sdkconfig.defaults.esp32p4 @@ -0,0 +1 @@ +CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y diff --git a/examples/host_bt_controller_mac_addr/CMakeLists.txt b/examples/host_bt_controller_mac_addr/CMakeLists.txt new file mode 100644 index 00000000..994697d8 --- /dev/null +++ b/examples/host_bt_controller_mac_addr/CMakeLists.txt @@ -0,0 +1,6 @@ +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(bt_mac_addr_init) diff --git a/examples/host_bt_controller_mac_addr/README.md b/examples/host_bt_controller_mac_addr/README.md new file mode 100644 index 00000000..775e5176 --- /dev/null +++ b/examples/host_bt_controller_mac_addr/README.md @@ -0,0 +1,178 @@ +| Supported Hosts | ESP32 | ESP32-P Series | ESP32-H Series | ESP32-C Series | ESP32-S Series | Any other MCU hosts | +| --------------- | ----- | -------------- | -------------- | -------------- | -------------- | ------------------- | + +| Supported Co-Processors | ESP32 | ESP32-C Series | ESP32-S Series | +| ----------------------- | ----- | -------------- | -------------- | + +# BT Controller MAC Address and Initialisation Example + +This example shows how to change the MAC Address. When run, a BLE +Scanner should show a `Bluedroid_Beacon` device with the assigned MAC +address. + +For more information on the Bluedroid Beacon, see the ESP-IDF +[Bluedroid Beacon example](https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/ble_get_started/bluedroid/Bluedroid_Beacon). + +This example can be modified to use NimBLE instead of Bluedroid. + +To run the example without modifying the BT Mac address, run `idf.py +menuconfig` --> `Example Configuration` and turn off `Update MAC +Address of BT Controller` option. + +### Build and Flash + +Run `idf.py -p PORT flash monitor` to build, flash and monitor the +project. + +(To exit the serial monitor, type ``Ctrl-]``.) + +## Example Output + +``` +I (25) boot: ESP-IDF v6.0-dev-2343-g92b90afa77 2nd stage bootloader +I (26) boot: compile time Sep 19 2025 13:47:15 +I (26) boot: Multicore bootloader +I (29) boot: chip revision: v1.0 +I (30) boot: efuse block revision: v0.1 +I (34) boot.esp32p4: SPI Speed : 80MHz +I (38) boot.esp32p4: SPI Mode : DIO +I (41) boot.esp32p4: SPI Flash Size : 2MB +I (45) boot: Enabling RNG early entropy source... +I (50) boot: Partition Table: +I (52) boot: ## Label Usage Type ST Offset Length +I (59) boot: 0 nvs WiFi data 01 02 00009000 00006000 +I (65) boot: 1 phy_init RF data 01 01 0000f000 00001000 +I (72) boot: 2 factory factory app 00 00 00010000 00100000 +I (79) boot: End of partition table +I (82) esp_image: segment 0: paddr=00010020 vaddr=40070020 size=3166ch (202348) map +I (125) esp_image: segment 1: paddr=00041694 vaddr=30100000 size=00044h ( 68) load +I (127) esp_image: segment 2: paddr=000416e0 vaddr=4ff00000 size=0e6ech ( 59116) load +I (141) esp_image: segment 3: paddr=0004fdd4 vaddr=4ff0e700 size=00244h ( 580) load +I (143) esp_image: segment 4: paddr=00050020 vaddr=40000020 size=6b1f4h (438772) map +I (221) esp_image: segment 5: paddr=000bb21c vaddr=4ff0e944 size=02398h ( 9112) load +I (228) boot: Loaded app from partition at offset 0x10000 +I (228) boot: Disabling RNG early entropy source... +W (239) pmu_pvt: blk_version is less than 2, pvt auto dbias init not supported in efuse. +I (241) cpu_start: Multicore app +I (251) cpu_start: GPIO 38 and 37 are used as console UART I/O pins +I (252) cpu_start: Pro cpu start user code +I (252) cpu_start: cpu freq: 360000000 Hz +I (254) app_init: Application information: +I (257) app_init: Project name: bt_mac_addr_init +I (262) app_init: App version: bb05bb9c +I (266) app_init: Compile time: Sep 19 2025 14:40:33 +I (271) app_init: ELF file SHA256: ab0fe993f... +I (275) app_init: ESP-IDF: v6.0-dev-2343-g92b90afa77 +I (281) efuse_init: Min chip rev: v0.1 +I (285) efuse_init: Max chip rev: v1.99 +I (289) efuse_init: Chip rev: v1.0 +I (293) heap_init: Initializing. RAM available for dynamic allocation: +I (299) heap_init: At 4FF130B0 len 00027F10 (159 KiB): RAM +I (304) heap_init: At 4FF3AFC0 len 00004BF0 (18 KiB): RAM +I (309) heap_init: At 4FF40000 len 00060000 (384 KiB): RAM +I (315) heap_init: At 50108080 len 00007F80 (31 KiB): RTCRAM +I (320) heap_init: At 30100044 len 00001FBC (7 KiB): TCM +I (326) spi_flash: detected chip: gd +I (328) spi_flash: flash io: dio +W (331) spi_flash: Detected size(16384k) larger than the size in the binary image header(2048k). Using the size in the binary image header. +I (343) host_init: ESP Hosted : Host chip_ip[18] +I (375) H_API: ESP-Hosted starting. Hosted_Tasks: prio:23, stack: 5120 RPC_task_stack: 5120 +I (375) H_API: ** add_esp_wifi_remote_channels ** +I (376) transport: Add ESP-Hosted channel IF[1]: S[0] Tx[0x4000c480] Rx[0x40020c3c] +--- 0x4000c480: transport_drv_sta_tx at /home/kysoh/projects/gitlab_esp_hosted_mcu/examples/host_bt_controller_mac_addr/components/esp_hosted/host/drivers/transport/transport_drv.c:245 +--- 0x40020c3c: esp_wifi_remote_channel_rx at /home/kysoh/projects/gitlab_esp_hosted_mcu/examples/host_bt_controller_mac_addr/managed_components/espressif__esp_wifi_remote/esp_wifi_remote_net.c:19 +I (384) transport: Add ESP-Hosted channel IF[2]: S[0] Tx[0x4000c3c0] Rx[0x40020c3c] +--- 0x4000c3c0: transport_drv_ap_tx at /home/kysoh/projects/gitlab_esp_hosted_mcu/examples/host_bt_controller_mac_addr/components/esp_hosted/host/drivers/transport/transport_drv.c:275 +--- 0x40020c3c: esp_wifi_remote_channel_rx at /home/kysoh/projects/gitlab_esp_hosted_mcu/examples/host_bt_controller_mac_addr/managed_components/espressif__esp_wifi_remote/esp_wifi_remote_net.c:19 +sdio_mempool_create free:196416 min-free:196416 lfb-def:155648 lfb-8bit:155648 + +I (400) H_SDIO_DRV: sdio_data_to_rx_buf_task started +I (403) main_task: Started on CPU0 +I (406) main_task: Calling app_main() +I (416) H_API: ESP-Hosted Try to communicate with ESP-Hosted slave + +I (416) transport: Attempt connection with slave: retry[0] +W (421) H_SDIO_DRV: Reset slave using GPIO[54] +I (425) os_wrapper_esp: GPIO [54] configured +I (1631) sdio_wrapper: SDIO master: Slot 1, Data-Lines: 4-bit Freq(KHz)[40000 KHz] +I (1631) sdio_wrapper: GPIOs: CLK[18] CMD[19] D0[14] D1[15] D2[16] D3[17] Slave_Reset[54] +I (1635) sdio_wrapper: Queues: Tx[20] Rx[20] SDIO-Rx-Mode[1] +Name: +Type: SDIO +Speed: 40.00 MHz (limit: 40.00 MHz) +Size: 0MB +CSD: ver=1, sector_size=0, capacity=0 read_bl_len=0 +SCR: sd_spec=0, bus_width=0 +TUPLE: DEVICE, size: 3: D9 01 FF +TUPLE: MANFID, size: 4 + MANF: 0092, CARD: 6666 +TUPLE: FUNCID, size: 2: 0C 00 +TUPLE: FUNCE, size: 4: 00 00 02 32 +TUPLE: CONFIG, size: 5: 01 01 00 02 07 +TUPLE: CFTABLE_ENTRY, size: 8 + INDX: C1, Intface: 1, Default: 1, Conf-Entry-Num: 1 + IF: 41 + FS: 30, misc: 0, mem_space: 1, irq: 1, io_space: 0, timing: 0, power: 0 + IR: 30, mask: 1, IRQ: FF FF + LEN: FFFF +TUPLE: END +I (1714) sdio_wrapper: Function 0 Blocksize: 512 +I (1718) sdio_wrapper: Function 1 Blocksize: 512 +I (1723) H_SDIO_DRV: Card init success, TRANSPORT_RX_ACTIVE +I (1728) transport: set_transport_state: 1 +I (1732) transport: Waiting for esp_hosted slave to be ready +I (1800) H_SDIO_DRV: SDIO Host operating in STREAMING MODE +I (1800) H_SDIO_DRV: Open data path at slave +I (1800) H_SDIO_DRV: Starting SDIO process rx task +I (1828) H_SDIO_DRV: Received ESP_PRIV_IF type message +I (1828) transport: Received INIT event from ESP32 peripheral +I (1828) transport: EVENT: 12 +I (1830) transport: Identified slave [esp32c6] +I (1834) transport: EVENT: 11 +I (1836) transport: capabilities: 0xd +I (1840) transport: Features supported are: +I (1844) transport: * WLAN +I (1846) transport: - HCI over SDIO +I (1850) transport: - BLE only +I (1853) transport: EVENT: 13 +I (1856) transport: ESP board type is : 13 + +I (1860) transport: Base transport is set-up, TRANSPORT_TX_ACTIVE +I (1866) H_API: Transport active +I (1869) transport: Slave chip Id[12] +I (1872) transport: raw_tp_dir[-], flow_ctrl: low[60] high[80] +I (1878) transport: transport_delayed_init +I (1881) esp_cli: Remove any existing deep_sleep cmd in cli +I (1887) esp_cli: Registering command: crash +I (1891) esp_cli: Registering command: reboot +I (1895) esp_cli: Registering command: mem-dump +I (1899) esp_cli: Registering command: task-dump +I (1903) esp_cli: Registering command: cpu-dump +I (1908) esp_cli: Registering command: heap-trace +I (1912) esp_cli: Registering command: sock-dump +I (1916) esp_cli: Registering command: host-power-save +I (1921) vhci_drv: Host BT Support: Enabled +I (1925) vhci_drv: BT Transport Type: VHCI +I (1929) H_SDIO_DRV: Received INIT event +I (1933) H_SDIO_DRV: Event type: 0x22 +I (1936) H_SDIO_DRV: Write thread started +I (1940) BT Example: getting fw version +I (2403) BT Example: FW Version: 2.4.4 +I (2410) BT Example: Current BT controller mac address is 9c:9e:6e:5a:b1:66 +I (2410) BT Example: Updating MAC address +I (2472) BT Example: New BT controller mac address is 08:3a:8d:01:01:01 +I (2582) transport: Attempt connection with slave: retry[0] +I (2582) transport: Transport is already up +I (2607) main_task: Returned from app_main() +I (2608) BT Example: Advertising data raw set, status 0 +I (2609) BT Example: Scan response data raw set, status 0 +I (2616) BT Example: Advertising start successfully +``` + +## Troubleshooting + +For any technical queries, please open an [issue](https://github.com/espressif/esp-hosted-mcu/issues) on ESP-Hosted on GitHub. We will get back to you soon. + +## References + +* Bluetooth Implementation in ESP-Hosted: https://github.com/espressif/esp-hosted-mcu/blob/main/docs/bluetooth_design.md diff --git a/examples/host_bt_controller_mac_addr/main/CMakeLists.txt b/examples/host_bt_controller_mac_addr/main/CMakeLists.txt new file mode 100644 index 00000000..18d510d9 --- /dev/null +++ b/examples/host_bt_controller_mac_addr/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(srcs "main.c") + +idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS ".") diff --git a/examples/host_bt_controller_mac_addr/main/Kconfig.projbuild b/examples/host_bt_controller_mac_addr/main/Kconfig.projbuild new file mode 100644 index 00000000..6cb0e04a --- /dev/null +++ b/examples/host_bt_controller_mac_addr/main/Kconfig.projbuild @@ -0,0 +1,8 @@ +menu "Example Configuration" + + config EXAMPLE_UPDATE_MAC_ADDRESS + bool "Update MAC Address of BT Controller" + default y + help + Update the MAC Address on the BT Controller +endmenu diff --git a/examples/host_bt_controller_mac_addr/main/idf_component.yml b/examples/host_bt_controller_mac_addr/main/idf_component.yml new file mode 100644 index 00000000..50ffd415 --- /dev/null +++ b/examples/host_bt_controller_mac_addr/main/idf_component.yml @@ -0,0 +1,9 @@ +dependencies: + espressif/esp_wifi_remote: + version: ">=0.10" + rules: + - if: "target in [esp32p4, esp32h2]" + espressif/esp_hosted: + version: "~2" + rules: + - if: "target in [esp32p4, esp32h2]" diff --git a/examples/host_bt_controller_mac_addr/main/main.c b/examples/host_bt_controller_mac_addr/main/main.c new file mode 100644 index 00000000..fe11bff9 --- /dev/null +++ b/examples/host_bt_controller_mac_addr/main/main.c @@ -0,0 +1,252 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +#include "esp_log.h" +#include "nvs_flash.h" +#include "esp_hosted.h" +#include "esp_hosted_bluedroid.h" +#include "esp_system.h" + +/* BLE */ +#include "esp_gap_ble_api.h" +#include "esp_gattc_api.h" +#include "esp_gatt_defs.h" +#include "esp_bt_main.h" +#include "esp_bt_defs.h" +#include "freertos/FreeRTOS.h" + +#include "esp_log.h" + +#define UPDATE_MAC_ADDRESS CONFIG_EXAMPLE_UPDATE_MAC_ADDRESS + +#define ADV_CONFIG_FLAG (1 << 0) +#define SCAN_RSP_CONFIG_FLAG (1 << 1) +#define URI_PREFIX_HTTPS (0x17) + +static const char *TAG = "BT Example"; + +#if UPDATE_MAC_ADDRESS +// Note 1: This is an example MAC address for demo purposes. In production, +// use a unique MAC address from your allocated range or locally +// administered address space +// Note 2: This MAC address setting is temporary and will revert after device +// reset. For permanent MAC address change, modify during hardware +// provisioning or burn directly into eFuse using appropriate commands +static uint8_t new_mac_addr[] = { 0x08, 0x3A, 0x8D, 0x01, 0x01, 0x01 }; +#endif + +static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param); + +static const char device_name[] = "Bluedroid_Beacon"; + +static uint8_t adv_config_done = 0; +static esp_bd_addr_t local_addr; +static uint8_t local_addr_type; + +static esp_ble_adv_params_t adv_params = { + .adv_int_min = 0x20, // 20ms + .adv_int_max = 0x20, // 20ms + .adv_type = ADV_TYPE_SCAN_IND, + .own_addr_type = BLE_ADDR_TYPE_PUBLIC, + .channel_map = ADV_CHNL_ALL, + .adv_filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY, +}; + +//configure raw data for advertising packet +static uint8_t adv_raw_data[] = { + 0x02, ESP_BLE_AD_TYPE_FLAG, 0x06, + 0x11, ESP_BLE_AD_TYPE_NAME_CMPL, 'B', 'l', 'u', 'e', 'd', 'r', 'o', 'i', 'd', '_', 'B', 'e', 'a', 'c', 'o', 'n', + 0x02, ESP_BLE_AD_TYPE_TX_PWR, 0x09, + 0x03, ESP_BLE_AD_TYPE_APPEARANCE, 0x00,0x02, + 0x02, ESP_BLE_AD_TYPE_LE_ROLE, 0x00, +}; + +static uint8_t scan_rsp_raw_data[] = { + 0x08, ESP_BLE_AD_TYPE_LE_DEV_ADDR, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, ESP_BLE_AD_TYPE_URI, URI_PREFIX_HTTPS, '/', '/', 'e', 's', 'p', 'r', 'e', 's', 's', 'i', 'f', '.', 'c', 'o', 'm', +}; + +// function to get and (optionally) set BT Controller MAC address +static void bt_mac_actions(void) +{ + uint8_t mac[10] = { 0 }; + size_t mac_len = 0; + + // get length of bt mac address + mac_len = esp_hosted_iface_mac_addr_len_get(ESP_MAC_BT); + if (mac_len) { + ESP_LOGI(TAG, "length of mac address for BT is %" PRIu16, mac_len); + } else { + ESP_LOGE(TAG, "Failed to get length of mac address for BT"); + } + + // get current bt mac address + if (ESP_OK == esp_hosted_iface_mac_addr_get(mac, mac_len, ESP_MAC_BT)) { + ESP_LOGI(TAG, "Current BT controller mac address is "MACSTR, MAC2STR(mac)); +#if UPDATE_MAC_ADDRESS + // update BT mac address - must be done before initialising bt controller + ESP_LOGI(TAG, "Updating MAC address"); + // switch OUI + memcpy(mac, new_mac_addr, mac_len); + if (ESP_OK == esp_hosted_iface_mac_addr_set(mac, mac_len, ESP_MAC_BT)) { + } else { + ESP_LOGE(TAG, "Failed to set mac address for BT"); + } + if (ESP_OK == esp_hosted_iface_mac_addr_get(mac, mac_len, ESP_MAC_BT)) { + ESP_LOGI(TAG, "New BT controller mac address is "MACSTR, MAC2STR(mac)); + } else { + ESP_LOGE(TAG, "Failed to get mac address for BT after updating"); + } +#endif + } else { + ESP_LOGE(TAG, "Failed to get mac address for BT"); + } +} + +void app_main(void) +{ + /* Initialize NVS — it is used to store PHY calibration data */ + esp_err_t ret = nvs_flash_init(); + if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { + ESP_ERROR_CHECK(nvs_flash_erase()); + ret = nvs_flash_init(); + } + ESP_ERROR_CHECK(ret); + + // initialise connection to co-processor + esp_hosted_connect_to_slave(); + + // get fw version + ESP_LOGI(TAG, "getting fw version"); + esp_hosted_coprocessor_fwver_t fwver; + if (ESP_OK == esp_hosted_get_coprocessor_fwversion(&fwver)) { + ESP_LOGI(TAG, "FW Version: %" PRIu32 ".%" PRIu32 ".%" PRIu32, + fwver.major1, fwver.minor1, fwver.patch1); + } else { + ESP_LOGW(TAG, "failed to get fw version"); + } + + // changes to the MAC must be done before the BT Controller is initalised + bt_mac_actions(); + + // init bt controller + if (ESP_OK != esp_hosted_bt_controller_init()) { + ESP_LOGW(TAG, "Failed to init bt controller"); + return; + } + + // enable bt controller + if (ESP_OK != esp_hosted_bt_controller_enable()) { + ESP_LOGW(TAG, "Failed to enable bt controller"); + return; + } + + // initialise ESP-Hosted connection for Bluedroid + hosted_hci_bluedroid_open(); + + /* get HCI driver operations */ + esp_bluedroid_hci_driver_operations_t operations = { + .send = hosted_hci_bluedroid_send, + .check_send_available = hosted_hci_bluedroid_check_send_available, + .register_host_callback = hosted_hci_bluedroid_register_host_callback, + }; + esp_bluedroid_attach_hci_driver(&operations); + + ret = esp_bluedroid_init(); + if (ret) { + ESP_LOGE(TAG, "%s init bluetooth failed: %s", __func__, esp_err_to_name(ret)); + return; + } + + ret = esp_bluedroid_enable(); + if (ret) { + ESP_LOGE(TAG, "%s enable bluetooth failed: %s", __func__, esp_err_to_name(ret)); + return; + } + + ret = esp_ble_gap_register_callback(esp_gap_cb); + if (ret) { + ESP_LOGE(TAG, "gap register error, error code = %x", ret); + return; + } + + ret = esp_ble_gap_set_device_name(device_name); + if (ret) { + ESP_LOGE(TAG, "set device name error, error code = %x", ret); + return; + } + + //config adv data + adv_config_done |= ADV_CONFIG_FLAG; + adv_config_done |= SCAN_RSP_CONFIG_FLAG; + ret = esp_ble_gap_config_adv_data_raw(adv_raw_data, sizeof(adv_raw_data)); + if (ret) { + ESP_LOGE(TAG, "config adv data failed, error code = %x", ret); + return; + } + + ret = esp_ble_gap_get_local_used_addr(local_addr, &local_addr_type); + if (ret) { + ESP_LOGE(TAG, "get local used address failed, error code = %x", ret); + return; + } + + scan_rsp_raw_data[2] = local_addr[5]; + scan_rsp_raw_data[3] = local_addr[4]; + scan_rsp_raw_data[4] = local_addr[3]; + scan_rsp_raw_data[5] = local_addr[2]; + scan_rsp_raw_data[6] = local_addr[1]; + scan_rsp_raw_data[7] = local_addr[0]; + ret = esp_ble_gap_config_scan_rsp_data_raw(scan_rsp_raw_data, sizeof(scan_rsp_raw_data)); + if (ret) { + ESP_LOGE(TAG, "config scan rsp data failed, error code = %x", ret); + } +} + +static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) +{ + switch (event) { + case ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT: + ESP_LOGI(TAG, "Advertising data set, status %d", param->adv_data_cmpl.status); + adv_config_done &= (~ADV_CONFIG_FLAG); + if (adv_config_done == 0) { + esp_ble_gap_start_advertising(&adv_params); + } + break; + case ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT: + ESP_LOGI(TAG, "Advertising data raw set, status %d", param->adv_data_raw_cmpl.status); + adv_config_done &= (~ADV_CONFIG_FLAG); + if (adv_config_done == 0) { + esp_ble_gap_start_advertising(&adv_params); + } + break; + case ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT: + ESP_LOGI(TAG, "Scan response data set, status %d", param->scan_rsp_data_cmpl.status); + adv_config_done &= (~SCAN_RSP_CONFIG_FLAG); + if (adv_config_done == 0) { + esp_ble_gap_start_advertising(&adv_params); + } + break; + case ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT: + ESP_LOGI(TAG, "Scan response data raw set, status %d", param->scan_rsp_data_raw_cmpl.status); + adv_config_done &= (~SCAN_RSP_CONFIG_FLAG); + if (adv_config_done == 0) { + esp_ble_gap_start_advertising(&adv_params); + } + break; + case ESP_GAP_BLE_ADV_START_COMPLETE_EVT: + if (param->adv_start_cmpl.status != ESP_BT_STATUS_SUCCESS) { + ESP_LOGE(TAG, "Advertising start failed, status %d", param->adv_start_cmpl.status); + break; + } + ESP_LOGI(TAG, "Advertising start successfully"); + break; + default: + break; + } +} diff --git a/examples/host_bt_controller_mac_addr/sdkconfig.defaults b/examples/host_bt_controller_mac_addr/sdkconfig.defaults new file mode 100644 index 00000000..f469affd --- /dev/null +++ b/examples/host_bt_controller_mac_addr/sdkconfig.defaults @@ -0,0 +1,27 @@ +# Override some defaults so BT stack is enabled +# in this example + +CONFIG_FREERTOS_HZ=1000 + +# +# BT config +# +CONFIG_BT_ENABLED=y +CONFIG_BT_CONTROLLER_DISABLED=y +CONFIG_BT_BLUEDROID_ENABLED=y +CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n +CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not used on ESP32, ESP32-C3 and ESP32-S3. +# CONFIG_BT_LE_50_FEATURE_SUPPORT is not set + +# +# Wi-Fi Remote +# +CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED=y + +# +# Enable ESP Hosted BT +# Used as VHCI transport between BT Host and Controller +# +CONFIG_ESP_HOSTED_ENABLE_BT_BLUEDROID=y +CONFIG_ESP_HOSTED_BLUEDROID_HCI_VHCI=y diff --git a/examples/host_network_split__power_save/CMakeLists.txt b/examples/host_network_split__power_save/CMakeLists.txt new file mode 100644 index 00000000..ee2035eb --- /dev/null +++ b/examples/host_network_split__power_save/CMakeLists.txt @@ -0,0 +1,8 @@ +# The following lines of boilerplate have to be in your project's CMakeLists +# in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +idf_build_set_property(MINIMAL_BUILD ON) +project(iperf) diff --git a/examples/host_network_split__power_save/README.md b/examples/host_network_split__power_save/README.md new file mode 100644 index 00000000..0564235f --- /dev/null +++ b/examples/host_network_split__power_save/README.md @@ -0,0 +1,331 @@ +# Network Split with Host Deep Sleep Example + +This example shows how to use two powerful ESP-Hosted features together: **Network Split** and **Host Deep Sleep**. These features allow a host MCU to save power by sleeping while the slave device keeps the network connection alive and only wakes the host when necessary. + +## What This Example Does + +**Network Split** - Smart traffic routing: +- Host handles important traffic (ports 49152-61439) +- Slave handles background traffic (ports 61440-65535) +- No unnecessary host wake-ups + + +**Host Deep Sleep** - Ultra-low power mode: +- Host can sleep while slave stays connected to WiFi +- Slave wakes host only for important traffic +- Wake-up can also be triggered by commands or MQTT messages + +## Supported Platforms and Transports + +### Supported Co-processors + +| Co-Processors Supported | ESP32-C5 | ESP32-C6/C61 | ESP32 | ESP32-S2 | ESP32-S3 | +| :---------------------- | :------- | :----------- | :---- | :------- | :------- | + +### Supported Host MCUs + +| Hosts Supported | ESP32-P4 | ESP32-H2 | Any other MCU hosts | +| :-------------- | :------- | :------- | :------------------ | + +### Supported Transport Interfaces + +| Transport Interface | SDIO | SPI Full-Duplex | SPI Half-Duplex | UART | +| :------------------ | :--- | :-------------- | :-------------- | :--- | + +## Example Hardware Used + +This example is designed for the **ESP32-P4-Function-EV-Board** with its built-in ESP32-C6. + +**Default setup:** +- **Host**: ESP32-P4 (handles important network traffic) +- **Slave**: ESP32-C6 (maintains WiFi and handles background traffic) +- **Connection**: SDIO (pre-wired on the board) +- **Wake-up wire**: Already connected between GPIO2 (slave) and GPIO6 (host) + +All listed items in default setup are customizable to suit specific use cases and requirements. + + +## Flash the Slave (ESP32-C6) + +The slave needs ESP-Hosted firmware with Network Split and Host Power Save enabled. + +With below additional configuration, Flash the slave using setup instructions, see: [Slave Example Guide](../../slave/README.md) + + +#### Slave Side Configuration: + +Using `idf.py menuconfig`, Enable: + +``` +# Minimal slave config +Example Configuration +├── [*] Enable Network Split +└── [*] Allow host to power save +``` + +**Advanced slave settings** (optional): +``` +Example Configuration +└── Network Split Configuration + ├── Host Static Port Forwarding + │ ├── TCP dst: 22,80,443,8080,8554 + │ └── UDP dst: 53,123 + ├── Port Ranges + │ ├── Host: 49152–61439 + │ └── Slave: 61440–65535 + └── Host power save config + ├── Allow host to enter deep sleep + ├── Slave out: Host wakeup GPIO (2) + └── Host Wakeup GPIO Level (High) +``` + +Continue to build and flash slave using [Slave Example Guide](../../slave/README.md) + + +## Flash the Host (ESP32-P4) + +The host needs ESP-Hosted firmware with Network Split and Host Power Save configured. + +**Essential host configuration:** +1. Set target: `idf.py set-target esp32p4` + +2. Network split and Host power save is pre-configured in this example. +(Optionally) customise the configuration using `idf.py menuconfig` +``` +Component config +└── ESP-Hosted config + ├── [*] Enable Network Split + │ └── Network Split Configuration + │ └── Port Ranges + │ ├── Host: 49152–61439 + │ └── Slave: 61440–65535 + └── [*] Enable Host Power Save + └── Host Power Save Configuration + [*] Allow host to enter deep sleep. + └── Deep Sleep Configuration + ├── Host Wakeup GPIO (6) + └── Host wakeup GPIO active low +``` + +3. Build and flash: `idf.py build && idf.py -p flash monitor` + +## Testing the Example + +### Basic Power Save Test +1. Wait for both devices to connect to WiFi +2. Connect to AP using command, `sta_connect ` +3. On host console: type `host-power-save` +4. Host goes to sleep, slave stays connected +5. On slave console: type `wake-up-host` to wake the host + +### Smart Wake-up Test +1. Put host to sleep using `host-power-save` +2. Send dummy TCP/UDP packet to the device IP in host ports (49152–61439) → host wakes automatically +3. Send dummy TCP/UDP packet to the device IP in slave ports (61440-65535) → slave handles without waking host + +##### Sample program to test Network based `Smart Wake-up Test` + +C program to send UDP packet:

send_udp_pkt.c
+
+ +```c +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2015-2025 Espressif Systems (Shanghai) PTE LTD + +/* This is just sample program to send sample udp packet */ + +/* +==================================================================== + send_udp_pkt.c +==================================================================== +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) { + if (argc != 3) { + fprintf(stderr, "Usage: %s \n", argv[0]); + return EXIT_FAILURE; + } + + const char *ip = argv[1]; + int port = atoi(argv[2]); + const char *msg = "Hello, UDP!"; + + int sock = socket(AF_INET, SOCK_DGRAM, 0); + if (sock < 0) { + perror("socket"); + return EXIT_FAILURE; + } + + // Non-blocking mode + int flags = fcntl(sock, F_GETFL, 0); + fcntl(sock, F_SETFL, flags | O_NONBLOCK); + + struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_port = htons(port), + }; + inet_pton(AF_INET, ip, &addr.sin_addr); + + ssize_t sent = sendto(sock, msg, strlen(msg), 0, + (struct sockaddr *)&addr, sizeof(addr)); + + if (sent < 0) { + if (errno == EWOULDBLOCK || errno == EAGAIN) { + fprintf(stderr, "sendto would block, try again later\n"); + } else { + perror("sendto"); + } + } else { + printf("Sent %zd bytes to %s:%d\n", sent, ip, port); + } + + close(sock); + return EXIT_SUCCESS; +} +``` +
+ + +Shell script to trigger wake-up:

send_udp_pkt.sh
+
+ +```bash +#!/bin/bash + +# Simple script to build and run send_udp_pkt.c + +#==================================================================== +# send_udp_pkt.sh +#==================================================================== +# Check if IP address is provided +if [ $# -eq 0 ]; then + echo "❌ Error: IP address is required!" + echo "Usage: $0 [port]" + echo "Example: $0 192.168.1.100 60000" + exit 1 +fi + +IP_ADDRESS="$1" +DEFAULT_PORT="60000" + +# Check if port is provided as second argument +if [ $# -ge 2 ]; then + PORT="$2" +else + PORT="$DEFAULT_PORT" + echo "No port specified, using default port: $DEFAULT_PORT" +fi + +echo "===== Network Split Host Wakeup with UDP Packet Tool =====" +echo "Target: $IP_ADDRESS:$PORT" +echo "Building and running network wakeup utility..." + +# Compile the program +gcc -o send_udp_pkt send_udp_pkt.c -pthread + +# Check if compilation succeeded +if [ $? -ne 0 ]; then + echo "❌ Compilation failed!" + exit 1 +fi + +echo "✅ Build successful!" +echo "Starting network wakeup utility..." +echo "-------------------------------------------" + +# Run the program with IP address and port +./send_udp_pkt $IP_ADDRESS $PORT + +# Capture result +RESULT=$? +if [ $RESULT -eq 0 ]; then + echo "-------------------------------------------" + echo "✅ Network wakeup packet sent successfully to $IP_ADDRESS:$PORT!" +else + echo "-------------------------------------------" + echo "❌ Network wakeup failed with code: $RESULT" +fi + +exit $RESULT +``` +
+ +Create both files in some temporary directory and run: +```bash +bash send_udp_pkt.sh 62000 # Send packet to slave port --> ❌ No host wake up + +bash send_udp_pkt.sh 123 # Send packet to host reserved udp port ==> ✅ host wake up +``` + +> [!TIP] +> +> You can design your packet routing & filtering as per application application use-case and deploy in slave firmware. +> Refer to the https://github.com/espressif/esp-hosted-mcu/blob/663d6631af6e7a6735755e2247ab60363fda87c8/slave/main/lwip_filter.c#L349 + +### Performance Test +1. Run iPerf server: `iperf -s -p 5001` +2. From another device: `iperf -c -p 5001` +3. Watch logs to see which device handles the traffic +For more details on iperf tests, refer [iperf test](README_iperf.md) + +## Customizing for Other Hardware + +#### Different Transport (e.g., SPI instead of SDIO) + +**Slave side:** +``` +Example Configuration +└── Bus Config in between Host and Co-processor + └── Transport layer + └── (X) SPI Full-duplex +``` + +**Host side:** +``` +Component config +└── ESP-Hosted config + └── Transport layer + └── (X) SPI Full-duplex +``` + +Configure the specific GPIO pins for the chosen transport bus and Host wake up GPIO pin + +#### Different MCU Combination +1. Change `idf.py set-target` to your MCU +2. Update GPIO pins in menuconfig to match your wiring +3. Make sure wake-up GPIO on host supports deep sleep wake-up + +## Troubleshooting + +**Host won't wake up:** +- Check GPIO wire connection between slave GPIO2 and host GPIO6 +- Verify host GPIO6 supports RTC wake-up +- Check GPIO level settings match on both sides + +**WiFi connection fails:** +- Double-check WiFi credentials in both devices +- Make sure both devices use the same WiFi settings + +**Traffic not splitting correctly:** +- Check port range settings in slave menuconfig +- Monitor logs to see packet routing decisions +- Verify Network Split is enabled on slave + +## References + +- [Network Split Documentation](../../docs/feature_network_split.md) +- [Host Power Save Documentation](../../docs/feature_host_power_save.md) +- [ESP32-P4-Function-EV-Board Guide](../../docs/esp32_p4_function_ev_board.md) +- [Slave Example Guide](../../slave/README.md) +- [Main ESP-Hosted Documentation](../../README.md) + + diff --git a/examples/host_network_split__power_save/README_iperf.md b/examples/host_network_split__power_save/README_iperf.md new file mode 100644 index 00000000..4e253247 --- /dev/null +++ b/examples/host_network_split__power_save/README_iperf.md @@ -0,0 +1,119 @@ +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | -------- | + +# Iperf Example + +## Note about iperf version +The iperf example doesn't support all features in standard iperf. It's compatible with iperf version 2.x. + +- Refer to the ESP Component Registry iperf-cmd page for more information: https://components.espressif.com/components/espressif/iperf-cmd + +## Note about 80MHz flash frequency (ESP32) +The iperf can get better throughput if the SPI flash frequency is set to 80MHz, but the system may crash in 80MHz mode for ESP-WROVER-KIT. +Removing R140\~R145 from the board can fix this issue. Currently the default SPI frequency is set to 40MHz, if you want to change the SPI flash +frequency to 80MHz, please make sure R140\~R145 are removed from ESP-WROVER-KIT or use ESP32 DevKitC. + +## Introduction +This example implements the protocol used by the common performance measurement tool [iPerf](https://iperf.fr/). +Performance can be measured between two ESP targets running this example, or between a single ESP target and a computer running the iPerf tool + +Demo steps to test station TCP Tx performance: + +- Configure in `menuconfig` which serial output you are using. Execute `idf.py menuconfig` and go to `Component config/ESP System Settings/Channel for console output`, then select the appropriate interface. By default the UART0 interface is used, this means that for example in the ESP32-S3-DevKitC-1 or ESP32-C6-DevKitC-1 you should connect to the micro-usb connector labeled as UART and not to the one labeled as USB. To use the one labeled as USB you should change the aforementioned setting to `USB Serial/JTAG Controller`. + +- Build and flash the iperf example with `sdkconfig.defaults`, which contains performance test specific configurations + - Use `help` for detailed command usage information. + +- Run the demo as station mode and join the target AP + - `sta_connect ` + - NOTE: the dut is started in station mode by default. If you want to use the dut as softap, please set wifi mode first: + - `wifi_mode ap` + - `ap_set ` + +- Run iperf as server on AP side + - `iperf -s -i 3` + +- Run iperf as client on ESP side + - `iperf -c 192.168.10.42 -i 3 -t 60` + +The console output, which is printed by station TCP RX throughput test, looks like: + + ``` + iperf> sta_connect testap-11 ******** + I (36836) WIFI: Connecting to testap-11... + I (36839) WIFI: DONE.WIFI_CONNECT_START,OK. + iperf> I (39248) WIFI: WIFI_EVENT_STA_DISCONNECTED! reason: 201 + I (39249) WIFI: trying to reconnect... + I (41811) wifi:new:<11,2>, old:<1,0>, ap:<255,255>, sta:<11,2>, prof:1, snd_ch_cfg:0x0 + I (41813) wifi:state: init -> auth (0xb0) + I (41816) wifi:state: auth -> assoc (0x0) + I (41840) wifi:state: assoc -> run (0x10) + I (41847) wifi:idx:0 (ifx:0, 30:5a:3a:74:90:f0), tid:0, ssn:0, winSize:64 + I (41914) wifi:connected with testap-11, aid = 1, channel 11, 40D, bssid = 30:5a:3a:74:90:f0 + I (41915) wifi:security: WPA2-PSK, phy: bgn, rssi: -34 + I (41926) wifi:pm start, type: 0 + + I (41927) wifi:dp: 1, bi: 102400, li: 3, scale listen interval from 307200 us to 307200 us + I (41929) WIFI: WIFI_EVENT_STA_CONNECTED! + I (41983) wifi:AP's beacon interval = 102400 us, DTIM period = 3 + I (42929) esp_netif_handlers: sta ip: 192.168.1.79, mask: 255.255.255.0, gw: 192.168.1.1 + I (42930) WIFI: IP_EVENT_STA_GOT_IP: Interface "sta" address: 192.168.1.79 + I (42942) WIFI: - IPv4 address: 192.168.1.79, + iperf> + iperf> iperf -s -i 2 + I (84810) IPERF: mode=tcp-server sip=0.0.0.0:5001, dip=0.0.0.0:5001, interval=2, time=30 + I (84812) iperf: Socket created + iperf> I (87967) iperf: accept: 192.168.1.2,43726 + + Interval Bandwidth + 0.0- 2.0 sec 24.36 Mbits/sec + 2.0- 4.0 sec 23.38 Mbits/sec + 4.0- 6.0 sec 24.02 Mbits/sec + 6.0- 8.0 sec 25.27 Mbits/sec + 8.0-10.0 sec 23.84 Mbits/sec + ``` + +Steps to test station/soft-AP TCP/UDP RX/TX throughput are similar as test steps in station TCP TX. + +#### Host Flashing Steps + +* Set the ESP32-P4 as the target + +```sh +idf.py set-target esp32p4 +``` + +You may see lines similar to this: + +``` +NOTICE: Processing 11 dependencies: +NOTICE: [1/11] cmd_system (*) (/home/esp/esp-idf/examples/system/console/advanced/components/cmd_system) +NOTICE: [2/11] esp-qa/ping-cmd (1.0.0) +NOTICE: [3/11] esp-qa/wifi-cmd (0.1.10) +NOTICE: [4/11] espressif/eppp_link (0.2.0) +NOTICE: [5/11] espressif/esp-extconn (0.1.0) +NOTICE: [6/11] espressif/esp_hosted (1.1.1) +NOTICE: [7/11] espressif/esp_serial_slave_link (1.1.0) +NOTICE: [8/11] espressif/esp_wifi_remote (0.5.3) +NOTICE: [9/11] espressif/iperf (0.1.3) +NOTICE: [10/11] espressif/iperf-cmd (0.1.3) +NOTICE: [11/11] idf (5.5.0) +``` + +The Wi-Fi Remote and ESP-Hosted components are automatically fetched during the configuration. + +* Build + + ```sh + idf.py build + ``` +* Flash + + ```sh + idf.py -p flash + ``` +* Monitor + + ```sh + idf.py -p monitor + ``` diff --git a/examples/host_network_split__power_save/main/CMakeLists.txt b/examples/host_network_split__power_save/main/CMakeLists.txt new file mode 100644 index 00000000..156c3bfc --- /dev/null +++ b/examples/host_network_split__power_save/main/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "iperf_example_main.c" + INCLUDE_DIRS ".") diff --git a/examples/host_network_split__power_save/main/idf_component.yml b/examples/host_network_split__power_save/main/idf_component.yml new file mode 100644 index 00000000..a11ba0fd --- /dev/null +++ b/examples/host_network_split__power_save/main/idf_component.yml @@ -0,0 +1,29 @@ +dependencies: + cmd_system: + path: ${IDF_PATH}/examples/system/console/advanced/components/cmd_system + espressif/iperf-cmd: + matches: + - if: "idf_version >=6.0" + version: "~0.1.3" + - if: "idf_version <6.0" + version: "~0.1.1" + esp-qa/wifi-cmd: + matches: + - if: "idf_version >=6.0" + version: "~0.2.0" + - if: "idf_version >=5.5,<6.0" + version: "~0.2.2" + - if: "idf_version >=5.4,<5.5" + version: "~0.1.8" + - if: "idf_version >=5.3,<5.4" + version: "~0.1.0" + esp-qa/ping-cmd: + version: "~1.0.0" + espressif/esp_wifi_remote: + version: "*" + rules: + - if: "target in [esp32p4, esp32h2]" + espressif/esp_hosted: + version: "*" + rules: + - if: "target in [esp32p4, esp32h2]" diff --git a/examples/host_network_split__power_save/main/iperf_example_main.c b/examples/host_network_split__power_save/main/iperf_example_main.c new file mode 100644 index 00000000..478fab79 --- /dev/null +++ b/examples/host_network_split__power_save/main/iperf_example_main.c @@ -0,0 +1,140 @@ +/* Wi-Fi iperf Example + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +#include +#include +#include "esp_wifi.h" +#include "esp_log.h" +#include "esp_err.h" +#include "nvs_flash.h" +#include "esp_console.h" +#include "cmd_system.h" + +/* component manager */ +#include "iperf.h" +#include "wifi_cmd.h" +#include "iperf_cmd.h" +#include "ping_cmd.h" + + +#if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS || CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS +#include "esp_wifi_he.h" +#endif +#if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS +extern int wifi_cmd_get_tx_statistics(int argc, char **argv); +extern int wifi_cmd_clr_tx_statistics(int argc, char **argv); +#endif +#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS +extern int wifi_cmd_get_rx_statistics(int argc, char **argv); +extern int wifi_cmd_clr_rx_statistics(int argc, char **argv); +#endif + +#if defined(CONFIG_ESP_EXT_CONN_ENABLE) && defined(CONFIG_ESP_HOST_WIFI_ENABLED) +#include "esp_extconn.h" +#endif + +void iperf_hook_show_wifi_stats(iperf_traffic_type_t type, iperf_status_t status) +{ + if (status == IPERF_STARTED) { +#if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS + if (type != IPERF_UDP_SERVER) { + wifi_cmd_clr_tx_statistics(0, NULL); + } +#endif +#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS + if (type != IPERF_UDP_CLIENT) { + wifi_cmd_clr_rx_statistics(0, NULL); + } +#endif + } + + if (status == IPERF_STOPPED) { +#if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS + if (type != IPERF_UDP_SERVER) { + wifi_cmd_get_tx_statistics(0, NULL); + } +#endif +#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS + if (type != IPERF_UDP_CLIENT) { + wifi_cmd_get_rx_statistics(0, NULL); + } +#endif + } + +} + + +void app_main(void) +{ +#if defined(CONFIG_ESP_EXT_CONN_ENABLE) && defined(CONFIG_ESP_HOST_WIFI_ENABLED) + esp_extconn_config_t ext_config = ESP_EXTCONN_CONFIG_DEFAULT(); + esp_extconn_init(&ext_config); +#endif + + esp_err_t ret = nvs_flash_init(); + if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { + ESP_ERROR_CHECK(nvs_flash_erase()); + ret = nvs_flash_init(); + } + ESP_ERROR_CHECK( ret ); + + /* initialise wifi */ + app_wifi_initialise_config_t config = APP_WIFI_CONFIG_DEFAULT(); + config.storage = WIFI_STORAGE_RAM; + config.ps_type = WIFI_PS_NONE; + app_initialise_wifi(&config); +#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS +#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_MU_STATS + esp_wifi_enable_rx_statistics(true, true); +#else + esp_wifi_enable_rx_statistics(true, false); +#endif +#endif +#if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS + esp_wifi_enable_tx_statistics(ESP_WIFI_ACI_BE, true); +#endif + + + esp_console_repl_t *repl = NULL; + esp_console_repl_config_t repl_config = ESP_CONSOLE_REPL_CONFIG_DEFAULT(); + repl_config.prompt = "iperf>"; + + // init console REPL environment +#if CONFIG_ESP_CONSOLE_UART + esp_console_dev_uart_config_t uart_config = ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_console_new_repl_uart(&uart_config, &repl_config, &repl)); +#elif CONFIG_ESP_CONSOLE_USB_CDC + esp_console_dev_usb_cdc_config_t cdc_config = ESP_CONSOLE_DEV_CDC_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_console_new_repl_usb_cdc(&cdc_config, &repl_config, &repl)); +#elif CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG + esp_console_dev_usb_serial_jtag_config_t usbjtag_config = ESP_CONSOLE_DEV_USB_SERIAL_JTAG_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_console_new_repl_usb_serial_jtag(&usbjtag_config, &repl_config, &repl)); +#endif + + /* Register commands */ + register_system(); + app_register_all_wifi_commands(); + app_register_iperf_commands(); + ping_cmd_register_ping(); + app_register_iperf_hook_func(iperf_hook_show_wifi_stats); + + + printf("\n ==================================================\n"); + printf(" | Steps to test WiFi throughput |\n"); + printf(" | |\n"); + printf(" | 1. Print 'help' to gain overview of commands |\n"); + printf(" | 2. Configure device to station or soft-AP |\n"); + printf(" | 3. Setup WiFi connection |\n"); + printf(" | 4. Run iperf to test UDP/TCP RX/TX throughput |\n"); + printf(" | |\n"); + printf(" =================================================\n\n"); + + // start console REPL + ESP_ERROR_CHECK(esp_console_start_repl(repl)); +} diff --git a/examples/host_network_split__power_save/sdkconfig.ci.sdio b/examples/host_network_split__power_save/sdkconfig.ci.sdio new file mode 100644 index 00000000..b7c436fb --- /dev/null +++ b/examples/host_network_split__power_save/sdkconfig.ci.sdio @@ -0,0 +1 @@ +CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE=y diff --git a/examples/host_network_split__power_save/sdkconfig.ci.spi b/examples/host_network_split__power_save/sdkconfig.ci.spi new file mode 100644 index 00000000..bc3d128f --- /dev/null +++ b/examples/host_network_split__power_save/sdkconfig.ci.spi @@ -0,0 +1 @@ +CONFIG_ESP_HOSTED_SPI_HOST_INTERFACE=y diff --git a/examples/host_network_split__power_save/sdkconfig.ci.spi_hd b/examples/host_network_split__power_save/sdkconfig.ci.spi_hd new file mode 100644 index 00000000..b529f249 --- /dev/null +++ b/examples/host_network_split__power_save/sdkconfig.ci.spi_hd @@ -0,0 +1 @@ +CONFIG_ESP_HOSTED_SPI_HD_HOST_INTERFACE=y diff --git a/examples/host_network_split__power_save/sdkconfig.ci.uart b/examples/host_network_split__power_save/sdkconfig.ci.uart new file mode 100644 index 00000000..38975d30 --- /dev/null +++ b/examples/host_network_split__power_save/sdkconfig.ci.uart @@ -0,0 +1 @@ +CONFIG_ESP_HOSTED_UART_HOST_INTERFACE=y diff --git a/examples/host_network_split__power_save/sdkconfig.defaults b/examples/host_network_split__power_save/sdkconfig.defaults new file mode 100644 index 00000000..21e5ea0c --- /dev/null +++ b/examples/host_network_split__power_save/sdkconfig.defaults @@ -0,0 +1,24 @@ +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 + +CONFIG_FREERTOS_UNICORE=n +CONFIG_FREERTOS_HZ=1000 + +CONFIG_ESP_INT_WDT=n +CONFIG_ESP_TASK_WDT_EN=n + +CONFIG_LWIP_IRAM_OPTIMIZATION=y +CONFIG_LWIP_TCPIP_TASK_PRIO=23 + +CONFIG_IPERF_TRAFFIC_TASK_PRIORITY=23 +CONFIG_IPERF_REPORT_TASK_PRIORITY=24 +CONFIG_COMPILER_OPTIMIZATION_PERF=y + +CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y + +# Enable Network Split +CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED=y + +#Enable Host power save +CONFIG_ESP_HOSTED_HOST_POWER_SAVE_ENABLED=y +CONFIG_ESP_HOSTED_HOST_DEEP_SLEEP_ALLOWED=y +#CONFIG_ESP_HOSTED_HOST_WAKEUP_GPIO=6 diff --git a/examples/host_network_split__power_save/sdkconfig.defaults.esp32 b/examples/host_network_split__power_save/sdkconfig.defaults.esp32 new file mode 100644 index 00000000..084ab233 --- /dev/null +++ b/examples/host_network_split__power_save/sdkconfig.defaults.esp32 @@ -0,0 +1,23 @@ +# +# ESP32-specific +# + +CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16 +CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=64 +CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=64 +CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y +CONFIG_WIFI_RMT_TX_BA_WIN=32 +CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y +CONFIG_WIFI_RMT_RX_BA_WIN=32 + +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 +CONFIG_LWIP_TCP_WND_DEFAULT=65534 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 + +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_40M=y + +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240 diff --git a/examples/host_network_split__power_save/sdkconfig.defaults.esp32c2 b/examples/host_network_split__power_save/sdkconfig.defaults.esp32c2 new file mode 100644 index 00000000..fdc4aed6 --- /dev/null +++ b/examples/host_network_split__power_save/sdkconfig.defaults.esp32c2 @@ -0,0 +1,26 @@ +# +# ESP32-C2 +# + +CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=14 +CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=14 +CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=18 +CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y +CONFIG_WIFI_RMT_TX_BA_WIN=16 +CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y +CONFIG_WIFI_RMT_RX_BA_WIN=14 + +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=7200 +CONFIG_LWIP_TCP_WND_DEFAULT=11520 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=32 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=32 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 + +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_120=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=120 + +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_60M=y + +CONFIG_LWIP_TCPIP_CORE_LOCKING=y +CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y diff --git a/examples/host_network_split__power_save/sdkconfig.defaults.esp32c3 b/examples/host_network_split__power_save/sdkconfig.defaults.esp32c3 new file mode 100644 index 00000000..6c60e9d3 --- /dev/null +++ b/examples/host_network_split__power_save/sdkconfig.defaults.esp32c3 @@ -0,0 +1,26 @@ +# +# ESP32C3 +# + +CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=20 +CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=40 +CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=40 +CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y +CONFIG_WIFI_RMT_TX_BA_WIN=32 +CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y +CONFIG_WIFI_RMT_RX_BA_WIN=32 + +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=40960 +CONFIG_LWIP_TCP_WND_DEFAULT=40960 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 + +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=160 + +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y + +CONFIG_LWIP_TCPIP_CORE_LOCKING=y +CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y diff --git a/examples/host_network_split__power_save/sdkconfig.defaults.esp32c5 b/examples/host_network_split__power_save/sdkconfig.defaults.esp32c5 new file mode 100644 index 00000000..4d15c8b7 --- /dev/null +++ b/examples/host_network_split__power_save/sdkconfig.defaults.esp32c5 @@ -0,0 +1,43 @@ +# +# ESP32C5-Specific +# +CONFIG_IDF_ENV_FPGA=n + +CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=20 +CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=48 +CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=48 +CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y +CONFIG_WIFI_RMT_TX_BA_WIN=32 +CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y +CONFIG_WIFI_RMT_RX_BA_WIN=22 + +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=41760 +CONFIG_LWIP_TCP_WND_DEFAULT=65535 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=48 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=48 +CONFIG_LWIP_IP_REASS_MAX_PBUFS=15 + +# +# Serial flasher config +# +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y + +# +# Wi-Fi +# +CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS=y +CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS=y +CONFIG_ESP_WIFI_ENABLE_WIFI_RX_MU_STATS=n +CONFIG_ESP_WIFI_ENABLE_DUMP_HESIGB=n +CONFIG_ESP_WIFI_ENABLE_DUMP_MU_CFO=n +CONFIG_ESP_WIFI_ENABLE_DUMP_CTRL_NDPA=n +CONFIG_ESP_WIFI_ENABLE_DUMP_CTRL_BFRP=n +CONFIG_ESP_WIFI_SLP_IRAM_OPT=n +CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=n + +CONFIG_LWIP_TCPIP_CORE_LOCKING=y +CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y + +CONFIG_IPERF_DEF_TCP_TX_BUFFER_LEN=2880 diff --git a/examples/host_network_split__power_save/sdkconfig.defaults.esp32c6 b/examples/host_network_split__power_save/sdkconfig.defaults.esp32c6 new file mode 100644 index 00000000..0183b3dd --- /dev/null +++ b/examples/host_network_split__power_save/sdkconfig.defaults.esp32c6 @@ -0,0 +1,28 @@ +# +# ESP32C6-Specific +# + +CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=40 +CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=60 +CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=40 +CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y +CONFIG_WIFI_RMT_TX_BA_WIN=32 +CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y +CONFIG_WIFI_RMT_RX_BA_WIN=32 + +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=51200 +CONFIG_LWIP_TCP_WND_DEFAULT=65535 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 + +CONFIG_LWIP_IP_REASS_MAX_PBUFS=15 + +CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS=n +CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS=n +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=y + +CONFIG_LWIP_TCPIP_CORE_LOCKING=y +CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y diff --git a/examples/host_network_split__power_save/sdkconfig.defaults.esp32c61 b/examples/host_network_split__power_save/sdkconfig.defaults.esp32c61 new file mode 100644 index 00000000..3f90fe0e --- /dev/null +++ b/examples/host_network_split__power_save/sdkconfig.defaults.esp32c61 @@ -0,0 +1,43 @@ +# +# ESP32C61-Specific +# +CONFIG_IDF_ENV_FPGA=n + +CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=20 +CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=40 +CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=36 +CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y +CONFIG_WIFI_RMT_TX_BA_WIN=32 +CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y +CONFIG_WIFI_RMT_RX_BA_WIN=20 + +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=25920 +CONFIG_LWIP_TCP_WND_DEFAULT=43200 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=48 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=48 +CONFIG_LWIP_IP_REASS_MAX_PBUFS=15 + +# +# Serial flasher config +# +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y + +# +# Wi-Fi +# +CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS=y +CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS=y +CONFIG_ESP_WIFI_ENABLE_WIFI_RX_MU_STATS=n +CONFIG_ESP_WIFI_ENABLE_DUMP_HESIGB=n +CONFIG_ESP_WIFI_ENABLE_DUMP_MU_CFO=n +CONFIG_ESP_WIFI_ENABLE_DUMP_CTRL_NDPA=n +CONFIG_ESP_WIFI_ENABLE_DUMP_CTRL_BFRP=n +CONFIG_ESP_WIFI_SLP_IRAM_OPT=n +CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=n + +CONFIG_LWIP_TCPIP_CORE_LOCKING=y +CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y + +CONFIG_IPERF_DEF_TCP_TX_BUFFER_LEN=2880 diff --git a/examples/host_network_split__power_save/sdkconfig.defaults.esp32p4 b/examples/host_network_split__power_save/sdkconfig.defaults.esp32p4 new file mode 100644 index 00000000..ba68d0dd --- /dev/null +++ b/examples/host_network_split__power_save/sdkconfig.defaults.esp32p4 @@ -0,0 +1,23 @@ +# +# ESP32-P4 specific +# + +CONFIG_SLAVE_IDF_TARGET_ESP32C6=y +CONFIG_ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD=y + + +CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16 +CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=64 +CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=64 +CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y +CONFIG_WIFI_RMT_TX_BA_WIN=32 +CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y +CONFIG_WIFI_RMT_RX_BA_WIN=32 + +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 +CONFIG_LWIP_TCP_WND_DEFAULT=65534 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 + +CONFIG_LWIP_TCP_SACK_OUT=y diff --git a/examples/host_network_split__power_save/sdkconfig.defaults.esp32s2 b/examples/host_network_split__power_save/sdkconfig.defaults.esp32s2 new file mode 100644 index 00000000..01799145 --- /dev/null +++ b/examples/host_network_split__power_save/sdkconfig.defaults.esp32s2 @@ -0,0 +1,30 @@ +# +# ESP32S2-specific +# + +CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=8 +CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=24 +CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=24 +CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y +CONFIG_WIFI_RMT_TX_BA_WIN=16 +CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y +CONFIG_WIFI_RMT_RX_BA_WIN=16 + +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=17280 +CONFIG_LWIP_TCP_WND_DEFAULT=28000 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=32 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=32 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 + +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240 + +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y + +CONFIG_ESP32S2_INSTRUCTION_CACHE_16KB=y +CONFIG_ESP32S2_INSTRUCTION_CACHE_LINE_16B=y +CONFIG_ESP32S2_INSTRUCTION_CACHE_WRAP=y + +CONFIG_LWIP_TCPIP_CORE_LOCKING=y +CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y diff --git a/examples/host_network_split__power_save/sdkconfig.defaults.esp32s3 b/examples/host_network_split__power_save/sdkconfig.defaults.esp32s3 new file mode 100644 index 00000000..73bdb029 --- /dev/null +++ b/examples/host_network_split__power_save/sdkconfig.defaults.esp32s3 @@ -0,0 +1,27 @@ +# +# ESP32S3-specific +# + +CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16 +CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=64 +CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=64 +CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y +CONFIG_WIFI_RMT_TX_BA_WIN=32 +CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y +CONFIG_WIFI_RMT_RX_BA_WIN=32 + +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65535 +CONFIG_LWIP_TCP_WND_DEFAULT=65535 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 + +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240 + +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y + +CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y +CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y +CONFIG_ESP32S3_INSTRUCTION_CACHE_WRAP=y diff --git a/examples/host_nimble_bleprph_host_only_uart_hci/README.md b/examples/host_nimble_bleprph_host_only_uart_hci/README.md index 8874768c..6e94129a 100644 --- a/examples/host_nimble_bleprph_host_only_uart_hci/README.md +++ b/examples/host_nimble_bleprph_host_only_uart_hci/README.md @@ -1,5 +1,8 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-S3 | ESP32-P4 | ESP32-H2 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | -------- | -------- | +| Supported Hosts | ESP32 | ESP32-P Series | ESP32-H Series | ESP32-C Series | ESP32-S Series | Any other MCU hosts | +| --------------- | ----- | -------------- | -------------- | -------------- | -------------- | ------------------- | + +| Supported Co-Processors | ESP32 | ESP32-C Series | ESP32-S Series | +| ----------------------- | ----- | -------------- | -------------- | # BLE Peripheral Example diff --git a/examples/host_nimble_bleprph_host_only_uart_hci/main/idf_component.yml b/examples/host_nimble_bleprph_host_only_uart_hci/main/idf_component.yml index aea470e2..6a234b8b 100644 --- a/examples/host_nimble_bleprph_host_only_uart_hci/main/idf_component.yml +++ b/examples/host_nimble_bleprph_host_only_uart_hci/main/idf_component.yml @@ -2,10 +2,10 @@ dependencies: nimble_peripheral_utils: path: ${IDF_PATH}/examples/bluetooth/nimble/common/nimble_peripheral_utils espressif/esp_wifi_remote: - version: "*" + version: ">=0.10" rules: - if: "target in [esp32p4, esp32h2]" espressif/esp_hosted: - version: "~1" + version: "~2" rules: - if: "target in [esp32p4, esp32h2]" diff --git a/examples/host_nimble_bleprph_host_only_uart_hci/main/main.c b/examples/host_nimble_bleprph_host_only_uart_hci/main/main.c index 277c0353..1e124d4c 100644 --- a/examples/host_nimble_bleprph_host_only_uart_hci/main/main.c +++ b/examples/host_nimble_bleprph_host_only_uart_hci/main/main.c @@ -16,6 +16,8 @@ #include "bleprph.h" #include "uart_driver.h" +#include "esp_hosted.h" + #if CONFIG_EXAMPLE_EXTENDED_ADV static uint8_t ext_adv_pattern_1[] = { 0x02, 0x01, 0x06, @@ -223,19 +225,23 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg) int rc; switch (event->type) { +#if defined(BLE_GAP_EVENT_LINK_ESTAB) case BLE_GAP_EVENT_LINK_ESTAB: +#else + case BLE_GAP_EVENT_CONNECT: +#endif /* A new connection was established or a connection attempt failed. */ MODLOG_DFLT(INFO, "connection %s; status=%d ", - event->link_estab.status == 0 ? "established" : "failed", - event->link_estab.status); - if (event->link_estab.status == 0) { - rc = ble_gap_conn_find(event->link_estab.conn_handle, &desc); + event->connect.status == 0 ? "established" : "failed", + event->connect.status); + if (event->connect.status == 0) { + rc = ble_gap_conn_find(event->connect.conn_handle, &desc); assert(rc == 0); bleprph_print_conn_desc(&desc); } MODLOG_DFLT(INFO, "\n"); - if (event->link_estab.status != 0) { + if (event->connect.status != 0) { /* Connection failed; resume advertising. */ #if CONFIG_EXAMPLE_EXTENDED_ADV ext_bleprph_advertise(); @@ -493,12 +499,27 @@ app_main(void) } ESP_ERROR_CHECK(ret); + // initialise connection to co-processor + esp_hosted_connect_to_slave(); + + // init bt controller + if (ESP_OK != esp_hosted_bt_controller_init()) { + ESP_LOGW("INFO", "failed to init bt controller"); + } + + // enable bt controller + if (ESP_OK != esp_hosted_bt_controller_enable()) { + ESP_LOGW("INFO", "failed to enable bt controller"); + } + hci_uart_open(); + ret = nimble_port_init(); if (ret != ESP_OK) { ESP_LOGE(tag, "Failed to init nimble %d ", ret); return; } + /* Initialize the NimBLE host configuration. */ ble_hs_cfg.reset_cb = bleprph_on_reset; ble_hs_cfg.sync_cb = bleprph_on_sync; diff --git a/examples/host_nimble_bleprph_host_only_uart_hci/sdkconfig.defaults b/examples/host_nimble_bleprph_host_only_uart_hci/sdkconfig.defaults index eb07a5c5..9d75e215 100644 --- a/examples/host_nimble_bleprph_host_only_uart_hci/sdkconfig.defaults +++ b/examples/host_nimble_bleprph_host_only_uart_hci/sdkconfig.defaults @@ -1,6 +1,8 @@ # Override some defaults so BT stack is enabled # in this example +CONFIG_FREERTOS_HZ=1000 + # # BT config # diff --git a/examples/host_nimble_bleprph_host_only_vhci/README.md b/examples/host_nimble_bleprph_host_only_vhci/README.md index 63a68f27..6e94f6b7 100644 --- a/examples/host_nimble_bleprph_host_only_vhci/README.md +++ b/examples/host_nimble_bleprph_host_only_vhci/README.md @@ -1,5 +1,8 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-S3 | ESP32-P4 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Hosts | ESP32 | ESP32-P Series | ESP32-H Series | ESP32-C Series | ESP32-S Series | Any other MCU hosts | +| --------------- | ----- | -------------- | -------------- | -------------- | -------------- | ------------------- | + +| Supported Co-Processors | ESP32 | ESP32-C Series | ESP32-S Series | +| ----------------------- | ----- | -------------- | -------------- | # BLE Host-Only Peripheral Hosted HCI Example diff --git a/examples/host_nimble_bleprph_host_only_vhci/main/idf_component.yml b/examples/host_nimble_bleprph_host_only_vhci/main/idf_component.yml index c2ddf618..6a234b8b 100644 --- a/examples/host_nimble_bleprph_host_only_vhci/main/idf_component.yml +++ b/examples/host_nimble_bleprph_host_only_vhci/main/idf_component.yml @@ -2,6 +2,10 @@ dependencies: nimble_peripheral_utils: path: ${IDF_PATH}/examples/bluetooth/nimble/common/nimble_peripheral_utils espressif/esp_wifi_remote: - version: "~0.5.1" + version: ">=0.10" + rules: + - if: "target in [esp32p4, esp32h2]" + espressif/esp_hosted: + version: "~2" rules: - if: "target in [esp32p4, esp32h2]" diff --git a/examples/host_nimble_bleprph_host_only_vhci/main/main.c b/examples/host_nimble_bleprph_host_only_vhci/main/main.c index 8b5b2ec3..6e5736b2 100644 --- a/examples/host_nimble_bleprph_host_only_vhci/main/main.c +++ b/examples/host_nimble_bleprph_host_only_vhci/main/main.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -15,6 +15,8 @@ #include "services/gap/ble_svc_gap.h" #include "bleprph.h" +#include "esp_hosted.h" + #if CONFIG_EXAMPLE_EXTENDED_ADV static uint8_t ext_adv_pattern_1[] = { 0x02, 0x01, 0x06, @@ -496,11 +498,35 @@ app_main(void) } ESP_ERROR_CHECK(ret); + // initialise connection to co-processor + esp_hosted_connect_to_slave(); + + // get fw version + ESP_LOGI("INFO", "getting fw version"); + esp_hosted_coprocessor_fwver_t fwver; + if (ESP_OK == esp_hosted_get_coprocessor_fwversion(&fwver)) { + ESP_LOGI("INFO", "FW Version: %" PRIu32 ".%" PRIu32 ".%" PRIu32, + fwver.major1, fwver.minor1, fwver.patch1); + } else { + ESP_LOGW("INFO", "failed to get fw version"); + } + + // init bt controller + if (ESP_OK != esp_hosted_bt_controller_init()) { + ESP_LOGW("INFO", "failed to init bt controller"); + } + + // enable bt controller + if (ESP_OK != esp_hosted_bt_controller_enable()) { + ESP_LOGW("INFO", "failed to enable bt controller"); + } + ret = nimble_port_init(); if (ret != ESP_OK) { - ESP_LOGE(tag, "Failed to init nimble %d ", ret); + ESP_LOGW("INFO", "Failed to init nimble %d ", ret); return; } + /* Initialize the NimBLE host configuration. */ ble_hs_cfg.reset_cb = bleprph_on_reset; ble_hs_cfg.sync_cb = bleprph_on_sync; diff --git a/examples/host_nimble_bleprph_host_only_vhci/sdkconfig.defaults b/examples/host_nimble_bleprph_host_only_vhci/sdkconfig.defaults index 2e66a8a8..0674e2ca 100644 --- a/examples/host_nimble_bleprph_host_only_vhci/sdkconfig.defaults +++ b/examples/host_nimble_bleprph_host_only_vhci/sdkconfig.defaults @@ -1,6 +1,8 @@ # Override some defaults so BT stack is enabled # in this example +CONFIG_FREERTOS_HZ=1000 + # # BT config # diff --git a/examples/host_performs_slave_ota/CMakeLists.txt b/examples/host_performs_slave_ota/CMakeLists.txt new file mode 100644 index 00000000..95d2c71d --- /dev/null +++ b/examples/host_performs_slave_ota/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +set(PARTITION_TABLE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/partitions.csv") + +project(host_performs_slave_ota) diff --git a/examples/host_performs_slave_ota/README.md b/examples/host_performs_slave_ota/README.md new file mode 100644 index 00000000..3763309a --- /dev/null +++ b/examples/host_performs_slave_ota/README.md @@ -0,0 +1,512 @@ +# ESP-Hosted Slave OTA Example + +| Supported Targets | ESP32-P4 | ESP32-H2 | +| ----------------- | -------- | -------- | + +## What This Example Does + +This example demonstrates **ESP-Hosted Transport OTA** - updating slave firmware **through the existing ESP-Hosted connection** (SDIO/SPI/UART) without any additional hardware or physical access. + +**Key Features:** +- **No extra hardware needed** - uses your existing ESP-Hosted transport +- **Three OTA methods** - choose what works best for your deployment +- **Version checking** - prevents unnecessary updates + +## ESP-Hosted Slave Firmware Update Approaches + +There are a lot of ways that you can flash the slave firmware. +To limit possibilities, **two main approaches** could be understood. + +##### 1. ESP-Hosted Slave OTA (Current Example focus this) +- **Hardware**: None (reuses existing SDIO/SPI/UART serial channel from ESP-Hosted) +- **Use case**: Production updates, remote deployment +- **Access**: Over-the-air OR through Host partition (Uses RPC calls to slave) + +##### 2. Direct UART Flashing +- **Hardware**: ESP-Prog or UART connection +- **Use case**: Initial slave FW setup, firmware recovery, development +- **Access**: Requires physical access to device + + +**This example focuses entirely on Method 1** + +--- + +## ESP-Hosted Slave OTA APIs + +The ESP-Hosted slave OTA functionality is built around **4 core APIs** that handle the complete OTA process. These APIs are transport-agnostic and can work with any firmware source (LittleFS, Partition, HTTPS, SPIFFS, etc.). + +### ESP-Hosted-MCU Slave OTA APIs Used + +#### 1. `esp_hosted_slave_ota_begin()` +```c +esp_err_t esp_hosted_slave_ota_begin(void); +``` +- **Purpose**: Initializes the OTA process on the slave +- **Arguments**: None +- **Returns**: `ESP_OK` on success, error code on failure +- **What it does**: + - Prepares slave for firmware reception + - Allocates OTA buffers + - Sets up the OTA partition on slave + +#### 2. `esp_hosted_slave_ota_write()` +```c +esp_err_t esp_hosted_slave_ota_write(const void *data, size_t size); +``` +- **Purpose**: Sends firmware data chunks to the slave +- **Arguments**: + - `data`: Pointer to firmware data chunk + - `size`: Size of the data chunk (typically 1400-1500 bytes) +- **Returns**: `ESP_OK` on success, error code on failure +- **What it does**: + - Transmits firmware data over ESP-Hosted transport (SDIO/SPI/UART) + - Slave writes data to its OTA partition + - Can be called multiple times for large firmware + +#### 3. `esp_hosted_slave_ota_end()` +```c +esp_err_t esp_hosted_slave_ota_end(void); +``` +- **Purpose**: Finalizes the OTA process +- **Arguments**: None +- **Returns**: `ESP_OK` on success, error code on failure +- **What it does**: + - Validates the complete firmware image on slave + - Calculates and verifies checksums + - Marks the new firmware as valid but not active + +#### 4. `esp_hosted_slave_ota_activate()` +```c +esp_err_t esp_hosted_slave_ota_activate(void); +``` +- **Purpose**: Activates the newly flashed firmware +- **Arguments**: None +- **Returns**: `ESP_OK` on success, error code on failure +- **What it does**: + - Switches slave's boot partition to the new firmware + - Triggers slave reboot with new firmware + - **Note**: After this call, slave will restart with new firmware + +### Additional API used + +#### 5. `esp_hosted_get_coprocessor_fwversion()` +```c +esp_err_t esp_hosted_get_coprocessor_fwversion(esp_hosted_coprocessor_fwver_t *version); +``` +- **Purpose**: Gets the currently running slave firmware version +- **Arguments**: + - `version`: Pointer to structure to store version information +- **Returns**: `ESP_OK` on success, error code on failure +- **Structure**: + ```c + typedef struct { + uint32_t major1; // Major version + uint32_t minor1; // Minor version + uint32_t patch1; // Patch version + } esp_hosted_coprocessor_fwver_t; + ``` + +### How This Example Works + +This example demonstrates the **complete OTA workflow**: + +1. **Version Check** (optional): Uses `esp_hosted_get_coprocessor_fwversion()` to get current slave version +2. **Begin OTA**: Calls `esp_hosted_slave_ota_begin()` to initialize +3. **Transfer Firmware**: + - Reads firmware from source (LittleFS file/Partition/HTTPS download) + - Calls `esp_hosted_slave_ota_write()` repeatedly with chunks +4. **Finalize**: Calls `esp_hosted_slave_ota_end()` to validate firmware +5. **Activate**: Calls `esp_hosted_slave_ota_activate()` to switch to new firmware + +### Firmware Source Flexibility + +**Important**: These APIs are **not limited to the three methods shown**. You can use: +- **LittleFS** (this example) +- **Dedicated Partition** (this example) +- **HTTPS Download** (this example) +- **SPIFFS filesystem** +- **SD Card files** +- **NVS storage** +- **Custom network protocols** +- **Any other firmware source** + +The **key requirement** is that you can read the firmware data and feed it to `esp_hosted_slave_ota_write()` in chunks. + +--- + +## ESP-Hosted Slave OTA Methods + +Choose the method that best fits your deployment: + +| Method | Remarks | +|--------|----------| +| Slave OTA using LittleFS | Local deployment. One of Host partition formatted as LittleFS and pushed the slave fw as file | +| Slave OTA using Host Partition | Local deployment. Slave Fw flashed in one of Host partition directly | +| Slave OTA Using HTTPS | Needs internet access. Can re-use HTTPS server in the deployment | + +`Ease of Use`: LittleFS > HTTPS > Partition + +Pre-requisites: +1. Please ensure the slave application firmware binary is located in the designated path specified below to prevent 'File not Found' build errors. +2. For HTTPS-based updates, verify that the required certificates are properly installed to avoid connection establishment failures. + +--- + +## Project Structure + +``` +host_performs_slave_ota/ +├── components/ +│ ├── ota_partition/ # Slave OTA using Host Partition method +│ │ └── slave_fw_bin/ # Put slave .bin files here +│ ├── ota_littlefs/ # Slave OTA using LittleFS method +│ │ └── slave_fw_bin/ # Put slave .bin files here +│ └── ota_https/ # Slave OTA Using HTTPS method +│ ├── certs/ # SSL certificates +│ └── test_server/ # Local HTTPS server +├── partitions.csv # Universal partition table +└── main/ # Main application +``` + +## Host Partition Table +``` +nvs, data, nvs, 0x9000, 16K, +otadata, data, ota, 0xd000, 8K, +phy_init, data, phy, 0xf000, 4K, +ota_0, app, ota_0, 0x10000, 2M, +ota_1, app, ota_1, 0x210000, 2M, +storage, data, littlefs, 0x410000, 0x1E0000, # Used by Slave OTA using LittleFS +slave_fw, data, 0x40, 0x5F0000, 0x200000, # Used by Slave OTA using Host Partition +``` + +--- + +## Method 1: Slave OTA using LittleFS + +**Best for**: General use, dynamic updates, multiple firmware storage + +### How it works: +- Slave firmware stored in LittleFS filesystem +- Build system creates filesystem image with firmware +- OTA mounts filesystem and reads firmware file + +### Setup Steps: + +1. **Build slave firmware:** + Please build the slave firmware referring the [slave example](https://components.espressif.com/components/espressif/esp_hosted/examples/slave). + +2. **Copy slave firmware:** + ```bash + cp slave/build/network_adapter.bin examples/host_performs_slave_ota/components/ota_littlefs/slave_fw_bin/ + ``` + +3. **Configure (optional - already default):** + ```bash + idf.py menuconfig + # ESP-Hosted Slave OTA Configuration → OTA Method → LittleFS OTA + ``` + +4. **Build and flash:** + ```bash + idf.py -p build flash monitor + ``` + +### What happens: +- Build system creates LittleFS image containing slave firmware +- LittleFS image flashed to `storage` partition +- At runtime, OTA mounts filesystem, finds firmware, and compares versions +- Only updates if versions differ + +--- + +## Method 2: Slave OTA using Host Partition + +**Best for**: Production, fastest updates, most reliable + +### How it works: +- Slave firmware pre-flashed to dedicated partition +- OTA reads directly from partition (no filesystem overhead) +- Version comparison prevents unnecessary updates + +### Setup Steps: + +1. **Build slave firmware:** + Please build the slave firmware referring the [slave example](https://components.espressif.com/components/espressif/esp_hosted/examples/slave). + +2. **Copy slave firmware:** + ```bash + cp slave/build/network_adapter.bin examples/host_performs_slave_ota/components/ota_partition/slave_fw_bin/ + ``` + +3. **Configure:** + ```bash + idf.py menuconfig + # ESP-Hosted Slave OTA Configuration → OTA Method → Partition OTA + # (Default) Set partition label to: slave_fw + ``` + +4. **Build and flash:** + ```bash + idf.py -p build flash monitor + ``` + +### What happens: +- Build system detects slave firmware and shows notice +- During flash, slave firmware automatically flashed to `slave_fw` partition +- At runtime, OTA reads firmware from partition and compares versions +- Only updates if versions differ + +--- + +## Method 3: Slave OTA Using HTTPS + +**Best for**: Remote updates, internet deployment + +### How it works: +- Downloads slave firmware from HTTPS server +- Verifies image header while downloading +- Supports both self-signed and CA certificates + +### HTTPS Certificate Handling + +The Slave OTA Using HTTPS supports two certificate modes: + +#### Production Mode +For real servers with CA-signed certificates, disable self signed testing. +``` +ESP-Hosted Slave OTA Configuration +└── OTA Method + └── HTTPS OTA Config + └── Use self-signed certificate (Testing Only) ---> ❌ DISABLE +``` + +**How it works:** +- Uses ESP-IDF's built-in CA certificate bundle (`esp_crt_bundle_attach`) +- Automatically validates certificates from major CAs +- No additional certificate files needed +- Production-ready security + +#### Testing Mode (Self-Signed Certificates) +**For local testing with self-signed certificates** + +1. **Enable self-signed certificates:** +``` +ESP-Hosted Slave OTA Configuration +└── OTA Method + └── HTTPS OTA Config + └── Use self-signed certificate (Testing Only) ---> ENABLE +``` + +2. **Generate SSL certificates:** + ```bash + cd examples/host_performs_slave_ota/components/ota_https/test_server + ./create_self_signed_certs.sh + ``` + +3. **Start HTTPS server:** + ```bash + cd examples/host_performs_slave_ota/components/ota_https/test_server + python3 create_https_server.py + ``` + +4. **Copy slave firmware to server:** + Please build the slave firmware referring the [slave example](https://components.espressif.com/components/espressif/esp_hosted/examples/slave). + ```bash + cp slave/build/network_adapter.bin examples/host_performs_slave_ota/components/ota_https/test_server/ + ``` + +5. **Configure WiFi and URL:** + ```bash + idf.py menuconfig + # ESP-Hosted Slave OTA Configuration → OTA Method → HTTPS OTA + # Set HTTPS OTA URL to: https://:8443/network_adapter.bin + # Set WiFi SSID and password + ``` + +6. **Build and flash:** + ```bash + idf.py -p build flash monitor + ``` + +### What happens: +- ESP32 connects to WiFi +- Downloads firmware over HTTPS with certificate verification +- Verifies image header during download +- Compares versions and only updates if different + +--- + +## Configuration Reference + +### Menuconfig Options: +``` +ESP-Hosted Slave OTA Configuration +├── OTA Method +│ ├── HTTPS OTA (default) +│ │ │ +│ │ ├── Wi-Fi Config +│ │ │ ├── SSID <--change--> +│ │ │ └── Password <--change--> +│ │ │ +│ │ └── HTTPS OTA Config +│ │ ├── HTTPS OTA URL (https://...) <--change--> +│ │ └── Use self-signed certificate (Testing Only) <--ENABLE-to-test-using-self-certs> +│ │ └── Skip certificate Common Name check <--ENABLE-to-test-using-self-certs> +│ │ +│ ├── LittleFS OTA +│ │ └── Delete OTA file from LittleFS once finished (y) +│ │ +│ └── Partition OTA +│ └── Partition Label (for Partition Slave OTA) (slave_fw) +│ +├── Host-Slave version compatibility check (y) +│ +└── Skip OTA if slave firmware versions match (y) +``` + +--- + +## Expected Output + +##### Successful OTA: +``` +I (1234) host_performs_slave_ota: ESP-Hosted initialized successfully +I (1235) host_performs_slave_ota: Using XXXX OTA method +I (1240) ota_XXXX: Current slave firmware version: 2.5.12 +I (1242) ota_XXXX: New slave firmware version: 2.6.0 +I (1245) ota_XXXX: Version differs - proceeding with OTA +I (5678) ota_XXXX: XXXX OTA completed successfully +I (5680) host_performs_slave_ota: OTA completed successfully +``` + +##### Same Version (Skip OTA): +``` +I (1240) ota_XXXX: Current slave firmware version: 2.6.0 +I (1242) ota_XXXX: New slave firmware version: 2.6.0 +W (1245) ota_XXXX: Versions match. Skipping OTA. +I (1246) host_performs_slave_ota: OTA not required +``` + +--- + +## Troubleshooting + +### Build Issues: +- **"No .bin files found"**: Copy slave firmware to appropriate `slave_fw_bin/` directory +- **"Partition not found"**: Check `partitions.csv` includes required partitions + +### Runtime Issues: +- **"Failed to initialize ESP-Hosted"**: Check hardware connections +- **"OTA failed"**: Check version format mismatch, ensure slave firmware uses semantic versioning +- **WiFi issues (HTTPS)**: Verify network credentials and connectivity +- **SSL errors (HTTPS)**: Ensure certificate CN matches server IP address + +### Version Issues: +- Slave firmware now uses semantic versioning (e.g., `2.5.12`) instead of git hashes +- Host compares versions and skips OTA if versions match +- Check slave firmware version with `esp_hosted_get_coprocessor_fwversion()` + +## Limitation +- Older slave firmwares (< `2.15.12`) exposed git commit as `PROJECT_VER`, instead of `X.Y.Z` Hosted slave firmware version. + So, Comparison of `Slave firmware image version` Vs `Slave current FW version` will always fail. So OTA will be triggered. + +--- + +## Direct UART Flashing + +> [!NOTE] +> +> This section is for reference only. The main focus of this example is ESP-Hosted Transport OTA above. + +### Slave Flashing Using ESP-Prog + +> [!NOTE] +> ESP-Prog is only required if you want to flash firmware to the +> slave using the standard ESP Tools. + +In following section, ESP32-P4-Function EV Board is considered as example, to showcase, how ESP-Prog is to be connected. Any ESP can be programmed with ESP-Prog, including Host as well. + +The image below shows the board with an ESP-Prog connected to the header to communicate with the on-board ESP32-C6.. + +ESP32-P4-Function-EV-Board with ESP-Prog Connected to ESP32-C6 + +*ESP32-P4-Function-EV-Board with ESP-Prog Connected to ESP32-C6* + +If you need to update the ESP-Hosted slave firmware on the on-board ESP32-C6 module using ESP-Prog, follow these steps: + +1. Check out the ESP-Hosted slave example project: + +``` +idf.py create-project-from-example "espressif/esp_hosted:slave" +``` + +2. Set the target and start `Menuconfig`: + +```sh +idf.py set-target esp32c6 +idf.py menuconfig +``` + +3. Navigate and ensure SDIO is enabled. By default it should already be enabled. + ``` + Example Configuration + └── Bus Config in between Host and Co-processor + └── Transport layer + └── Select "SDIO" + ``` + +4. Build the firmware: + +```sh +idf.py build +``` + +5. Connect the Program Header on the ESP-Prog to the `PROG_C6` header + on the board. The connections are as follows: + +| ESP-Prog | PROG_C6 | Notes | +| --- | --- | --- | +| ESP\_EN | EN | | +| ESP\_TXD | TXD | | +| ESP\_RXD | RXD | | +| VDD | - | Do not connect | +| GND | GND | | +| ESP\_IO0 | IO0 | | + + +6. Flashing the firmware + +The on-board ESP32-P4 controls the reset signal for the ESP32-C6. To +prevent the P4 interfering with the C6 while flashing (by asserting +the C6 Reset signal during the firmware download), set the P4 into +Bootloader mode before flashing the firmware to the C6: + +###### Manual Way + 1. hold down the `BOOT` button on the board + 2. press and release the `RST` button on the board + 3. release the `BOOT` button + +###### Script Way + +```sh +esptool.py -p --before default_reset --after no_reset run +``` + +You can now flash the firmware to the C6 (and monitor the console +output): + +```sh +idf.py -p flash monitor +``` + +### Flashing Slave FW From Host MCU Using direct UART +You can connect above ESP32-C6 (slave) GPIOs directly on ESP32-P4 (Host) GPIOs and use [ESP-Serial-Flasher](https://github.com/espressif/esp-serial-flasher) to flash the Slave firmware from Host. + +**Hardware Required**: Host MCU UART connection (dedicated UART needed, cannot use ESP-Hosted bus) + +**Steps**: + +1. Connect host UART to slave flashing pins +2. Put host in bootloader mode (same as explined above) +3. Use esp-serial-flasher library to flash over UART diff --git a/examples/host_performs_slave_ota/components/common_ota_scripts/find_newest_firmware.cmake b/examples/host_performs_slave_ota/components/common_ota_scripts/find_newest_firmware.cmake new file mode 100644 index 00000000..b2fe41f4 --- /dev/null +++ b/examples/host_performs_slave_ota/components/common_ota_scripts/find_newest_firmware.cmake @@ -0,0 +1,64 @@ +# Common script to find the newest firmware file dynamically during build +# This runs every time during build, not just during configuration +# +# Required input variables: +# - SOURCE_COMPONENT_DIR: Path to the component source directory +# - BINARY_COMPONENT_DIR: Path to the component binary directory +# - OTA_ACTION: "prepare_littlefs" or "select_for_partition" +# +# Optional input variables: +# - COMPONENT_NAME: Name for logging (default: "OTA") + +if(NOT DEFINED COMPONENT_NAME) + set(COMPONENT_NAME "OTA") +endif() + +# Use the passed component directories +set(SOURCE_DIR "${SOURCE_COMPONENT_DIR}/slave_fw_bin") +set(TEMP_DIR "${BINARY_COMPONENT_DIR}/temp_littlefs") + +message(STATUS "${COMPONENT_NAME}: Dynamically searching for newest firmware...") +message(STATUS "${COMPONENT_NAME}: Searching in ${SOURCE_DIR}") + +# Get all .bin files +file(GLOB FIRMWARE_FILES "${SOURCE_DIR}/*.bin") + +if(NOT FIRMWARE_FILES) + message(FATAL_ERROR "${COMPONENT_NAME}: No .bin files found in ${SOURCE_DIR}") +endif() + +# Find the newest file by timestamp +set(NEWEST_FILE "") +set(NEWEST_TIMESTAMP 0) + +foreach(FIRMWARE_FILE ${FIRMWARE_FILES}) + file(TIMESTAMP "${FIRMWARE_FILE}" FILE_TIMESTAMP "%s") + message(STATUS "${COMPONENT_NAME}: File ${FIRMWARE_FILE} timestamp: ${FILE_TIMESTAMP}") + if(FILE_TIMESTAMP GREATER NEWEST_TIMESTAMP) + set(NEWEST_FILE "${FIRMWARE_FILE}") + set(NEWEST_TIMESTAMP "${FILE_TIMESTAMP}") + endif() +endforeach() + +get_filename_component(NEWEST_FILENAME "${NEWEST_FILE}" NAME) +message(STATUS "${COMPONENT_NAME}: Selected newest firmware: ${NEWEST_FILENAME}") + +# Perform the requested action +if(OTA_ACTION STREQUAL "prepare_littlefs") + # Clean and recreate temp directory for LittleFS + file(REMOVE_RECURSE "${TEMP_DIR}") + file(MAKE_DIRECTORY "${TEMP_DIR}") + file(COPY "${NEWEST_FILE}" DESTINATION "${TEMP_DIR}") + message(STATUS "${COMPONENT_NAME}: Prepared ${NEWEST_FILENAME} in temp directory for LittleFS") + +elseif(OTA_ACTION STREQUAL "select_for_partition") + # Write selection to files for partition OTA + file(WRITE "${BINARY_COMPONENT_DIR}/selected_firmware.txt" "${NEWEST_FILE}") + file(WRITE "${BINARY_COMPONENT_DIR}/selected_firmware_name.txt" "${NEWEST_FILENAME}") + message(STATUS "${COMPONENT_NAME}: Saved firmware selection for partition flashing") + +else() + message(FATAL_ERROR "${COMPONENT_NAME}: Unknown OTA_ACTION: ${OTA_ACTION}") +endif() + +message(STATUS "${COMPONENT_NAME}: Firmware selection completed") \ No newline at end of file diff --git a/examples/host_performs_slave_ota/components/common_ota_scripts/flash_selected_firmware.cmake b/examples/host_performs_slave_ota/components/common_ota_scripts/flash_selected_firmware.cmake new file mode 100644 index 00000000..eadc3ea0 --- /dev/null +++ b/examples/host_performs_slave_ota/components/common_ota_scripts/flash_selected_firmware.cmake @@ -0,0 +1,61 @@ +# Script to flash the dynamically selected firmware for partition OTA +# Reads the firmware path from the selection file and flashes it +# +# Required input variables: +# - BINARY_COMPONENT_DIR: Path to the component binary directory +# - SLAVE_FW_OFFSET: Partition offset for flashing +# - PYTHON: Python executable path + +if(NOT DEFINED COMPONENT_NAME) + set(COMPONENT_NAME "Partition OTA") +endif() + +# Read the selected firmware path and name +set(SELECTION_FILE "${BINARY_COMPONENT_DIR}/selected_firmware.txt") +set(NAME_FILE "${BINARY_COMPONENT_DIR}/selected_firmware_name.txt") + +if(NOT EXISTS "${SELECTION_FILE}") + message(FATAL_ERROR "${COMPONENT_NAME}: Selection file not found: ${SELECTION_FILE}") +endif() + +file(READ "${SELECTION_FILE}" SELECTED_FIRMWARE_PATH) +file(READ "${NAME_FILE}" SELECTED_FIRMWARE_NAME) + +# Remove any trailing newlines +string(STRIP "${SELECTED_FIRMWARE_PATH}" SELECTED_FIRMWARE_PATH) +string(STRIP "${SELECTED_FIRMWARE_NAME}" SELECTED_FIRMWARE_NAME) + +message(STATUS "-----------------------------------------------------") +message(STATUS "${COMPONENT_NAME}: Flashing ${SELECTED_FIRMWARE_NAME}") +message(STATUS "Path: ${SELECTED_FIRMWARE_PATH}") +message(STATUS "Offset: ${SLAVE_FW_OFFSET}") +message(STATUS "-----------------------------------------------------") + +# Check if file exists +if(NOT EXISTS "${SELECTED_FIRMWARE_PATH}") + message(FATAL_ERROR "❌ ERROR: Selected firmware file not found: ${SELECTED_FIRMWARE_PATH}") +endif() + +# Execute esptool (this will inherit the port from the parent build process) +execute_process( + COMMAND ${PYTHON} -m esptool + -b 2000000 + write-flash + --force + ${SLAVE_FW_OFFSET} "${SELECTED_FIRMWARE_PATH}" + RESULT_VARIABLE FLASH_RESULT + OUTPUT_VARIABLE FLASH_OUTPUT + ERROR_VARIABLE FLASH_ERROR + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE +) + +if(FLASH_OUTPUT) + message(STATUS "${FLASH_OUTPUT}") +endif() + +if(NOT FLASH_RESULT EQUAL 0) + message(FATAL_ERROR "❌ ERROR: Failed to flash firmware:\n${FLASH_ERROR}") +endif() + +message(STATUS "✅ Successfully flashed ${SELECTED_FIRMWARE_NAME} to partition!") diff --git a/examples/host_performs_slave_ota/components/ota_https/CMakeLists.txt b/examples/host_performs_slave_ota/components/ota_https/CMakeLists.txt new file mode 100644 index 00000000..616425d7 --- /dev/null +++ b/examples/host_performs_slave_ota/components/ota_https/CMakeLists.txt @@ -0,0 +1,28 @@ +if(CONFIG_OTA_METHOD_HTTPS) + set(SRC_LIST "ota_https.c" "ota_https_wifi.c") +endif() + +idf_component_register(SRCS ${SRC_LIST} + INCLUDE_DIRS "." + REQUIRES esp_http_client app_update esp_wifi esp_hosted nvs_flash esp_https_ota mbedtls esp-tls bootloader_support esp_app_format) + +# Conditional certificate embedding based on Kconfig +if(CONFIG_OTA_METHOD_HTTPS) +if(CONFIG_OTA_USE_SELF_SIGNED_CERT) + if(EXISTS "${COMPONENT_DIR}/certs/server_cert.pem") + target_add_binary_data( + ${COMPONENT_LIB} + "certs/server_cert.pem" + TEXT + ) + message(STATUS "✓ HTTPS OTA: Embedding self-signed certificate for testing") + else() + message(FATAL_ERROR + "HTTPS OTA: Self-signed cert enabled but certs/server_cert.pem not found! \n" + "1. Run ./create_self_signed_certs.sh in components/ota_https/test_server directory to generate certificates.\n" + "2. Run ./create_https_server.py in components/ota_https/test_server directory to start the HTTPS server.") + endif() +else() + message(STATUS "✓ HTTPS OTA: Using CA certificate bundle (Production mode)") +endif() +endif() diff --git a/examples/host_performs_slave_ota/components/ota_https/ota_https.c b/examples/host_performs_slave_ota/components/ota_https/ota_https.c new file mode 100644 index 00000000..dec6b7fb --- /dev/null +++ b/examples/host_performs_slave_ota/components/ota_https/ota_https.c @@ -0,0 +1,394 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include "esp_log.h" +#include "esp_err.h" +#include "esp_hosted.h" +#include "esp_http_client.h" +#include "esp_crt_bundle.h" // For certificate bundle +#include "sdkconfig.h" // For configuration macros +#include "esp_app_format.h" +#include "esp_app_desc.h" +#include "esp_hosted_api_types.h" + +#ifndef CHUNK_SIZE +#define CHUNK_SIZE 1400 +#endif + +static const char* TAG = "https_ota"; + +extern esp_err_t establish_wifi_connection(void); + +/* Self-signed certificate - embedded at compile time (only if enabled) */ +#ifdef CONFIG_OTA_USE_SELF_SIGNED_CERT +extern const uint8_t server_cert_pem_start[] asm("_binary_server_cert_pem_start"); +extern const uint8_t server_cert_pem_end[] asm("_binary_server_cert_pem_end"); +#endif + +uint8_t http_err = 0; + +/* Function to parse ESP32 image header and get firmware info from buffer */ +static esp_err_t parse_image_header_from_buffer(const uint8_t* buffer, size_t buffer_size, size_t* firmware_size, char* app_version_str, size_t version_str_len) +{ + esp_image_header_t image_header; + esp_image_segment_header_t segment_header; + esp_app_desc_t app_desc; + size_t offset = 0; + size_t total_size = 0; + + /* Check if buffer has enough data for image header */ + if (buffer_size < sizeof(image_header)) { + ESP_LOGE(TAG, "Buffer too small for image header verification"); + return ESP_ERR_INVALID_SIZE; + } + + /* Read image header from buffer */ + memcpy(&image_header, buffer + offset, sizeof(image_header)); + + /* Validate magic number */ + if (image_header.magic != ESP_IMAGE_HEADER_MAGIC) { + ESP_LOGE(TAG, "Invalid image magic: 0x%" PRIx8, image_header.magic); + return ESP_ERR_INVALID_ARG; + } + + ESP_LOGI(TAG, "Image header: magic=0x%" PRIx8 ", segment_count=%" PRIu8 ", hash_appended=%" PRIu8, + image_header.magic, image_header.segment_count, image_header.hash_appended); + + /* Calculate total size by reading all segments */ + offset = sizeof(image_header); + total_size = sizeof(image_header); + + for (int i = 0; i < image_header.segment_count; i++) { + /* Check if buffer has enough data for segment header */ + if (buffer_size < offset + sizeof(segment_header)) { + ESP_LOGW(TAG, "Buffer too small to read all segment headers, using partial verification"); + break; + } + + /* Read segment header from buffer */ + memcpy(&segment_header, buffer + offset, sizeof(segment_header)); + + ESP_LOGI(TAG, "Segment %d: data_len=%" PRIu32 ", load_addr=0x%" PRIx32, i, segment_header.data_len, segment_header.load_addr); + + /* Add segment header size + data size */ + total_size += sizeof(segment_header) + segment_header.data_len; + offset += sizeof(segment_header) + segment_header.data_len; + + /* Read app description from the first segment */ + if (i == 0) { + size_t app_desc_offset = sizeof(image_header) + sizeof(segment_header); + if (buffer_size >= app_desc_offset + sizeof(app_desc)) { + memcpy(&app_desc, buffer + app_desc_offset, sizeof(app_desc)); + strncpy(app_version_str, app_desc.version, version_str_len - 1); + app_version_str[version_str_len - 1] = '\0'; + ESP_LOGI(TAG, "Found app description: version='%s', project_name='%s'", + app_desc.version, app_desc.project_name); + } else { + ESP_LOGW(TAG, "Buffer too small to read app description"); + strncpy(app_version_str, "unknown", version_str_len - 1); + app_version_str[version_str_len - 1] = '\0'; + } + } + } + + /* Add padding to align to 16 bytes */ + size_t padding = (16 - (total_size % 16)) % 16; + if (padding > 0) { + ESP_LOGD(TAG, "Adding %u bytes of padding for alignment", (unsigned int)padding); + total_size += padding; + } + + /* Add the checksum byte (always present) */ + total_size += 1; + ESP_LOGD(TAG, "Added 1 byte for checksum"); + + /* Add SHA256 hash if appended */ + bool has_hash = (image_header.hash_appended == 1); + if (has_hash) { + total_size += 32; // SHA256 hash is 32 bytes + ESP_LOGD(TAG, "Added 32 bytes for SHA256 hash (hash_appended=1)"); + } else { + ESP_LOGD(TAG, "No SHA256 hash appended (hash_appended=0)"); + } + + *firmware_size = total_size; + ESP_LOGI(TAG, "Total image size: %u bytes", (unsigned int)*firmware_size); + + return ESP_OK; +} + +static esp_err_t http_client_event_handler(esp_http_client_event_t *evt) +{ + switch(evt->event_id) { + case HTTP_EVENT_ERROR: + ESP_LOGE(TAG, "HTTP_EVENT_ERROR"); + http_err = 1; + break; + case HTTP_EVENT_ON_CONNECTED: + ESP_LOGI(TAG, "HTTPS_EVENT_ON_CONNECTED - SSL handshake successful"); + break; + case HTTP_EVENT_HEADER_SENT: + ESP_LOGI(TAG, "HTTPS_EVENT_HEADER_SENT"); + break; + case HTTP_EVENT_ON_HEADER: + ESP_LOGD(TAG, "HTTPS_EVENT_ON_HEADER: %s=%s", evt->header_key, evt->header_value); + if (strcmp(evt->header_key, "Content-Length") == 0) { + ESP_LOGI(TAG, "Content-Length: %s bytes", evt->header_value); + } + break; + case HTTP_EVENT_ON_DATA: + /* Data received - logged elsewhere */ + break; + case HTTP_EVENT_ON_FINISH: + ESP_LOGI(TAG, "HTTPS_EVENT_ON_FINISH - Transfer complete"); + break; + case HTTP_EVENT_DISCONNECTED: + ESP_LOGI(TAG, "HTTPS_EVENT_DISCONNECTED"); + break; + case HTTP_EVENT_REDIRECT: + ESP_LOGW(TAG, "HTTPS_EVENT_REDIRECT"); + break; + default: + ESP_LOGD(TAG, "Unhandled HTTPS event id: %d", evt->event_id); + break; + } + return ESP_OK; +} + +esp_err_t ota_https_perform(const char* image_url) +{ + uint8_t *ota_chunk = NULL; + esp_err_t err = ESP_OK; + int data_read = 0; + int ota_failed = 0; + + if ((image_url == NULL) || (image_url[0] == '\0')) { + ESP_LOGE(TAG, "Invalid image URL"); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + // Validate HTTPS URL + if (strncmp(image_url, "https://", 8) != 0) { + ESP_LOGE(TAG, "URL must use HTTPS protocol"); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + err = establish_wifi_connection(); + if (err != ESP_OK) { + ESP_LOGE(TAG, "WiFi connection failed: %s", esp_err_to_name(err)); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + ESP_LOGI(TAG, "Starting HTTPS OTA from URL: %s", image_url); + +#ifdef CONFIG_OTA_USE_SELF_SIGNED_CERT + // Log certificate information for self-signed mode + size_t cert_len = server_cert_pem_end - server_cert_pem_start; + ESP_LOGI(TAG, "Security: Self-signed certificate (Testing mode)"); + ESP_LOGI(TAG, "Certificate size: %u bytes", (unsigned int)cert_len); + + if (cert_len == 0) { + ESP_LOGE(TAG, "Certificate not embedded properly! Check CMakeLists.txt"); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } +#else + ESP_LOGI(TAG, "Security: CA Certificate Bundle (Production mode)"); + ESP_LOGI(TAG, "Supports: Let's Encrypt, DigiCert, and 200+ CAs"); +#endif + + esp_http_client_config_t config = { + .url = image_url, + .timeout_ms = CONFIG_OTA_HTTPS_TIMEOUT_MS, + .transport_type = HTTP_TRANSPORT_OVER_SSL, // Force HTTPS + .event_handler = http_client_event_handler, + .buffer_size = 8192, // Larger buffer for SSL + .buffer_size_tx = 4096, // Increased TX buffer + +#ifdef CONFIG_OTA_USE_SELF_SIGNED_CERT + /* TESTING MODE - Self-signed certificate */ + .cert_pem = (const char *)server_cert_pem_start, + .cert_len = server_cert_pem_end - server_cert_pem_start, + .skip_cert_common_name_check = CONFIG_OTA_SKIP_CERT_CN_CHECK, + .use_global_ca_store = false, // Use only our certificate +#else + /* PRODUCTION MODE - CA certificate bundle */ + .crt_bundle_attach = esp_crt_bundle_attach, + .skip_cert_common_name_check = false, // Always validate CN in production +#endif + + .keep_alive_enable = true, + .keep_alive_idle = 5, + .keep_alive_interval = 5, + .keep_alive_count = 3, + }; + + esp_http_client_handle_t client = esp_http_client_init(&config); + if (client == NULL) { + ESP_LOGE(TAG, "Failed to initialize HTTPS client"); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + /* Open connection */ + ESP_LOGI(TAG, "Opening HTTPS connection..."); + if ((err = esp_http_client_open(client, 0)) != ESP_OK) { + ESP_LOGE(TAG, "Failed to open HTTPS connection: %s", esp_err_to_name(err)); + ESP_LOGE(TAG, "Common causes:"); + ESP_LOGE(TAG, " - Certificate CN doesn't match server IP"); + ESP_LOGE(TAG, " - Server not running or unreachable"); + ESP_LOGE(TAG, " - WiFi connection issues"); + ESP_LOGE(TAG, " - Firewall blocking port 8443"); + esp_http_client_cleanup(client); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + if (http_err) { + ESP_LOGE(TAG, "Exiting OTA, due to http failure"); + esp_http_client_cleanup(client); + http_err = 0; + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + /* Fetch headers */ + ESP_LOGI(TAG, "Fetching HTTPS headers..."); + int64_t content_length = esp_http_client_fetch_headers(client); + + int http_status = esp_http_client_get_status_code(client); + if (http_status != 200) { + ESP_LOGE(TAG, "HTTPS request failed with status: %d", http_status); + esp_http_client_cleanup(client); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + if (content_length <= 0) { + ESP_LOGE(TAG, "HTTP client fetch headers failed"); + ESP_LOGI(TAG, "HTTP GET Status = %d, content_length = %"PRId64, + esp_http_client_get_status_code(client), + esp_http_client_get_content_length(client)); + esp_http_client_close(client); + esp_http_client_cleanup(client); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + ESP_LOGI(TAG, "HTTP GET Status = %d, content_length = %"PRId64, + esp_http_client_get_status_code(client), + esp_http_client_get_content_length(client)); + + /* Begin OTA */ + ESP_LOGI(TAG, "Preparing OTA"); + if ((err = esp_hosted_slave_ota_begin()) != ESP_OK) { + ESP_LOGE(TAG, "esp_hosted_slave_ota_begin failed: %s", esp_err_to_name(err)); + ESP_LOGI(TAG, "esp_ota_begin failed, error=%s", esp_err_to_name(err)); + esp_http_client_close(client); + esp_http_client_cleanup(client); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + ota_chunk = (uint8_t*)calloc(1, CHUNK_SIZE); + if (!ota_chunk) { + ESP_LOGE(TAG, "Failed to allocate OTA chunk memory"); + esp_http_client_close(client); + esp_http_client_cleanup(client); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + ESP_LOGI(TAG, "Starting OTA data transfer over HTTPS"); + + /* Read and write OTA data */ + bool header_verified = false; + int chunk_count = 0; + + while ((data_read = esp_http_client_read(client, (char*)ota_chunk, CHUNK_SIZE)) > 0) { + ESP_LOGD(TAG, "Read image length %d", data_read); + + /* Verify image header from the first chunk */ + if (!header_verified && chunk_count == 0) { + size_t firmware_size; + char app_version[32]; + + ESP_LOGI(TAG, "Verifying image header from first chunk (%d bytes)", data_read); + if ((err = parse_image_header_from_buffer(ota_chunk, data_read, &firmware_size, app_version, sizeof(app_version))) != ESP_OK) { + ESP_LOGE(TAG, "Image header verification failed: %s", esp_err_to_name(err)); + ota_failed = 1; + break; + } + + ESP_LOGI(TAG, "Image verified - Size: %u bytes, Version: %s", (unsigned int)firmware_size, app_version); + +#ifdef CONFIG_OTA_VERSION_CHECK_SLAVEFW_SLAVE + /* Get current running slave firmware version and compare */ + esp_hosted_coprocessor_fwver_t current_slave_version = {0}; + esp_err_t version_ret = esp_hosted_get_coprocessor_fwversion(¤t_slave_version); + + if (version_ret == ESP_OK) { + char current_version_str[32]; + snprintf(current_version_str, sizeof(current_version_str), "%" PRIu32 ".%" PRIu32 ".%" PRIu32, + current_slave_version.major1, current_slave_version.minor1, current_slave_version.patch1); + + ESP_LOGI(TAG, "Current slave firmware version: %s", current_version_str); + ESP_LOGI(TAG, "New slave firmware version: %s", app_version); + + if (strcmp(app_version, current_version_str) == 0) { + ESP_LOGW(TAG, "Current slave firmware version (%s) is the same as new version (%s). Skipping OTA.", + current_version_str, app_version); + /* Cleanup and return success */ + free(ota_chunk); + esp_http_client_close(client); + esp_http_client_cleanup(client); + return ESP_HOSTED_SLAVE_OTA_NOT_REQUIRED; + } + + ESP_LOGI(TAG, "Version differs - proceeding with OTA from %s to %s", current_version_str, app_version); + } else { + ESP_LOGW(TAG, "Could not get current slave firmware version (error: %s), proceeding with OTA", + esp_err_to_name(version_ret)); + } +#else + ESP_LOGI(TAG, "Version check disabled - proceeding with OTA (new firmware version: %s)", app_version); +#endif + + header_verified = true; + } + + if ((err = esp_hosted_slave_ota_write(ota_chunk, data_read)) != ESP_OK) { + ESP_LOGE(TAG, "esp_hosted_slave_ota_write failed: %s", esp_err_to_name(err)); + ota_failed = 1; + break; + } + + chunk_count++; + } + + /* Cleanup resources */ + free(ota_chunk); + esp_http_client_close(client); + esp_http_client_cleanup(client); + + /* Check for read errors */ + if (data_read < 0) { + ESP_LOGE(TAG, "Error: HTTPS data read error"); + ota_failed = 1; + } + + /* End OTA */ + if ((err = esp_hosted_slave_ota_end()) != ESP_OK) { + ESP_LOGE(TAG, "esp_ota_end failed, error=%s", esp_err_to_name(err)); + esp_http_client_close(client); + esp_http_client_cleanup(client); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + /* Final result */ + if (ota_failed) { + ESP_LOGE(TAG, "********* Slave OTA Failed *******************"); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } else { + ESP_LOGI(TAG, "********* Slave OTA Complete *******************"); + return ESP_HOSTED_SLAVE_OTA_COMPLETED; + } +} diff --git a/examples/host_performs_slave_ota/components/ota_https/ota_https.h b/examples/host_performs_slave_ota/components/ota_https/ota_https.h new file mode 100644 index 00000000..d66b25e9 --- /dev/null +++ b/examples/host_performs_slave_ota/components/ota_https/ota_https.h @@ -0,0 +1,25 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "esp_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Perform HTTP OTA update + * + * @param url URL to download firmware from + * @return esp_err_t ESP_OK on success + */ +esp_err_t ota_https_perform(const char* url); + +#ifdef __cplusplus +} +#endif diff --git a/examples/host_performs_slave_ota/components/ota_https/ota_https_wifi.c b/examples/host_performs_slave_ota/components/ota_https/ota_https_wifi.c new file mode 100644 index 00000000..37f0e577 --- /dev/null +++ b/examples/host_performs_slave_ota/components/ota_https/ota_https_wifi.c @@ -0,0 +1,133 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* Miniature version of esp-idf example of Wi-Fi station, + * /examples/wifi/getting_started/station/main/station_example_main.c + * */ +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "freertos/event_groups.h" +#include "esp_system.h" +#include "esp_wifi.h" +#include "esp_event.h" +#include "esp_log.h" + +#include "lwip/err.h" +#include "lwip/sys.h" + +#ifdef CONFIG_OTA_METHOD_HTTPS +#include "nvs_flash.h" + +static const char* TAG = "ota_https_wifi"; + +#define EXAMPLE_ESP_WIFI_SSID CONFIG_ESP_WIFI_SSID +#define EXAMPLE_ESP_WIFI_PASS CONFIG_ESP_WIFI_PASSWORD +#define EXAMPLE_ESP_MAXIMUM_RETRY CONFIG_ESP_MAXIMUM_RETRY + +#define WIFI_CONNECTED_BIT BIT0 +#define WIFI_FAIL_BIT BIT1 + +/* FreeRTOS event group to signal when we are connected*/ +static EventGroupHandle_t s_wifi_event_group; + +static int s_retry_num = 0; + + +static void event_handler(void* arg, esp_event_base_t event_base, + int32_t event_id, void* event_data) +{ + if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) { + esp_wifi_connect(); + } else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) { + if (s_retry_num < EXAMPLE_ESP_MAXIMUM_RETRY) { + esp_wifi_connect(); + s_retry_num++; + ESP_LOGI(TAG, "retry to connect to the AP"); + } else { + xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT); + } + ESP_LOGI(TAG,"connect to the AP fail"); + } else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) { + ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data; + ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip)); + s_retry_num = 0; + xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT); + } +} + +void wifi_init_sta(void) +{ + s_wifi_event_group = xEventGroupCreate(); + + esp_netif_init(); + + esp_event_loop_create_default(); + esp_netif_create_default_wifi_sta(); + + wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_wifi_init(&cfg)); + + esp_event_handler_instance_t instance_any_id; + esp_event_handler_instance_t instance_got_ip; + ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, + ESP_EVENT_ANY_ID, + &event_handler, + NULL, + &instance_any_id)); + ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT, + IP_EVENT_STA_GOT_IP, + &event_handler, + NULL, + &instance_got_ip)); + + wifi_config_t wifi_config = { + .sta = { + .ssid = EXAMPLE_ESP_WIFI_SSID, + .password = EXAMPLE_ESP_WIFI_PASS, + }, + }; + ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) ); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config) ); + ESP_ERROR_CHECK(esp_wifi_start() ); + + ESP_LOGI(TAG, "wifi_init_sta finished."); + + /* Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum + * number of re-tries (WIFI_FAIL_BIT). The bits are set by event_handler() (see above) */ + EventBits_t bits = xEventGroupWaitBits(s_wifi_event_group, + WIFI_CONNECTED_BIT | WIFI_FAIL_BIT, + pdFALSE, + pdFALSE, + portMAX_DELAY); + + if (bits & WIFI_CONNECTED_BIT) { + ESP_LOGI(TAG, "connected to ap SSID:%s password:%s", + EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS); + } else if (bits & WIFI_FAIL_BIT) { + ESP_LOGI(TAG, "Failed to connect to SSID:%s, password:%s", + EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS); + } else { + ESP_LOGE(TAG, "UNEXPECTED EVENT"); + } +} + +esp_err_t establish_wifi_connection(void) +{ + ESP_LOGI(TAG, "ESP_WIFI_MODE_STA"); + wifi_init_sta(); + + EventBits_t bits = xEventGroupGetBits(s_wifi_event_group); + if (bits & WIFI_CONNECTED_BIT) { + return ESP_OK; + } else if (bits & WIFI_FAIL_BIT) { + ESP_LOGE(TAG, "WiFi connection failed after maximum retries"); + return ESP_FAIL; + } else { + ESP_LOGE(TAG, "WiFi connection in unexpected state"); + return ESP_ERR_INVALID_STATE; + } +} + +#endif diff --git a/examples/host_performs_slave_ota/components/ota_https/test_server/README.md b/examples/host_performs_slave_ota/components/ota_https/test_server/README.md new file mode 100644 index 00000000..88417fa4 --- /dev/null +++ b/examples/host_performs_slave_ota/components/ota_https/test_server/README.md @@ -0,0 +1,58 @@ +# Test Server Tools + +This directory contains tools for testing HTTPS OTA functionality with self-signed certificates. + +## Files + +- `create_self_signed_certs.sh` - Generates self-signed certificates for testing +- `create_https_server.py` - Simple HTTPS server for serving OTA files +- `README.md` - This file + +## Quick Start + +### 1. Generate Test Certificates +```bash +cd test_server +bash create_self_signed_certs.sh +``` + +### 2. Start HTTPS Server +```bash +cd test_server +python3 create_https_server.py +``` + +### 3. Configure ESP32 +```bash +# From project root +idf.py menuconfig +``` + +Enable in menuconfig: +- `Component config` → `HTTPS OTA Configuration` → `Use self-signed certificate (Testing Only)` → **YES** +- Update `OTA Server URL` to the URL shown by the server + +## Important Notes + +- **Testing Only**: Self-signed certificates should only be used for testing +- **Security**: For production, use proper CA-signed certificates +- **IP Address**: The certificate is generated for your current IP address +- **Regenerate**: If your IP changes, regenerate certificates + +## Troubleshooting + +### Certificate not found error +```bash +# Make sure you're in test_server directory +cd test_server +bash create_self_signed_certs.sh +``` + +### Server won't start +- Check if port 8443 is available +- Ensure certificates exist in `../certs/` +``` +ls ../certs/ +server_cert.pem server_key.pem +``` +- Run from `test_server/` directory diff --git a/examples/host_performs_slave_ota/components/ota_https/test_server/create_https_server.py b/examples/host_performs_slave_ota/components/ota_https/test_server/create_https_server.py new file mode 100755 index 00000000..efacb173 --- /dev/null +++ b/examples/host_performs_slave_ota/components/ota_https/test_server/create_https_server.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 +# SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Apache-2.0 +import http.server +import ssl +import socket +import os +import sys + +def get_local_ip(): + """Get the local IP address of this machine""" + try: + # Connect to a remote address (doesn't actually send data) + with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s: + s.connect(("8.8.8.8", 80)) + return s.getsockname()[0] + except Exception: + return "127.0.0.1" + +# Check if certificates exist (relative to component certs) +cert_path = '../certs/server_cert.pem' +key_path = '../certs/server_key.pem' + +if not os.path.exists(cert_path) or not os.path.exists(key_path): + print("ERROR: Certificates not found!") + print(f"Please run: bash create_self_signed_certs.sh") + print(f"Looking for: {cert_path} and {key_path}") + print(f"Note: Run this server from components/ota_https/test_server/ directory") + sys.exit(1) + +# Get local IP +local_ip = get_local_ip() +port = 8443 + +# Create HTTPS server +class CORSHTTPRequestHandler(http.server.SimpleHTTPRequestHandler): + def end_headers(self): + self.send_header('Access-Control-Allow-Origin', '*') + self.send_header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS') + self.send_header('Access-Control-Allow-Headers', '*') + super().end_headers() + + def log_message(self, format, *args): + """Enhanced logging""" + print(f"[{self.date_time_string()}] {format % args}") + +server_address = ('0.0.0.0', port) +httpd = http.server.HTTPServer(server_address, CORSHTTPRequestHandler) + +# Configure SSL with proper settings for ESP32 +ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) +ssl_context.minimum_version = ssl.TLSVersion.TLSv1_2 +ssl_context.set_ciphers('ECDHE+AESGCM:ECDHE+CHACHA20:DHE+AESGCM:DHE+CHACHA20:!aNULL:!MD5:!DSS') +ssl_context.load_cert_chain(cert_path, key_path) + +# Wrap socket with SSL +httpd.socket = ssl_context.wrap_socket(httpd.socket, server_side=True) + +print("=" * 60) +print("HTTPS OTA Server Started Successfully!") +print("=" * 60) +print(f"Server running on: https://{local_ip}:{port}") +print(f"Serving files from: {os.getcwd()}") +print(f"Using certificates:") +print(f" Cert: {cert_path}") +print(f" Key: {key_path}") +print("") +print("ESP32 Configuration:") +print(f" Set OTA_HTTP_URL to: https://{local_ip}:{port}/firmware.bin") +print("") +print("To test, place your firmware.bin file in this directory") +print("Press Ctrl+C to stop the server") +print("=" * 60) + +try: + httpd.serve_forever() +except KeyboardInterrupt: + print("\n🛑 Server stopped by user") + httpd.server_close() diff --git a/examples/host_performs_slave_ota/components/ota_https/test_server/create_self_signed_certs.sh b/examples/host_performs_slave_ota/components/ota_https/test_server/create_self_signed_certs.sh new file mode 100755 index 00000000..282356ed --- /dev/null +++ b/examples/host_performs_slave_ota/components/ota_https/test_server/create_self_signed_certs.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# Create certificates for HTTPS OTA testing +# This script should be run from the component's test_server directory + +# Create a directory for certificates in the component's certs folder +mkdir -p ../certs +cd ../certs + +# Get your machine's IP address +IP_ADDRESS=$(ipconfig getifaddr en0 2>/dev/null || ipconfig getifaddr en1 2>/dev/null || echo "192.168.1.100") +echo "Creating certificate for IP: $IP_ADDRESS" +echo "If this IP is incorrect, please update the CN field manually" + +# Generate private key +openssl genrsa -out server_key.pem 2048 + +# Generate self-signed certificate (valid for 365 days) +# Use your actual IP address as Common Name +openssl req -new -x509 -key server_key.pem -out server_cert.pem -days 365 \ + -subj "/C=US/ST=State/L=City/O=ESP-OTA/CN=$IP_ADDRESS" \ + -extensions v3_req \ + -config <(cat < +#include +#include +#include +#include +#include "esp_log.h" +#include "esp_err.h" +#include "esp_littlefs.h" +#include "esp_hosted_ota.h" +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "esp_app_format.h" +#include "esp_app_desc.h" +#include "esp_hosted.h" +#include "esp_hosted_api_types.h" + +static const char* TAG = "ota_littlefs"; + +#ifndef CHUNK_SIZE +#define CHUNK_SIZE 1500 +#endif + +/* Function to parse ESP32 image header and get firmware info from file */ +static esp_err_t parse_image_header_from_file(const char* file_path, size_t* firmware_size, char* app_version_str, size_t version_str_len) +{ + FILE* file; + esp_image_header_t image_header; + esp_image_segment_header_t segment_header; + esp_app_desc_t app_desc; + size_t offset = 0; + size_t total_size = 0; + + file = fopen(file_path, "rb"); + if (file == NULL) { + ESP_LOGE(TAG, "Failed to open firmware file for header verification: %s", file_path); + return ESP_FAIL; + } + + /* Read image header */ + if (fread(&image_header, sizeof(image_header), 1, file) != 1) { + ESP_LOGE(TAG, "Failed to read image header from file"); + fclose(file); + return ESP_FAIL; + } + + /* Validate magic number */ + if (image_header.magic != ESP_IMAGE_HEADER_MAGIC) { + ESP_LOGE(TAG, "Invalid image magic: 0x%" PRIx8, image_header.magic); + fclose(file); + return ESP_ERR_INVALID_ARG; + } + + ESP_LOGI(TAG, "Image header: magic=0x%" PRIx8 ", segment_count=%" PRIu8 ", hash_appended=%" PRIu8, + image_header.magic, image_header.segment_count, image_header.hash_appended); + + /* Calculate total size by reading all segments */ + offset = sizeof(image_header); + total_size = sizeof(image_header); + + for (int i = 0; i < image_header.segment_count; i++) { + /* Read segment header */ + if (fseek(file, offset, SEEK_SET) != 0 || + fread(&segment_header, sizeof(segment_header), 1, file) != 1) { + ESP_LOGE(TAG, "Failed to read segment %d header", i); + fclose(file); + return ESP_FAIL; + } + + ESP_LOGI(TAG, "Segment %d: data_len=%" PRIu32 ", load_addr=0x%" PRIx32, i, segment_header.data_len, segment_header.load_addr); + + /* Add segment header size + data size */ + total_size += sizeof(segment_header) + segment_header.data_len; + offset += sizeof(segment_header) + segment_header.data_len; + + /* Read app description from the first segment */ + if (i == 0) { + size_t app_desc_offset = sizeof(image_header) + sizeof(segment_header); + if (fseek(file, app_desc_offset, SEEK_SET) == 0 && + fread(&app_desc, sizeof(app_desc), 1, file) == 1) { + strncpy(app_version_str, app_desc.version, version_str_len - 1); + app_version_str[version_str_len - 1] = '\0'; + ESP_LOGI(TAG, "Found app description: version='%s', project_name='%s'", + app_desc.version, app_desc.project_name); + } else { + ESP_LOGW(TAG, "Failed to read app description"); + strncpy(app_version_str, "unknown", version_str_len - 1); + app_version_str[version_str_len - 1] = '\0'; + } + } + } + + /* Add padding to align to 16 bytes */ + size_t padding = (16 - (total_size % 16)) % 16; + if (padding > 0) { + ESP_LOGD(TAG, "Adding %u bytes of padding for alignment", (unsigned int)padding); + total_size += padding; + } + + /* Add the checksum byte (always present) */ + total_size += 1; + ESP_LOGD(TAG, "Added 1 byte for checksum"); + + /* Add SHA256 hash if appended */ + bool has_hash = (image_header.hash_appended == 1); + if (has_hash) { + total_size += 32; // SHA256 hash is 32 bytes + ESP_LOGD(TAG, "Added 32 bytes for SHA256 hash (hash_appended=1)"); + } else { + ESP_LOGD(TAG, "No SHA256 hash appended (hash_appended=0)"); + } + + *firmware_size = total_size; + ESP_LOGI(TAG, "Total image size: %u bytes", (unsigned int)*firmware_size); + + fclose(file); + return ESP_OK; +} + +/* Find latest firmware file in LittleFS */ +static esp_err_t find_latest_firmware(char* firmware_path, size_t max_len) +{ + DIR *dir; + struct dirent *entry; + struct stat file_stat; + char *latest_file = malloc(256); // Use heap instead of stack + char *full_path = malloc(512); // Use heap for full path + + if (!latest_file || !full_path) { + ESP_LOGE(TAG, "Failed to allocate memory for file search"); + if (latest_file) free(latest_file); + if (full_path) free(full_path); + return ESP_ERR_NO_MEM; + } + + memset(latest_file, 0, 256); + + dir = opendir("/littlefs"); + if (dir == NULL) { + ESP_LOGE(TAG, "Failed to open /littlefs directory"); + free(latest_file); + free(full_path); + return ESP_FAIL; + } + + ESP_LOGI(TAG, "Successfully opened /littlefs directory"); + + /* Find the first .bin file (since timestamps might not be reliable in LittleFS) */ + while ((entry = readdir(dir)) != NULL) { + ESP_LOGI(TAG, "Found file: %s", entry->d_name); + if (strstr(entry->d_name, ".bin") != NULL) { + ESP_LOGI(TAG, "Found .bin file: %s", entry->d_name); + snprintf(full_path, 512, "/littlefs/%s", entry->d_name); + + if (stat(full_path, &file_stat) == 0) { + ESP_LOGI(TAG, "File stat successful for %s, size: %ld", entry->d_name, file_stat.st_size); + /* Use the first .bin file found */ + strncpy(latest_file, entry->d_name, 255); + latest_file[255] = '\0'; // Ensure null termination + ESP_LOGI(TAG, "Using firmware file: %s", latest_file); + break; // Use the first .bin file found + } else { + ESP_LOGW(TAG, "Failed to stat file: %s", full_path); + } + } + } + closedir(dir); + + ESP_LOGI(TAG, "Final latest_file: '%s', length: %d", latest_file, strlen(latest_file)); + + if (strlen(latest_file) == 0) { + ESP_LOGE(TAG, "No .bin files found in /littlefs directory. Please refer doc to know how partition is created with slave firmware at correct path."); + free(latest_file); + free(full_path); + return ESP_FAIL; + } + + // Ensure we don't overflow the destination buffer + if (snprintf(firmware_path, max_len, "/littlefs/%s", latest_file) >= max_len) { + ESP_LOGE(TAG, "Firmware path too long"); + free(latest_file); + free(full_path); + return ESP_FAIL; + } + + ESP_LOGI(TAG, "Found latest firmware: %s", firmware_path); + + // Clean up allocated memory + free(latest_file); + free(full_path); + + return ESP_OK; +} + +esp_err_t ota_littlefs_perform(bool delete_after_use) +{ + char *firmware_path = malloc(256); // Use heap instead of stack + FILE *firmware_file; + uint8_t *chunk = malloc(CHUNK_SIZE); // Use heap for chunk buffer + size_t bytes_read; + esp_err_t ret = ESP_OK; + + if (!firmware_path || !chunk) { + ESP_LOGE(TAG, "Failed to allocate memory"); + if (firmware_path) free(firmware_path); + if (chunk) free(chunk); + return ESP_ERR_NO_MEM; + } + + ESP_LOGI(TAG, "Starting LittleFS OTA process"); + + /* Initialize LittleFS */ + ESP_LOGI(TAG, "Initializing LittleFS filesystem"); + esp_vfs_littlefs_conf_t conf = { + .base_path = "/littlefs", + .partition_label = "storage", + .format_if_mount_failed = true, + .dont_mount = false, + }; + + ret = esp_vfs_littlefs_register(&conf); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to initialize LittleFS: %s", esp_err_to_name(ret)); + free(firmware_path); + free(chunk); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + ESP_LOGI(TAG, "LittleFS filesystem registered successfully"); + + /* Get filesystem info */ + size_t total = 0, used = 0; + ret = esp_littlefs_info("storage", &total, &used); + if (ret != ESP_OK) { + ESP_LOGW(TAG, "Failed to get LittleFS partition information (%s)", esp_err_to_name(ret)); + } else { + ESP_LOGI(TAG, "LittleFS partition size: total: %d, used: %d", total, used); + } + + /* Find the latest firmware file */ + ESP_LOGI(TAG, "Searching for firmware files in LittleFS"); + ret = find_latest_firmware(firmware_path, 256); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to find firmware file"); + esp_vfs_littlefs_unregister("storage"); + free(firmware_path); + free(chunk); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + ESP_LOGI(TAG, "Firmware file found: %s", firmware_path); + + /* Verify image header and get firmware info */ + size_t firmware_size; + char new_app_version[32]; + ret = parse_image_header_from_file(firmware_path, &firmware_size, new_app_version, sizeof(new_app_version)); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to parse image header: %s", esp_err_to_name(ret)); + esp_vfs_littlefs_unregister("storage"); + free(firmware_path); + free(chunk); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + ESP_LOGI(TAG, "Firmware verified - Size: %u bytes, Version: %s", (unsigned int)firmware_size, new_app_version); + +#ifdef CONFIG_OTA_VERSION_CHECK_SLAVEFW_SLAVE + /* Get current running slave firmware version */ + esp_hosted_coprocessor_fwver_t current_slave_version = {0}; + esp_err_t version_ret = esp_hosted_get_coprocessor_fwversion(¤t_slave_version); + + if (version_ret == ESP_OK) { + char current_version_str[32]; + snprintf(current_version_str, sizeof(current_version_str), "%" PRIu32 ".%" PRIu32 ".%" PRIu32, + current_slave_version.major1, current_slave_version.minor1, current_slave_version.patch1); + + ESP_LOGI(TAG, "Current slave firmware version: %s", current_version_str); + ESP_LOGI(TAG, "New slave firmware version: %s", new_app_version); + + if (strcmp(new_app_version, current_version_str) == 0) { + ESP_LOGW(TAG, "Current slave firmware version (%s) is the same as new version (%s). Skipping OTA.", + current_version_str, new_app_version); + esp_vfs_littlefs_unregister("storage"); + free(firmware_path); + free(chunk); + return ESP_HOSTED_SLAVE_OTA_NOT_REQUIRED; + } + + ESP_LOGI(TAG, "Version differs - proceeding with OTA from %s to %s", current_version_str, new_app_version); + } else { + ESP_LOGW(TAG, "Could not get current slave firmware version (error: %s), proceeding with OTA", + esp_err_to_name(version_ret)); + } +#else + ESP_LOGI(TAG, "Version check disabled - proceeding with OTA (new firmware version: %s)", new_app_version); +#endif + + /* Open firmware file */ + firmware_file = fopen(firmware_path, "rb"); + if (firmware_file == NULL) { + ESP_LOGE(TAG, "Failed to open firmware file: %s", firmware_path); + esp_vfs_littlefs_unregister("storage"); + free(firmware_path); + free(chunk); + return ESP_FAIL; + } + + ESP_LOGI(TAG, "Starting OTA from LittleFS: %s", firmware_path); + + /* Begin OTA */ + ret = esp_hosted_slave_ota_begin(); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to begin OTA: %s", esp_err_to_name(ret)); + fclose(firmware_file); + esp_vfs_littlefs_unregister("storage"); + free(firmware_path); + free(chunk); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + /* Write firmware in chunks */ + while ((bytes_read = fread(chunk, 1, CHUNK_SIZE, firmware_file)) > 0) { + ret = esp_hosted_slave_ota_write(chunk, bytes_read); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to write OTA chunk: %s", esp_err_to_name(ret)); + fclose(firmware_file); + esp_vfs_littlefs_unregister("storage"); + free(firmware_path); + free(chunk); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + } + + fclose(firmware_file); + + /* End OTA */ + ret = esp_hosted_slave_ota_end(); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to end OTA: %s", esp_err_to_name(ret)); + esp_vfs_littlefs_unregister("storage"); + free(firmware_path); + free(chunk); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + ESP_LOGI(TAG, "LittleFS OTA completed successfully"); + + /* Delete firmware file if requested */ + if (delete_after_use) { + if (unlink(firmware_path) == 0) { + ESP_LOGI(TAG, "Deleted firmware file: %s", firmware_path); + } else { + ESP_LOGW(TAG, "Failed to delete firmware file: %s", firmware_path); + } + } + + esp_vfs_littlefs_unregister("storage"); + + /* Clean up allocated memory */ + free(firmware_path); + free(chunk); + + return ESP_HOSTED_SLAVE_OTA_COMPLETED; +} diff --git a/examples/host_performs_slave_ota/components/ota_littlefs/ota_littlefs.h b/examples/host_performs_slave_ota/components/ota_littlefs/ota_littlefs.h new file mode 100644 index 00000000..61b42b8e --- /dev/null +++ b/examples/host_performs_slave_ota/components/ota_littlefs/ota_littlefs.h @@ -0,0 +1,25 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "esp_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Perform LittleFS OTA update + * + * @param delete_after_use Whether to delete firmware file after successful flash + * @return esp_err_t ESP_OK on success + */ +esp_err_t ota_littlefs_perform(bool delete_after_use); + +#ifdef __cplusplus +} +#endif diff --git a/examples/host_performs_slave_ota/components/ota_partition/CMakeLists.txt b/examples/host_performs_slave_ota/components/ota_partition/CMakeLists.txt new file mode 100644 index 00000000..47ec5e03 --- /dev/null +++ b/examples/host_performs_slave_ota/components/ota_partition/CMakeLists.txt @@ -0,0 +1,86 @@ +# Partition OTA Component CMakeLists.txt +# This component handles Partition-based OTA updates + +idf_component_register( + SRCS "ota_partition.c" + INCLUDE_DIRS "." + PRIV_REQUIRES "esp_partition" "esp_hosted" "bootloader_support" "esp_app_format" +) + +if(CONFIG_OTA_METHOD_PARTITION) +# --- Step 0: Get partition offset from partition table --- +set(SLAVE_FW_PARTITION_NAME "slave_fw") +file(READ "${CMAKE_SOURCE_DIR}/partitions.csv" PARTITION_TABLE_CONTENT) +string(REGEX MATCH "${SLAVE_FW_PARTITION_NAME}[^,]*,[^,]*,[^,]*,[ ]*([^,]*)" PARTITION_MATCH "${PARTITION_TABLE_CONTENT}") +if(PARTITION_MATCH) + string(REGEX REPLACE "${SLAVE_FW_PARTITION_NAME}[^,]*,[^,]*,[^,]*,[ ]*([^,]*)" "\\1" SLAVE_FW_OFFSET "${PARTITION_MATCH}") + string(STRIP "${SLAVE_FW_OFFSET}" SLAVE_FW_OFFSET) + message(STATUS "✅ Partition OTA: Found ${SLAVE_FW_PARTITION_NAME} partition at offset: ${SLAVE_FW_OFFSET}") +else() + set(SLAVE_FW_OFFSET "0x5F0000") # Fallback to hardcoded value + message(WARNING "⚠️ Partition OTA: Could not find ${SLAVE_FW_PARTITION_NAME} in partitions.csv, using fallback offset: ${SLAVE_FW_OFFSET}") +endif() + +# --- Step 1: Check if firmware files exist (early validation) --- +message(STATUS "🔍 Partition OTA: Checking for firmware files...") + +file(GLOB SLAVE_FW_BIN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/slave_fw_bin/*.bin") + +if(SLAVE_FW_BIN_FILES) + message(STATUS "✅ Partition OTA: Found firmware files for dynamic selection") + + # Get Python and esptool path from IDF + idf_build_get_property(PYTHON PYTHON) + idf_build_get_property(ESPTOOL_PATH ESPTOOL_PATH) + + # Create a target that dynamically selects the newest firmware + add_custom_target(select_partition_firmware + COMMAND ${CMAKE_COMMAND} + -DSOURCE_COMPONENT_DIR=${CMAKE_CURRENT_SOURCE_DIR} + -DBINARY_COMPONENT_DIR=${CMAKE_CURRENT_BINARY_DIR} + -DCOMPONENT_NAME=Partition OTA + -DOTA_ACTION=select_for_partition + -P ${CMAKE_CURRENT_SOURCE_DIR}/../common_ota_scripts/find_newest_firmware.cmake + COMMENT "Partition OTA: Dynamically selecting newest firmware" + VERBATIM + ) + + # Create a target that flashes the selected firmware + add_custom_target(flash_slave_fw + DEPENDS select_partition_firmware + COMMAND ${CMAKE_COMMAND} + -DBINARY_COMPONENT_DIR=${CMAKE_CURRENT_BINARY_DIR} + -DSLAVE_FW_OFFSET=${SLAVE_FW_OFFSET} + -DPYTHON=${PYTHON} + -DCOMPONENT_NAME=Partition OTA + -P ${CMAKE_CURRENT_SOURCE_DIR}/../common_ota_scripts/flash_selected_firmware.cmake + COMMENT "Partition OTA: Flashing selected firmware to partition" + VERBATIM + ) + + # Make flash_slave_fw depend on the main project binary being built successfully + idf_build_get_property(project_name PROJECT_NAME) + add_dependencies(flash_slave_fw ${project_name}.elf) + + # Add flash_slave_fw to the flash target only after successful build + add_dependencies(flash flash_slave_fw) + +else() + message(WARNING "⚠️ Partition OTA: No .bin files found in slave_fw_bin directory. Nothing to flash.") + + # Add warning target for flash command when no slave firmware present + add_custom_target(warn_no_slave_fw + COMMAND ${CMAKE_COMMAND} -E echo "" + COMMAND ${CMAKE_COMMAND} -E echo "⚠️ WARNING: Partition OTA is enabled but no slave firmware found!" + COMMAND ${CMAKE_COMMAND} -E echo " Expected: .bin files in components/ota_partition/slave_fw_bin/" + COMMAND ${CMAKE_COMMAND} -E echo " Current flash will only flash the host application" + COMMAND ${CMAKE_COMMAND} -E echo " The partition at ${SLAVE_FW_OFFSET} will not be flashed this time" + COMMAND ${CMAKE_COMMAND} -E echo "" + COMMENT "Warning: No slave firmware binaries found" + VERBATIM + ) + + # Make flash target show this warning + add_dependencies(flash warn_no_slave_fw) +endif() +endif() \ No newline at end of file diff --git a/examples/host_performs_slave_ota/components/ota_partition/ota_partition.c b/examples/host_performs_slave_ota/components/ota_partition/ota_partition.c new file mode 100644 index 00000000..6b22e9b6 --- /dev/null +++ b/examples/host_performs_slave_ota/components/ota_partition/ota_partition.c @@ -0,0 +1,241 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include "esp_log.h" +#include "esp_err.h" +#include "esp_partition.h" +#include "esp_hosted_ota.h" +#include "esp_app_format.h" +#include "esp_app_desc.h" +#include "esp_hosted.h" +#include "esp_hosted_api_types.h" + +static const char* TAG = "ota_partition"; + +#ifndef CHUNK_SIZE +#define CHUNK_SIZE 1500 +#endif + +/* Function to parse ESP32 image header and get firmware info */ +static esp_err_t parse_image_header(const esp_partition_t* partition, size_t* firmware_size, char* app_version_str, size_t version_str_len) +{ + esp_image_header_t image_header; + esp_image_segment_header_t segment_header; + esp_app_desc_t app_desc; + esp_err_t ret; + size_t offset = 0; + size_t total_size = 0; + + /* Read image header */ + ret = esp_partition_read(partition, offset, &image_header, sizeof(image_header)); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to read image header: %s", esp_err_to_name(ret)); + return ret; + } + + /* Validate magic number */ + if (image_header.magic != ESP_IMAGE_HEADER_MAGIC) { + ESP_LOGE(TAG, "Invalid image magic: 0x%" PRIx8, image_header.magic); + return ESP_ERR_INVALID_ARG; + } + + ESP_LOGI(TAG, "Image header: magic=0x%" PRIx8 ", segment_count=%" PRIu8 ", hash_appended=%" PRIu8, + image_header.magic, image_header.segment_count, image_header.hash_appended); + + /* Calculate total size by reading all segments */ + offset = sizeof(image_header); + total_size = sizeof(image_header); + + for (int i = 0; i < image_header.segment_count; i++) { + /* Read segment header */ + ret = esp_partition_read(partition, offset, &segment_header, sizeof(segment_header)); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to read segment %d header: %s", i, esp_err_to_name(ret)); + return ret; + } + + ESP_LOGI(TAG, "Segment %d: data_len=%" PRIu32 ", load_addr=0x%" PRIx32, i, segment_header.data_len, segment_header.load_addr); + + /* Add segment header size + data size */ + total_size += sizeof(segment_header) + segment_header.data_len; + offset += sizeof(segment_header) + segment_header.data_len; + + /* Read app description from the first segment */ + if (i == 0) { + size_t app_desc_offset = sizeof(image_header) + sizeof(segment_header); + ret = esp_partition_read(partition, app_desc_offset, &app_desc, sizeof(app_desc)); + if (ret == ESP_OK) { + strncpy(app_version_str, app_desc.version, version_str_len - 1); + app_version_str[version_str_len - 1] = '\0'; + ESP_LOGI(TAG, "Found app description: version='%s', project_name='%s'", + app_desc.version, app_desc.project_name); + } else { + ESP_LOGW(TAG, "Failed to read app description: %s", esp_err_to_name(ret)); + strncpy(app_version_str, "unknown", version_str_len - 1); + app_version_str[version_str_len - 1] = '\0'; + } + } + } + + /* Add padding to align to 16 bytes */ + size_t padding = (16 - (total_size % 16)) % 16; + if (padding > 0) { + ESP_LOGD(TAG, "Adding %u bytes of padding for alignment", (unsigned int)padding); + total_size += padding; + } + + /* Add the checksum byte (always present) */ + total_size += 1; + ESP_LOGD(TAG, "Added 1 byte for checksum"); + + /* Add SHA256 hash if appended */ + bool has_hash = (image_header.hash_appended == 1); + if (has_hash) { + total_size += 32; // SHA256 hash is 32 bytes + ESP_LOGD(TAG, "Added 32 bytes for SHA256 hash (hash_appended=1)"); + } else { + ESP_LOGD(TAG, "No SHA256 hash appended (hash_appended=0)"); + } + + *firmware_size = total_size; + ESP_LOGI(TAG, "Total image size: %u bytes", (unsigned int)*firmware_size); + + /* Debug: Read last 48 bytes to verify structure */ + uint8_t tail_data[48]; + size_t tail_offset = (total_size > 48) ? (total_size - 48) : 0; + ret = esp_partition_read(partition, tail_offset, tail_data, 48); + if (ret == ESP_OK) { + ESP_LOGD(TAG, "Last 48 bytes of image (offset %u):", (unsigned int)tail_offset); + ESP_LOG_BUFFER_HEX_LEVEL(TAG, tail_data, 48, ESP_LOG_DEBUG); + } + + return ESP_OK; +} + +esp_err_t ota_partition_perform(const char* partition_label) +{ + const esp_partition_t* partition; + esp_err_t ret = ESP_OK; + uint8_t chunk[CHUNK_SIZE]; + size_t bytes_read; + size_t offset = 0; + size_t firmware_size; + char new_app_version[32]; + + ESP_LOGI(TAG, "Starting Partition OTA from partition: %s", partition_label); + + /* Find the partition */ + partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, partition_label); + if (partition == NULL) { + ESP_LOGE(TAG, "Partition '%s' not found", partition_label); + return ESP_FAIL; + } + + ESP_LOGI(TAG, "Found partition: %s, size: %" PRIu32 " bytes", partition->label, partition->size); + + /* Parse image header to get firmware size and version */ + ret = parse_image_header(partition, &firmware_size, new_app_version, sizeof(new_app_version)); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to parse image header: %s", esp_err_to_name(ret)); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + ESP_LOGI(TAG, "Firmware verified - Size: %u bytes, Version: %s", (unsigned int)firmware_size, new_app_version); + +#ifdef CONFIG_OTA_VERSION_CHECK_SLAVEFW_SLAVE + /* Get current running slave firmware version */ + esp_hosted_coprocessor_fwver_t current_slave_version = {0}; + esp_err_t version_ret = esp_hosted_get_coprocessor_fwversion(¤t_slave_version); + + if (version_ret == ESP_OK) { + char current_version_str[32]; + snprintf(current_version_str, sizeof(current_version_str), "%" PRIu32 ".%" PRIu32 ".%" PRIu32, + current_slave_version.major1, current_slave_version.minor1, current_slave_version.patch1); + + ESP_LOGI(TAG, "Current slave firmware version: %s", current_version_str); + ESP_LOGI(TAG, "New slave firmware version: %s", new_app_version); + + if (strcmp(new_app_version, current_version_str) == 0) { + ESP_LOGW(TAG, "Current slave firmware version (%s) is the same as new version (%s). Skipping OTA.", + current_version_str, new_app_version); + return ESP_HOSTED_SLAVE_OTA_NOT_REQUIRED; + } + + ESP_LOGI(TAG, "Version differs - proceeding with OTA from %s to %s", current_version_str, new_app_version); + } else { + ESP_LOGW(TAG, "Could not get current slave firmware version (error: %s), proceeding with OTA", + esp_err_to_name(version_ret)); + } +#else + ESP_LOGI(TAG, "Version check disabled - proceeding with OTA (new firmware version: %s)", new_app_version); +#endif + + /* Validate firmware size */ + if (firmware_size == 0) { + ESP_LOGE(TAG, "Firmware size is 0, cannot proceed with OTA"); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + if (firmware_size > partition->size) { + ESP_LOGE(TAG, "Firmware size (%u) exceeds partition size (%" PRIu32 ")", (unsigned int)firmware_size, partition->size); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + ESP_LOGI(TAG, "Proceeding with OTA - Firmware size: %u bytes", (unsigned int)firmware_size); + + /* Begin OTA */ + ret = esp_hosted_slave_ota_begin(); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to begin OTA: %s", esp_err_to_name(ret)); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + /* Read firmware from partition in chunks - only up to actual firmware size */ + uint32_t total_bytes_sent = 0; + uint32_t chunk_count = 0; + + while (offset < firmware_size) { + bytes_read = (firmware_size - offset > CHUNK_SIZE) ? CHUNK_SIZE : (firmware_size - offset); + + ret = esp_partition_read(partition, offset, chunk, bytes_read); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to read partition: %s", esp_err_to_name(ret)); + esp_hosted_slave_ota_end(); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + ret = esp_hosted_slave_ota_write(chunk, bytes_read); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to write OTA chunk %" PRIu32 ": %s", chunk_count, esp_err_to_name(ret)); + esp_hosted_slave_ota_end(); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + total_bytes_sent += bytes_read; + offset += bytes_read; + chunk_count++; + + /* Progress indicator */ + if (chunk_count % 50 == 0) { + ESP_LOGD(TAG, "Progress: %" PRIu32 "/%u bytes (%.1f%%)", + total_bytes_sent, (unsigned int)firmware_size, (float)total_bytes_sent * 100 / firmware_size); + } + } + + ESP_LOGD(TAG, "Total chunks sent: %" PRIu32 ", Total bytes sent: %" PRIu32, chunk_count, total_bytes_sent); + + /* End OTA */ + ret = esp_hosted_slave_ota_end(); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to end OTA: %s", esp_err_to_name(ret)); + return ESP_HOSTED_SLAVE_OTA_FAILED; + } + + ESP_LOGI(TAG, "Partition OTA completed successfully - Sent %u bytes", (unsigned int)firmware_size); + return ESP_HOSTED_SLAVE_OTA_COMPLETED; +} diff --git a/examples/host_performs_slave_ota/components/ota_partition/ota_partition.h b/examples/host_performs_slave_ota/components/ota_partition/ota_partition.h new file mode 100644 index 00000000..caf6dc91 --- /dev/null +++ b/examples/host_performs_slave_ota/components/ota_partition/ota_partition.h @@ -0,0 +1,25 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "esp_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Perform Partition OTA update + * + * @param partition_label Label of the partition containing firmware + * @return esp_err_t ESP_OK on success + */ +esp_err_t ota_partition_perform(const char* partition_label); + +#ifdef __cplusplus +} +#endif diff --git a/examples/host_performs_slave_ota/main/CMakeLists.txt b/examples/host_performs_slave_ota/main/CMakeLists.txt new file mode 100644 index 00000000..c0e2d0e4 --- /dev/null +++ b/examples/host_performs_slave_ota/main/CMakeLists.txt @@ -0,0 +1,6 @@ +# Simple component selection based on Kconfig +set(COMPONENT_SRCS "main.c") +set(COMPONENT_REQUIRES esp_hosted console esp_timer) + +idf_component_register(SRCS ${COMPONENT_SRCS} + INCLUDE_DIRS ".") diff --git a/examples/host_performs_slave_ota/main/Kconfig.projbuild b/examples/host_performs_slave_ota/main/Kconfig.projbuild new file mode 100644 index 00000000..1b995e10 --- /dev/null +++ b/examples/host_performs_slave_ota/main/Kconfig.projbuild @@ -0,0 +1,130 @@ +menu "ESP-Hosted Slave OTA Config" + +choice OTA_METHOD + prompt "Select OTA Method" + default OTA_METHOD_HTTPS + help + Choose the OTA method for updating slave firmware. + +config OTA_METHOD_HTTPS + bool "HTTP OTA" + help + Download firmware from HTTPS URL + +config OTA_METHOD_LITTLEFS + bool "LittleFS OTA" + help + Read firmware from LittleFS filesystem + +config OTA_METHOD_PARTITION + bool "Partition OTA" + help + Read firmware from dedicated partition + +endchoice + +########### OTA with Partition ######## +config OTA_PARTITION_LABEL + string "Partition Label" + depends on OTA_METHOD_PARTITION + default "slave_fw" + help + Label of the partition containing firmware + +########### OTA with Littlefs ######### +config OTA_DELETE_FILE_AFTER_FLASH + depends on OTA_METHOD_LITTLEFS + bool "Delete OTA file from LittleFS/FatFS etc, once finished" + default y + +########### OTA with HTTPS ############ +menu "WiFi Connection" + depends on OTA_METHOD_HTTPS + config ESP_WIFI_SSID + string "WiFi SSID" + default "MyWiFiSSID" + help + SSID (network name) for the example to connect to. + + config ESP_WIFI_PASSWORD + string "WiFi Password" + default "MyWiFiPass@123" + help + WiFi password (WPA or WPA2) for the example to use. + + config ESP_MAXIMUM_RETRY + int "Maximum retry" + default 5 + help + Set the Maximum retry to avoid station reconnecting to the AP unlimited when the AP is really inexistent. + +endmenu + +menu "HTTPS OTA Configuration" + depends on OTA_METHOD_HTTPS + + config OTA_USE_SELF_SIGNED_CERT + bool "Use self-signed certificate (Testing Only)" + default n + help + Enable this ONLY for testing with self-signed certificates. + Disable for production use with CA-signed certificates. + + When enabled, the component will use an embedded certificate + from certs/server_cert.pem for HTTPS validation. + + When disabled, the component will use the ESP32 CA certificate + bundle which supports major CAs like Let's Encrypt, DigiCert, etc. + + config OTA_SKIP_CERT_CN_CHECK + bool "Skip certificate Common Name check" + depends on OTA_USE_SELF_SIGNED_CERT + default n + help + Skip Common Name validation in self-signed certificates. + Only enable if you cannot match the CN with your server IP/hostname. + + WARNING: This reduces security. Use only for testing. + + config OTA_HTTPS_TIMEOUT_MS + int "HTTPS connection timeout (milliseconds)" + default 30000 + range 5000 120000 + help + Timeout for HTTPS connection and SSL handshake. + Increase if you have slow network or server. + + config OTA_SERVER_URL + string "OTA Server URL" + default "https://192.168.1.3:8443/firmware.bin" + help + HTTPS URL of the OTA firmware file. + Must start with https:// + +endmenu + +########### OTA Verification Options ############ +menu "OTA Verification Options" + + config OTA_VERSION_CHECK_HOST_SLAVE + bool "Host-Slave version compatibility check" + default y + help + Check if host and slave firmware have compatible major.minor versions. + If host is X.Y.Z and slave is A.B.C, warn if X.Y != A.B. + + This ensures compatible API versions between host and slave. + + config OTA_VERSION_CHECK_SLAVEFW_SLAVE + bool "Skip OTA if slave firmware versions match" + default y + help + Compare current running slave firmware version with new firmware version. + Skip OTA if versions are identical to avoid unnecessary updates. + + Disable this to force OTA even when versions match. + +endmenu + + +endmenu diff --git a/examples/host_performs_slave_ota/main/idf_component.yml b/examples/host_performs_slave_ota/main/idf_component.yml new file mode 100644 index 00000000..9c2f54d7 --- /dev/null +++ b/examples/host_performs_slave_ota/main/idf_component.yml @@ -0,0 +1,15 @@ +dependencies: + cmd_system: + path: ${IDF_PATH}/examples/system/console/advanced/components/cmd_system + cmd_nvs: + path: ${IDF_PATH}/examples/system/console/advanced/components/cmd_nvs + espressif/esp_wifi_remote: + version: ">=0.10,<2.0" + rules: + - if: "target in [esp32p4, esp32h2]" + espressif/esp_hosted: + rules: + - if: "target in [esp32p4, esp32h2]" + joltwallet/littlefs: + version: "*" + diff --git a/examples/host_performs_slave_ota/main/main.c b/examples/host_performs_slave_ota/main/main.c new file mode 100644 index 00000000..d1aa5ea4 --- /dev/null +++ b/examples/host_performs_slave_ota/main/main.c @@ -0,0 +1,152 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include "esp_log.h" +#include "esp_system.h" +#include "nvs_flash.h" +#include "esp_event.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "esp_err.h" +#include "esp_hosted.h" +#include "esp_hosted_ota.h" +#include "esp_timer.h" +#include "esp_app_desc.h" +#include "esp_hosted_api_types.h" + +#if CONFIG_OTA_METHOD_HTTPS +#include "ota_https.h" +#elif CONFIG_OTA_METHOD_LITTLEFS +#include "ota_littlefs.h" +#elif CONFIG_OTA_METHOD_PARTITION +#include "ota_partition.h" +#endif + +static const char *TAG = "host_performs_slave_ota"; + +#ifdef CONFIG_OTA_VERSION_CHECK_HOST_SLAVE +/* Compare host and slave firmware versions */ +static int compare_self_version_with_slave_version(uint32_t slave_version) +{ + uint32_t host_version = ESP_HOSTED_VERSION_VAL(ESP_HOSTED_VERSION_MAJOR_1, + ESP_HOSTED_VERSION_MINOR_1, + ESP_HOSTED_VERSION_PATCH_1); + + // mask out patch level + // compare major.minor only + slave_version &= 0xFFFFFF00; + host_version &= 0xFFFFFF00; + + if (host_version == slave_version) { + // versions match + return 0; + } else if (host_version > slave_version) { + // host version > slave version + ESP_LOGW(TAG, "=== ESP-Hosted Version Warning ==="); + printf("Version on Host is NEWER than version on co-processor\n"); + printf("RPC requests sent by host may encounter timeout errors\n"); + printf("or may not be supported by co-processor\n"); + ESP_LOGW(TAG, "=== ESP-Hosted Version Warning ==="); + return -1; + } else { + // host version < slave version + ESP_LOGW(TAG, "=== ESP-Hosted Version Warning ==="); + printf("Version on Host is OLDER than version on co-processor\n"); + printf("Host may not be compatible with co-processor\n"); + ESP_LOGW(TAG, "=== ESP-Hosted Version Warning ==="); + return 1; + } +} + +/* Check host-slave version compatibility */ +static int compare_host_slave_version(void) +{ + /* Get slave version via RPC */ + esp_hosted_coprocessor_fwver_t slave_version_struct = {0}; + esp_err_t ret = esp_hosted_get_coprocessor_fwversion(&slave_version_struct); + + if (ret != ESP_OK) { + ESP_LOGW(TAG, "Could not get slave firmware version (error: %s)", esp_err_to_name(ret)); + ESP_LOGW(TAG, "Proceeding without version compatibility check"); + return ESP_OK; + } + + /* Convert slave version to 32-bit value for comparison */ + uint32_t slave_version = ESP_HOSTED_VERSION_VAL(slave_version_struct.major1, + slave_version_struct.minor1, + slave_version_struct.patch1); + + /* Log versions */ + ESP_LOGI(TAG, "Host firmware version: %d.%d.%d", ESP_HOSTED_VERSION_MAJOR_1, ESP_HOSTED_VERSION_MINOR_1, ESP_HOSTED_VERSION_PATCH_1); + ESP_LOGI(TAG, "Slave firmware version: %" PRIu32 ".%" PRIu32 ".%" PRIu32, + slave_version_struct.major1, slave_version_struct.minor1, slave_version_struct.patch1); + + return compare_self_version_with_slave_version(slave_version); +} +#endif + +void app_main(void) +{ + int ret; + int host_slave_version_not_compatible = 1; + + ESP_ERROR_CHECK(nvs_flash_init()); + ESP_ERROR_CHECK(esp_event_loop_create_default()); + ESP_ERROR_CHECK(esp_hosted_init()); + ESP_ERROR_CHECK(esp_hosted_connect_to_slave()); + + ESP_LOGI(TAG, "ESP-Hosted initialized successfully"); + +#ifdef CONFIG_OTA_VERSION_CHECK_HOST_SLAVE + /* Check host-slave version compatibility */ + host_slave_version_not_compatible = compare_host_slave_version(); +#endif + + if (!host_slave_version_not_compatible) { + ESP_LOGW(TAG, "Slave OTA not required, so nothing to do!"); + return; + } + + /* Perform OTA based on Kconfig selection */ +#if CONFIG_OTA_METHOD_HTTPS + ESP_LOGI(TAG, "Using HTTP OTA method"); + ret = ota_https_perform(CONFIG_OTA_SERVER_URL); +#elif CONFIG_OTA_METHOD_LITTLEFS + uint8_t delete_post_flash = 0; + ESP_LOGI(TAG, "Using LittleFS OTA method"); + #ifdef CONFIG_OTA_DELETE_FILE_AFTER_FLASH + delete_post_flash = 1; + #endif + ret = ota_littlefs_perform(delete_post_flash); +#elif CONFIG_OTA_METHOD_PARTITION + ESP_LOGI(TAG, "Using Partition OTA method"); + ret = ota_partition_perform(CONFIG_OTA_PARTITION_LABEL); +#else + ESP_LOGE(TAG, "No OTA method selected!"); + return; +#endif + + if (ret == ESP_HOSTED_SLAVE_OTA_COMPLETED) { + ESP_LOGI(TAG, "OTA completed successfully"); + + /* Activate the new firmware */ + ret = esp_hosted_slave_ota_activate(); + if (ret == ESP_OK) { + ESP_LOGI(TAG, "Slave will reboot with new firmware"); + ESP_LOGI(TAG, "********* Restarting host to avoid sync issues **********************"); + vTaskDelay(pdMS_TO_TICKS(2000)); + esp_restart(); + } else { + ESP_LOGE(TAG, "Failed to activate OTA: %s", esp_err_to_name(ret)); + } + } else if (ret == ESP_HOSTED_SLAVE_OTA_NOT_REQUIRED) { + ESP_LOGI(TAG, "OTA not required"); + } else { + ESP_LOGE(TAG, "OTA failed: %s", esp_err_to_name(ret)); + } +} diff --git a/examples/host_performs_slave_ota/partitions.csv b/examples/host_performs_slave_ota/partitions.csv new file mode 100644 index 00000000..c9c9a6b8 --- /dev/null +++ b/examples/host_performs_slave_ota/partitions.csv @@ -0,0 +1,9 @@ +# Universal partition table for all OTA methods +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 16K, +otadata, data, ota, 0xd000, 8K, +phy_init, data, phy, 0xf000, 4K, +ota_0, app, ota_0, 0x10000, 2M, +ota_1, app, ota_1, 0x210000, 2M, +storage, data, littlefs, 0x410000, 0x1E0000, +slave_fw, data, 0x40, 0x5F0000, 0x200000, diff --git a/examples/host_performs_slave_ota/sdkconfig.defaults b/examples/host_performs_slave_ota/sdkconfig.defaults new file mode 100644 index 00000000..20e72d6b --- /dev/null +++ b/examples/host_performs_slave_ota/sdkconfig.defaults @@ -0,0 +1,17 @@ +# Default configuration for Host Slave OTA Simple Example + +# Flash size configuration +CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y +CONFIG_ESPTOOLPY_FLASHSIZE="8MB" + +# Force enable ESP-Hosted component +CONFIG_ESP_WIFI_REMOTE_ENABLED=y +CONFIG_ESP_HOSTED_ENABLED=y + +# FreeRTOS configuration +CONFIG_FREERTOS_HZ=1000 + +# Partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" diff --git a/examples/host_transport_config/CMakeLists.txt b/examples/host_transport_config/CMakeLists.txt new file mode 100644 index 00000000..061903fe --- /dev/null +++ b/examples/host_transport_config/CMakeLists.txt @@ -0,0 +1,8 @@ +# The following lines of boilerplate have to be in your project's CMakeLists +# in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +idf_build_set_property(MINIMAL_BUILD ON) +project(transport_config) \ No newline at end of file diff --git a/examples/host_transport_config/README.md b/examples/host_transport_config/README.md new file mode 100644 index 00000000..072dbf66 --- /dev/null +++ b/examples/host_transport_config/README.md @@ -0,0 +1,103 @@ +# ESP-Hosted Transport Configuration Example + +Demonstrates how to configure ESP-Hosted transport interfaces (SDIO, SPI, UART) before initialization. + +## Supported Transports + +| Transport | Speed | Pins | Use Case | +|-----------|-------|------|----------| +| **SDIO 1-bit** | High | 5 pins | Good performance, fewer pins | +| **SDIO 4-bit** | Highest | 7 pins | Best performance | +| **SPI Full-Duplex** | Medium | 6 pins | Standard interface | +| **SPI HD Dual** | Medium | 4 pins | Fewer pins needed | +| **SPI HD Quad** | Medium | 6 pins | Better throughput | +| **UART** | Low | 3 pins | Simple connection | + +## Pin Connections + +### SDIO 1-bit +| Host <-> Slave (5 pins) | CLK | CMD | DAT0 | DAT1 (interrupt) | RESET | +|---|---|---|---|---|---| + +### SDIO 4-bit (Default) +| Host <-> Slave (7 pins) | CLK | CMD | DAT0 | DAT1 | DAT2 | DAT3 | RESET | +|---|---|---|---|---|---|---|---| + +### SPI Full-Duplex +| Host <-> Slave (6 pins) | MOSI | MISO | SCLK | CS | HANDSHAKE | DATA_READY | +|---|---|---|---|---|---|---| + +### SPI Half-Duplex Dual +| Host <-> Slave (4 pins) | CLK | CS | D0 | D1 (+ DATA_READY) | +|---|---|---|---|---| + +### SPI Half-Duplex Quad +| Host <-> Slave (6 pins) | CLK | CS | D0 | D1 | D2 | D3 (+ DATA_READY) | +|---|---|---|---|---|---|---| + +### UART +| Host <-> Slave (3 pins) | TX | RX | RESET | +|---|---|---|---| + +## What This Example Shows + +- Get default transport configuration +- Customize parameters (clock, pins, buffers) +- Apply configuration before `esp_hosted_init()` + +## Key Code Pattern + +```c +// 1. Get default config +struct esp_hosted_sdio_config config = INIT_DEFAULT_HOST_SDIO_CONFIG(); + +// 2. Customize settings +config.clock_freq_khz = 25000; +config.bus_width = 4; + +// 3. Apply config +esp_hosted_sdio_set_config(&config); + +// 4. Initialize ESP-Hosted +esp_hosted_init(); +``` + +## Customization + +> [!TIP] +> +> This example was added to showcase (Option 2: Programmatic Configuration) discussed below. +> (Option 1: Using menuconfig) is anyway available for any host example. + +### Pin Configuration Options + +**Option 1: Using menuconfig** + +First select your transport: +```bash +idf.py menuconfig +# (Top) → Component config → ESP-Hosted config → Transport layer +``` + +Then configure pins: +- **SDIO**: `(Top) → Component config → ESP-Hosted config → Hosted SDIO Configuration` +- **SPI Full-Duplex**: `(Top) → Component config → ESP-Hosted config → SPI Configuration` +- **SPI Half-Duplex**: `(Top) → Component config → ESP-Hosted config → SPI Half-duplex Configuration` +- **UART**: `(Top) → Component config → ESP-Hosted config → UART Configuration` + +**Option 2: Programmatic Configuration** +Edit the configuration functions in `main.c` for users who prefer code-based configuration or have limitations with menuconfig: + +```c +// Example: Custom SPI pin assignment +spi_config.pin_mosi.pin = YOUR_MOSI_PIN; +spi_config.pin_miso.pin = YOUR_MISO_PIN; +spi_config.pin_sclk.pin = YOUR_SCLK_PIN; +spi_config.pin_cs.pin = YOUR_CS_PIN; +``` + +### Other Customizations +- **Clock speeds**: Adjust for stability vs performance +- **Buffer sizes**: Tune for your throughput needs +- **Data lines**: Configure GPIOs to match your connections +- **Transport config**: Any other transport specific config diff --git a/examples/host_transport_config/main/CMakeLists.txt b/examples/host_transport_config/main/CMakeLists.txt new file mode 100644 index 00000000..73c91203 --- /dev/null +++ b/examples/host_transport_config/main/CMakeLists.txt @@ -0,0 +1,3 @@ +idf_component_register(SRCS "transport_config_main.c" + PRIV_REQUIRES esp_wifi console nvs_flash + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/host_transport_config/main/idf_component.yml b/examples/host_transport_config/main/idf_component.yml new file mode 100644 index 00000000..2d033a1a --- /dev/null +++ b/examples/host_transport_config/main/idf_component.yml @@ -0,0 +1,9 @@ +dependencies: + espressif/esp_wifi_remote: + version: "*" + rules: + - if: "target in [esp32p4, esp32h2]" + espressif/esp_hosted: + version: "*" + rules: + - if: "target in [esp32p4, esp32h2]" diff --git a/examples/host_transport_config/main/transport_config_main.c b/examples/host_transport_config/main/transport_config_main.c new file mode 100644 index 00000000..d068ca4c --- /dev/null +++ b/examples/host_transport_config/main/transport_config_main.c @@ -0,0 +1,521 @@ +/** + * @file esp_hosted_transport_config_example.c + * @brief ESP-Hosted Transport Configuration Example + * + * This example demonstrates comprehensive transport configuration for ESP-Hosted, + * including SDIO, SPI Full-Duplex, SPI Half-Duplex, and UART interfaces. + * + * Features: + * - Default configuration initialization + * - Custom parameter configuration + * - Configuration validation + * - Error handling and recovery + * - Runtime configuration inspection + * + * @version 1.0.0 + * @date 2024-2025 + * + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-License-Identifier: Unlicense OR CC0-1.0 + */ + + #include + #include + #include + + #include "freertos/FreeRTOS.h" + #include "freertos/task.h" + #include "esp_log.h" + #include "esp_event.h" + #include "esp_err.h" + #include "nvs_flash.h" + #include "esp_console.h" +// #include "cmd_system.h" + + #include "esp_hosted.h" + #include "esp_hosted_transport_config.h" + + /*============================================================================== + * CONSTANTS AND DEFINITIONS + *============================================================================*/ + + static const char *TAG = "esp_hosted_transport_config"; + + /** @brief Default task delay for main loop (ms) */ + #define MAIN_LOOP_DELAY_MS 10000 + + /*============================================================================== + * TYPE DEFINITIONS + *============================================================================*/ + + /** + * @brief Transport configuration status enumeration + */ + typedef enum { + TRANSPORT_CONFIG_STATUS_UNINITIALIZED = 0, + TRANSPORT_CONFIG_STATUS_CONFIGURED, + TRANSPORT_CONFIG_STATUS_ACTIVE, + TRANSPORT_CONFIG_STATUS_ERROR + } transport_config_status_t; + + /** + * @brief Transport configuration context structure + */ + typedef struct { + transport_config_status_t status; + esp_hosted_transport_err_t last_error; + } transport_config_context_t; + + /*============================================================================== + * GLOBAL VARIABLES + *============================================================================*/ + + static transport_config_context_t g_transport_context = { + .status = TRANSPORT_CONFIG_STATUS_UNINITIALIZED, + .last_error = ESP_TRANSPORT_OK, + }; + + /*============================================================================== + * FORWARD DECLARATIONS + *============================================================================*/ + + static esp_err_t initialize_system_components(void); + static esp_err_t configure_transport_interface(void); + static esp_err_t validate_transport_configuration(void); + static void display_transport_configuration(void); + + /*============================================================================== + * SDIO TRANSPORT CONFIGURATION + *============================================================================*/ + + #ifdef CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE + /** + * @brief Configure SDIO transport with optimized settings + * + * @return ESP_OK on success, ESP_FAIL on error + */ + static esp_err_t configure_sdio_transport(void) + { + ESP_LOGI(TAG, "Configuring SDIO transport interface"); + + // Initialize default SDIO configuration + struct esp_hosted_sdio_config sdio_config = INIT_DEFAULT_HOST_SDIO_CONFIG(); + + // Apply optimized settings + sdio_config.clock_freq_khz = 25000; // 25MHz for stable operation + sdio_config.bus_width = 4; // 4-bit bus for better throughput + sdio_config.tx_queue_size = 20; // Increased queue sizes + sdio_config.rx_queue_size = 20; + + // Optional: Enable IOMUX for better performance (hardware dependent) + // sdio_config.iomux_enable = true; + + // Apply configuration + esp_hosted_transport_err_t result = esp_hosted_sdio_set_config(&sdio_config); + if (result != ESP_TRANSPORT_OK) { + ESP_LOGE(TAG, "SDIO configuration failed: error code %d", result); + g_transport_context.last_error = result; + return ESP_FAIL; + } + + ESP_LOGI(TAG, "SDIO transport configured successfully:"); + ESP_LOGI(TAG, " Clock frequency: %lu kHz", sdio_config.clock_freq_khz); + ESP_LOGI(TAG, " Bus width: %d bits", sdio_config.bus_width); + ESP_LOGI(TAG, " Queue sizes - TX: %d, RX: %d", + sdio_config.tx_queue_size, sdio_config.rx_queue_size); + + return ESP_OK; + } + #endif /* CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE */ + + /*============================================================================== + * SPI FULL-DUPLEX TRANSPORT CONFIGURATION + *============================================================================*/ + + #ifdef CONFIG_ESP_HOSTED_SPI_HOST_INTERFACE + /** + * @brief Configure SPI Full-Duplex transport with custom pin mapping + * + * @return ESP_OK on success, ESP_FAIL on error + */ + static esp_err_t configure_spi_transport(void) + { + ESP_LOGI(TAG, "Configuring SPI Full-Duplex transport interface"); + + // Initialize default SPI configuration + struct esp_hosted_spi_config spi_config = INIT_DEFAULT_HOST_SPI_CONFIG(); + + // Configure GPIO pin assignments + spi_config.pin_mosi.pin = 23; // Master Out Slave In + spi_config.pin_miso.pin = 19; // Master In Slave Out + spi_config.pin_sclk.pin = 18; // Serial Clock + spi_config.pin_cs.pin = 5; // Chip Select + spi_config.pin_handshake.pin = 2; // Handshake signal + spi_config.pin_data_ready.pin = 4; // Data Ready indication + + // Configure SPI parameters + spi_config.clk_mhz = 10; // 10MHz clock frequency + spi_config.mode = 0; // SPI mode 0 (CPOL=0, CPHA=0) + spi_config.tx_queue_size = 15; // Transmission queue size + spi_config.rx_queue_size = 15; // Reception queue size + + // Apply configuration + esp_hosted_transport_err_t result = esp_hosted_spi_set_config(&spi_config); + if (result != ESP_TRANSPORT_OK) { + ESP_LOGE(TAG, "SPI configuration failed: error code %d", result); + g_transport_context.last_error = result; + return ESP_FAIL; + } + + ESP_LOGI(TAG, "SPI Full-Duplex transport configured successfully:"); + ESP_LOGI(TAG, " Clock frequency: %lu MHz", spi_config.clk_mhz); + ESP_LOGI(TAG, " Pin mapping - MOSI: %d, MISO: %d, SCLK: %d, CS: %d", + spi_config.pin_mosi.pin, spi_config.pin_miso.pin, + spi_config.pin_sclk.pin, spi_config.pin_cs.pin); + ESP_LOGI(TAG, " Control pins - Handshake: %d, Data Ready: %d", + spi_config.pin_handshake.pin, spi_config.pin_data_ready.pin); + + return ESP_OK; + } + #endif /* CONFIG_ESP_HOSTED_SPI_HOST_INTERFACE */ + + /*============================================================================== + * SPI HALF-DUPLEX TRANSPORT CONFIGURATION + *============================================================================*/ + + #ifdef CONFIG_ESP_HOSTED_SPI_HD_HOST_INTERFACE + /** + * @brief Configure SPI Half-Duplex transport with enhanced features + * + * @return ESP_OK on success, ESP_FAIL on error + */ + static esp_err_t configure_spi_hd_transport(void) + { + ESP_LOGI(TAG, "Configuring SPI Half-Duplex transport interface"); + + // Initialize default SPI HD configuration + struct esp_hosted_spi_hd_config spi_hd_config = INIT_DEFAULT_HOST_SPI_HD_CONFIG(); + + // Configure enhanced parameters + spi_hd_config.num_data_lines = 4; // Quad SPI mode + spi_hd_config.clk_mhz = 20; // 20MHz clock frequency + spi_hd_config.checksum_enable = true; // Enable data integrity checking + + // Configure GPIO pin assignments + spi_hd_config.pin_cs.pin = 15; // Chip Select + spi_hd_config.pin_clk.pin = 14; // Clock line + spi_hd_config.pin_data_ready.pin = 4; // Data Ready indication + + // Apply configuration + esp_hosted_transport_err_t result = esp_hosted_spi_hd_set_config(&spi_hd_config); + if (result != ESP_TRANSPORT_OK) { + ESP_LOGE(TAG, "SPI Half-Duplex configuration failed: error code %d", result); + g_transport_context.last_error = result; + return ESP_FAIL; + } + + ESP_LOGI(TAG, "SPI Half-Duplex transport configured successfully:"); + ESP_LOGI(TAG, " Clock frequency: %lu MHz", spi_hd_config.clk_mhz); + ESP_LOGI(TAG, " Data lines: %d (Quad SPI)", spi_hd_config.num_data_lines); + ESP_LOGI(TAG, " Checksum: %s", spi_hd_config.checksum_enable ? "enabled" : "disabled"); + ESP_LOGI(TAG, " Pin mapping - CS: %d, CLK: %d, Data Ready: %d", + spi_hd_config.pin_cs.pin, spi_hd_config.pin_clk.pin, + spi_hd_config.pin_data_ready.pin); + + return ESP_OK; + } + #endif /* CONFIG_ESP_HOSTED_SPI_HD_HOST_INTERFACE */ + + /*============================================================================== + * UART TRANSPORT CONFIGURATION + *============================================================================*/ + + #ifdef CONFIG_ESP_HOSTED_UART_HOST_INTERFACE + /** + * @brief Configure UART transport with high-speed settings + * + * @return ESP_OK on success, ESP_FAIL on error + */ + static esp_err_t configure_uart_transport(void) + { + ESP_LOGI(TAG, "Configuring UART transport interface"); + + // Initialize default UART configuration + struct esp_hosted_uart_config uart_config = INIT_DEFAULT_HOST_UART_CONFIG(); + + // Configure high-speed UART parameters + uart_config.baud_rate = 921600; // High baud rate for performance + uart_config.num_data_bits = 8; // 8 data bits + uart_config.parity = 0; // No parity bit + uart_config.stop_bits = 1; // 1 stop bit + uart_config.checksum_enable = true; // Enable data integrity checking + + // Configure GPIO pin assignments + uart_config.pin_tx.pin = 17; // Transmit pin + uart_config.pin_rx.pin = 16; // Receive pin + + // Configure buffer sizes + uart_config.tx_queue_size = 100; // Transmission buffer + uart_config.rx_queue_size = 100; // Reception buffer + + // Apply configuration + esp_hosted_transport_err_t result = esp_hosted_uart_set_config(&uart_config); + if (result != ESP_TRANSPORT_OK) { + ESP_LOGE(TAG, "UART configuration failed: error code %d", result); + g_transport_context.last_error = result; + return ESP_FAIL; + } + + ESP_LOGI(TAG, "UART transport configured successfully:"); + ESP_LOGI(TAG, " Baud rate: %lu bps", uart_config.baud_rate); + ESP_LOGI(TAG, " Parameters: %d%c%d", uart_config.num_data_bits, + uart_config.parity ? 'P' : 'N', uart_config.stop_bits); + ESP_LOGI(TAG, " Pin mapping - TX: %d, RX: %d", + uart_config.pin_tx.pin, uart_config.pin_rx.pin); + ESP_LOGI(TAG, " Checksum: %s", uart_config.checksum_enable ? "enabled" : "disabled"); + ESP_LOGI(TAG, " Buffer sizes - TX: %d, RX: %d", + uart_config.tx_queue_size, uart_config.rx_queue_size); + + return ESP_OK; + } + #endif /* CONFIG_ESP_HOSTED_UART_HOST_INTERFACE */ + + /*============================================================================== + * CONFIGURATION VALIDATION AND INSPECTION + *============================================================================*/ + + /** + * @brief Display current transport configuration + */ + static void display_transport_configuration(void) + { + ESP_LOGI(TAG, "Retrieving current transport configuration..."); + + struct esp_hosted_transport_config *config; + esp_hosted_transport_err_t result = esp_hosted_transport_get_config(&config); + + if (result != ESP_TRANSPORT_OK || !config) { + ESP_LOGE(TAG, "Failed to retrieve transport configuration: error %d", result); + return; + } + + ESP_LOGI(TAG, "Current transport configuration:"); + ESP_LOGI(TAG, " Transport type: %d", config->transport_in_use); + + switch (config->transport_in_use) { + case 1: // SDIO + ESP_LOGI(TAG, " SDIO Configuration:"); + ESP_LOGI(TAG, " Clock frequency: %lu kHz", config->u.sdio.clock_freq_khz); + ESP_LOGI(TAG, " Bus width: %d bits", config->u.sdio.bus_width); + ESP_LOGI(TAG, " Queue sizes - TX: %d, RX: %d", + config->u.sdio.tx_queue_size, config->u.sdio.rx_queue_size); + break; + + case 2: // SPI Half-Duplex + ESP_LOGI(TAG, " SPI Half-Duplex Configuration:"); + ESP_LOGI(TAG, " Clock frequency: %lu MHz", config->u.spi_hd.clk_mhz); + ESP_LOGI(TAG, " Data lines: %d", config->u.spi_hd.num_data_lines); + ESP_LOGI(TAG, " Checksum: %s", + config->u.spi_hd.checksum_enable ? "enabled" : "disabled"); + break; + + case 3: // SPI Full-Duplex + ESP_LOGI(TAG, " SPI Full-Duplex Configuration:"); + ESP_LOGI(TAG, " Clock frequency: %lu MHz", config->u.spi.clk_mhz); + ESP_LOGI(TAG, " SPI mode: %d", config->u.spi.mode); + ESP_LOGI(TAG, " Queue sizes - TX: %d, RX: %d", + config->u.spi.tx_queue_size, config->u.spi.rx_queue_size); + break; + + case 4: // UART + ESP_LOGI(TAG, " UART Configuration:"); + ESP_LOGI(TAG, " Baud rate: %lu bps", config->u.uart.baud_rate); + ESP_LOGI(TAG, " UART port: %d", config->u.uart.port); + ESP_LOGI(TAG, " Checksum: %s", + config->u.uart.checksum_enable ? "enabled" : "disabled"); + break; + + default: + ESP_LOGW(TAG, " Unknown transport type: %d", config->transport_in_use); + break; + } + } + + /** + * @brief Validate transport configuration + * + * @return ESP_OK if configuration is valid, ESP_FAIL otherwise + */ + static esp_err_t validate_transport_configuration(void) + { + ESP_LOGI(TAG, "Validating transport configuration..."); + + struct esp_hosted_transport_config *config; + esp_hosted_transport_err_t result = esp_hosted_transport_get_config(&config); + + if (result != ESP_TRANSPORT_OK || !config) { + ESP_LOGE(TAG, "Configuration validation failed: cannot retrieve config"); + return ESP_FAIL; + } + + // Basic validation checks + if (config->transport_in_use < 1 || config->transport_in_use > 4) { + ESP_LOGE(TAG, "Invalid transport type: %d", config->transport_in_use); + return ESP_FAIL; + } + + ESP_LOGI(TAG, "Transport configuration validation passed"); + return ESP_OK; + } + + /*============================================================================== + * SYSTEM INITIALIZATION + *============================================================================*/ + + /** + * @brief Initialize system components (NVS, event loop) + * + * @return ESP_OK on success, error code on failure + */ + static esp_err_t initialize_system_components(void) + { + ESP_LOGI(TAG, "Initializing system components..."); + + // Initialize NVS flash + esp_err_t ret = nvs_flash_init(); + if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { + ESP_LOGW(TAG, "NVS flash needs to be erased, reinitializing..."); + ESP_ERROR_CHECK(nvs_flash_erase()); + ret = nvs_flash_init(); + } + if (ret != ESP_OK) { + ESP_LOGE(TAG, "NVS flash initialization failed: %s", esp_err_to_name(ret)); + return ret; + } + + // Initialize default event loop + ret = esp_event_loop_create_default(); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Event loop initialization failed: %s", esp_err_to_name(ret)); + return ret; + } + + ESP_LOGI(TAG, "System components initialized successfully"); + return ESP_OK; + } + + /** + * @brief Configure transport interface based on menuconfig selection + * + * @return ESP_OK on success, ESP_FAIL on error + */ + static esp_err_t configure_transport_interface(void) + { + esp_err_t result = ESP_FAIL; + + ESP_LOGI(TAG, "Configuring transport interface..."); + + #ifdef CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE + ESP_LOGI(TAG, "SDIO interface selected in menuconfig"); + result = configure_sdio_transport(); + #elif defined(CONFIG_ESP_HOSTED_SPI_HOST_INTERFACE) + ESP_LOGI(TAG, "SPI Full-Duplex interface selected in menuconfig"); + result = configure_spi_transport(); + #elif defined(CONFIG_ESP_HOSTED_SPI_HD_HOST_INTERFACE) + ESP_LOGI(TAG, "SPI Half-Duplex interface selected in menuconfig"); + result = configure_spi_hd_transport(); + #elif defined(CONFIG_ESP_HOSTED_UART_HOST_INTERFACE) + ESP_LOGI(TAG, "UART interface selected in menuconfig"); + result = configure_uart_transport(); + #else + ESP_LOGW(TAG, "No transport interface selected in menuconfig"); + ESP_LOGI(TAG, "Please configure transport interface using 'idf.py menuconfig'"); + return ESP_FAIL; + #endif + + if (result == ESP_OK) { + g_transport_context.status = TRANSPORT_CONFIG_STATUS_CONFIGURED; + ESP_LOGI(TAG, "Transport interface configured successfully"); + } else { + g_transport_context.status = TRANSPORT_CONFIG_STATUS_ERROR; + ESP_LOGE(TAG, "Transport interface configuration failed"); + } + + return result; + } + + /** + * @brief Initialize ESP-Hosted (simple version) + * + * @return ESP_OK on success, ESP_FAIL on error + */ + static esp_err_t initialize_esp_hosted_simple(void) + { + ESP_LOGI(TAG, "Initializing ESP-Hosted..."); + + esp_err_t result = esp_hosted_init(); + if (result == ESP_OK) { + ESP_LOGI(TAG, "ESP-Hosted initialized successfully"); + g_transport_context.status = TRANSPORT_CONFIG_STATUS_ACTIVE; + } else { + ESP_LOGE(TAG, "ESP-Hosted initialization failed: %s", esp_err_to_name(result)); + g_transport_context.status = TRANSPORT_CONFIG_STATUS_ERROR; + ESP_LOGE(TAG, "Check transport configuration and slave device connection"); + } + + return result; + } + + /*============================================================================== + * MAIN APPLICATION + *============================================================================*/ + + /** + * @brief Main application entry point + */ + void app_main(void) + { + ESP_LOGI(TAG, "ESP-Hosted Transport Configuration Example v1.0.0"); + ESP_LOGI(TAG, "========================================"); + + // Initialize system components + if (initialize_system_components() != ESP_OK) { + ESP_LOGE(TAG, "System initialization failed, stopping application"); + return; + } + + // Configure transport interface + if (configure_transport_interface() != ESP_OK) { + ESP_LOGE(TAG, "Transport configuration failed, stopping application"); + return; + } + + // Validate configuration + if (validate_transport_configuration() != ESP_OK) { + ESP_LOGE(TAG, "Transport configuration validation failed"); + return; + } + + // Display current configuration + display_transport_configuration(); + + ESP_LOGI(TAG, "========================================"); + ESP_LOGI(TAG, "Initializing ESP-Hosted..."); + + // Initialize ESP-Hosted with configured transport + if (initialize_esp_hosted_simple() == ESP_OK) { + ESP_LOGI(TAG, "ESP-Hosted initialization successful!"); + ESP_LOGI(TAG, "WiFi and Bluetooth functionality is now available"); + + // Display final configuration + display_transport_configuration(); + + ESP_LOGI(TAG, "========================================"); + } else { + ESP_LOGE(TAG, "ESP-Hosted initialization failed"); + } + + ESP_LOGI(TAG, "Application running - Transport status: %s", + g_transport_context.status == TRANSPORT_CONFIG_STATUS_ACTIVE ? + "Active" : "Error"); + } diff --git a/examples/host_transport_config/sdkconfig.defaults b/examples/host_transport_config/sdkconfig.defaults new file mode 100644 index 00000000..9e45c40c --- /dev/null +++ b/examples/host_transport_config/sdkconfig.defaults @@ -0,0 +1,53 @@ +# ESP-Hosted Configuration +CONFIG_ESP_HOSTED_ENABLED=y + +# Transport Interface - Choose one based on your setup +# Uncomment the transport you want to use: + +# SDIO Interface (default for this example) +CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE=y +CONFIG_ESP_HOSTED_SDIO_CLOCK_FREQ_KHZ=25000 +CONFIG_ESP_HOSTED_SDIO_BUS_WIDTH=4 +CONFIG_ESP_HOSTED_SDIO_TX_Q_SIZE=10 +CONFIG_ESP_HOSTED_SDIO_RX_Q_SIZE=10 + +# SPI Interface (uncomment to use instead of SDIO) +# CONFIG_ESP_HOSTED_SPI_HOST_INTERFACE=y +# CONFIG_ESP_HOSTED_SPI_CLK_FREQ=10 +# CONFIG_ESP_HOSTED_SPI_MODE=0 +# CONFIG_ESP_HOSTED_SPI_TX_Q_SIZE=10 +# CONFIG_ESP_HOSTED_SPI_RX_Q_SIZE=10 + +# SPI Half-Duplex Interface (uncomment to use instead of SDIO) +# CONFIG_ESP_HOSTED_SPI_HD_HOST_INTERFACE=y +# CONFIG_ESP_HOSTED_SPI_HD_CLK_FREQ=20 +# CONFIG_ESP_HOSTED_SPI_HD_INTERFACE_NUM_DATA_LINES=4 +# CONFIG_ESP_HOSTED_SPI_HD_TX_Q_SIZE=10 +# CONFIG_ESP_HOSTED_SPI_HD_RX_Q_SIZE=10 + +# UART Interface (uncomment to use instead of SDIO) +# CONFIG_ESP_HOSTED_UART_HOST_INTERFACE=y +# CONFIG_ESP_HOSTED_UART_BAUDRATE=921600 +# CONFIG_ESP_HOSTED_UART_TX_Q_SIZE=50 +# CONFIG_ESP_HOSTED_UART_RX_Q_SIZE=50 + +# GPIO Configuration (adjust based on your board) +CONFIG_ESP_HOSTED_GPIO_SLAVE_RESET_SLAVE=21 + +# Console Configuration +CONFIG_ESP_CONSOLE_UART_DEFAULT=y +CONFIG_ESP_CONSOLE_UART_BAUDRATE_115200=y + +# Logging +CONFIG_LOG_DEFAULT_LEVEL_INFO=y +CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE=y + +# FreeRTOS +CONFIG_FREERTOS_HZ=1000 + +# WiFi Configuration +CONFIG_ESP_WIFI_ENABLED=y + +# Bluetooth Configuration (optional) +CONFIG_BT_ENABLED=y +CONFIG_BT_BLUEDROID_ENABLED=y diff --git a/examples/host_wifi_easy_connect_dpp_enrollee/CMakeLists.txt b/examples/host_wifi_easy_connect_dpp_enrollee/CMakeLists.txt new file mode 100644 index 00000000..f8ada180 --- /dev/null +++ b/examples/host_wifi_easy_connect_dpp_enrollee/CMakeLists.txt @@ -0,0 +1,6 @@ +# The following lines of boilerplate have to be in your project's CMakeLists +# in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(dpp-enrollee) diff --git a/examples/host_wifi_easy_connect_dpp_enrollee/README.md b/examples/host_wifi_easy_connect_dpp_enrollee/README.md new file mode 100644 index 00000000..c031f753 --- /dev/null +++ b/examples/host_wifi_easy_connect_dpp_enrollee/README.md @@ -0,0 +1,72 @@ +| Supported Hosts | ESP32-P4 | +|-----------------|----------| + +| Supported Co-processors | ESP32 | ESP32-C Series | ESP32-S Series | +|-------------------------|-------|----------------|----------------| + +# Device Provisioning Protocol (Enrollee) Example + +This example shows how to configure ESP devices as an enrollee using Device Provisioning Protocol(DPP) also known as Wi-Fi Easy Connect. + +DPP provides a simple and secure way to onboard ESP devices to a network. +We now support DPP in Responder-Enrollee mode with AKM types PSK and DPP. + +You need a Wi-Fi Easy Connect with Initiator mode capable device to make use of this example. Some Android 10+ devices have this capability. (Vendor specific) + +To run the example with an Android 10+ device follow below steps - +1. Compile and flash the example on ESP device, a QR code will appear on your console. +2. Connect your phone to the network, say named "Example-AP". +3. Now go to Settings->WiFi & Internet->Wi-Fi->Example-AP->Advanced->Add Device. +4. Scan QR Code using the scanner, which will make ESP device connect to Example-AP. + +Optional configuration available + +*Note:* +- QR Code should be displayed as dark on a white/light background to work properly. +- If displayed QR Code had line gaps, try switching to a new font or a different Terminal program. See below QR Code for checking beforehand. + +### Example output + +Here is an example of the console output. +``` +I (807) wifi:mode : sta (24:0a:c4:23:da:20) +I (807) wifi dpp-enrollee: Started listening on Channel 11 for DPP Authentication +I (1157) wifi dpp-enrollee: Scan below QR Code to configure the enrollee: + + + █▀▀▀▀▀█ ██▄▄▄█▄▀██▄▄█▄ ▀ ▀▄ █▄▄ █▀▀▀▀▀█ + █ ███ █ ██▀█▀ ▀▀██▀█▄█▀▄▀ ██▀▀█ ▄ █ ███ █ + █ ▀▀▀ █ ▄█▀▄▄ ▄▄▀ █▄▀ ▄ ▄ ▄▀▄ ██ █ ▀▀▀ █ + ▀▀▀▀▀▀▀ ▀ █▄▀ ▀ ▀▄▀▄▀▄▀ █ ▀ ▀▄█ ▀ ▀▀▀▀▀▀▀ + █▀ ▄██▀ ▄█ ▀█ ▄▀▄▄▄ ▀▀█▄ ▄▀█▄█▀▀▄▄▄▀▄██▀█ + █▄▀ ▄ ▀▄█▄ ▀▀█▀▀█ ▀▄ ▄█▀▀▀▀█▀▄▄▄ ██▄ ▄█ + ▀█▀█▀ ▀▀ ▀ ▄▀▄▀▀ ▄ ▄▀▀▀ █▄ ▄▄ ▀█▄▀▄ █ + ▀ ▀ ▀▀▀█▄ █▀▀ █▄▄▄ █▄ █▄▀ ██▄ ▄▄▀█▄▀ ▄█ + ▀██▀▄█▀▄ ▄█ ▀▄▀ █ ▄ ▄█▄▀▄▀▄▄▀▄ ▄▄▄▀▄▄ + ▀▀▄█▀█▄▀▀█▄ ▄▀ █▄ ▀█▄█▄▀ ▀█▄▄ ▄▀▄ █▄▀ █ + ▄▀▀ ▀█▀▀▀ ▄ ▀█▀▀▄ ▀ ▄▄█▄ █ ██▀▄▀▀▄▄▄▄█▀▄ + ▀ ███▀▀▄ ▄ ▄ ▀█▄▄▀█▀▀▀ ▀▀▄▄ ▀ █▄ ▄█ + █ ▀▄▄ ▀▀▀▀▄▀▀▀▄█▄▄ ▄▀▄▀ ▀▄▀▄▀█▀▀▄▀ ▄█▄▀ + ███ ▄▀▄▀▀▄▀▀█▀▀▄ ▀▄ ████ █▀▄█▄▄ ▀█▄ ▀▀ ▀ + ▄▀█▀▀▀▀█▀ ▄█▄▀▀ ▄ ▀█▀▀ ▀ ▄▀▀ ▀▄█ ▄ ▀ + █ ▀▀▀▄██▄█▀ ▀█▄█▄ ▀██▀▄▀▄▀ █▀ ▀ ▄▄▀█ ▄█ + ▀▀▀ ▀▀▀▀▄▄█▄▀█▄ ▄ ▄ ▀▀▀█▄▄▀▀▀ █▀▀▀██▀▀▄ + █▀▀▀▀▀█ ▄▄▀█▀ ▄█▄█▄▄█▄ ▀ ▀▀▀█▄ ▀█ ▀ █ ▀ █ + █ ███ █ ▀█▀ ▀█▀▀▄▄▀ ▀▄█▀▀ ██▀█▀▀▀█▀▄▄▄█ + █ ▀▀▀ █ ▄▀█ ▄ ▄ ▀█▄ ▀▄▀█ ▀▄██▄ ▀ ▄█ ▄▀▄█ + ▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀ ▀▀▀ ▀▀▀▀▀ ▀ ▀ ▀ + +I (6357) wifi dpp-enrollee: DPP Authentication successful, connecting to AP : DigitalFortress +I (6477) wifi:new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1 +I (7277) wifi:state: init -> auth (b0) +I (7277) wifi:state: auth -> assoc (0) +I (7287) wifi:state: assoc -> run (10) +I (7317) wifi:connected with DigitalFortress, aid = 4, channel 1, BW20, bssid = 04:d4:c4:5e:22:f0 +I (7317) wifi:security type: 3, phy: bgn, rssi: -60 +I (7427) wifi:pm start, type: 1 + +I (7427) wifi:AP's beacon interval = 102400 us, DTIM period = 1 +I (11617) esp_netif_handlers: sta ip: 192.168.1.216, mask: 255.255.255.0, gw: 192.168.1.1 +I (11617) wifi dpp-enrollee: got ip:192.168.1.216 +I (11617) wifi dpp-enrollee: connected to ap SSID:DigitalFortress password:password +``` diff --git a/examples/host_wifi_easy_connect_dpp_enrollee/main/CMakeLists.txt b/examples/host_wifi_easy_connect_dpp_enrollee/main/CMakeLists.txt new file mode 100644 index 00000000..97a762af --- /dev/null +++ b/examples/host_wifi_easy_connect_dpp_enrollee/main/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "dpp_enrollee_main.c" + INCLUDE_DIRS ".") diff --git a/examples/host_wifi_easy_connect_dpp_enrollee/main/Kconfig.projbuild b/examples/host_wifi_easy_connect_dpp_enrollee/main/Kconfig.projbuild new file mode 100644 index 00000000..90a0928e --- /dev/null +++ b/examples/host_wifi_easy_connect_dpp_enrollee/main/Kconfig.projbuild @@ -0,0 +1,17 @@ +menu "Example Configuration" + config ESP_DPP_LISTEN_CHANNEL_LIST + string "DPP Listen channel list" + default "6" + help + DPP Bootstrapping listen channels separated by commas. + + config ESP_DPP_BOOTSTRAPPING_KEY + string "Bootstrapping key" + help + 64 hex digits (or 32 bytes) of raw private key for DPP Bootstrapping. + + config ESP_DPP_DEVICE_INFO + string "Additional Device Info" + help + Additional ancillary information to be included in QR Code. +endmenu diff --git a/examples/host_wifi_easy_connect_dpp_enrollee/main/dpp_enrollee_main.c b/examples/host_wifi_easy_connect_dpp_enrollee/main/dpp_enrollee_main.c new file mode 100644 index 00000000..18069976 --- /dev/null +++ b/examples/host_wifi_easy_connect_dpp_enrollee/main/dpp_enrollee_main.c @@ -0,0 +1,274 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Unlicense OR CC0-1.0 + */ + +/* DPP Enrollee Example + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "freertos/event_groups.h" +#include "esp_system.h" +#include "esp_wifi.h" +#include "esp_event.h" +#include "esp_dpp.h" +#include "esp_log.h" +#include "nvs_flash.h" +#include "qrcode.h" +#include "esp_idf_version.h" + +/** for ESP-IDF v5.5.0 and above, DPP events come in as Wi-Fi Events + ** set EXAMPLE_DPP_USE_WIFI_EVENTS to 0 to use the older Supplicant + ** based DPP events + * + ** Note: ESP-IDF v6.0 and above removed Supplicant based DPP events + */ +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0) +#define EXAMPLE_DPP_USE_WIFI_EVENTS 1 +#else +#define EXAMPLE_DPP_USE_WIFI_EVENTS 0 +#endif + +#ifdef CONFIG_ESP_DPP_LISTEN_CHANNEL_LIST +#define EXAMPLE_DPP_LISTEN_CHANNEL_LIST CONFIG_ESP_DPP_LISTEN_CHANNEL_LIST +#else +#define EXAMPLE_DPP_LISTEN_CHANNEL_LIST "6" +#endif + +#ifdef CONFIG_ESP_DPP_BOOTSTRAPPING_KEY +#define EXAMPLE_DPP_BOOTSTRAPPING_KEY CONFIG_ESP_DPP_BOOTSTRAPPING_KEY +#else +#define EXAMPLE_DPP_BOOTSTRAPPING_KEY 0 +#endif + +#ifdef CONFIG_ESP_DPP_DEVICE_INFO +#define EXAMPLE_DPP_DEVICE_INFO CONFIG_ESP_DPP_DEVICE_INFO +#else +#define EXAMPLE_DPP_DEVICE_INFO 0 +#endif + +#define CURVE_SEC256R1_PKEY_HEX_DIGITS 64 + +static const char *TAG = "wifi dpp-enrollee"; +wifi_config_t s_dpp_wifi_config; + +static int s_retry_num = 0; + +/* FreeRTOS event group to signal when we are connected*/ +static EventGroupHandle_t s_dpp_event_group; + +#define DPP_CONNECTED_BIT BIT0 +#define DPP_CONNECT_FAIL_BIT BIT1 +#define DPP_AUTH_FAIL_BIT BIT2 +#define WIFI_MAX_RETRY_NUM 10 + +static void event_handler(void *arg, esp_event_base_t event_base, + int32_t event_id, void *event_data) +{ + if (event_base == WIFI_EVENT) { + switch (event_id) { + case WIFI_EVENT_STA_START: + ESP_ERROR_CHECK(esp_supp_dpp_start_listen()); + ESP_LOGW(TAG, "Started listening for DPP Authentication"); + break; + case WIFI_EVENT_STA_DISCONNECTED: + if (s_retry_num < WIFI_MAX_RETRY_NUM) { + esp_wifi_connect(); + s_retry_num++; + ESP_LOGI(TAG, "retry to connect to the AP"); + } else { + xEventGroupSetBits(s_dpp_event_group, DPP_CONNECT_FAIL_BIT); + } + break; + case WIFI_EVENT_STA_CONNECTED: + ESP_LOGI(TAG, "Successfully connected to the AP ssid : %s ", s_dpp_wifi_config.sta.ssid); + break; +#if EXAMPLE_DPP_USE_WIFI_EVENTS + case WIFI_EVENT_DPP_URI_READY: + wifi_event_dpp_uri_ready_t *uri_data = event_data; + ESP_LOGW(TAG, "uri_data_len %d", uri_data->uri_data_len); + if (uri_data != NULL) { + esp_qrcode_config_t cfg = ESP_QRCODE_CONFIG_DEFAULT(); + + ESP_LOGI(TAG, "Scan below QR Code to configure the enrollee:"); + // delay a short while so printing the QR code isn't + // interrupted by messages from background tasks + vTaskDelay(500 / portTICK_PERIOD_MS); + esp_qrcode_generate(&cfg, (const char *)uri_data->uri); + } + break; + case WIFI_EVENT_DPP_CFG_RECVD: + wifi_event_dpp_config_received_t *config = event_data; + memcpy(&s_dpp_wifi_config, &config->wifi_cfg, sizeof(s_dpp_wifi_config)); + s_retry_num = 0; + esp_wifi_set_config(WIFI_IF_STA, &s_dpp_wifi_config); + esp_wifi_connect(); + break; + case WIFI_EVENT_DPP_FAILED: + wifi_event_dpp_failed_t *dpp_failure = event_data; + if (s_retry_num < 5) { + ESP_LOGI(TAG, "DPP Auth failed (Reason: %s), retry...", esp_err_to_name((int)dpp_failure->failure_reason)); + ESP_ERROR_CHECK(esp_supp_dpp_start_listen()); + s_retry_num++; + } else { + xEventGroupSetBits(s_dpp_event_group, DPP_AUTH_FAIL_BIT); + } + break; +#endif + default: + break; + } + } + if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) { + ip_event_got_ip_t *event = (ip_event_got_ip_t *) event_data; + ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip)); + s_retry_num = 0; + xEventGroupSetBits(s_dpp_event_group, DPP_CONNECTED_BIT); + } +} + +#if !EXAMPLE_DPP_USE_WIFI_EVENTS +void dpp_enrollee_event_cb(esp_supp_dpp_event_t event, void *data) +{ + switch (event) { + case ESP_SUPP_DPP_URI_READY: + if (data != NULL) { + esp_qrcode_config_t cfg = ESP_QRCODE_CONFIG_DEFAULT(); + ESP_LOGI(TAG, "Scan below QR Code to configure the enrollee:"); + // delay a short while so printing the QR code isn't + // interrupted by messages from background tasks + vTaskDelay(500 / portTICK_PERIOD_MS); + esp_qrcode_generate(&cfg, (const char *)data); + } + break; + case ESP_SUPP_DPP_CFG_RECVD: + memcpy(&s_dpp_wifi_config, data, sizeof(s_dpp_wifi_config)); + s_retry_num = 0; + esp_wifi_set_config(WIFI_IF_STA, &s_dpp_wifi_config); + esp_wifi_connect(); + break; + case ESP_SUPP_DPP_FAIL: + if (s_retry_num < 5) { + ESP_LOGI(TAG, "DPP Auth failed (Reason: %s), retry...", esp_err_to_name((int)data)); + ESP_ERROR_CHECK(esp_supp_dpp_start_listen()); + s_retry_num++; + } else { + xEventGroupSetBits(s_dpp_event_group, DPP_AUTH_FAIL_BIT); + } + break; + default: + break; + } +} +#endif // !EXAMPLE_DPP_USE_WIFI_EVENTS + +esp_err_t dpp_enrollee_bootstrap(void) +{ + esp_err_t ret; + size_t pkey_len = strlen(EXAMPLE_DPP_BOOTSTRAPPING_KEY); + char *key = NULL; + + if (pkey_len) { + /* Currently only NIST P-256 curve is supported, add prefix/postfix accordingly */ + char prefix[] = "30310201010420"; + char postfix[] = "a00a06082a8648ce3d030107"; + + if (pkey_len != CURVE_SEC256R1_PKEY_HEX_DIGITS) { + ESP_LOGI(TAG, "Invalid key length! Private key needs to be 32 bytes (or 64 hex digits) long"); + return ESP_FAIL; + } + + key = malloc(sizeof(prefix) + pkey_len + sizeof(postfix)); + if (!key) { + ESP_LOGI(TAG, "Failed to allocate for bootstrapping key"); + return ESP_ERR_NO_MEM; + } + sprintf(key, "%s%s%s", prefix, EXAMPLE_DPP_BOOTSTRAPPING_KEY, postfix); + } + + /* Currently only supported method is QR Code */ + ret = esp_supp_dpp_bootstrap_gen(EXAMPLE_DPP_LISTEN_CHANNEL_LIST, DPP_BOOTSTRAP_QR_CODE, + key, EXAMPLE_DPP_DEVICE_INFO); + + if (key) + free(key); + + return ret; +} + +void dpp_enrollee_init(void) +{ + s_dpp_event_group = xEventGroupCreate(); + + ESP_ERROR_CHECK(esp_netif_init()); + + ESP_ERROR_CHECK(esp_event_loop_create_default()); + esp_netif_create_default_wifi_sta(); + + ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL)); + ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &event_handler, NULL)); + + wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_wifi_init(&cfg)); + + ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); +#if EXAMPLE_DPP_USE_WIFI_EVENTS +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) + ESP_ERROR_CHECK(esp_supp_dpp_init()); +#else + ESP_ERROR_CHECK(esp_supp_dpp_init(NULL)); +#endif +#else + ESP_ERROR_CHECK(esp_supp_dpp_init(dpp_enrollee_event_cb)); +#endif + ESP_ERROR_CHECK(dpp_enrollee_bootstrap()); + ESP_ERROR_CHECK(esp_wifi_start()); + + /* Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum + * number of re-tries (WIFI_FAIL_BIT). The bits are set by event_handler() (see above) */ + EventBits_t bits = xEventGroupWaitBits(s_dpp_event_group, + DPP_CONNECTED_BIT | DPP_CONNECT_FAIL_BIT | DPP_AUTH_FAIL_BIT, + pdFALSE, + pdFALSE, + portMAX_DELAY); + + /* xEventGroupWaitBits() returns the bits before the call returned, hence we can test which event actually + * happened. */ + if (bits & DPP_CONNECTED_BIT) { + ESP_LOGI(TAG, "connected to ap SSID:%s password:%s", + s_dpp_wifi_config.sta.ssid, s_dpp_wifi_config.sta.password); + } else if (bits & DPP_CONNECT_FAIL_BIT) { + ESP_LOGI(TAG, "Failed to connect to SSID:%s, password:%s", + s_dpp_wifi_config.sta.ssid, s_dpp_wifi_config.sta.password); + } else if (bits & DPP_AUTH_FAIL_BIT) { + ESP_LOGI(TAG, "DPP Authentication failed after %d retries", s_retry_num); + } else { + ESP_LOGE(TAG, "UNEXPECTED EVENT"); + } + + esp_supp_dpp_deinit(); + ESP_ERROR_CHECK(esp_event_handler_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, &event_handler)); + ESP_ERROR_CHECK(esp_event_handler_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, &event_handler)); + vEventGroupDelete(s_dpp_event_group); +} + +void app_main(void) +{ + //Initialize NVS + esp_err_t ret = nvs_flash_init(); + if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { + ESP_ERROR_CHECK(nvs_flash_erase()); + ret = nvs_flash_init(); + } + ESP_ERROR_CHECK(ret); + + dpp_enrollee_init(); +} diff --git a/examples/host_wifi_easy_connect_dpp_enrollee/main/idf_component.yml b/examples/host_wifi_easy_connect_dpp_enrollee/main/idf_component.yml new file mode 100644 index 00000000..a603c6aa --- /dev/null +++ b/examples/host_wifi_easy_connect_dpp_enrollee/main/idf_component.yml @@ -0,0 +1,10 @@ +dependencies: + qrcode: "^0.1.0" + espressif/esp_wifi_remote: + version: ">=0.10,<2.0" + rules: + - if: "target in [esp32p4, esp32h2]" + espressif/esp_hosted: + version: "*" + rules: + - if: "target in [esp32p4, esp32h2]" diff --git a/examples/host_wifi_easy_connect_dpp_enrollee/sdkconfig.defaults b/examples/host_wifi_easy_connect_dpp_enrollee/sdkconfig.defaults new file mode 100644 index 00000000..cc90041c --- /dev/null +++ b/examples/host_wifi_easy_connect_dpp_enrollee/sdkconfig.defaults @@ -0,0 +1,7 @@ +CONFIG_FREERTOS_HZ=1000 + +### don't use any saved Wi-Fi config on the co-processor +CONFIG_WIFI_RMT_NVS_ENABLED=n + +### enable DPP feature +CONFIG_ESP_HOSTED_ENABLE_DPP=y diff --git a/examples/host_wifi_easy_connect_dpp_enrollee/sdkconfig.defaults.esp32p4 b/examples/host_wifi_easy_connect_dpp_enrollee/sdkconfig.defaults.esp32p4 new file mode 100644 index 00000000..739c9a83 --- /dev/null +++ b/examples/host_wifi_easy_connect_dpp_enrollee/sdkconfig.defaults.esp32p4 @@ -0,0 +1,6 @@ +# +# ESP32-P4 specific +# + +CONFIG_SLAVE_IDF_TARGET_ESP32C6=y +CONFIG_ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD=y diff --git a/examples/host_wifi_itwt/CMakeLists.txt b/examples/host_wifi_itwt/CMakeLists.txt new file mode 100644 index 00000000..935ad6ba --- /dev/null +++ b/examples/host_wifi_itwt/CMakeLists.txt @@ -0,0 +1,8 @@ +# The following lines of boilerplate have to be in your project's CMakeLists +# in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +idf_build_set_property(MINIMAL_BUILD ON) +project(itwt) diff --git a/examples/host_wifi_itwt/README.md b/examples/host_wifi_itwt/README.md new file mode 100644 index 00000000..088fc398 --- /dev/null +++ b/examples/host_wifi_itwt/README.md @@ -0,0 +1,31 @@ +| Supported Hosts | ESP32-P4 | +| --------------- | -------- | + +| Supported Co-processors | ESP32-C5 | ESP32-C6 | +| ----------------------- | -------- | -------- | + +# Wifi itwt Example + +## Introduction +This example shows how to use itwt of wifi. + +Itwt only works in station mode. And AP needs to support the capability of itwt. + +Itwt can works under different power save mode. + +### Modem sleep (supported) +This is default mode. Under this mode, can support console command "itwt, probe" to config itwt. + +* itwt: this command is for itwt setup/teardown/suspend. +* probe: this command will send a probe request to update tsf time with ap + +### Light Sleep (will support) +Need system support light sleep. Console command will not support in this mode. + +### Typical current consumption with Itwt enabled + + +### Typical current consumption with Itwt disabled + + +Note that current consumption and average current are higher when disabled. diff --git a/examples/host_wifi_itwt/main/CMakeLists.txt b/examples/host_wifi_itwt/main/CMakeLists.txt new file mode 100644 index 00000000..18cf0c49 --- /dev/null +++ b/examples/host_wifi_itwt/main/CMakeLists.txt @@ -0,0 +1,5 @@ +idf_component_register(SRCS "itwt_main.c" + "wifi_stats_cmd.c" + "wifi_itwt_cmd.c" + PRIV_REQUIRES lwip esp_wifi esp_timer esp_pm + INCLUDE_DIRS ".") diff --git a/examples/host_wifi_itwt/main/Kconfig.projbuild b/examples/host_wifi_itwt/main/Kconfig.projbuild new file mode 100644 index 00000000..601111ec --- /dev/null +++ b/examples/host_wifi_itwt/main/Kconfig.projbuild @@ -0,0 +1,189 @@ +menu "Example Configuration" + + config EXAMPLE_WIFI_SSID + string "WiFi SSID" + default "myssid" + help + SSID (network name) for the example to connect to. + + config EXAMPLE_WIFI_PASSWORD + string "WiFi Password" + default "mypassword" + help + WiFi password (WPA or WPA2) for the example to use. + + config EXAMPLE_ENABLE_STATIC_IP + bool "enable static ip" + default y + help + Enable static IP + config EXAMPLE_STATIC_IP_ADDR + string "Static IP address" + default "192.168.4.2" + depends on EXAMPLE_ENABLE_STATIC_IP + help + Set static IP address. + + config EXAMPLE_STATIC_NETMASK_ADDR + string "Static netmask address" + default "255.255.255.0" + depends on EXAMPLE_ENABLE_STATIC_IP + help + Set static netmask address. + + config EXAMPLE_STATIC_GW_ADDR + string "Static gateway address" + default "192.168.4.1" + depends on EXAMPLE_ENABLE_STATIC_IP + help + Set static gateway address. + + config EXAMPLE_TWT_ENABLE_KEEP_ALIVE_QOS_NULL + bool "enable keep alive qos null" + default n + help + Enable send QOS NULL to keep alive during TWT. + + menu "iTWT Configuration" + config EXAMPLE_ITWT_TRIGGER_ENABLE + bool "trigger-enabled" + default y + help + 0- a non-trigger-enabled TWT, 1-a trigger-enabled TWT + + config EXAMPLE_ITWT_ANNOUNCED + bool "announced" + default y + help + 0- an unannounced TWT, 1-an announced TWT + + config EXAMPLE_ITWT_MIN_WAKE_DURA + int "itwt minimum wake duration" + range 1 255 + default 255 + help + Nominal Minimum Wake Duration, indicates the minimum amount of time, in unit of 256 us, that the TWT + requesting STA expects that it needs to be awake. The value range is [1, 255]. + + config EXAMPLE_ITWT_WAKE_DURATION_UNIT + int "itwt wake duration unit" + range 0 1 + default 0 + help + TWT wake duration unit, 0: 256us 1: TU (TU = 1024us) + + config EXAMPLE_ITWT_WAKE_INVL_EXPN + int "itwt wake interval exponent" + range 0 31 + default 10 + help + TWT Wake Interval Exponent, in microseconds. The value range is [0, 31]. + + config EXAMPLE_ITWT_WAKE_INVL_MANT + int "itwt wake interval mantissa" + range 1 65535 + default 512 + help + TWT Wake Interval Mantissa, in microseconds. The value range is [1, 65535]. + + config EXAMPLE_ITWT_ID + int "itwt connection id" + range 0 32767 + default 0 + help + TWT Connection id. The value range is [0, 32767]. + + config EXAMPLE_ITWT_SETUP_TIMEOUT_TIME_MS + int "itwt setup timeout times" + range 100 65535 + default 5000 + help + TWT setup timeout time, in microseconds. The value range is [100, 65535]. + + endmenu + + choice EXAMPLE_MAX_CPU_FREQ + prompt "Maximum CPU frequency" + default EXAMPLE_MAX_CPU_FREQ_96 if IDF_TARGET_ESP32H2 + default EXAMPLE_MAX_CPU_FREQ_80 + depends on PM_ENABLE + help + Maximum CPU frequency to use for dynamic frequency scaling. + + config EXAMPLE_MAX_CPU_FREQ_96 + bool "96 MHz" + depends on IDF_TARGET_ESP32H2 + config EXAMPLE_MAX_CPU_FREQ_80 + bool "80 MHz" + depends on !IDF_TARGET_ESP32P4 + config EXAMPLE_MAX_CPU_FREQ_90 + bool "90 MHz" + depends on IDF_TARGET_ESP32P4 + config EXAMPLE_MAX_CPU_FREQ_120 + bool "120 MHz" + depends on IDF_TARGET_ESP32C2 + config EXAMPLE_MAX_CPU_FREQ_160 + bool "160 MHz" + depends on !IDF_TARGET_ESP32P4 + config EXAMPLE_MAX_CPU_FREQ_180 + bool "180 MHz" + depends on IDF_TARGET_ESP32P4 + config EXAMPLE_MAX_CPU_FREQ_240 + bool "240 MHz" + depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C5 + endchoice + + config EXAMPLE_MAX_CPU_FREQ_MHZ + int + default 64 if EXAMPLE_MAX_CPU_FREQ_64 + default 80 if EXAMPLE_MAX_CPU_FREQ_80 + default 90 if EXAMPLE_MAX_CPU_FREQ_90 + default 96 if EXAMPLE_MAX_CPU_FREQ_96 + default 120 if EXAMPLE_MAX_CPU_FREQ_120 + default 160 if EXAMPLE_MAX_CPU_FREQ_160 + default 180 if EXAMPLE_MAX_CPU_FREQ_180 + default 240 if EXAMPLE_MAX_CPU_FREQ_240 + + choice EXAMPLE_MIN_CPU_FREQ + prompt "Minimum CPU frequency" + default EXAMPLE_MIN_CPU_FREQ_10M if !IDF_TARGET_ESP32C5 + default EXAMPLE_MIN_CPU_FREQ_12M if IDF_TARGET_ESP32C5 + depends on PM_ENABLE + help + Minimum CPU frequency to use for dynamic frequency scaling. + Should be set to XTAL frequency or XTAL frequency divided by integer. + + config EXAMPLE_MIN_CPU_FREQ_40M + bool "40 MHz (use with 40MHz XTAL)" + depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO + config EXAMPLE_MIN_CPU_FREQ_20M + bool "20 MHz (use with 40MHz XTAL)" + depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO + config EXAMPLE_MIN_CPU_FREQ_16M + bool "16 MHz (use with 32MHz XTAL)" + depends on XTAL_FREQ_32 || XTAL_FREQ_AUTO + config EXAMPLE_MIN_CPU_FREQ_12M + bool "12 MHz (use with 48MHz XTAL)" + depends on XTAL_FREQ_48 || XTAL_FREQ_AUTO + config EXAMPLE_MIN_CPU_FREQ_10M + bool "10 MHz (use with 40MHz XTAL)" + depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO + config EXAMPLE_MIN_CPU_FREQ_26M + bool "26 MHz (use with 26MHz XTAL)" + depends on XTAL_FREQ_26 || XTAL_FREQ_AUTO + config EXAMPLE_MIN_CPU_FREQ_13M + bool "13 MHz (use with 26MHz XTAL)" + depends on XTAL_FREQ_26 || XTAL_FREQ_AUTO + endchoice + + config EXAMPLE_MIN_CPU_FREQ_MHZ + int + default 40 if EXAMPLE_MIN_CPU_FREQ_40M + default 20 if EXAMPLE_MIN_CPU_FREQ_20M + default 10 if EXAMPLE_MIN_CPU_FREQ_10M + default 26 if EXAMPLE_MIN_CPU_FREQ_26M + default 16 if EXAMPLE_MIN_CPU_FREQ_16M + default 13 if EXAMPLE_MIN_CPU_FREQ_13M + default 12 if EXAMPLE_MIN_CPU_FREQ_12M + +endmenu diff --git a/examples/host_wifi_itwt/main/idf_component.yml b/examples/host_wifi_itwt/main/idf_component.yml new file mode 100644 index 00000000..834e3fcf --- /dev/null +++ b/examples/host_wifi_itwt/main/idf_component.yml @@ -0,0 +1,13 @@ +dependencies: + cmd_system: + path: ${IDF_PATH}/examples/system/console/advanced/components/cmd_system + cmd_nvs: + path: ${IDF_PATH}/examples/system/console/advanced/components/cmd_nvs + espressif/esp_wifi_remote: + version: ">=0.10,<2.0" + rules: + - if: "target in [esp32p4, esp32h2]" + espressif/esp_hosted: + version: "*" + rules: + - if: "target in [esp32p4, esp32h2]" diff --git a/examples/host_wifi_itwt/main/itwt_main.c b/examples/host_wifi_itwt/main/itwt_main.c new file mode 100644 index 00000000..c2775a30 --- /dev/null +++ b/examples/host_wifi_itwt/main/itwt_main.c @@ -0,0 +1,386 @@ +/* + * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Unlicense OR CC0-1.0 + */ +/* itwt Example + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +/* + this example shows how to use itwt + set a router or a AP using the same SSID&PASSWORD as configuration of this example. + start esp32c6 and when it connected to AP it will setup itwt. +*/ +#include +#include "freertos/FreeRTOS.h" +#include "freertos/event_groups.h" +#include "esp_wifi.h" +#include "esp_log.h" +#include "esp_event.h" +#include "nvs_flash.h" +#include "esp_console.h" +#include "cmd_system.h" +#include "esp_wifi_he.h" +#include "esp_pm.h" +#include "esp_timer.h" +#include "esp_idf_version.h" +#include "wifi_cmd.h" + +/******************************************************* + * Constants + *******************************************************/ +static const char *TAG = "itwt"; + +/******************************************************* + * Structures + *******************************************************/ + +/******************************************************* + * Variable Definitions + *******************************************************/ +/*set the ssid and password via "idf.py menuconfig"*/ +#define DEFAULT_SSID CONFIG_EXAMPLE_WIFI_SSID +#define DEFAULT_PWD CONFIG_EXAMPLE_WIFI_PASSWORD +#define ITWT_SETUP_SUCCESS 1 + +#if CONFIG_EXAMPLE_TWT_ENABLE_KEEP_ALIVE_QOS_NULL +bool keep_alive_enabled = true; +#else +bool keep_alive_enabled = false; +#endif + +#if CONFIG_EXAMPLE_ITWT_TRIGGER_ENABLE +uint8_t trigger_enabled = 1; +#else +uint8_t trigger_enabled = 0; +#endif + +#if CONFIG_EXAMPLE_ITWT_ANNOUNCED +uint8_t flow_type_announced = 1; +#else +uint8_t flow_type_announced = 0; +#endif + +esp_netif_t *netif_sta = NULL; +const int CONNECTED_BIT = BIT0; +const int DISCONNECTED_BIT = BIT1; +EventGroupHandle_t wifi_event_group; + +/******************************************************* + * Function Declarations + *******************************************************/ + +/******************************************************* + * Function Definitions + *******************************************************/ + +static void example_set_static_ip(esp_netif_t *netif) +{ +#if CONFIG_EXAMPLE_ENABLE_STATIC_IP + if (esp_netif_dhcpc_stop(netif) != ESP_OK) { + ESP_LOGE(TAG, "Failed to stop dhcp client"); + return; + } + esp_netif_ip_info_t ip; + memset(&ip, 0 , sizeof(esp_netif_ip_info_t)); + ip.ip.addr = ipaddr_addr(CONFIG_EXAMPLE_STATIC_IP_ADDR); + ip.netmask.addr = ipaddr_addr(CONFIG_EXAMPLE_STATIC_NETMASK_ADDR); + ip.gw.addr = ipaddr_addr(CONFIG_EXAMPLE_STATIC_GW_ADDR); + if (esp_netif_set_ip_info(netif, &ip) != ESP_OK) { + ESP_LOGE(TAG, "Failed to set ip info"); + return; + } + ESP_LOGI(TAG, "Success to set static ip: %s, netmask: %s, gw: %s", + CONFIG_EXAMPLE_STATIC_IP_ADDR, CONFIG_EXAMPLE_STATIC_NETMASK_ADDR, CONFIG_EXAMPLE_STATIC_GW_ADDR); +#endif +} + +static const char *itwt_probe_status_to_str(wifi_itwt_probe_status_t status) +{ + switch (status) { + case ITWT_PROBE_FAIL: return "itwt probe fail"; + case ITWT_PROBE_SUCCESS: return "itwt probe success"; + case ITWT_PROBE_TIMEOUT: return "itwt probe timeout"; + case ITWT_PROBE_STA_DISCONNECTED: return "Sta disconnected"; + default: return "Unknown status"; + } +} + +static void got_ip_handler(void *arg, esp_event_base_t event_base, + int32_t event_id, void *event_data) +{ + xEventGroupClearBits(wifi_event_group, DISCONNECTED_BIT); + xEventGroupSetBits(wifi_event_group, CONNECTED_BIT); + + /* setup a trigger-based announce individual TWT agreement. */ + wifi_phy_mode_t phymode; + wifi_config_t sta_cfg = { 0, }; + esp_wifi_get_config(WIFI_IF_STA, &sta_cfg); + esp_wifi_sta_get_negotiated_phymode(&phymode); + if (phymode == WIFI_PHY_MODE_HE20) { + esp_err_t err = ESP_OK; +#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 3, 0) + wifi_itwt_setup_config_t setup_config +#else + // wifi_itwt_setup_config_t only found in IDF v5.3.1 and above + wifi_twt_setup_config_t setup_config +#endif + = { + .setup_cmd = TWT_REQUEST, + .flow_id = 0, + .twt_id = CONFIG_EXAMPLE_ITWT_ID, + .flow_type = flow_type_announced ? 0 : 1, + .min_wake_dura = CONFIG_EXAMPLE_ITWT_MIN_WAKE_DURA, + .wake_duration_unit = CONFIG_EXAMPLE_ITWT_WAKE_DURATION_UNIT, + .wake_invl_expn = CONFIG_EXAMPLE_ITWT_WAKE_INVL_EXPN, + .wake_invl_mant = CONFIG_EXAMPLE_ITWT_WAKE_INVL_MANT, + .trigger = trigger_enabled, + .timeout_time_ms = CONFIG_EXAMPLE_ITWT_SETUP_TIMEOUT_TIME_MS, + }; + err = esp_wifi_sta_itwt_setup(&setup_config); + if (err != ESP_OK) { + ESP_LOGE(TAG, "itwt setup failed, err:0x%x", err); + ESP_LOGE(TAG, "Error: %s", esp_err_to_name(err)); + } + } else { + ESP_LOGE(TAG, "Must be in 11ax mode to support itwt"); + } +} + +static void start_handler(void *arg, esp_event_base_t event_base, + int32_t event_id, void *event_data) +{ + ESP_LOGI(TAG, "sta connect to %s", DEFAULT_SSID); + esp_wifi_connect(); +} + +static void disconnect_handler(void *arg, esp_event_base_t event_base, + int32_t event_id, void *event_data) +{ + ESP_LOGI(TAG, "sta disconnect, reconnect..."); + xEventGroupClearBits(wifi_event_group, CONNECTED_BIT); + esp_wifi_connect(); +} + +static void itwt_setup_handler(void *arg, esp_event_base_t event_base, + int32_t event_id, void *event_data) +{ + wifi_event_sta_itwt_setup_t *setup = (wifi_event_sta_itwt_setup_t *) event_data; + if (setup->status == ITWT_SETUP_SUCCESS) { + /* TWT Wake Interval = TWT Wake Interval Mantissa * (2 ^ TWT Wake Interval Exponent) */ + ESP_LOGI(TAG, "twt_id:%d, flow_id:%d, %s, %s, wake_dura:%d, wake_dura_unit:%d, wake_invl_e:%d, wake_invl_m:%d", setup->config.twt_id, + setup->config.flow_id, setup->config.trigger ? "trigger-enabled" : "non-trigger-enabled", setup->config.flow_type ? "unannounced" : "announced", + setup->config.min_wake_dura, setup->config.wake_duration_unit, setup->config.wake_invl_expn, setup->config.wake_invl_mant); + ESP_LOGI(TAG, "target wake time:%lld, wake duration:%d us, service period:%d us", setup->target_wake_time, setup->config.min_wake_dura << (setup->config.wake_duration_unit == 1 ? 10 : 8), + setup->config.wake_invl_mant << setup->config.wake_invl_expn); + } else { + if (setup->status == ESP_ERR_WIFI_TWT_SETUP_TIMEOUT) { + ESP_LOGE(TAG, "twt_id:%d, timeout of receiving twt setup response frame", setup->config.twt_id); + } else if (setup->status == ESP_ERR_WIFI_TWT_SETUP_TXFAIL) { + ESP_LOGE(TAG, "twt_id:%d, twt setup frame tx failed, reason: %d", setup->config.twt_id, setup->reason); + } else if (setup->status == ESP_ERR_WIFI_TWT_SETUP_REJECT) { + ESP_LOGE(TAG, "twt_id:%d, twt setup request was rejected, setup cmd: %d", setup->config.twt_id, setup->config.setup_cmd); + } else { + ESP_LOGE(TAG, "twt_id:%d, twt setup failed, status: %d", setup->config.twt_id, setup->status); + } + } +} + +static void itwt_teardown_handler(void *arg, esp_event_base_t event_base, + int32_t event_id, void *event_data) +{ + wifi_event_sta_itwt_teardown_t *teardown = (wifi_event_sta_itwt_teardown_t *) event_data; + if (teardown->status == ITWT_TEARDOWN_FAIL) { + ESP_LOGE(TAG, "flow_id %d%s, twt teardown frame tx failed", teardown->flow_id, (teardown->flow_id == 8) ? "(all twt)" : ""); + } else { + ESP_LOGI(TAG, "flow_id %d%s", teardown->flow_id, (teardown->flow_id == 8) ? "(all twt)" : ""); + } +} + +static void itwt_suspend_handler(void *arg, esp_event_base_t event_base, + int32_t event_id, void *event_data) +{ + wifi_event_sta_itwt_suspend_t *suspend = (wifi_event_sta_itwt_suspend_t *) event_data; + ESP_LOGI(TAG, "status:%d, flow_id_bitmap:0x%x, actual_suspend_time_ms:[%lu %lu %lu %lu %lu %lu %lu %lu]", + suspend->status, suspend->flow_id_bitmap, + suspend->actual_suspend_time_ms[0], suspend->actual_suspend_time_ms[1], suspend->actual_suspend_time_ms[2], suspend->actual_suspend_time_ms[3], + suspend->actual_suspend_time_ms[4], suspend->actual_suspend_time_ms[5], suspend->actual_suspend_time_ms[6], suspend->actual_suspend_time_ms[7]); +} + +static void itwt_probe_handler(void *arg, esp_event_base_t event_base, + int32_t event_id, void *event_data) +{ + wifi_event_sta_itwt_probe_t *probe = (wifi_event_sta_itwt_probe_t *) event_data; + ESP_LOGI(TAG, "status:%s, reason:0x%x", itwt_probe_status_to_str(probe->status), probe->reason); +} + +static void wifi_itwt(void) +{ + ESP_ERROR_CHECK(esp_netif_init()); + wifi_event_group = xEventGroupCreate(); + ESP_ERROR_CHECK(esp_event_loop_create_default()); + netif_sta = esp_netif_create_default_wifi_sta(); + assert(netif_sta); + + wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_wifi_init(&cfg)); + + ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, + WIFI_EVENT_STA_START, + &start_handler, + NULL, + NULL)); + ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, + WIFI_EVENT_STA_DISCONNECTED, + &disconnect_handler, + NULL, + NULL)); + ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT, + IP_EVENT_STA_GOT_IP, + &got_ip_handler, + NULL, + NULL)); + /* itwt */ + ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, + WIFI_EVENT_ITWT_SETUP, + &itwt_setup_handler, + NULL, + NULL)); + ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, + WIFI_EVENT_ITWT_TEARDOWN, + &itwt_teardown_handler, + NULL, + NULL)); + ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, + WIFI_EVENT_ITWT_SUSPEND, + &itwt_suspend_handler, + NULL, + NULL)); + ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, + WIFI_EVENT_ITWT_PROBE, + &itwt_probe_handler, + NULL, + NULL)); + + wifi_config_t wifi_config = { + .sta = { + .ssid = DEFAULT_SSID, + .password = DEFAULT_PWD, + }, + }; + ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config)); + +#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 3, 0) + wifi_twt_config_t wifi_twt_config = { + .post_wakeup_event = false, +#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 3, 1) + // twt_enable_keep_alive only found in IDF v5.3.2 and above + .twt_enable_keep_alive = keep_alive_enabled, +#endif + }; + // esp_wifi_sta_twt_config only found in IDF v5.3.1 and above + ESP_ERROR_CHECK(esp_wifi_sta_twt_config(&wifi_twt_config)); +#endif +#if CONFIG_SOC_WIFI_SUPPORT_5G || CONFIG_SLAVE_SOC_WIFI_SUPPORT_5G + wifi_bandwidths_t bw = { + .ghz_2g = WIFI_BW_HT20, + .ghz_5g = WIFI_BW_HT20, + }; + esp_wifi_set_bandwidths(WIFI_IF_STA, &bw); + + wifi_protocols_t protocol = { + .ghz_2g = WIFI_PROTOCOL_11AX, + .ghz_5g = WIFI_PROTOCOL_11AX, + }; + esp_wifi_set_protocols(WIFI_IF_STA, &protocol); +#else + esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT20); + esp_wifi_set_protocol(WIFI_IF_STA, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N | WIFI_PROTOCOL_11AX); +#endif + esp_wifi_set_ps(WIFI_PS_MIN_MODEM); + +#if CONFIG_EXAMPLE_ENABLE_STATIC_IP + example_set_static_ip(netif_sta); +#endif + + ESP_ERROR_CHECK(esp_wifi_start()); + +#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS +#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_MU_STATS + esp_wifi_enable_rx_statistics(true, true); +#else + esp_wifi_enable_rx_statistics(true, false); +#endif +#endif +#if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS + esp_wifi_enable_tx_statistics(ESP_WIFI_ACI_VO, true); //VO, mgmt + esp_wifi_enable_tx_statistics(ESP_WIFI_ACI_BE, true); //BE, data +#endif + +} + +void app_main(void) +{ + // Initialize NVS + esp_err_t ret = nvs_flash_init(); + if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { + ESP_ERROR_CHECK(nvs_flash_erase()); + ret = nvs_flash_init(); + } + +#if CONFIG_PM_ENABLE + // Configure dynamic frequency scaling: + // maximum and minimum frequencies are set in sdkconfig, + // automatic light sleep is enabled if tickless idle support is enabled. + esp_pm_config_t pm_config = { + .max_freq_mhz = CONFIG_EXAMPLE_MAX_CPU_FREQ_MHZ, + .min_freq_mhz = CONFIG_EXAMPLE_MIN_CPU_FREQ_MHZ, +#if CONFIG_FREERTOS_USE_TICKLESS_IDLE + // SDIO currently does not work with auto light sleep + //.light_sleep_enable = true + .light_sleep_enable = false +#endif + }; + ESP_ERROR_CHECK( esp_pm_configure(&pm_config) ); + ESP_ERROR_CHECK( ret ); + +#else + printf("\n =================================================\n"); + printf(" | Test WiFi 6 itwt |\n"); + printf(" =================================================\n\n"); + + esp_console_repl_t *repl = NULL; + esp_console_repl_config_t repl_config = ESP_CONSOLE_REPL_CONFIG_DEFAULT(); + repl_config.prompt = "itwt>"; + + // init console REPL environment +#if CONFIG_ESP_CONSOLE_UART + esp_console_dev_uart_config_t uart_config = ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_console_new_repl_uart(&uart_config, &repl_config, &repl)); +#elif CONFIG_ESP_CONSOLE_USB_CDC + esp_console_dev_usb_cdc_config_t cdc_config = ESP_CONSOLE_DEV_CDC_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_console_new_repl_usb_cdc(&cdc_config, &repl_config, &repl)); +#elif CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG + esp_console_dev_usb_serial_jtag_config_t usbjtag_config = ESP_CONSOLE_DEV_USB_SERIAL_JTAG_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_console_new_repl_usb_serial_jtag(&usbjtag_config, &repl_config, &repl)); +#endif + + // start console REPL + ESP_ERROR_CHECK(esp_console_start_repl(repl)); +#endif + + //start wifi + wifi_itwt(); + // register commands + register_system(); + register_wifi_itwt(); + register_wifi_stats(); + +} diff --git a/examples/host_wifi_itwt/main/wifi_cmd.h b/examples/host_wifi_itwt/main/wifi_cmd.h new file mode 100644 index 00000000..ab91396c --- /dev/null +++ b/examples/host_wifi_itwt/main/wifi_cmd.h @@ -0,0 +1,18 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +void register_wifi_itwt(void); +void register_wifi_stats(void); + +#ifdef __cplusplus +} +#endif diff --git a/examples/host_wifi_itwt/main/wifi_itwt_cmd.c b/examples/host_wifi_itwt/main/wifi_itwt_cmd.c new file mode 100644 index 00000000..97e89352 --- /dev/null +++ b/examples/host_wifi_itwt/main/wifi_itwt_cmd.c @@ -0,0 +1,259 @@ +/* + * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include "esp_log.h" +#include "freertos/FreeRTOS.h" +#include "freertos/event_groups.h" + +#if CONFIG_SOC_WIFI_HE_SUPPORT || CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT + +#include "esp_console.h" +#include "argtable3/argtable3.h" +#include "esp_netif.h" +#include "esp_event.h" +#include "esp_wifi.h" +#include "esp_wifi_he.h" + +/******************************************************* + * Constants + *******************************************************/ +static const char *TAG = "twt"; + +/******************************************************* + * Structures + *******************************************************/ +typedef struct { + struct arg_int *setup; + struct arg_lit *teardown; + struct arg_lit *suspend; + struct arg_lit *getflowid; + struct arg_int *waketimeoffset; + struct arg_int *trigger; //1-trigger-enabled, 0-non-trigger-enabled, setup + struct arg_int *flowtype; //1-unannounced, 0-announced, setup + struct arg_int *negtype; + struct arg_int *wakeinvlexp; //setup + struct arg_int *wakeduraunit; //1-TU, 0-256us + struct arg_int *wakeinvlman; //setup + struct arg_int *minwakedur; //setup + struct arg_int *flowid; + struct arg_int *twtid; + struct arg_int *setup_timeout_time_ms; + struct arg_int *suspend_time_ms; + struct arg_int *all_twt; + struct arg_end *end; +} wifi_itwt_args_t; + +typedef struct { + struct arg_int *timeout; + struct arg_end *end; +} wifi_itwt_send_probereq_t; + +/******************************************************* + * Variable Definitions + *******************************************************/ +static wifi_itwt_args_t itwt_args; +static wifi_itwt_send_probereq_t itwt_probe_args; + +/******************************************************* + * Function Declarations + *******************************************************/ + +/******************************************************* + * Function Definitions + *******************************************************/ +static int wifi_cmd_itwt(int argc, char **argv) +{ + int nerrors = arg_parse(argc, argv, (void **) &itwt_args); + if (nerrors != 0) { + arg_print_errors(stderr, itwt_args.end, argv[0]); + return 1; + } + + esp_err_t err = ESP_OK; + if (itwt_args.setup->count) { + if (itwt_args.wakeinvlman->count) { + if (itwt_args.wakeinvlman->ival[0] < 0 || itwt_args.wakeinvlman->ival[0] > 65535) { + ESP_LOGE(TAG, "(itwt)expect [0, 65535], wake_invl_mant: %d", itwt_args.wakeinvlman->ival[0]); + return 1; + } + } + if (itwt_args.wakeinvlexp->count) { + if (itwt_args.wakeinvlexp->ival[0] < 0 || itwt_args.wakeinvlexp->ival[0] > 31) { + ESP_LOGE(TAG, "(itwt)expect [0, 31], wake_invl_expn: %d", itwt_args.wakeinvlexp->ival[0]); + return 1; + } + } + if (itwt_args.minwakedur->count) { + if (itwt_args.minwakedur->ival[0] < 0 || itwt_args.minwakedur->ival[0] > 255) { + ESP_LOGE(TAG, "(itwt)expect [0, 255], min_wake_dura: %d", itwt_args.minwakedur->ival[0]); + return 1; + } + } + if (itwt_args.wakeduraunit->count) { + if (itwt_args.wakeduraunit->ival[0] < 0 || itwt_args.wakeduraunit->ival[0] > 1) { + ESP_LOGE(TAG, "(itwt)expect [0, 1], wake duration unit: %d", itwt_args.wakeduraunit->ival[0]); + return 1; + } + } + if (itwt_args.twtid->count) { + if (itwt_args.twtid->ival[0] < 0 || itwt_args.twtid->ival[0] > 32767) { + ESP_LOGE(TAG, "(itwt)expect [0, 32767], twt id: %d", itwt_args.twtid->ival[0]); + return 1; + } + } + if (itwt_args.setup_timeout_time_ms->count) { + if (itwt_args.setup_timeout_time_ms->ival[0] < 0 || itwt_args.setup_timeout_time_ms->ival[0] > 65535) { + ESP_LOGE(TAG, "(itwt)expect [0, 65535], setup timeout time: %d", itwt_args.setup_timeout_time_ms->ival[0]); + return 1; + } + } + wifi_twt_setup_config_t setup_config = { + .setup_cmd = (itwt_args.setup->ival[0] <= TWT_DEMAND) ? itwt_args.setup->ival[0] : TWT_REQUEST, + .flow_id = itwt_args.flowid->count ? itwt_args.flowid->ival[0] : 0, + .twt_id = itwt_args.twtid->count ? itwt_args.twtid->ival[0] : 0, + .flow_type = itwt_args.flowtype->count ? ((itwt_args.flowtype->ival[0] == 0) ? 0 : 1) : 0, + .min_wake_dura = itwt_args.minwakedur->count ? itwt_args.minwakedur->ival[0] : 255, + .wake_duration_unit = itwt_args.wakeduraunit->count ? itwt_args.wakeduraunit->ival[0] : 0, + .wake_invl_expn = itwt_args.wakeinvlexp->count ? itwt_args.wakeinvlexp->ival[0] : 10, + .wake_invl_mant = itwt_args.wakeinvlman->count ? itwt_args.wakeinvlman->ival[0] : 512, + .trigger = itwt_args.trigger->count ? (itwt_args.trigger->ival[0] ? 1 : 0) : 1, + .timeout_time_ms = itwt_args.setup_timeout_time_ms->count ? itwt_args.setup_timeout_time_ms->ival[0] : 5000, + }; + err = esp_wifi_sta_itwt_setup(&setup_config); + ESP_LOGI(TAG, "(itwt)setup, trigger:%d, %s, flow_id:%d, err:0x%x", + setup_config.trigger, setup_config.flow_type ? "unannounce" : "announced", setup_config.flow_id, err); + if (err != ESP_OK) { + ESP_LOGE(TAG, "Error: %s", esp_err_to_name(err)); + } + } + if (itwt_args.teardown->count) { + // teardown a given flow id, all_twt has a high priority + int flow_id = itwt_args.flowid->count ? itwt_args.flowid->ival[0] : (-1); + bool all_twt = itwt_args.all_twt->count ? ((itwt_args.all_twt->ival[0] == 1) ? true : false) : false; + flow_id = (all_twt == true) ? FLOW_ID_ALL : flow_id; + ESP_LOGW(TAG, "flow_id %d", flow_id); + if (flow_id >= 0) { + err = esp_wifi_sta_itwt_teardown(flow_id); + ESP_LOGI(TAG, "(itwt)teardown, flow_id:%d, all_twt:%d, err:0x%x", flow_id, all_twt, err); + if (err != ESP_OK) { + ESP_LOGE(TAG, "Error: %s", esp_err_to_name(err)); + } + } else { + ESP_LOGE(TAG, "(itwt)teardown, should specify an existing flow id"); + } + } + if (itwt_args.suspend->count) { + // suspend a given flow id + int flow_id = itwt_args.flowid->count ? itwt_args.flowid->ival[0] : (-1); + bool all_twt = itwt_args.all_twt->count ? (itwt_args.all_twt->ival[0] ? true : false) : false; + flow_id = (all_twt == true) ? FLOW_ID_ALL : flow_id; + int suspend_time_ms = itwt_args.suspend_time_ms->count ? itwt_args.suspend_time_ms->ival[0] : 0; + if (flow_id >= 0) { + err = esp_wifi_sta_itwt_suspend(flow_id, suspend_time_ms); + ESP_LOGI(TAG, "(itwt)suspend, flow_id:%d, all_twt:%d, suspend:%d ms, err:0x%x", flow_id, all_twt, suspend_time_ms, err); + if (err != ESP_OK) { + ESP_LOGE(TAG, "Error: %s", esp_err_to_name(err)); + } + } else { + ESP_LOGE(TAG, "(itwt)suspend, should specify an existing flow id"); + } + } + if (itwt_args.getflowid->count) { + int flow_id_bitmap; + err = esp_wifi_sta_itwt_get_flow_id_status(&flow_id_bitmap); + if (err == ESP_OK) { + ESP_LOGI(TAG, "flowid bitmap: 0x%" PRIx16, flow_id_bitmap); + } else { + ESP_LOGE(TAG, "Error: %s", esp_err_to_name(err)); + } + } + if (itwt_args.waketimeoffset->count) { + int offset_us = itwt_args.waketimeoffset->ival[0]; + err = esp_wifi_sta_itwt_set_target_wake_time_offset(offset_us); + if (err != ESP_OK) { + ESP_LOGE(TAG, "Error: %s", esp_err_to_name(err)); + } + } + return 0; +} + +static int wifi_cmd_itwt_probe(int argc, char **argv) +{ + int nerrors = arg_parse(argc, argv, (void **) &itwt_probe_args); + if (nerrors != 0) { + arg_print_errors(stderr, itwt_probe_args.end, argv[0]); + return 1; + } + + esp_err_t err = ESP_OK; + if (itwt_probe_args.timeout->count) { + if (itwt_probe_args.timeout->ival[0] > 0) { + ESP_LOGI(TAG, "(itwt)send probe req, timeout:%d ms", itwt_probe_args.timeout->ival[0]); + err = esp_wifi_sta_itwt_send_probe_req(itwt_probe_args.timeout->ival[0]); + if (err != ESP_OK) { + ESP_LOGE(TAG, "Error: %s", esp_err_to_name(err)); + } + } else { + ESP_LOGE(TAG, "(itwt)invalid input, timeout:%d ms", itwt_probe_args.timeout->ival[0]); + } + } + ESP_LOGI(TAG, "err:0x%x", err); + return err; +} + +void register_wifi_itwt(void) +{ + /* itwt setup/teardown */ + itwt_args.setup = arg_int0(NULL, "setup", "", "twt setup/teardown an individual flow id"); + itwt_args.teardown = arg_lit0(NULL, "teardown", "twt setup/teardown an individual flow id"); + itwt_args.suspend = arg_lit0(NULL, "suspend", "twt setup/teardown an individual flow id"); + itwt_args.getflowid = arg_lit0(NULL, "getflowid", "get flow ids"); + itwt_args.waketimeoffset = arg_int0(NULL, "waketimeoffset", "", "set wake time offset (in us)"); + itwt_args.trigger = arg_int0("t", NULL, "", "trigger"); + itwt_args.flowtype = arg_int0("f", NULL, "", "flow type: 0-announced, 1-unannounced"); + itwt_args.negtype = arg_int0("n", NULL, "", "negotiate type"); + itwt_args.minwakedur = arg_int0("d", NULL, "", "Norminal Min. Wake Duration"); + itwt_args.wakeduraunit = arg_int0("u", NULL, "", "wake duration unit 0-256us, 1-TU (TU = 1024us)"); + itwt_args.wakeinvlexp = arg_int0("e", NULL, "", "Wake Interval Exponent"); + itwt_args.wakeinvlman = arg_int0("m", NULL, "", "Wake Interval Mantissa"); + itwt_args.flowid = arg_int0("i", NULL, "", "Flow ID"); + itwt_args.suspend_time_ms = arg_int0("s", NULL, "", "time of suspending iTWT agreements, unit ms"); + itwt_args.twtid = arg_int0("w", NULL, "", "TWT ID"); + itwt_args.setup_timeout_time_ms = arg_int0("u", NULL, "", "iTWT setup timeout time, unit ms"); + itwt_args.all_twt = arg_int0("a", NULL, "", "All TWT"); + itwt_args.end = arg_end(1); + const esp_console_cmd_t itwt_cmd = { + .command = "itwt", + .help = "itwt setup, teardown or suspend", + .hint = NULL, + .func = &wifi_cmd_itwt, + .argtable = &itwt_args + }; + ESP_ERROR_CHECK(esp_console_cmd_register(&itwt_cmd)); + + /* itwt probe */ + itwt_probe_args.timeout = arg_int0("t", NULL, "[timeout]", "time of sending a probe request frame and receiving a probe response frame from ap, unit ms"); + itwt_probe_args.end = arg_end(1); + const esp_console_cmd_t itwt_probe_cmd = { + .command = "probe", + .help = "send probe request for TSF update when at lease one itwt agreement setup", + .hint = NULL, + .func = &wifi_cmd_itwt_probe, + .argtable = &itwt_probe_args + }; + ESP_ERROR_CHECK(esp_console_cmd_register(&itwt_probe_cmd)); +} + +#else + +void register_wifi_itwt(void) +{ + ; +} + +#endif /* CONFIG_SOC_WIFI_HE_SUPPORT || CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT */ diff --git a/examples/host_wifi_itwt/main/wifi_stats_cmd.c b/examples/host_wifi_itwt/main/wifi_stats_cmd.c new file mode 100644 index 00000000..b3a9e10a --- /dev/null +++ b/examples/host_wifi_itwt/main/wifi_stats_cmd.c @@ -0,0 +1,584 @@ +/* + * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include "esp_log.h" + +#if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS || CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS + +#include "esp_console.h" +#include "argtable3/argtable3.h" +#include "esp_event.h" +#include "esp_wifi.h" +#include "esp_wifi_types.h" +#include "esp_private/esp_wifi_he_private.h" + +/******************************************************* + * Macros + *******************************************************/ +/* + * enable/disable rx/tx statistics after Wi-Fi started: + * (1) esp_wifi_enable_rx_statistics(true, true); //rx_stats=true, rx_mu_stats=true + * (2) esp_wifi_enable_tx_statistics(ESP_WIFI_ACI_BE, true); //aci=ESP_WIFI_ACI_BE, tx_stats=true + */ + +/******************************************************* + * Constants + *******************************************************/ +static const char *TAG = "stats"; + +/******************************************************* + * Structures + *******************************************************/ + +/******************************************************* + * Variable Definitions + *******************************************************/ +#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_MU_STATS +esp_test_rx_mu_statistics_t rx_mu_stats = { 0, }; //10932 bytes +#endif + +/******************************************************* + * Function Declarations + *******************************************************/ + +/******************************************************* + * Function Definitions + *******************************************************/ +const char *tx_fail_error2str(esp_test_tx_fail_error_t error) +{ + switch (error) { + case TEST_TX_FAIL_ERROR_H00: + return "0x00"; + case TEST_TX_FAIL_ERROR_H53: + return "0x53"; + case TEST_TX_FAIL_ERROR_H63: + return "0x63"; + case TEST_TX_FAIL_ERROR_H75: + return "0x75"; + case TEST_TX_FAIL_ERROR_H41: + return "0x41"; + case TEST_TX_FAIL_ERROR_H42: + return "0x42"; + case TEST_TX_FAIL_ERROR_H47: + return "0x47"; + case TEST_TX_FAIL_ERROR_H80: + return "0x80"; + case TEST_TX_FAIL_ERROR_H5A: + return "0x5A"; + case TEST_TX_FAIL_ERROR_HXX: + return "Others"; + case TEST_TX_FAIL_ERROR_MAX: + return "Undefined"; + } + return "Undefined"; +} + +const char *tx_fail_match2str(esp_test_tx_fail_match_t match) +{ + switch (match) { + case TEST_TX_WAIT_MATCH: + return "MATCH"; + case TEST_TX_WAIT_NOT2SELF: + return "NOT2SELF"; + case TEST_TX_MISMATCH: + return "MISMATCH"; + case TEST_TX_WAIT_TIMEOUT: + return "TIMEOUT"; + case TEST_TX_WAIT_MAX: + return "Undefined"; + } + return "Undefined"; +} + +const char *tx_fail_state2str(esp_test_tx_fail_state_t state) +{ + switch (state) { + case TEST_TX_SUCCESS: + return "TX Success"; + case TEST_TX_FAIL_RTS: + return "TX RTS"; + case TEST_TX_WAIT_CTS: //RX + return "Wait CTS"; + case TEST_TX_FAIL_CTS: + return "TX RTS"; + case TEST_TX_FAIL_DATA: + return "TX DATA"; + case TEST_TX_WAIT_ACK: //RX + return "Wait ACK/BA"; + case TEST_TX_FAIL_MAX: + return "Undefined"; + } + return "Undefined"; +} + +int wifi_cmd_clr_tx_statistics(int argc, char **argv) +{ + ESP_LOGW(TAG, "Clear tx statistics"); + int i; + for (i = 0; i < 3; i++) { + esp_wifi_clr_tx_statistics(i); //BE + esp_wifi_clr_tx_tb_statistics(i); + } + esp_test_clr_hw_statistics(); + return 0; +} + +void print_hw_tb_statistics(void) +{ + esp_test_hw_tb_statistics_t hw_tb_stats = { 0, }; + esp_test_get_hw_tb_statistics(&hw_tb_stats); + printf("(test)rx_trig:%d, tx_bfrpt:%d, tb_times:%d, tb_qos_null:%d, tb_qos_data:%d, tb_cca_cancel:%d, tb_sifs_abort:%d, tb_pwr_outof_range:%d\n", + hw_tb_stats.rx_trig, + hw_tb_stats.tx_bfrpt, //including TB and Non-TB + hw_tb_stats.tb_times, + hw_tb_stats.tb_qos_null, + hw_tb_stats.tb_times - hw_tb_stats.tb_qos_null, + hw_tb_stats.tb_cca_cancel, + hw_tb_stats.tb_sifs_abort, + hw_tb_stats.tb_pwr_outof_range); +} + +int wifi_cmd_get_tx_statistics(int argc, char **argv) +{ + uint8_t i, h, j, k; + + ESP_LOGW(TAG, "Get tx statistics"); + esp_test_tx_tb_statistics_t tb_stats = { 0, }; //32 bytes + esp_test_tx_statistics_t tx_stats = { 0, }; //136 bytes + esp_test_tx_fail_statistics_t tx_fail[TEST_TX_FAIL_MAX] = { 0, }; //TEST_TX_FAIL_MAX * 164 bytes + + print_hw_tb_statistics(); + //only check BE + for (i = 2; i < 3; i++) { + esp_wifi_get_tx_tb_statistics(i, &tb_stats); + /* TB */ + printf("(test)aci:%" PRIu8 ", tb(suc:%" PRIu32 ", ack:%" PRIu32 ", err:%" PRIu32 "), " + "count(suc:%" PRIu32 ", ack:%" PRIu32 ", err:%" PRIu32 ", tot:%" PRIu32 ", max_sent:%" PRIu32 ")\n", + i, + tb_stats.complete_suc_tb, + tb_stats.complete_ack_tb, + tb_stats.complete_err_tb, + tb_stats.complete_tb_suc_count, + tb_stats.complete_tb_ack_count, + tb_stats.complete_tb_err_count, + tb_stats.complete_tb_tot_count, + tb_stats.complete_tb_pack_sent); + + esp_wifi_get_tx_statistics(i, &tx_stats, (esp_test_tx_fail_statistics_t *) &tx_fail); + int tot_tx_times = tx_stats.tb_times + (tx_stats.tx_enable - tx_stats.tb_last); //TB + EDCA + int tot_fail = tx_fail[1].count + tx_fail[2].count + tx_fail[3].count + tx_fail[4].count + tx_fail[5].count; + printf("(test)aci:%" PRIu8 ", enable:%" PRIu32 ", complete:%" PRIu32 ", tb_times:%" PRIu32 ", tb_last:%" PRIu32 ", edca:%" PRIu32 ", " + "succ:%" PRIu32 ", fail(%" PRIu32 ",%" PRIu32 ",%" PRIu32 ", cts:%" PRIu32 "/%2.2f%%, ack:%" PRIu32 "/%2.2f%%, tot:%d, %.2f%%), " + "edca(ack:%" PRIu32 ", ba:%" PRIu32 "), tb(hw-ba:%" PRIu32 ", sw-ba:%" PRIu32 ")\n", + i, tx_stats.tx_enable, + tx_stats.tx_complete, + tx_stats.tb_times, + tx_stats.tb_last, + tx_stats.tx_enable - tx_stats.tb_last, + tx_fail[0].count, + tx_fail[1].count, + tx_fail[3].count, + tx_fail[4].count, + tx_fail[2].count, + (float) ((float) tx_fail[2].count / (float) tot_tx_times) * 100, //rx cts + tx_fail[5].count, (float) ((float) tx_fail[5].count / (float) tot_tx_times) * 100, //rx ack + tot_fail, + (float) ((float) tot_fail / (float) tot_tx_times) * 100, + tx_stats.rx_ack, + tx_stats.rx_ba, + tx_stats.tb_rx_ba, //including ACKs + tx_stats.rx_dump_ba); + + printf("(test)aci:%" PRIu8 ", txFrames:%" PRIu32 ", s-mpdu:%" PRIu32 "(%.2f%%), " + "bitmap(max:%d, min:%d, tot:%" PRIu32 ", avg:%.2f), " + "retry(edca:%" PRIu32 ", tb:%" PRIu32 ", %.2f%%), collision:%" PRIu32 ", timeout:%" PRIu32 "\n", + i, + tx_stats.tx_succ, + tx_stats.rx_ack, + ((float) (tx_stats.rx_ack) / (float) tot_tx_times) * 100, + tx_stats.rx_max_bitmap, + tx_stats.rx_min_bitmap, + tx_stats.rx_tot_bitmap, + (float) tx_stats.rx_tot_bitmap / (float) (tx_stats.tb_rx_ba + tx_stats.rx_ba), + tx_stats.retry_edca, tx_stats.retry_tb, (float) (tx_stats.retry_edca + tx_stats.retry_tb) / (float) tx_stats.tx_succ * 100, + tx_stats.collision, tx_stats.timeout); + + float tot_rtt_ms = (float) tx_stats.tx_tot_rtt / (float) 1000; + printf("(test)aci:%" PRIu8 ", seqno_rtt[%" PRIu32 ",%" PRIu32 "], hw_rtt[%" PRIu32 ", %" PRIu32 "], muedca[enable:%" PRIu32 ", times:%" PRIu32 ", %.2f, %.2f, tot:%.2f], avg:%.3f ms, tot:%.3f secs\n", + i, + tx_stats.tx_seq_min_rtt, + tx_stats.tx_seq_max_rtt, + tx_stats.tx_min_rtt, + tx_stats.tx_max_rtt, + tx_stats.tx_muedca_enable, + tx_stats.muedca_times, + (float) tx_stats.tx_min_muedca_time / (float) 1000, + (float) tx_stats.tx_max_muedca_time / (float) 1000, + (float) tx_stats.tx_tot_muedca_time / (float) 1000, //ms + (float) tot_rtt_ms / (float) tot_tx_times, //ms + (float) tot_rtt_ms / (float) 1000); //seconds + /* fail state */ + for (h = 1; h < TEST_TX_FAIL_MAX; h++) { //state + for (j = 0; j < TEST_TX_WAIT_MAX; j++) { //match + for (k = 0; k < TEST_TX_FAIL_ERROR_MAX; k++) { //error + if (tx_fail[h].match[j][k]) { + printf("(test)[%d][%d][%d](%16s + %16s + %16s)%3" PRIu32 "/%3" PRIu32 "(%.2f%%)\n", h, j, k, tx_fail_state2str(h), + tx_fail_match2str(j), tx_fail_error2str(k), + tx_fail[h].match[j][k], tx_fail[h].count, + ((float) tx_fail[h].match[j][k] / (float) tx_fail[h].count) * 100); + } + } + } + } + printf("\n"); + } + wifi_cmd_clr_tx_statistics(0, 0); + return 0; +} + +void print_rx_statistics_nonmimo(const esp_test_rx_mu_statistics_t *mu_stats) +{ + if (!mu_stats->nonmimo_rx) { + return; + } + + int i, j; + int tot_rx_nonmimo = 0; + ESP_LOGW(TAG, "(nonmimo)dut rx:%" PRIu32, mu_stats->nonmimo_rx); + ESP_LOGW(TAG, "(nonmimo)ru_alloc_96_num_2046:%" PRIu32 ", ru_alloc_112_num_2046:%" PRIu32, mu_stats->ru_alloc_96_num_2046, mu_stats->ru_alloc_112_num_2046); + ESP_LOGW(TAG, "(nonmimo)sigb, mcs0:%" PRIu32 "(%2.2f%%), mcs1:%" PRIu32 "(%2.2f%%), mcs2:%" PRIu32 "(%2.2f%%), mcs3:%" PRIu32 "(%2.2f%%), mcs4:%" PRIu32 "(%2.2f%%), mcs5:%" PRIu32 "(%2.2f%%)", + mu_stats->nonmimo_sigb_mcs[0], ((float) mu_stats->nonmimo_sigb_mcs[0] / (float) mu_stats->nonmimo_rx) * 100, + mu_stats->nonmimo_sigb_mcs[1], ((float) mu_stats->nonmimo_sigb_mcs[1] / (float) mu_stats->nonmimo_rx) * 100, + mu_stats->nonmimo_sigb_mcs[2], ((float) mu_stats->nonmimo_sigb_mcs[2] / (float) mu_stats->nonmimo_rx) * 100, + mu_stats->nonmimo_sigb_mcs[3], ((float) mu_stats->nonmimo_sigb_mcs[3] / (float) mu_stats->nonmimo_rx) * 100, + mu_stats->nonmimo_sigb_mcs[4], ((float) mu_stats->nonmimo_sigb_mcs[4] / (float) mu_stats->nonmimo_rx) * 100, + mu_stats->nonmimo_sigb_mcs[5], ((float) mu_stats->nonmimo_sigb_mcs[5] / (float) mu_stats->nonmimo_rx) * 100); + ESP_LOGW(TAG, "(nonmimo)users, num1:%" PRIu32 "(%2.2f%%), num2:%" PRIu32 "(%2.2f%%), num3:%" PRIu32 "(%2.2f%%), num4:%" PRIu32 "(%2.2f%%), num5:%" PRIu32 "(%2.2f%%), num6:%" PRIu32 "(%2.2f%%), num7:%" PRIu32 "(%2.2f%%), num8:%" PRIu32 "(%2.2f%%), num9:%" PRIu32 "(%2.2f%%)", + mu_stats->nonmimo_user_num_occu[0], ((float) mu_stats->nonmimo_user_num_occu[0] / (float) mu_stats->nonmimo_rx) * 100, + mu_stats->nonmimo_user_num_occu[1], ((float) mu_stats->nonmimo_user_num_occu[1] / (float) mu_stats->nonmimo_rx) * 100, + mu_stats->nonmimo_user_num_occu[2], ((float) mu_stats->nonmimo_user_num_occu[2] / (float) mu_stats->nonmimo_rx) * 100, + mu_stats->nonmimo_user_num_occu[3], ((float) mu_stats->nonmimo_user_num_occu[3] / (float) mu_stats->nonmimo_rx) * 100, + mu_stats->nonmimo_user_num_occu[4], ((float) mu_stats->nonmimo_user_num_occu[4] / (float) mu_stats->nonmimo_rx) * 100, + mu_stats->nonmimo_user_num_occu[5], ((float) mu_stats->nonmimo_user_num_occu[5] / (float) mu_stats->nonmimo_rx) * 100, + mu_stats->nonmimo_user_num_occu[6], ((float) mu_stats->nonmimo_user_num_occu[6] / (float) mu_stats->nonmimo_rx) * 100, + mu_stats->nonmimo_user_num_occu[7], ((float) mu_stats->nonmimo_user_num_occu[7] / (float) mu_stats->nonmimo_rx) * 100, + mu_stats->nonmimo_user_num_occu[8], ((float) mu_stats->nonmimo_user_num_occu[8] / (float) mu_stats->nonmimo_rx) * 100); + for (i = 0; i < 256; i++) { + for (j = 0; j < 9; j++) { + if (!mu_stats->nonmimo_ru_alloc[i][j]) { + continue; + } + ESP_LOGI(TAG, "(nonmimo)ru_allocation:0x%2x(%3" PRIu8 "), position:%" PRIu8 ", %5" PRIu32 "(%2.2f%%)", i, i, j + 1, mu_stats->nonmimo_ru_alloc[i][j], + ((float) mu_stats->nonmimo_ru_alloc[i][j] / (float) mu_stats->nonmimo_rx) * 100); + } + } + for (i = 0; i < ESP_TEST_RX_MU_USER_NUM; i++) { + if (!mu_stats->nonmimo[i].aid) { + continue; + } + if (mu_stats->aid != mu_stats->nonmimo[i].aid) { + continue; + } + tot_rx_nonmimo = mu_stats->nonmimo[i].occu_nsts[0] + mu_stats->nonmimo[i].occu_nsts[1] + mu_stats->nonmimo[i].occu_nsts[2] + mu_stats->nonmimo[i].occu_nsts[3]; + printf("[%" PRIu8 "]%said:0x%x, txbf:%" PRIu32 ", dcm:%" PRIu32 "\n", i, (mu_stats->aid == mu_stats->nonmimo[i].aid) ? "#" : " ", mu_stats->nonmimo[i].aid, + mu_stats->nonmimo[i].txbf, mu_stats->nonmimo[i].dcm); + printf("[%d]%said:0x%x, " + "mcs0:%" PRIu32 "(%2.2f%%), mcs1:%" PRIu32 "(%2.2f%%), mcs2:%" PRIu32 "(%2.2f%%), mcs3:%" PRIu32 "(%2.2f%%), mcs4:%" PRIu32 "(%2.2f%%), " + "mcs5:%" PRIu32 "(%2.2f%%), mcs6:%" PRIu32 "(%2.2f%%), mcs7:%" PRIu32 "(%2.2f%%), mcs8:%" PRIu32 "(%2.2f%%), mcs9:%" PRIu32 "(%2.2f%%), " + "mcs10:%" PRIu32 "(%2.2f%%), mcs11:%" PRIu32 "(%2.2f%%)\n", + i, (mu_stats->aid == mu_stats->nonmimo[i].aid) ? "#" : " ", mu_stats->nonmimo[i].aid, + mu_stats->nonmimo[i].occu_mcs[0], ((float) mu_stats->nonmimo[i].occu_mcs[0] / (float) tot_rx_nonmimo) * 100, + mu_stats->nonmimo[i].occu_mcs[1], ((float) mu_stats->nonmimo[i].occu_mcs[1] / (float) tot_rx_nonmimo) * 100, + mu_stats->nonmimo[i].occu_mcs[2], ((float) mu_stats->nonmimo[i].occu_mcs[2] / (float) tot_rx_nonmimo) * 100, + mu_stats->nonmimo[i].occu_mcs[3], ((float) mu_stats->nonmimo[i].occu_mcs[3] / (float) tot_rx_nonmimo) * 100, + mu_stats->nonmimo[i].occu_mcs[4], ((float) mu_stats->nonmimo[i].occu_mcs[4] / (float) tot_rx_nonmimo) * 100, + mu_stats->nonmimo[i].occu_mcs[5], ((float) mu_stats->nonmimo[i].occu_mcs[5] / (float) tot_rx_nonmimo) * 100, + mu_stats->nonmimo[i].occu_mcs[6], ((float) mu_stats->nonmimo[i].occu_mcs[6] / (float) tot_rx_nonmimo) * 100, + mu_stats->nonmimo[i].occu_mcs[7], ((float) mu_stats->nonmimo[i].occu_mcs[7] / (float) tot_rx_nonmimo) * 100, + mu_stats->nonmimo[i].occu_mcs[8], ((float) mu_stats->nonmimo[i].occu_mcs[8] / (float) tot_rx_nonmimo) * 100, + mu_stats->nonmimo[i].occu_mcs[9], ((float) mu_stats->nonmimo[i].occu_mcs[9] / (float) tot_rx_nonmimo) * 100, + mu_stats->nonmimo[i].occu_mcs[10], ((float) mu_stats->nonmimo[i].occu_mcs[10] / (float) tot_rx_nonmimo) * 100, + mu_stats->nonmimo[i].occu_mcs[11], ((float) mu_stats->nonmimo[i].occu_mcs[11] / (float) tot_rx_nonmimo) * 100); + printf("[%" PRIu8 "]%said:0x%x, " + "nsts0:%" PRIu32 "(%2.2f%%), nsts1:%" PRIu32 "(%2.2f%%), nsts2:%" PRIu32 "(%2.2f%%), nsts3:%" PRIu32 "(%2.2f%%)\n", + i, (mu_stats->aid == mu_stats->nonmimo[i].aid) ? "#" : " ", mu_stats->nonmimo[i].aid, + mu_stats->nonmimo[i].occu_nsts[0], ((float) mu_stats->nonmimo[i].occu_nsts[0] / (float) tot_rx_nonmimo) * 100, + mu_stats->nonmimo[i].occu_nsts[1], ((float) mu_stats->nonmimo[i].occu_nsts[1] / (float) tot_rx_nonmimo) * 100, + mu_stats->nonmimo[i].occu_nsts[2], ((float) mu_stats->nonmimo[i].occu_nsts[2] / (float) tot_rx_nonmimo) * 100, + mu_stats->nonmimo[i].occu_nsts[3], ((float) mu_stats->nonmimo[i].occu_nsts[3] / (float) tot_rx_nonmimo) * 100); + printf("[%" PRIu8 "]%said:0x%x, " + "tot_rx_nonmimo:%8d, sta/dut:%2.2f%%\n", + i, (mu_stats->aid == mu_stats->nonmimo[i].aid) ? "#" : " ", mu_stats->nonmimo[i].aid, + tot_rx_nonmimo, ((float) tot_rx_nonmimo / (float) mu_stats->nonmimo_rx) * 100); + } +} + +void print_rx_statistics_mimo(const esp_test_rx_mu_statistics_t *mu_stats) +{ + if (!mu_stats->mimo_rx) { + return; + } + + int i; + int tot_rx_mimo = 0; + ESP_LOGW(TAG, "(mimo)dut rx:%" PRIu32 "", mu_stats->mimo_rx); + ESP_LOGW(TAG, "(mimo)sigb, mcs0:%" PRIu32 "(%2.2f%%), mcs1:%" PRIu32 "(%2.2f%%), mcs2:%" PRIu32 "(%2.2f%%), mcs3:%" PRIu32 "(%2.2f%%), mcs4:%" PRIu32 "(%2.2f%%), mcs5:%" PRIu32 "(%2.2f%%)", + mu_stats->mimo_sigb_mcs[0], ((float) mu_stats->mimo_sigb_mcs[0] / (float) mu_stats->mimo_rx) * 100, + mu_stats->mimo_sigb_mcs[1], ((float) mu_stats->mimo_sigb_mcs[1] / (float) mu_stats->mimo_rx) * 100, + mu_stats->mimo_sigb_mcs[2], ((float) mu_stats->mimo_sigb_mcs[2] / (float) mu_stats->mimo_rx) * 100, + mu_stats->mimo_sigb_mcs[3], ((float) mu_stats->mimo_sigb_mcs[3] / (float) mu_stats->mimo_rx) * 100, + mu_stats->mimo_sigb_mcs[4], ((float) mu_stats->mimo_sigb_mcs[4] / (float) mu_stats->mimo_rx) * 100, + mu_stats->mimo_sigb_mcs[5], ((float) mu_stats->mimo_sigb_mcs[5] / (float) mu_stats->mimo_rx) * 100); + ESP_LOGW(TAG, "(mimo)users num2:%" PRIu32 "(%2.2f%%), num3:%" PRIu32 "(%2.2f%%), num4:%" PRIu32 "(%2.2f%%), num5:%" PRIu32 "(%2.2f%%), num6:%" PRIu32 "(%2.2f%%), num7:%" PRIu32 "(%2.2f%%), num8:%" PRIu32 "(%2.2f%%)", + mu_stats->mimo_user_num_occu[0], ((float) mu_stats->mimo_user_num_occu[0] / (float) mu_stats->mimo_rx) * 100, + mu_stats->mimo_user_num_occu[1], ((float) mu_stats->mimo_user_num_occu[1] / (float) mu_stats->mimo_rx) * 100, + mu_stats->mimo_user_num_occu[2], ((float) mu_stats->mimo_user_num_occu[2] / (float) mu_stats->mimo_rx) * 100, + mu_stats->mimo_user_num_occu[3], ((float) mu_stats->mimo_user_num_occu[3] / (float) mu_stats->mimo_rx) * 100, + mu_stats->mimo_user_num_occu[4], ((float) mu_stats->mimo_user_num_occu[4] / (float) mu_stats->mimo_rx) * 100, + mu_stats->mimo_user_num_occu[5], ((float) mu_stats->mimo_user_num_occu[5] / (float) mu_stats->mimo_rx) * 100, + mu_stats->mimo_user_num_occu[6], ((float) mu_stats->mimo_user_num_occu[6] / (float) mu_stats->mimo_rx) * 100); + for (i = 0; i < ESP_TEST_RX_MU_USER_NUM; i++) { + if (!mu_stats->mimo[i].aid) { + continue; + } + tot_rx_mimo = mu_stats->mimo[i].occu_ss[0] + mu_stats->mimo[i].occu_ss[1] + mu_stats->mimo[i].occu_ss[2] + mu_stats->mimo[i].occu_ss[3]; + printf("[%" PRIu8 "]%said:0x%x, " + "mcs0:%" PRIu32 "(%2.2f%%), mcs1:%" PRIu32 "(%2.2f%%), mcs2:%" PRIu32 "(%2.2f%%), mcs3:%" PRIu32 "(%2.2f%%), mcs4:%" PRIu32 "(%2.2f%%), " + "mcs5:%" PRIu32 "(%2.2f%%), mcs6:%" PRIu32 "(%2.2f%%), mcs7:%" PRIu32 "(%2.2f%%), mcs8:%" PRIu32 "(%2.2f%%), mcs9:%" PRIu32 "(%2.2f%%), " + "mcs10:%" PRIu32 "(%2.2f%%), mcs11:%" PRIu32 "(%2.2f%%)\n", + i, (mu_stats->aid == mu_stats->mimo[i].aid) ? "#" : " ", mu_stats->mimo[i].aid, + mu_stats->mimo[i].occu_mcs[0], ((float) mu_stats->mimo[i].occu_mcs[0] / (float) tot_rx_mimo) * 100, + mu_stats->mimo[i].occu_mcs[1], ((float) mu_stats->mimo[i].occu_mcs[1] / (float) tot_rx_mimo) * 100, + mu_stats->mimo[i].occu_mcs[2], ((float) mu_stats->mimo[i].occu_mcs[2] / (float) tot_rx_mimo) * 100, + mu_stats->mimo[i].occu_mcs[3], ((float) mu_stats->mimo[i].occu_mcs[3] / (float) tot_rx_mimo) * 100, + mu_stats->mimo[i].occu_mcs[4], ((float) mu_stats->mimo[i].occu_mcs[4] / (float) tot_rx_mimo) * 100, + mu_stats->mimo[i].occu_mcs[5], ((float) mu_stats->mimo[i].occu_mcs[5] / (float) tot_rx_mimo) * 100, + mu_stats->mimo[i].occu_mcs[6], ((float) mu_stats->mimo[i].occu_mcs[6] / (float) tot_rx_mimo) * 100, + mu_stats->mimo[i].occu_mcs[7], ((float) mu_stats->mimo[i].occu_mcs[7] / (float) tot_rx_mimo) * 100, + mu_stats->mimo[i].occu_mcs[8], ((float) mu_stats->mimo[i].occu_mcs[8] / (float) tot_rx_mimo) * 100, + mu_stats->mimo[i].occu_mcs[9], ((float) mu_stats->mimo[i].occu_mcs[9] / (float) tot_rx_mimo) * 100, + mu_stats->mimo[i].occu_mcs[10], ((float) mu_stats->mimo[i].occu_mcs[10] / (float) tot_rx_mimo) * 100, + mu_stats->mimo[i].occu_mcs[11], ((float) mu_stats->mimo[i].occu_mcs[11] / (float) tot_rx_mimo) * 100); + printf("[%" PRIu8 "]%said:0x%x, " + "ss0:%" PRIu32 "(%2.2f%%), ss1:%" PRIu32 "(%2.2f%%), ss2:%" PRIu32 "(%2.2f%%), ss3:%" PRIu32 "(%2.2f%%)\n", + i, (mu_stats->aid == mu_stats->mimo[i].aid) ? "#" : " ", mu_stats->mimo[i].aid, + mu_stats->mimo[i].occu_ss[0], ((float) mu_stats->mimo[i].occu_ss[0] / (float) tot_rx_mimo) * 100, + mu_stats->mimo[i].occu_ss[1], ((float) mu_stats->mimo[i].occu_ss[1] / (float) tot_rx_mimo) * 100, + mu_stats->mimo[i].occu_ss[2], ((float) mu_stats->mimo[i].occu_ss[2] / (float) tot_rx_mimo) * 100, + mu_stats->mimo[i].occu_ss[3], ((float) mu_stats->mimo[i].occu_ss[3] / (float) tot_rx_mimo) * 100); + printf("[%" PRIu8 "]%said:0x%x, " + "tot_rx_mimo:%8d, sta/dut:%2.2f%%\n", + i, (mu_stats->aid == mu_stats->mimo[i].aid) ? "#" : " ", mu_stats->mimo[i].aid, + tot_rx_mimo, ((float) tot_rx_mimo / (float) mu_stats->mimo_rx) * 100); + } +} + +void print_hw_rx_statistics(void) +{ + esp_test_hw_rx_statistics_t hw_rx_stats = { 0, }; + esp_test_get_hw_rx_statistics(&hw_rx_stats); + printf( + "WDEVRX_FCS_ERR :%d\n" + "WDEVRX_ABORT :%d\n" + "WDEVRX_ABORT_FCS_PASS :%d\n" + "NRX_ERR_PWRDROP :%d\n" + "NRX_HESIGB_ERR :%d\n" + "WDEVRX_SAMEBM_ERRCNT :%d\n" + "WDEVRX_MPDU :%d\n" + "WDEVRX_END_CNT :%d\n" + "WDEVRX_DATASUC :%d\n" + "WDEVRX_LASTUNMATCH_ERR :%d\n" + "RXHUNG_STATIS :%d\n" + "TXHUNG_STATIS :%d\n" + "RXTXHUNG :%" PRIu32 "\n" + "WDEVRX_CFO :%d\n" + "WDEVRX_SF :%d\n" + "WDEVRX_OTHER_UCAST :%d\n" + "WDEVRX_BUF_FULLCNT :%d\n" + "WDEVRX_FIFO_OVFCNT :%d\n" + "WDEVRX_TKIP_ERRCNT :%d\n" + "WDEVRX_BTBLOCK_ERR :%d\n" + "WDEVRX_FREQHOP_ERR :%d\n" + "WDEVRX_ACK_INT_CNT :%d\n" + "WDEVRX_RTS_INT_CNT :%d\n" + "BRX_ERR_AGC :%d\n" + "BRX_ERR :%d\n" + "NRX_ERR :%d\n" + "NRX_ERR_ABORT :%d\n" + "NRX_ERR_AGCEXIT :%d\n" + "NRX_ERR_BBOFF :%d\n" + "NRX_ERR_FDM_WDG :%d\n" + "NRX_ERR_RESTART :%d\n" + "NRX_ERR_SERV :%d\n" + "NRX_ERR_TXOVER :%d\n" + "NRX_HE_UNSUPPORT :%d\n" + "NRX_HTSIG_ERR :%d\n" + "NRX_HEUNSUPPORT :%d\n" + "NRX_HESIGA_CRC :%d\n", + hw_rx_stats.rx_fcs_err, + hw_rx_stats.rx_abort, + hw_rx_stats.rx_abort_fcs_pass, + hw_rx_stats.nrx_err_pwrdrop, + hw_rx_stats.nrx_hesigb_err, + hw_rx_stats.rx_samebm_errcnt, + hw_rx_stats.rx_mpdu, + hw_rx_stats.rx_end_cnt, + hw_rx_stats.rx_datasuc, + hw_rx_stats.rx_lastunmatch_err, + hw_rx_stats.rxhung_statis, + hw_rx_stats.txhung_statis, + hw_rx_stats.rxtxhung, + hw_rx_stats.rx_cfo_hz, + hw_rx_stats.rx_sf, + hw_rx_stats.rx_other_ucast, + hw_rx_stats.rx_buf_fullcnt, + hw_rx_stats.rx_fifo_ovfcnt, + hw_rx_stats.rx_tkip_errcnt, + hw_rx_stats.rx_btblock_err, + hw_rx_stats.rx_freqhop_err, + hw_rx_stats.rx_ack_int_cnt, + hw_rx_stats.rx_rts_int_cnt, + hw_rx_stats.brx_err_agc, + hw_rx_stats.brx_err, + hw_rx_stats.nrx_err, + hw_rx_stats.nrx_err_abort, + hw_rx_stats.nrx_err_agcexit, + hw_rx_stats.nrx_err_bboff, + hw_rx_stats.nrx_err_fdm_wdg, + hw_rx_stats.nrx_err_restart, + hw_rx_stats.nrx_err_serv, + hw_rx_stats.nrx_err_txover, + hw_rx_stats.nrx_err_unsupport, + hw_rx_stats.nrx_htsig_err, + hw_rx_stats.nrx_heunsupport, + hw_rx_stats.nrx_hesiga_crc + ); +} + +int wifi_cmd_clr_rx_statistics(int argc, char **argv) +{ + ESP_LOGW(TAG, "Clear rx statistics"); + esp_wifi_clr_rx_statistics(0); + esp_wifi_clr_rx_statistics(7); +#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_MU_STATS + esp_test_clr_rx_error_occurs(); + esp_wifi_clr_rx_mu_statistics(); +#endif + esp_test_clr_hw_statistics(); + return 0; +} + +void print_rx_mu_statistics(void) +{ + /* mu */ + esp_wifi_get_rx_mu_statistics(&rx_mu_stats); + /* MIMO */ + print_rx_statistics_mimo(&rx_mu_stats); + /* non-MIMO */ + print_rx_statistics_nonmimo(&rx_mu_stats); +} + +int wifi_cmd_get_rx_statistics(int argc, char **argv) +{ + ESP_LOGW(TAG, "Get rx statistics"); + esp_test_rx_statistics_t rx_stats = { 0, }; + esp_test_rx_error_occurs_t rx_error_occurs = { 0, }; + + esp_wifi_get_rx_statistics(0, &rx_stats); //tid=0 + print_hw_tb_statistics(); + + ESP_LOGW(TAG, "(0)legacy:%" PRIu32 ", ht(ht:%" PRIu32 ", ht_retry:%" PRIu32 "/%2.2f%%, ht_noeb:%" PRIu32 "/%2.2f%%)", + rx_stats.legacy, + rx_stats.ht, rx_stats.ht_retry, + rx_stats.ht_retry ? ((float) ((float) rx_stats.ht_retry / (float) rx_stats.ht) * 100) : 0, + rx_stats.ht_noeb, rx_stats.ht_noeb ? ((float) ((float) rx_stats.ht_noeb / (float) rx_stats.ht) * 100) : 0); + ESP_LOGW(TAG, "(0)su(su:%" PRIu32 ", su_txbf:%" PRIu32 ", su_stbc:%" PRIu32 ", su_retry:%" PRIu32 "/%2.2f%%, ersu:%" PRIu32 ", ersu_dcm:%" PRIu32 ", su_noeb:%" PRIu32 "/%2.2f%%)", + rx_stats.su, + rx_stats.su_txbf, rx_stats.su_stbc, + rx_stats.su_retry, + rx_stats.su_retry ? ((float) ((float) rx_stats.su_retry / (float) rx_stats.su) * 100) : 0, + rx_stats.ersu, + rx_stats.ersu_dcm, + rx_stats.su_noeb, rx_stats.su_noeb ? ((float) ((float) rx_stats.su_noeb / (float) rx_stats.su) * 100) : 0); + ESP_LOGW(TAG, "(0)mu(mu:%" PRIu32 ", mimo:%" PRIu32 ", non-mimo:%" PRIu32 ", txbf:%" PRIu32 ", stbc:%" PRIu32 ", mu_retry:%" PRIu32 "/%2.2f%%, mu_noeb:%" PRIu32 "/%2.2f%%)", + rx_stats.mu, + rx_stats.mu_mimo, + rx_stats.mu_ofdma, rx_stats.mu_txbf, rx_stats.mu_stbc, + rx_stats.mu_retry, + rx_stats.mu_retry ? ((float) ((float) rx_stats.mu_retry / (float) rx_stats.mu) * 100) : 0, + rx_stats.mu_noeb, rx_stats.mu_noeb ? ((float) ((float) rx_stats.mu_noeb / (float) rx_stats.mu) * 100) : 0); + + memset(&rx_stats, 0, sizeof(rx_stats)); + esp_wifi_get_rx_statistics(7, &rx_stats); //tid=7 + ESP_LOGW(TAG, "(7)legacy:%" PRIu32 ", ht:%" PRIu32 ", su:%" PRIu32 ", su_txbf:%" PRIu32 ", ersu:%" PRIu32 ", mu:%" PRIu32, rx_stats.legacy, + rx_stats.ht, rx_stats.su, rx_stats.su_txbf, rx_stats.ersu, rx_stats.mu); + ESP_LOGW(TAG, "(hw)isr:%" PRIu32 ", nblks:%" PRIu32, rx_stats.rx_isr, rx_stats.rx_nblks); + /* hw rx statistics */ + print_hw_rx_statistics(); +#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_MU_STATS + print_rx_mu_statistics(); +#endif + esp_test_get_rx_error_occurs(&rx_error_occurs); + ESP_LOGW(TAG, "(rx)tot_errors:%" PRIu32, rx_error_occurs.tot); + int known_errors = 0; //rx error: 0x40-0xff + int i; + for (i = 0; i < 2; i++) { + if (rx_error_occurs.occurs[i]) { + known_errors += rx_error_occurs.occurs[i]; + printf("[%3d] 0x%x, %8" PRIu32 ", %2.2f%%\n", i, (i ? 0xf5 : 0xc6), rx_error_occurs.occurs[i], ((float) rx_error_occurs.occurs[i] / (float) rx_error_occurs.tot) * 100); + } + } + if (rx_error_occurs.tot - known_errors) { + printf("[%3d]others, %8" PRIu32 ", %2.2f%%\n\n", i, rx_error_occurs.tot - known_errors, ((float) known_errors / (float) rx_error_occurs.tot) * 100); + } + wifi_cmd_clr_rx_statistics(0, 0); + return 0; +} + +#endif /* CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS || CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS */ + +void register_wifi_stats(void) +{ +#if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS + /* get tx statistics */ + const esp_console_cmd_t tx_stats_cmd = { + .command = "tx", + .help = "get tx statistics", + .hint = NULL, + .func = &wifi_cmd_get_tx_statistics, + }; + ESP_ERROR_CHECK(esp_console_cmd_register(&tx_stats_cmd)); + /* clear tx statistics */ + const esp_console_cmd_t clr_cmd = { + .command = "clrtx", + .help = "clear tx statistics", + .hint = NULL, + .func = &wifi_cmd_clr_tx_statistics, + }; + ESP_ERROR_CHECK(esp_console_cmd_register(&clr_cmd)); +#endif + +#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS + /* get rx statistics */ + const esp_console_cmd_t rx_stats_cmd = { + .command = "rx", + .help = "get rx statistics", + .hint = NULL, + .func = &wifi_cmd_get_rx_statistics, + }; + ESP_ERROR_CHECK(esp_console_cmd_register(&rx_stats_cmd)); + /* clear rx statistics */ + const esp_console_cmd_t clr_rx_cmd = { + .command = "clrrx", + .help = "clear rx statistics", + .hint = NULL, + .func = &wifi_cmd_clr_rx_statistics, + }; + ESP_ERROR_CHECK(esp_console_cmd_register(&clr_rx_cmd)); +#endif +} diff --git a/examples/host_wifi_itwt/sdkconfig.defaults b/examples/host_wifi_itwt/sdkconfig.defaults new file mode 100644 index 00000000..dfa88a13 --- /dev/null +++ b/examples/host_wifi_itwt/sdkconfig.defaults @@ -0,0 +1,19 @@ +# Use lower CPU frequency +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80=y +# Enable support for power management +CONFIG_PM_ENABLE=y +# Enable tickless idle mode +CONFIG_FREERTOS_USE_TICKLESS_IDLE=y +# Put related source code in IRAM +CONFIG_PM_SLP_IRAM_OPT=y +CONFIG_PM_RTOS_IDLE_OPT=y +# Disable all GPIO at light sleep +CONFIG_PM_SLP_DISABLE_GPIO=y +# Enable wifi sleep iram optimization +CONFIG_ESP_WIFI_SLP_IRAM_OPT=y + +CONFIG_LWIP_ESP_GRATUITOUS_ARP=n + +CONFIG_FREERTOS_HZ=1000 +# CONFIG_LWIP_ESP_GRATUITOUS_ARP is not set +# CONFIG_ESP_GRATUITOUS_ARP is not set diff --git a/examples/host_wifi_itwt/sdkconfig.defaults.esp32p4 b/examples/host_wifi_itwt/sdkconfig.defaults.esp32p4 new file mode 100644 index 00000000..be159a6d --- /dev/null +++ b/examples/host_wifi_itwt/sdkconfig.defaults.esp32p4 @@ -0,0 +1 @@ +CONFIG_EXAMPLE_MAX_CPU_FREQ_90=y diff --git a/host/api/include/esp_hosted_api.h b/host/api/include/esp_hosted_api.h deleted file mode 100644 index be50610d..00000000 --- a/host/api/include/esp_hosted_api.h +++ /dev/null @@ -1,105 +0,0 @@ -/* -* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD -* -* SPDX-License-Identifier: Apache-2.0 -*/ - -/** prevent recursive inclusion **/ -#ifndef __ESP_HOSTED_API_H__ -#define __ESP_HOSTED_API_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/** Includes **/ -#include "stdbool.h" -#include "esp_wifi.h" -#include "esp_wifi_remote.h" -#include "esp_hosted_api_types.h" - -/** Exported variables **/ -#define ESP_HOSTED_CHANNEL_CONFIG_DEFAULT() { \ - .secure = true, \ -} - -struct esp_remote_channel_config { - int if_type; // values should be of esp_hosted_if_type_t - bool secure; -}; - -/** Inline functions **/ - -/** Exported Functions **/ -esp_err_t esp_hosted_init(void); -esp_err_t esp_hosted_deinit(void); -esp_err_t esp_hosted_reinit(void); - -esp_err_t esp_hosted_setup(void); -esp_err_t esp_hosted_slave_reset(void); -esp_remote_channel_t esp_hosted_add_channel(esp_remote_channel_config_t config, - esp_remote_channel_tx_fn_t *tx, const esp_remote_channel_rx_fn_t rx); -esp_err_t esp_hosted_remove_channel(esp_remote_channel_t channel); - -esp_err_t esp_wifi_remote_init(const wifi_init_config_t *arg); -esp_err_t esp_wifi_remote_deinit(void); -esp_err_t esp_wifi_remote_set_mode(wifi_mode_t mode); -esp_err_t esp_wifi_remote_get_mode(wifi_mode_t* mode); -esp_err_t esp_wifi_remote_start(void); -esp_err_t esp_wifi_remote_stop(void); -esp_err_t esp_wifi_remote_connect(void); -esp_err_t esp_wifi_remote_disconnect(void); -esp_err_t esp_wifi_remote_set_config(wifi_interface_t interface, wifi_config_t *conf); -esp_err_t esp_wifi_remote_get_config(wifi_interface_t interface, wifi_config_t *conf); -esp_err_t esp_wifi_remote_get_mac(wifi_interface_t mode, uint8_t mac[6]); -esp_err_t esp_wifi_remote_set_mac(wifi_interface_t mode, const uint8_t mac[6]); - -esp_err_t esp_wifi_remote_scan_start(const wifi_scan_config_t *config, bool block); -esp_err_t esp_wifi_remote_scan_stop(void); -esp_err_t esp_wifi_remote_scan_get_ap_num(uint16_t *number); -esp_err_t esp_wifi_remote_scan_get_ap_record(wifi_ap_record_t *ap_record); -esp_err_t esp_wifi_remote_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records); -esp_err_t esp_wifi_remote_clear_ap_list(void); -esp_err_t esp_wifi_remote_restore(void); -esp_err_t esp_wifi_remote_clear_fast_connect(void); -esp_err_t esp_wifi_remote_deauth_sta(uint16_t aid); -esp_err_t esp_wifi_remote_sta_get_ap_info(wifi_ap_record_t *ap_info); -esp_err_t esp_wifi_remote_set_ps(wifi_ps_type_t type); -esp_err_t esp_wifi_remote_get_ps(wifi_ps_type_t *type); -esp_err_t esp_wifi_remote_set_storage(wifi_storage_t storage); -esp_err_t esp_wifi_remote_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw); -esp_err_t esp_wifi_remote_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw); -esp_err_t esp_wifi_remote_set_channel(uint8_t primary, wifi_second_chan_t second); -esp_err_t esp_wifi_remote_get_channel(uint8_t *primary, wifi_second_chan_t *second); -esp_err_t esp_wifi_remote_set_country_code(const char *country, bool ieee80211d_enabled); -esp_err_t esp_wifi_remote_get_country_code(char *country); -esp_err_t esp_wifi_remote_set_country(const wifi_country_t *country); -esp_err_t esp_wifi_remote_get_country(wifi_country_t *country); -esp_err_t esp_wifi_remote_ap_get_sta_list(wifi_sta_list_t *sta); -esp_err_t esp_wifi_remote_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid); -esp_err_t esp_wifi_remote_sta_get_rssi(int *rssi); -esp_err_t esp_wifi_remote_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap); -esp_err_t esp_wifi_remote_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap); -esp_err_t esp_wifi_remote_set_max_tx_power(int8_t power); -esp_err_t esp_wifi_remote_get_max_tx_power(int8_t *power); -esp_err_t esp_wifi_remote_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode); -esp_err_t esp_wifi_remote_sta_get_aid(uint16_t *aid); -esp_err_t esp_hosted_slave_ota(const char* image_url); -esp_err_t esp_hosted_get_coprocessor_fwversion(esp_hosted_coprocessor_fwver_t *ver_info); - -#if H_WIFI_DUALBAND_SUPPORT -esp_err_t esp_wifi_remote_set_band(wifi_band_t band); -esp_err_t esp_wifi_remote_get_band(wifi_band_t *band); -esp_err_t esp_wifi_remote_set_band_mode(wifi_band_mode_t band_mode); -esp_err_t esp_wifi_remote_get_band_mode(wifi_band_mode_t *band_mode); -esp_err_t esp_wifi_remote_set_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols); -esp_err_t esp_wifi_remote_get_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols); -esp_err_t esp_wifi_remote_set_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw); -esp_err_t esp_wifi_remote_get_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw); -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/host/api/include/esp_hosted_api_types.h b/host/api/include/esp_hosted_api_types.h index 26740d75..f5ccc54b 100644 --- a/host/api/include/esp_hosted_api_types.h +++ b/host/api/include/esp_hosted_api_types.h @@ -1,5 +1,5 @@ /* -* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -8,6 +8,8 @@ #ifndef __ESP_HOSTED_API_TYPES_H__ #define __ESP_HOSTED_API_TYPES_H__ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/host/api/include/esp_hosted_config.h b/host/api/include/esp_hosted_config.h deleted file mode 100644 index f1053e1a..00000000 --- a/host/api/include/esp_hosted_config.h +++ /dev/null @@ -1,386 +0,0 @@ -/* -* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD -* -* SPDX-License-Identifier: Apache-2.0 -*/ - -#ifndef __ESP_HOSTED_CONFIG_H__ -#define __ESP_HOSTED_CONFIG_H__ - -#include "sdkconfig.h" -#include "esp_task.h" - -#define H_TRANSPORT_NONE 0 -#define H_TRANSPORT_SDIO 1 -#define H_TRANSPORT_SPI_HD 2 -#define H_TRANSPORT_SPI 3 -#define H_TRANSPORT_UART 4 - -#ifdef CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE -#include "driver/sdmmc_host.h" -#endif - -#ifdef CONFIG_ESP_HOSTED_UART_HOST_INTERFACE -#include "hal/uart_types.h" -#endif - -/* This file is to tune the main ESP-Hosted configurations. - * In case you are not sure of some value, Let it be default. - **/ - -#define H_GPIO_LOW 0 -#define H_GPIO_HIGH 1 - -enum { - H_GPIO_INTR_DISABLE = 0, /*!< Disable GPIO interrupt */ - H_GPIO_INTR_POSEDGE = 1, /*!< GPIO interrupt type : rising edge */ - H_GPIO_INTR_NEGEDGE = 2, /*!< GPIO interrupt type : falling edge */ - H_GPIO_INTR_ANYEDGE = 3, /*!< GPIO interrupt type : both rising and falling edge */ - H_GPIO_INTR_LOW_LEVEL = 4, /*!< GPIO interrupt type : input low level trigger */ - H_GPIO_INTR_HIGH_LEVEL = 5, /*!< GPIO interrupt type : input high level trigger */ - H_GPIO_INTR_MAX, -}; - -#if CONFIG_SLAVE_IDF_TARGET_ESP32 -#define H_SLAVE_TARGET_ESP32 1 -#elif CONFIG_SLAVE_IDF_TARGET_ESP32S2 -#define H_SLAVE_TARGET_ESP32S2 1 -#elif CONFIG_SLAVE_IDF_TARGET_ESP32C3 -#define H_SLAVE_TARGET_ESP32C3 1 -#elif CONFIG_SLAVE_IDF_TARGET_ESP32S3 -#define H_SLAVE_TARGET_ESP32S3 1 -#elif CONFIG_SLAVE_IDF_TARGET_ESP32C2 -#define H_SLAVE_TARGET_ESP32C2 1 -#elif CONFIG_SLAVE_IDF_TARGET_ESP32C6 -#define H_SLAVE_TARGET_ESP32C6 1 -#elif CONFIG_SLAVE_IDF_TARGET_ESP32C5 -#define H_SLAVE_TARGET_ESP32C5 1 -#else -#error "Unknown Slave Target" -#endif - -#if CONFIG_ESP_HOSTED_USE_MEMPOOL -#define H_USE_MEMPOOL 1 -#endif - -#define H_MAX_SYNC_RPC_REQUESTS CONFIG_ESP_HOSTED_MAX_SIMULTANEOUS_SYNC_RPC_REQUESTS -#define H_MAX_ASYNC_RPC_REQUESTS CONFIG_ESP_HOSTED_MAX_SIMULTANEOUS_ASYNC_RPC_REQUESTS - -#undef H_TRANSPORT_IN_USE - -#ifdef CONFIG_ESP_HOSTED_SPI_HOST_INTERFACE -#define H_TRANSPORT_IN_USE H_TRANSPORT_SPI -/* -------------------------- SPI Master Config start ---------------------- */ -/* -Pins in use. The SPI Master can use the GPIO mux, -so feel free to change these if needed. -*/ - - -/* SPI config */ - -#ifdef CONFIG_ESP_HOSTED_HS_ACTIVE_LOW - #define H_HANDSHAKE_ACTIVE_HIGH 0 -#else - /* Default HS: Active High */ - #define H_HANDSHAKE_ACTIVE_HIGH 1 -#endif - -#ifdef CONFIG_ESP_HOSTED_DR_ACTIVE_LOW - #define H_DATAREADY_ACTIVE_HIGH 0 -#else - /* Default DR: Active High */ - #define H_DATAREADY_ACTIVE_HIGH 1 -#endif - -#if H_HANDSHAKE_ACTIVE_HIGH - #define H_HS_VAL_ACTIVE H_GPIO_HIGH - #define H_HS_VAL_INACTIVE H_GPIO_LOW - #define H_HS_INTR_EDGE H_GPIO_INTR_POSEDGE -#else - #define H_HS_VAL_ACTIVE H_GPIO_LOW - #define H_HS_VAL_INACTIVE H_GPIO_HIGH - #define H_HS_INTR_EDGE H_GPIO_INTR_NEGEDGE -#endif - -#if H_DATAREADY_ACTIVE_HIGH - #define H_DR_VAL_ACTIVE H_GPIO_HIGH - #define H_DR_VAL_INACTIVE H_GPIO_LOW - #define H_DR_INTR_EDGE H_GPIO_INTR_POSEDGE -#else - #define H_DR_VAL_ACTIVE H_GPIO_LOW - #define H_DR_VAL_INACTIVE H_GPIO_HIGH - #define H_DR_INTR_EDGE H_GPIO_INTR_NEGEDGE -#endif - -#define H_GPIO_HANDSHAKE_Port NULL -#define H_GPIO_HANDSHAKE_Pin CONFIG_ESP_HOSTED_SPI_GPIO_HANDSHAKE -#define H_GPIO_DATA_READY_Port NULL -#define H_GPIO_DATA_READY_Pin CONFIG_ESP_HOSTED_SPI_GPIO_DATA_READY - - - -#define H_GPIO_MOSI_Port NULL -#define H_GPIO_MOSI_Pin CONFIG_ESP_HOSTED_SPI_GPIO_MOSI -#define H_GPIO_MISO_Port NULL -#define H_GPIO_MISO_Pin CONFIG_ESP_HOSTED_SPI_GPIO_MISO -#define H_GPIO_SCLK_Port NULL -#define H_GPIO_SCLK_Pin CONFIG_ESP_HOSTED_SPI_GPIO_CLK -#define H_GPIO_CS_Port NULL -#define H_GPIO_CS_Pin CONFIG_ESP_HOSTED_SPI_GPIO_CS - -#define H_SPI_TX_Q CONFIG_ESP_HOSTED_SPI_TX_Q_SIZE -#define H_SPI_RX_Q CONFIG_ESP_HOSTED_SPI_RX_Q_SIZE - -#define H_SPI_MODE CONFIG_ESP_HOSTED_SPI_MODE -#define H_SPI_INIT_CLK_MHZ CONFIG_ESP_HOSTED_SPI_CLK_FREQ - -/* -------------------------- SPI Master Config end ------------------------ */ -#endif - -#ifdef CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE -#define H_TRANSPORT_IN_USE H_TRANSPORT_SDIO -/* -------------------------- SDIO Host Config start ----------------------- */ - -#ifdef CONFIG_SOC_SDMMC_USE_GPIO_MATRIX -#define H_SDIO_SOC_USE_GPIO_MATRIX -#endif - -#define H_SDIO_CLOCK_FREQ_KHZ CONFIG_ESP_HOSTED_SDIO_CLOCK_FREQ_KHZ -#define H_SDIO_BUS_WIDTH CONFIG_ESP_HOSTED_SDIO_BUS_WIDTH -#define H_SDMMC_HOST_SLOT SDMMC_HOST_SLOT_1 - -#ifdef H_SDIO_SOC_USE_GPIO_MATRIX - #define H_SDIO_PIN_CLK CONFIG_ESP_HOSTED_SDIO_PIN_CLK - #define H_SDIO_PIN_CMD CONFIG_ESP_HOSTED_SDIO_PIN_CMD - #define H_SDIO_PIN_D0 CONFIG_ESP_HOSTED_SDIO_PIN_D0 - #define H_SDIO_PIN_D1 CONFIG_ESP_HOSTED_SDIO_PIN_D1 - #if (H_SDIO_BUS_WIDTH == 4) - #define H_SDIO_PIN_D2 CONFIG_ESP_HOSTED_SDIO_PIN_D2 - #define H_SDIO_PIN_D3 CONFIG_ESP_HOSTED_SDIO_PIN_D3 - #else - #define H_SDIO_PIN_D2 -1 - #define H_SDIO_PIN_D3 -1 - #endif -#else - #define H_SDIO_PIN_CLK -1 - #define H_SDIO_PIN_CMD -1 - #define H_SDIO_PIN_D0 -1 - #define H_SDIO_PIN_D1 -1 - #if (H_SDIO_BUS_WIDTH == 4) - #define H_SDIO_PIN_D2 -1 - #define H_SDIO_PIN_D3 -1 - #else - #define H_SDIO_PIN_D2 -1 - #define H_SDIO_PIN_D3 -1 - #endif -#endif - -#define H_SDIO_TX_Q CONFIG_ESP_HOSTED_SDIO_TX_Q_SIZE -#define H_SDIO_RX_Q CONFIG_ESP_HOSTED_SDIO_RX_Q_SIZE - -#define H_SDIO_CHECKSUM CONFIG_ESP_HOSTED_SDIO_CHECKSUM - -#define H_SDIO_HOST_STREAMING_MODE 1 -#define H_SDIO_ALWAYS_HOST_RX_MAX_TRANSPORT_SIZE 2 -#define H_SDIO_OPTIMIZATION_RX_NONE 3 - -#ifdef CONFIG_ESP_HOSTED_SDIO_OPTIMIZATION_RX_STREAMING_MODE - #define H_SDIO_HOST_RX_MODE H_SDIO_HOST_STREAMING_MODE -#elif defined(CONFIG_ESP_HOSTED_SDIO_OPTIMIZATION_RX_MAX_SIZE) - #define H_SDIO_HOST_RX_MODE H_SDIO_ALWAYS_HOST_RX_MAX_TRANSPORT_SIZE -#else - /* Use this if unsure */ - #define H_SDIO_HOST_RX_MODE H_SDIO_OPTIMIZATION_RX_NONE -#endif - -// Pad transfer len for host operation -#define H_SDIO_TX_LEN_TO_TRANSFER(x) ((x + 3) & (~3)) -#define H_SDIO_RX_LEN_TO_TRANSFER(x) ((x + 3) & (~3)) - -/* Do Block Mode only transfers - * - * When enabled, SDIO only uses block mode transfers for higher - * throughput. Data lengths are padded to multiples of ESP_BLOCK_SIZE. - * - * This is safe for the SDIO slave: - * - for Host Tx: slave will ignore extra data sent by Host - * - for Host Rx: slave will send extra 0 data, ignored by Host - */ -#define H_SDIO_TX_BLOCK_ONLY_XFER (1) -#define H_SDIO_RX_BLOCK_ONLY_XFER (1) - -// workarounds for some SDIO transfer errors that may occur -#if 0 -/* Below workarounds could be enabled for non-ESP MCUs to test first - * Once everything is stable, can disable workarounds and test again - * */ -#define H_SDIO_TX_LIMIT_XFER_SIZE_WORKAROUND // limit transfer to one ESP_BLOCK_SIZE at a time -#define H_SDIO_RX_LIMIT_XFER_SIZE_WORKDAROUND // limit transfer to one ESP_BLOCK_SIZE at a time -#endif - -#if defined(H_SDIO_TX_LIMIT_XFER_SIZE_WORKAROUND) -#define H_SDIO_TX_BLOCKS_TO_TRANSFER(x) (1) -#else -#define H_SDIO_TX_BLOCKS_TO_TRANSFER(x) (x / ESP_BLOCK_SIZE) -#endif - -#if defined(H_SDIO_RX_LIMIT_XFER_SIZE_WORKDAROUND) -#define H_SDIO_RX_BLOCKS_TO_TRANSFER(x) (1) -#else -#define H_SDIO_RX_BLOCKS_TO_TRANSFER(x) (x / ESP_BLOCK_SIZE) -#endif - -/* -------------------------- SDIO Host Config end ------------------------- */ -#endif - -#ifdef CONFIG_ESP_HOSTED_SPI_HD_HOST_INTERFACE -#define H_TRANSPORT_IN_USE H_TRANSPORT_SPI_HD -/* -------------------------- SPI_HD Host Config start ----------------------- */ - -#define H_SPI_HD_HOST_INTERFACE 1 - -enum { - H_SPI_HD_CONFIG_2_DATA_LINES, - H_SPI_HD_CONFIG_4_DATA_LINES, -}; - -#if CONFIG_ESP_HOSTED_SPI_HD_DR_ACTIVE_HIGH - #define H_SPI_HD_DATAREADY_ACTIVE_HIGH 1 -#else - #define H_SPI_HD_DATAREADY_ACTIVE_HIGH 0 -#endif - -#if H_SPI_HD_DATAREADY_ACTIVE_HIGH - #define H_SPI_HD_DR_VAL_ACTIVE H_GPIO_HIGH - #define H_SPI_HD_DR_VAL_INACTIVE H_GPIO_LOW - #define H_SPI_HD_DR_INTR_EDGE H_GPIO_INTR_POSEDGE -#else - #define H_SPI_HD_DR_VAL_ACTIVE H_GPIO_LOW - #define H_SPI_HD_DR_VAL_INACTIVE H_GPIO_HIGH - #define H_SPI_HD_DR_INTR_EDGE H_GPIO_INTR_NEGEDGE -#endif - -#define H_SPI_HD_HOST_NUM_DATA_LINES CONFIG_ESP_HOSTED_SPI_HD_INTERFACE_NUM_DATA_LINES - -#define H_SPI_HD_PIN_D0 CONFIG_ESP_HOSTED_SPI_HD_GPIO_D0 -#define H_SPI_HD_PIN_D1 CONFIG_ESP_HOSTED_SPI_HD_GPIO_D1 -#if (CONFIG_ESP_HOSTED_SPI_HD_INTERFACE_NUM_DATA_LINES == 4) -#define H_SPI_HD_PIN_D2 CONFIG_ESP_HOSTED_SPI_HD_GPIO_D2 -#define H_SPI_HD_PIN_D3 CONFIG_ESP_HOSTED_SPI_HD_GPIO_D3 -#else -#define H_SPI_HD_PIN_D2 -1 -#define H_SPI_HD_PIN_D3 -1 -#endif -#define H_SPI_HD_PIN_CS CONFIG_ESP_HOSTED_SPI_HD_GPIO_CS -#define H_SPI_HD_PIN_CLK CONFIG_ESP_HOSTED_SPI_HD_GPIO_CLK -#define H_SPI_HD_GPIO_DATA_READY_Port NULL -#define H_SPI_HD_PIN_DATA_READY CONFIG_ESP_HOSTED_SPI_HD_GPIO_DATA_READY - -#define H_SPI_HD_CLK_MHZ CONFIG_ESP_HOSTED_SPI_HD_CLK_FREQ -#define H_SPI_HD_MODE CONFIG_ESP_HOSTED_SPI_HD_MODE -#define H_SPI_HD_TX_QUEUE_SIZE CONFIG_ESP_HOSTED_SPI_HD_TX_Q_SIZE -#define H_SPI_HD_RX_QUEUE_SIZE CONFIG_ESP_HOSTED_SPI_HD_RX_Q_SIZE - -#define H_SPI_HD_CHECKSUM CONFIG_ESP_HOSTED_SPI_HD_CHECKSUM - -#define H_SPI_HD_NUM_COMMAND_BITS 8 -#define H_SPI_HD_NUM_ADDRESS_BITS 8 -#define H_SPI_HD_NUM_DUMMY_BITS 8 - -/* -------------------------- SPI_HD Host Config end ------------------------- */ -#else -#define H_SPI_HD_HOST_INTERFACE 0 -#endif - -#ifdef CONFIG_ESP_HOSTED_UART_HOST_INTERFACE -#define H_TRANSPORT_IN_USE H_TRANSPORT_UART -/* -------------------------- UART Host Config start ------------------------- */ - -#define H_UART_HOST_TRANSPORT 1 - -#define H_UART_PORT CONFIG_ESP_HOSTED_UART_PORT -#define H_UART_NUM_DATA_BITS CONFIG_ESP_HOSTED_UART_NUM_DATA_BITS -#define H_UART_PARITY CONFIG_ESP_HOSTED_UART_PARITY -#define H_UART_START_BITS 1 -#define H_UART_STOP_BITS CONFIG_ESP_HOSTED_UART_STOP_BITS -#define H_UART_FLOWCTRL UART_HW_FLOWCTRL_DISABLE -#define H_UART_CLK_SRC UART_SCLK_DEFAULT - -#define H_UART_CHECKSUM CONFIG_ESP_HOSTED_UART_CHECKSUM -#define H_UART_BAUD_RATE CONFIG_ESP_HOSTED_UART_BAUDRATE -#define H_UART_TX_PIN CONFIG_ESP_HOSTED_UART_PIN_TX -#define H_UART_RX_PIN CONFIG_ESP_HOSTED_UART_PIN_RX -#define H_UART_TX_QUEUE_SIZE CONFIG_ESP_HOSTED_UART_TX_Q_SIZE -#define H_UART_RX_QUEUE_SIZE CONFIG_ESP_HOSTED_UART_RX_Q_SIZE - -/* -------------------------- UART Host Config end ------------------------- */ -#else -#define H_UART_HOST_TRANSPORT 0 -#endif - -/* Generic reset pin config */ -#define H_GPIO_PIN_RESET_Port NULL -#define H_GPIO_PIN_RESET_Pin CONFIG_ESP_HOSTED_GPIO_SLAVE_RESET_SLAVE - -/* If Reset pin is Enable, it is Active High. - * If it is RST, active low */ -#ifdef CONFIG_ESP_HOSTED_RESET_GPIO_ACTIVE_LOW - #define H_RESET_ACTIVE_HIGH 0 -#else - #define H_RESET_ACTIVE_HIGH 1 -#endif - -#ifdef H_RESET_ACTIVE_HIGH - #define H_RESET_VAL_ACTIVE H_GPIO_HIGH - #define H_RESET_VAL_INACTIVE H_GPIO_LOW -#else - #define H_RESET_VAL_ACTIVE H_GPIO_LOW - #define H_RESET_VAL_INACTIVE H_GPIO_HIGH -#endif - - -#define TIMEOUT_PSERIAL_RESP 30 - - -#define PRE_FORMAT_NEWLINE_CHAR "" -#define POST_FORMAT_NEWLINE_CHAR "\n" - -#define USE_STD_C_LIB_MALLOC 0 - -#ifdef CONFIG_HOST_TO_ESP_WIFI_DATA_THROTTLE - #define H_WIFI_TX_DATA_THROTTLE_LOW_THRESHOLD CONFIG_ESP_HOSTED_TO_WIFI_DATA_THROTTLE_LOW_THRESHOLD - #define H_WIFI_TX_DATA_THROTTLE_HIGH_THRESHOLD CONFIG_ESP_HOSTED_TO_WIFI_DATA_THROTTLE_HIGH_THRESHOLD -#else - #define H_WIFI_TX_DATA_THROTTLE_LOW_THRESHOLD 0 - #define H_WIFI_TX_DATA_THROTTLE_HIGH_THRESHOLD 0 -#endif - -#define H_PKT_STATS CONFIG_ESP_HOSTED_PKT_STATS - -/* Raw Throughput Testing */ -#define H_TEST_RAW_TP CONFIG_ESP_HOSTED_RAW_THROUGHPUT_TRANSPORT - -#if H_TEST_RAW_TP -#define H_RAW_TP_REPORT_INTERVAL CONFIG_ESP_HOSTED_RAW_TP_REPORT_INTERVAL -#define H_RAW_TP_PKT_LEN CONFIG_ESP_HOSTED_RAW_TP_HOST_TO_ESP_PKT_LEN - -#if CONFIG_ESP_HOSTED_RAW_THROUGHPUT_TX_TO_SLAVE -#define H_TEST_RAW_TP_DIR (ESP_TEST_RAW_TP__HOST_TO_ESP) -#elif CONFIG_ESP_HOSTED_RAW_THROUGHPUT_RX_FROM_SLAVE -#define H_TEST_RAW_TP_DIR (ESP_TEST_RAW_TP__ESP_TO_HOST) -#elif CONFIG_ESP_HOSTED_RAW_THROUGHPUT_BIDIRECTIONAL -#define H_TEST_RAW_TP_DIR (ESP_TEST_RAW_TP__BIDIRECTIONAL) -#else -#error Test Raw TP direction not defined -#endif - -#else -#define H_TEST_RAW_TP_DIR (ESP_TEST_RAW_TP_NONE) -#endif - - -esp_err_t esp_hosted_set_default_config(void); -bool esp_hosted_is_config_valid(void); - -#endif /*__ESP_HOSTED_CONFIG_H__*/ diff --git a/host/api/include/esp_hosted_gpio.h b/host/api/include/esp_hosted_gpio.h new file mode 100644 index 00000000..03e02166 --- /dev/null +++ b/host/api/include/esp_hosted_gpio.h @@ -0,0 +1,33 @@ +/* APIs to do control GPIOs of the co-processor + * + * Note: This API is platform dependent + * + * Source for the API should be in host/port//... + * + */ + +#ifndef __ESP_HOSTED_GPIO_H__ +#define __ESP_HOSTED_GPIO_H__ + + +#include "esp_err.h" + +typedef struct +{ + uint64_t pin_bit_mask; /*!< GPIO pin: set with bit mask, each bit maps to a GPIO */ + uint32_t mode; /*!< GPIO mode: set input/output mode */ + uint32_t pull_up_en; /*!< GPIO pull-up */ + uint32_t pull_down_en; /*!< GPIO pull-down */ + uint32_t intr_type; /*!< GPIO interrupt type */ + +} esp_hosted_gpio_config_t; + +esp_err_t esp_hosted_gpio_config(const esp_hosted_gpio_config_t *pGPIOConfig); +esp_err_t esp_hosted_gpio_reset_pin(uint32_t gpio_num); +esp_err_t esp_hosted_gpio_set_level(uint32_t gpio_num, uint32_t level); +int esp_hosted_gpio_get_level(uint32_t gpio_num); +esp_err_t esp_hosted_gpio_set_direction(uint32_t gpio_num, uint32_t mode); +esp_err_t esp_hosted_gpio_input_enable(uint32_t gpio_num); +esp_err_t esp_hosted_gpio_set_pull_mode(uint32_t gpio_num, uint32_t pull); + +#endif /*__ESP_HOSTED_GPIO_H__*/ diff --git a/host/api/include/esp_hosted_ota.h b/host/api/include/esp_hosted_ota.h new file mode 100644 index 00000000..a1ed1eab --- /dev/null +++ b/host/api/include/esp_hosted_ota.h @@ -0,0 +1,82 @@ +/* + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD +* +* SPDX-License-Identifier: Apache-2.0 +*/ + +/* APIs to do OTA updates of the co-processor + * + * Note: This API is platform dependent + * + * Add additional APIs as required based on how the OTA binary is to + * be fetched. + * + * Source for the API should be in host/port//... + * + * Procedure used by APIs to do OTA update: + * 1. Fetch and prepare OTA binary + * 2. Call rpc_ota_begin() to start OTA + * 3. Repeatedly call rpc_ota_write() with a continuous chunk of OTA data + * 4. Call rpc_ota_end() + * + * @deprecated This API is deprecated. Use the new OTA examples in examples/host_slave_ota/ + * and examples/host_self_ota/ which provide more flexible OTA implementations. + * These examples demonstrate how to use the low-level esp_hosted_ota_begin(), + * esp_hosted_ota_write(), and esp_hosted_ota_end() APIs directly. + */ + +#ifndef __ESP_HOSTED_OTA_H__ +#define __ESP_HOSTED_OTA_H__ + +#include "esp_err.h" + +enum { + ESP_HOSTED_SLAVE_OTA_ACTIVATED, + ESP_HOSTED_SLAVE_OTA_COMPLETED, + ESP_HOSTED_SLAVE_OTA_NOT_REQUIRED, + ESP_HOSTED_SLAVE_OTA_NOT_STARTED, + ESP_HOSTED_SLAVE_OTA_IN_PROGRESS, + ESP_HOSTED_SLAVE_OTA_FAILED, +}; + +/** + * @brief Fetch OTA image from a web server (image_url) + * @deprecated Use the examples in examples/host_slave_ota/ for new implementations + * @param image_url URL of the OTA image + * @return esp_err_t ESP_OK on success, error code on failure + */ +esp_err_t esp_hosted_slave_ota(const char* image_url) __attribute__((deprecated("Use examples/host_slave_ota/ for new OTA implementations"))); + +/* --------- OTA APIs --------- */ +/** + * @brief Begin OTA update on the remote coprocessor device + * + * @return esp_err_t ESP_OK on success, error code on failure + */ +esp_err_t esp_hosted_slave_ota_begin(void); + +/** + * @brief Write OTA data chunk to the remote coprocessor device + * + * @param ota_data Pointer to OTA data chunk + * @param ota_data_len Length of OTA data chunk + * @return esp_err_t ESP_OK on success, error code on failure + */ +esp_err_t esp_hosted_slave_ota_write(uint8_t* ota_data, uint32_t ota_data_len); + +/** + * @brief End OTA update on the remote coprocessor device + * + * @return esp_err_t ESP_OK on success, error code on failure + */ +esp_err_t esp_hosted_slave_ota_end(void); + +/** + * @brief Activate OTA update on the remote coprocessor device. This would also reboot the remote coprocessor. + * + * @return esp_err_t ESP_OK on success, error code on failure + */ +esp_err_t esp_hosted_slave_ota_activate(void); + + +#endif /*__ESP_HOSTED_OTA_H__*/ diff --git a/host/api/include/esp_hosted_power_save.h b/host/api/include/esp_hosted_power_save.h new file mode 100644 index 00000000..6cc3d0a9 --- /dev/null +++ b/host/api/include/esp_hosted_power_save.h @@ -0,0 +1,84 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ESP_HOSTED_POWER_SAVE_API_H +#define ESP_HOSTED_POWER_SAVE_API_H + +typedef enum { + HOSTED_WAKEUP_UNDEFINED = 0, + HOSTED_WAKEUP_NORMAL_REBOOT, + HOSTED_WAKEUP_DEEP_SLEEP, +} esp_hosted_wakeup_reason_t; + +typedef enum { + HOSTED_POWER_SAVE_TYPE_NONE = 0, + HOSTED_POWER_SAVE_TYPE_LIGHT_SLEEP, + HOSTED_POWER_SAVE_TYPE_DEEP_SLEEP, +} esp_hosted_power_save_type_t; + +/* + * @brief Initializes the power save driver. + * This function is typically called automatically during esp_hosted_init(). + */ +int esp_hosted_power_save_init(void); + +/* + * @brief Deinitializes the power save driver. + * This function is typically called automatically during esp_hosted_deinit(). + */ +int esp_hosted_power_save_deinit(void); + +/** + * @brief Checks if the host power save feature is enabled in Kconfig. + * + * @return int Returns 1 if the feature is enabled, 0 otherwise. + */ +int esp_hosted_power_save_enabled(void); + +/** + * @brief Determines if the host rebooted due to deep sleep. + * + * @return int Returns 1 if the host rebooted due to deep sleep, 0 otherwise. + */ +int esp_hosted_woke_from_power_save(void); + +/** + * @brief Checks if the host is currently in power saving mode. + * + * @return int Returns 1 if the host is in power saving mode, 0 otherwise. + */ +int esp_hosted_power_saving(void); + +/** + * @brief Initiates the host power save mode (deep sleep). + * @note This function does not return. The host will enter deep sleep + * and reboot upon wake-up. + * + * @param power_save_type The type of power save mode to enter. + * Currently, only HOSTED_POWER_SAVE_TYPE_DEEP_SLEEP is supported. + * @return int Returns 0 on success, or a nonzero value on failure (e.g., if the feature is disabled). + */ +int esp_hosted_power_save_start(esp_hosted_power_save_type_t power_save_type); + +/** + * @brief Starts a timer that will place the host into deep sleep upon expiration. + * + * @param time_ms The duration in milliseconds after which the host will enter deep sleep. + * @param timer_type The type of timer to start. Use H_TIMER_TYPE_ONESHOT for a single event. + * Use H_TIMER_TYPE_PERIODIC for periodic events. + * @return int Returns 0 on success or a nonzero value on failure. + */ +int esp_hosted_power_save_timer_start(uint32_t time_ms, int timer_type); + +/** + * @brief Stops the host power save timer. + * + * @return int Returns 0 on success or a nonzero value on failure. + */ +int esp_hosted_power_save_timer_stop(void); + + +#endif diff --git a/host/api/include/esp_hosted_transport_config.h b/host/api/include/esp_hosted_transport_config.h index 25b4e449..ccf80f14 100644 --- a/host/api/include/esp_hosted_transport_config.h +++ b/host/api/include/esp_hosted_transport_config.h @@ -1,13 +1,14 @@ /* -* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD -* -* SPDX-License-Identifier: Apache-2.0 -*/ + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef __ESP_HOSTED_TRANSPORT_CONFIG_H__ #define __ESP_HOSTED_TRANSPORT_CONFIG_H__ -#include "esp_hosted_config.h" +#include + #include "esp_err.h" typedef enum { @@ -20,7 +21,7 @@ typedef enum { /* GPIO pin configuration structure */ typedef struct { void *port; - uint8_t pin; + int pin; } gpio_pin_t; /* New Configuration Structures */ @@ -34,9 +35,12 @@ struct esp_hosted_sdio_config { gpio_pin_t pin_d1; gpio_pin_t pin_d2; gpio_pin_t pin_d3; + gpio_pin_t pin_reset; uint8_t rx_mode; bool block_mode; bool iomux_enable; + uint16_t tx_queue_size; + uint16_t rx_queue_size; }; struct esp_hosted_spi_hd_config { @@ -51,6 +55,7 @@ struct esp_hosted_spi_hd_config { gpio_pin_t pin_d1; gpio_pin_t pin_d2; gpio_pin_t pin_d3; + gpio_pin_t pin_reset; /* SPI HD configuration */ uint32_t clk_mhz; @@ -71,6 +76,7 @@ struct esp_hosted_spi_config { gpio_pin_t pin_cs; gpio_pin_t pin_handshake; gpio_pin_t pin_data_ready; + gpio_pin_t pin_reset; /* SPI Full Duplex configuration */ uint16_t tx_queue_size; @@ -86,6 +92,7 @@ struct esp_hosted_uart_config { /* UART pins */ gpio_pin_t pin_tx; gpio_pin_t pin_rx; + gpio_pin_t pin_reset; /* UART configuration */ uint8_t num_data_bits; @@ -109,123 +116,56 @@ struct esp_hosted_transport_config { } u; }; -#if H_TRANSPORT_SDIO == H_TRANSPORT_IN_USE -#define INIT_DEFAULT_HOST_SDIO_CONFIG() \ - (struct esp_hosted_sdio_config) { \ - .clock_freq_khz = H_SDIO_CLOCK_FREQ_KHZ, \ - .bus_width = H_SDIO_BUS_WIDTH, \ - .slot = H_SDMMC_HOST_SLOT, \ - .pin_clk = {.port = NULL, .pin = H_SDIO_PIN_CLK}, \ - .pin_cmd = {.port = NULL, .pin = H_SDIO_PIN_CMD}, \ - .pin_d0 = {.port = NULL, .pin = H_SDIO_PIN_D0}, \ - .pin_d1 = {.port = NULL, .pin = H_SDIO_PIN_D1}, \ - .pin_d2 = {.port = NULL, .pin = H_SDIO_PIN_D2}, \ - .pin_d3 = {.port = NULL, .pin = H_SDIO_PIN_D3}, \ - .rx_mode = H_SDIO_HOST_RX_MODE, \ - .block_mode = H_SDIO_TX_BLOCK_ONLY_XFER && H_SDIO_RX_BLOCK_ONLY_XFER, \ - .iomux_enable = false, \ - } - - -#define INIT_DEFAULT_HOST_SDIO_IOMUX_CONFIG() \ - (struct esp_hosted_sdio_config) { \ - .clock_freq_khz = H_SDIO_CLOCK_FREQ_KHZ, \ - .bus_width = H_SDIO_BUS_WIDTH, \ - .slot = H_SDMMC_HOST_SLOT, \ - .rx_mode = H_SDIO_HOST_RX_MODE, \ - .block_mode = H_SDIO_TX_BLOCK_ONLY_XFER && H_SDIO_RX_BLOCK_ONLY_XFER, \ - .iomux_enable = true, \ - } -#endif - -#if H_TRANSPORT_SPI_HD == H_TRANSPORT_IN_USE -#define INIT_DEFAULT_HOST_SPI_HD_CONFIG() \ - (struct esp_hosted_spi_hd_config) { \ - .num_data_lines = H_SPI_HD_HOST_NUM_DATA_LINES, \ - .pin_cs = {.port = NULL, .pin = H_SPI_HD_PIN_CS}, \ - .pin_clk = {.port = NULL, .pin = H_SPI_HD_PIN_CLK}, \ - .pin_data_ready = {.port = NULL, .pin = H_SPI_HD_PIN_DATA_READY}, \ - .pin_d0 = {.port = NULL, .pin = H_SPI_HD_PIN_D0}, \ - .pin_d1 = {.port = NULL, .pin = H_SPI_HD_PIN_D1}, \ - .pin_d2 = {.port = NULL, .pin = H_SPI_HD_PIN_D2}, \ - .pin_d3 = {.port = NULL, .pin = H_SPI_HD_PIN_D3}, \ - .clk_mhz = H_SPI_HD_CLK_MHZ, \ - .mode = H_SPI_HD_MODE, \ - .tx_queue_size = H_SPI_HD_TX_QUEUE_SIZE, \ - .rx_queue_size = H_SPI_HD_RX_QUEUE_SIZE, \ - .checksum_enable = H_SPI_HD_CHECKSUM, \ - .num_command_bits = H_SPI_HD_NUM_COMMAND_BITS, \ - .num_address_bits = H_SPI_HD_NUM_ADDRESS_BITS, \ - .num_dummy_bits = H_SPI_HD_NUM_DUMMY_BITS, \ - } -#endif - -#if H_TRANSPORT_SPI == H_TRANSPORT_IN_USE -#define INIT_DEFAULT_HOST_SPI_CONFIG() \ - (struct esp_hosted_spi_config) { \ - .pin_mosi = {.port = NULL, .pin = H_GPIO_MOSI_Pin}, \ - .pin_miso = {.port = NULL, .pin = H_GPIO_MISO_Pin}, \ - .pin_sclk = {.port = NULL, .pin = H_GPIO_SCLK_Pin}, \ - .pin_cs = {.port = NULL, .pin = H_GPIO_CS_Pin}, \ - .pin_handshake = {.port = NULL, .pin = H_GPIO_HANDSHAKE_Pin}, \ - .pin_data_ready = {.port = NULL, .pin = H_GPIO_DATA_READY_Pin}, \ - .tx_queue_size = H_SPI_TX_Q, \ - .rx_queue_size = H_SPI_RX_Q, \ - .mode = H_SPI_MODE, \ - .clk_mhz = H_SPI_INIT_CLK_MHZ, \ - } -#endif - -#if H_TRANSPORT_UART == H_TRANSPORT_IN_USE -#define INIT_DEFAULT_HOST_UART_CONFIG() \ - (struct esp_hosted_uart_config) { \ - .port = H_UART_PORT, \ - .pin_tx = {.port = NULL, .pin = H_UART_TX_PIN}, \ - .pin_rx = {.port = NULL, .pin = H_UART_RX_PIN}, \ - .num_data_bits = H_UART_NUM_DATA_BITS, \ - .parity = H_UART_PARITY, \ - .stop_bits = H_UART_STOP_BITS, \ - .flow_ctrl = H_UART_FLOWCTRL, \ - .clk_src = H_UART_CLK_SRC, \ - .checksum_enable = H_UART_CHECKSUM, \ - .baud_rate = H_UART_BAUD_RATE, \ - .tx_queue_size = H_UART_TX_QUEUE_SIZE, \ - .rx_queue_size = H_UART_RX_QUEUE_SIZE \ - } -#endif +/* Default configuration functions - implemented by port layer */ +struct esp_hosted_sdio_config esp_hosted_get_default_sdio_config(void); +struct esp_hosted_sdio_config esp_hosted_get_default_sdio_iomux_config(void); +struct esp_hosted_spi_hd_config esp_hosted_get_default_spi_hd_config(void); +struct esp_hosted_spi_config esp_hosted_get_default_spi_config(void); +struct esp_hosted_uart_config esp_hosted_get_default_uart_config(void); + +/* Convenience macros for backward compatibility and ease of use */ +#define INIT_DEFAULT_HOST_SDIO_CONFIG() esp_hosted_get_default_sdio_config() +#define INIT_DEFAULT_HOST_SDIO_IOMUX_CONFIG() esp_hosted_get_default_sdio_iomux_config() +#define INIT_DEFAULT_HOST_SPI_HD_CONFIG() esp_hosted_get_default_spi_hd_config() +#define INIT_DEFAULT_HOST_SPI_CONFIG() esp_hosted_get_default_spi_config() +#define INIT_DEFAULT_HOST_UART_CONFIG() esp_hosted_get_default_uart_config() + +/*** + * Generic Transport APIs + ***/ +esp_err_t esp_hosted_set_default_config(void); +bool esp_hosted_is_config_valid(void); /* Configuration get/set functions */ esp_hosted_transport_err_t esp_hosted_transport_set_default_config(void); esp_hosted_transport_err_t esp_hosted_transport_get_config(struct esp_hosted_transport_config **config); +esp_hosted_transport_err_t esp_hosted_transport_get_reset_config(gpio_pin_t *pin_config); + bool esp_hosted_transport_is_config_valid(void); -#if H_TRANSPORT_SDIO == H_TRANSPORT_IN_USE +/*** + * Transport dependent APIs. + * Can only be used with the configured host transport + ***/ /* SDIO functions */ esp_hosted_transport_err_t esp_hosted_sdio_get_config(struct esp_hosted_sdio_config **config); esp_hosted_transport_err_t esp_hosted_sdio_set_config(struct esp_hosted_sdio_config *config) __attribute__((warn_unused_result)); esp_hosted_transport_err_t esp_hosted_sdio_iomux_set_config(struct esp_hosted_sdio_config *config) __attribute__((warn_unused_result)); -#endif -#if H_TRANSPORT_SPI_HD == H_TRANSPORT_IN_USE /* SPI Half Duplex functions */ esp_hosted_transport_err_t esp_hosted_spi_hd_get_config(struct esp_hosted_spi_hd_config **config); esp_hosted_transport_err_t esp_hosted_spi_hd_set_config(struct esp_hosted_spi_hd_config *config) __attribute__((warn_unused_result)); esp_hosted_transport_err_t esp_hosted_spi_hd_2lines_get_config(struct esp_hosted_spi_hd_config **config); esp_hosted_transport_err_t esp_hosted_spi_hd_2lines_set_config(struct esp_hosted_spi_hd_config *config) __attribute__((warn_unused_result)); -#endif -#if H_TRANSPORT_SPI == H_TRANSPORT_IN_USE /* SPI Full Duplex functions */ esp_hosted_transport_err_t esp_hosted_spi_get_config(struct esp_hosted_spi_config **config); esp_hosted_transport_err_t esp_hosted_spi_set_config(struct esp_hosted_spi_config *config) __attribute__((warn_unused_result)); -#endif -#if H_TRANSPORT_UART == H_TRANSPORT_IN_USE /* UART functions */ esp_hosted_transport_err_t esp_hosted_uart_get_config(struct esp_hosted_uart_config **config); esp_hosted_transport_err_t esp_hosted_uart_set_config(struct esp_hosted_uart_config *config) __attribute__((warn_unused_result)); -#endif #endif /* __ESP_HOSTED_TRANSPORT_CONFIG_H__ */ diff --git a/host/api/include/esp_hosted_wifi_remote_glue.h b/host/api/include/esp_hosted_wifi_remote_glue.h new file mode 100644 index 00000000..6e070556 --- /dev/null +++ b/host/api/include/esp_hosted_wifi_remote_glue.h @@ -0,0 +1,44 @@ +/* +* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD +* +* SPDX-License-Identifier: Apache-2.0 +*/ + +#ifndef __ESP_HOSTED_WIFI_REMOTE_GLUE_H__ +#define __ESP_HOSTED_WIFI_REMOTE_GLUE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "esp_hosted_interface.h" +#include "esp_wifi_remote.h" +#include "esp_wifi.h" + +struct esp_remote_channel_config { + esp_hosted_if_type_t if_type; + bool secure; +}; + +typedef struct esp_remote_channel_config * esp_remote_channel_config_t; + +/* Transport/Channel related data structures and macros */ +#define ESP_HOSTED_CHANNEL_CONFIG_DEFAULT() { \ + .secure = true, \ +} + +/* Function pointer types for channel callbacks */ +typedef esp_err_t (*esp_remote_channel_rx_fn_t)(void *h, void *buffer, + void *buff_to_free, size_t len); +typedef esp_err_t (*esp_remote_channel_tx_fn_t)(void *h, void *buffer, size_t len); + +/* Transport/Channel Management API Functions - use managed component typedef */ +esp_remote_channel_t esp_hosted_add_channel(esp_remote_channel_config_t config, + esp_remote_channel_tx_fn_t *tx, const esp_remote_channel_rx_fn_t rx); +esp_err_t esp_hosted_remove_channel(esp_remote_channel_t channel); + +#ifdef __cplusplus +} +#endif + +#endif /* __ESP_HOSTED_WIFI_REMOTE_GLUE_H__ */ diff --git a/host/api/priv/esp_hosted_api_priv.h b/host/api/priv/esp_hosted_api_priv.h new file mode 100644 index 00000000..fe0b4ecf --- /dev/null +++ b/host/api/priv/esp_hosted_api_priv.h @@ -0,0 +1,153 @@ +/* + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* prevent recursive inclusion */ +#ifndef __ESP_HOSTED_API_PRIV_H__ +#define __ESP_HOSTED_API_PRIV_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes */ +#include "stdbool.h" +#include "esp_wifi.h" +#include "esp_wifi_remote.h" +#include "esp_hosted_api_types.h" +#include "port_esp_hosted_host_wifi_config.h" + + +#if H_WIFI_ENTERPRISE_SUPPORT +#include "esp_eap_client.h" +#endif + +#if H_DPP_SUPPORT +#include "esp_dpp.h" +#endif + +/* Remote WiFi API Functions - Port/Implementation Specific */ +esp_err_t esp_wifi_remote_init(const wifi_init_config_t *arg); +esp_err_t esp_wifi_remote_deinit(void); +esp_err_t esp_wifi_remote_set_mode(wifi_mode_t mode); +esp_err_t esp_wifi_remote_get_mode(wifi_mode_t* mode); +esp_err_t esp_wifi_remote_start(void); +esp_err_t esp_wifi_remote_stop(void); +esp_err_t esp_wifi_remote_connect(void); +esp_err_t esp_wifi_remote_disconnect(void); +esp_err_t esp_wifi_remote_set_config(wifi_interface_t interface, wifi_config_t *conf); +esp_err_t esp_wifi_remote_get_config(wifi_interface_t interface, wifi_config_t *conf); +esp_err_t esp_wifi_remote_get_mac(wifi_interface_t mode, uint8_t mac[6]); +esp_err_t esp_wifi_remote_set_mac(wifi_interface_t mode, const uint8_t mac[6]); + +esp_err_t esp_wifi_remote_scan_start(const wifi_scan_config_t *config, bool block); +esp_err_t esp_wifi_remote_scan_stop(void); +esp_err_t esp_wifi_remote_scan_get_ap_num(uint16_t *number); +esp_err_t esp_wifi_remote_scan_get_ap_record(wifi_ap_record_t *ap_record); +esp_err_t esp_wifi_remote_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records); +esp_err_t esp_wifi_remote_clear_ap_list(void); +esp_err_t esp_wifi_remote_restore(void); +esp_err_t esp_wifi_remote_clear_fast_connect(void); +esp_err_t esp_wifi_remote_deauth_sta(uint16_t aid); +esp_err_t esp_wifi_remote_sta_get_ap_info(wifi_ap_record_t *ap_info); +esp_err_t esp_wifi_remote_set_ps(wifi_ps_type_t type); +esp_err_t esp_wifi_remote_get_ps(wifi_ps_type_t *type); +esp_err_t esp_wifi_remote_set_storage(wifi_storage_t storage); +esp_err_t esp_wifi_remote_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw); +esp_err_t esp_wifi_remote_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw); +esp_err_t esp_wifi_remote_set_channel(uint8_t primary, wifi_second_chan_t second); +esp_err_t esp_wifi_remote_get_channel(uint8_t *primary, wifi_second_chan_t *second); +esp_err_t esp_wifi_remote_set_country_code(const char *country, bool ieee80211d_enabled); +esp_err_t esp_wifi_remote_get_country_code(char *country); +esp_err_t esp_wifi_remote_set_country(const wifi_country_t *country); +esp_err_t esp_wifi_remote_get_country(wifi_country_t *country); +esp_err_t esp_wifi_remote_ap_get_sta_list(wifi_sta_list_t *sta); +esp_err_t esp_wifi_remote_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid); +esp_err_t esp_wifi_remote_sta_get_rssi(int *rssi); +esp_err_t esp_wifi_remote_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap); +esp_err_t esp_wifi_remote_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap); +esp_err_t esp_wifi_remote_set_max_tx_power(int8_t power); +esp_err_t esp_wifi_remote_get_max_tx_power(int8_t *power); +esp_err_t esp_wifi_remote_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode); +esp_err_t esp_wifi_remote_sta_get_aid(uint16_t *aid); +esp_err_t esp_wifi_remote_set_inactive_time(wifi_interface_t ifx, uint16_t sec); +esp_err_t esp_wifi_remote_get_inactive_time(wifi_interface_t ifx, uint16_t *sec); + +#if H_WIFI_HE_SUPPORT +esp_err_t esp_wifi_remote_sta_twt_config(wifi_twt_config_t *config); +#if H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 +esp_err_t esp_wifi_remote_sta_itwt_setup(wifi_itwt_setup_config_t *setup_config); +#else +esp_err_t esp_wifi_remote_sta_itwt_setup(wifi_twt_setup_config_t *setup_config); +#endif +esp_err_t esp_wifi_remote_sta_itwt_teardown(int flow_id); +esp_err_t esp_wifi_remote_sta_itwt_suspend(int flow_id, int suspend_time_ms); +esp_err_t esp_wifi_remote_sta_itwt_get_flow_id_status(int *flow_id_bitmap); +esp_err_t esp_wifi_remote_sta_itwt_send_probe_req(int timeout_ms); +esp_err_t esp_wifi_remote_sta_itwt_set_target_wake_time_offset(int timeout_us); +#endif + +#if H_WIFI_DUALBAND_SUPPORT +/* Dual-band WiFi API (Depends upon co-processor used) */ +esp_err_t esp_wifi_remote_set_band(wifi_band_t band); +esp_err_t esp_wifi_remote_get_band(wifi_band_t *band); +esp_err_t esp_wifi_remote_set_band_mode(wifi_band_mode_t band_mode); +esp_err_t esp_wifi_remote_get_band_mode(wifi_band_mode_t *band_mode); +esp_err_t esp_wifi_remote_set_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols); +esp_err_t esp_wifi_remote_get_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols); +esp_err_t esp_wifi_remote_set_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw); +esp_err_t esp_wifi_remote_get_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw); +#endif + +#if H_WIFI_ENTERPRISE_SUPPORT +esp_err_t esp_wifi_remote_sta_enterprise_enable(void); +esp_err_t esp_wifi_remote_sta_enterprise_disable(void); +esp_err_t esp_eap_client_remote_set_identity(const unsigned char *identity, int len); +esp_err_t esp_eap_client_remote_clear_identity(void); +esp_err_t esp_eap_client_remote_set_username(const unsigned char *username, int len); +esp_err_t esp_eap_client_remote_clear_username(void); +esp_err_t esp_eap_client_remote_set_password(const unsigned char *password, int len); +esp_err_t esp_eap_client_remote_clear_password(void); +esp_err_t esp_eap_client_remote_set_new_password(const unsigned char *new_password, int len); +esp_err_t esp_eap_client_remote_clear_new_password(void); +esp_err_t esp_eap_client_remote_set_ca_cert(const unsigned char *ca_cert, int ca_cert_len); +esp_err_t esp_eap_client_remote_clear_ca_cert(void); +esp_err_t esp_eap_client_remote_clear_certificate_and_key(void); +esp_err_t esp_eap_client_remote_set_disable_time_check(bool disable); +esp_err_t esp_eap_client_remote_get_disable_time_check(bool *disable); +esp_err_t esp_eap_client_remote_set_ttls_phase2_method(esp_eap_ttls_phase2_types type); +esp_err_t esp_eap_client_remote_set_suiteb_192bit_certification(bool enable); +esp_err_t esp_eap_client_remote_set_pac_file(const unsigned char *pac_file, int pac_file_len); +esp_err_t esp_eap_client_remote_set_fast_params(esp_eap_fast_config config); +esp_err_t esp_eap_client_remote_use_default_cert_bundle(bool use_default_bundle); +esp_err_t esp_wifi_remote_set_okc_support(bool enable); +esp_err_t esp_eap_client_remote_set_domain_name(const char *domain_name); +esp_err_t esp_eap_client_remote_set_certificate_and_key(const unsigned char *client_cert, int client_cert_len, + const unsigned char *private_key, int private_key_len, + const unsigned char *private_key_password, int private_key_passwd_len); +#if H_GOT_SET_EAP_METHODS_API +esp_err_t esp_eap_client_remote_set_eap_methods(esp_eap_method_t methods); +#endif +#endif + +#if H_DPP_SUPPORT +#if H_SUPP_DPP_SUPPORT +esp_err_t esp_supp_remote_dpp_init(esp_supp_dpp_event_cb_t evt_cb); +#else +esp_err_t esp_supp_remote_dpp_init(void); +#endif +esp_err_t esp_supp_remote_dpp_deinit(void); +esp_err_t esp_supp_remote_dpp_bootstrap_gen(const char *chan_list, + esp_supp_dpp_bootstrap_t type, + const char *key, const char *info); +esp_err_t esp_supp_remote_dpp_start_listen(void); +esp_err_t esp_supp_remote_dpp_stop_listen(void); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __ESP_HOSTED_API_PRIV_H__ */ diff --git a/host/api/src/esp_hosted_api.c b/host/api/src/esp_hosted_api.c index f5a492cf..45d2c491 100644 --- a/host/api/src/esp_hosted_api.c +++ b/host/api/src/esp_hosted_api.c @@ -1,8 +1,8 @@ /* -* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD -* -* SPDX-License-Identifier: Apache-2.0 -*/ + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifdef __cplusplus extern "C" { @@ -10,18 +10,30 @@ extern "C" { /** Includes **/ #include "esp_hosted_transport_config.h" -#include "esp_wifi_remote.h" -#include "esp_hosted_wifi_config.h" -#include "esp_hosted_api.h" +#include "esp_hosted_api_priv.h" +#include "esp_hosted_wifi_remote_glue.h" +#include "port_esp_hosted_host_wifi_config.h" +#include "port_esp_hosted_host_os.h" +#include "esp_hosted_misc.h" #include "esp_check.h" #include "transport_drv.h" #include "rpc_wrap.h" #include "esp_log.h" +#if H_DPP_SUPPORT +#include "esp_dpp.h" +#endif + /** Macros **/ static const char *TAG="H_API"; static uint8_t esp_hosted_init_done; +static uint8_t esp_hosted_transport_up; + + +#define check_transport_up() \ +if (!esp_hosted_transport_up) return ESP_FAIL + /** Exported variables **/ struct esp_remote_channel { @@ -30,16 +42,13 @@ struct esp_remote_channel { //static semaphore_handle_t transport_up_sem; -typedef esp_err_t (*esp_remote_channel_rx_fn_t)(void *h, void *buffer, - void *buff_to_free, size_t len); -typedef esp_err_t (*esp_remote_channel_tx_fn_t)(void *h, void *buffer, size_t len); - /** Inline functions **/ /** Exported Functions **/ static void transport_active_cb(void) { - //g_h.funcs->_h_post_semaphore(transport_up_sem); + ESP_LOGI(TAG, "Transport active"); + esp_hosted_transport_up = 1; } #if 0 @@ -96,7 +105,7 @@ static void set_host_modules_log_level(void) esp_log_level_set("rpc_rsp", ESP_LOG_WARN); esp_log_level_set("rpc_evt", ESP_LOG_WARN); } -esp_err_t esp_hosted_init(void) +int esp_hosted_init(void) { if (esp_hosted_init_done) return ESP_OK; @@ -111,8 +120,8 @@ esp_err_t esp_hosted_init(void) } else { ESP_ERROR_CHECK(esp_hosted_set_default_config()); } - ESP_ERROR_CHECK(transport_drv_init(transport_active_cb)); ESP_ERROR_CHECK(add_esp_wifi_remote_channels()); + ESP_ERROR_CHECK(setup_transport(transport_active_cb)); ESP_ERROR_CHECK(rpc_init()); rpc_register_event_callbacks(); @@ -120,12 +129,12 @@ esp_err_t esp_hosted_init(void) return ESP_OK; } -esp_err_t esp_hosted_deinit(void) +int esp_hosted_deinit(void) { ESP_LOGI(TAG, "ESP-Hosted deinit\n"); rpc_unregister_event_callbacks(); ESP_ERROR_CHECK(rpc_deinit()); - ESP_ERROR_CHECK(transport_drv_deinit()); + ESP_ERROR_CHECK(teardown_transport()); esp_hosted_init_done = 0; return ESP_OK; } @@ -137,20 +146,11 @@ static inline esp_err_t esp_hosted_reconfigure(void) return ESP_FAIL; } - ESP_ERROR_CHECK(transport_drv_reconfigure()); + ESP_ERROR_CHECK_WITHOUT_ABORT(transport_drv_reconfigure()); return ESP_OK; } -esp_err_t esp_hosted_reinit(void) -{ - ESP_LOGI(TAG, "ESP-Hosted re-init\n"); - ESP_ERROR_CHECK(esp_hosted_deinit()); - ESP_ERROR_CHECK(esp_hosted_init()); - ESP_ERROR_CHECK(esp_hosted_reconfigure()); - return ESP_OK; -} - -esp_err_t esp_hosted_slave_reset(void) +int esp_hosted_connect_to_slave(void) { ESP_LOGI(TAG, "ESP-Hosted Try to communicate with ESP-Hosted slave\n"); return esp_hosted_reconfigure(); @@ -190,268 +190,628 @@ esp_err_t esp_hosted_remove_channel(esp_remote_channel_t eh_chan) esp_err_t esp_wifi_remote_init(const wifi_init_config_t *arg) { - ESP_ERROR_CHECK(esp_hosted_reconfigure()); + ESP_ERROR_CHECK_WITHOUT_ABORT(esp_hosted_reconfigure()); + check_transport_up(); return rpc_wifi_init(arg); } esp_err_t esp_wifi_remote_deinit(void) { + esp_hosted_transport_up = 0; + check_transport_up(); return rpc_wifi_deinit(); } esp_err_t esp_wifi_remote_set_mode(wifi_mode_t mode) { + check_transport_up(); return rpc_wifi_set_mode(mode); } esp_err_t esp_wifi_remote_get_mode(wifi_mode_t* mode) { + check_transport_up(); return rpc_wifi_get_mode(mode); } esp_err_t esp_wifi_remote_start(void) { + check_transport_up(); return rpc_wifi_start(); } esp_err_t esp_wifi_remote_stop(void) { + check_transport_up(); return rpc_wifi_stop(); } esp_err_t esp_wifi_remote_connect(void) { ESP_LOGI(TAG, "%s",__func__); + check_transport_up(); return rpc_wifi_connect(); } esp_err_t esp_wifi_remote_disconnect(void) { + check_transport_up(); return rpc_wifi_disconnect(); } esp_err_t esp_wifi_remote_set_config(wifi_interface_t interface, wifi_config_t *conf) { + check_transport_up(); return rpc_wifi_set_config(interface, conf); } esp_err_t esp_wifi_remote_get_config(wifi_interface_t interface, wifi_config_t *conf) { + check_transport_up(); return rpc_wifi_get_config(interface, conf); } esp_err_t esp_wifi_remote_get_mac(wifi_interface_t mode, uint8_t mac[6]) { + check_transport_up(); return rpc_wifi_get_mac(mode, mac); } esp_err_t esp_wifi_remote_set_mac(wifi_interface_t mode, const uint8_t mac[6]) { + check_transport_up(); return rpc_wifi_set_mac(mode, mac); } esp_err_t esp_wifi_remote_scan_start(const wifi_scan_config_t *config, bool block) { + check_transport_up(); return rpc_wifi_scan_start(config, block); } esp_err_t esp_wifi_remote_scan_stop(void) { + check_transport_up(); return rpc_wifi_scan_stop(); } esp_err_t esp_wifi_remote_scan_get_ap_num(uint16_t *number) { + check_transport_up(); return rpc_wifi_scan_get_ap_num(number); } esp_err_t esp_wifi_remote_scan_get_ap_record(wifi_ap_record_t *ap_record) { + check_transport_up(); return rpc_wifi_scan_get_ap_record(ap_record); } esp_err_t esp_wifi_remote_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records) { + check_transport_up(); return rpc_wifi_scan_get_ap_records(number, ap_records); } esp_err_t esp_wifi_remote_clear_ap_list(void) { + check_transport_up(); return rpc_wifi_clear_ap_list(); } esp_err_t esp_wifi_remote_restore(void) { + check_transport_up(); return rpc_wifi_restore(); } esp_err_t esp_wifi_remote_clear_fast_connect(void) { + check_transport_up(); return rpc_wifi_clear_fast_connect(); } esp_err_t esp_wifi_remote_deauth_sta(uint16_t aid) { + check_transport_up(); return rpc_wifi_deauth_sta(aid); } esp_err_t esp_wifi_remote_sta_get_ap_info(wifi_ap_record_t *ap_info) { + check_transport_up(); return rpc_wifi_sta_get_ap_info(ap_info); } esp_err_t esp_wifi_remote_set_ps(wifi_ps_type_t type) { + check_transport_up(); return rpc_wifi_set_ps(type); } esp_err_t esp_wifi_remote_get_ps(wifi_ps_type_t *type) { + check_transport_up(); return rpc_wifi_get_ps(type); } esp_err_t esp_wifi_remote_set_storage(wifi_storage_t storage) { + check_transport_up(); return rpc_wifi_set_storage(storage); } esp_err_t esp_wifi_remote_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw) { + check_transport_up(); return rpc_wifi_set_bandwidth(ifx, bw); } esp_err_t esp_wifi_remote_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw) { + check_transport_up(); return rpc_wifi_get_bandwidth(ifx, bw); } esp_err_t esp_wifi_remote_set_channel(uint8_t primary, wifi_second_chan_t second) { + check_transport_up(); return rpc_wifi_set_channel(primary, second); } esp_err_t esp_wifi_remote_get_channel(uint8_t *primary, wifi_second_chan_t *second) { + check_transport_up(); return rpc_wifi_get_channel(primary, second); } esp_err_t esp_wifi_remote_set_country_code(const char *country, bool ieee80211d_enabled) { + check_transport_up(); return rpc_wifi_set_country_code(country, ieee80211d_enabled); } esp_err_t esp_wifi_remote_get_country_code(char *country) { + check_transport_up(); return rpc_wifi_get_country_code(country); } esp_err_t esp_wifi_remote_set_country(const wifi_country_t *country) { + check_transport_up(); return rpc_wifi_set_country(country); } esp_err_t esp_wifi_remote_get_country(wifi_country_t *country) { + check_transport_up(); return rpc_wifi_get_country(country); } esp_err_t esp_wifi_remote_ap_get_sta_list(wifi_sta_list_t *sta) { + check_transport_up(); return rpc_wifi_ap_get_sta_list(sta); } esp_err_t esp_wifi_remote_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid) { + check_transport_up(); return rpc_wifi_ap_get_sta_aid(mac, aid); } esp_err_t esp_wifi_remote_sta_get_rssi(int *rssi) { + check_transport_up(); return rpc_wifi_sta_get_rssi(rssi); } esp_err_t esp_wifi_remote_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap) { + check_transport_up(); return rpc_wifi_set_protocol(ifx, protocol_bitmap); } esp_err_t esp_wifi_remote_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap) { + check_transport_up(); return rpc_wifi_get_protocol(ifx, protocol_bitmap); } esp_err_t esp_wifi_remote_set_max_tx_power(int8_t power) { + check_transport_up(); return rpc_wifi_set_max_tx_power(power); } esp_err_t esp_wifi_remote_get_max_tx_power(int8_t *power) { + check_transport_up(); return rpc_wifi_get_max_tx_power(power); } esp_err_t esp_wifi_remote_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode) { + check_transport_up(); return rpc_wifi_sta_get_negotiated_phymode(phymode); } esp_err_t esp_wifi_remote_sta_get_aid(uint16_t *aid) { + check_transport_up(); return rpc_wifi_sta_get_aid(aid); } +esp_err_t esp_wifi_remote_set_inactive_time(wifi_interface_t ifx, uint16_t sec) +{ + return rpc_wifi_set_inactive_time(ifx, sec); +} + +esp_err_t esp_wifi_remote_get_inactive_time(wifi_interface_t ifx, uint16_t *sec) +{ + return rpc_wifi_get_inactive_time(ifx, sec); +} + +#if H_WIFI_HE_SUPPORT +esp_err_t esp_wifi_remote_sta_twt_config(wifi_twt_config_t *config) +{ + return rpc_wifi_sta_twt_config(config); +} + +#if H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 +esp_err_t esp_wifi_remote_sta_itwt_setup(wifi_itwt_setup_config_t *setup_config) +#else +esp_err_t esp_wifi_remote_sta_itwt_setup(wifi_twt_setup_config_t *setup_config) +#endif +{ + return rpc_wifi_sta_itwt_setup(setup_config); +} + +esp_err_t esp_wifi_remote_sta_itwt_teardown(int flow_id) +{ + return rpc_wifi_sta_itwt_teardown(flow_id); +} + +esp_err_t esp_wifi_remote_sta_itwt_suspend(int flow_id, int suspend_time_ms) +{ + return rpc_wifi_sta_itwt_suspend(flow_id, suspend_time_ms); +} + +esp_err_t esp_wifi_remote_sta_itwt_get_flow_id_status(int *flow_id_bitmap) +{ + return rpc_wifi_sta_itwt_get_flow_id_status(flow_id_bitmap); +} + +esp_err_t esp_wifi_remote_sta_itwt_send_probe_req(int timeout_ms) +{ + return rpc_wifi_sta_itwt_send_probe_req(timeout_ms); +} + +esp_err_t esp_wifi_remote_sta_itwt_set_target_wake_time_offset(int offset_us) +{ + return rpc_wifi_sta_itwt_set_target_wake_time_offset(offset_us); +} +#endif + #if H_WIFI_DUALBAND_SUPPORT +/* Dual-band WiFi API - always available at high level, but returns ESP_ERR_NOT_SUPPORTED when co-processor do not support */ esp_err_t esp_wifi_remote_set_band(wifi_band_t band) { + check_transport_up(); return rpc_wifi_set_band(band); } esp_err_t esp_wifi_remote_get_band(wifi_band_t *band) { + check_transport_up(); return rpc_wifi_get_band(band); } esp_err_t esp_wifi_remote_set_band_mode(wifi_band_mode_t band_mode) { + check_transport_up(); return rpc_wifi_set_band_mode(band_mode); } esp_err_t esp_wifi_remote_get_band_mode(wifi_band_mode_t *band_mode) { + check_transport_up(); return rpc_wifi_get_band_mode(band_mode); } esp_err_t esp_wifi_remote_set_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols) { + check_transport_up(); return rpc_wifi_set_protocols(ifx, protocols); } esp_err_t esp_wifi_remote_get_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols) { + check_transport_up(); return rpc_wifi_get_protocols(ifx, protocols); } esp_err_t esp_wifi_remote_set_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) { + check_transport_up(); return rpc_wifi_set_bandwidths(ifx, bw); } esp_err_t esp_wifi_remote_get_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) { + check_transport_up(); return rpc_wifi_get_bandwidths(ifx, bw); } #endif -esp_err_t esp_hosted_slave_ota(const char* image_url) +#if H_DPP_SUPPORT +#if H_SUPP_DPP_SUPPORT +esp_err_t esp_supp_remote_dpp_init(esp_supp_dpp_event_cb_t evt_cb) { - return rpc_ota(image_url); + check_transport_up(); + return rpc_supp_dpp_init(evt_cb); +} +#else +esp_err_t esp_supp_remote_dpp_init(void) +{ + check_transport_up(); + return rpc_supp_dpp_init(); +} +#endif + +esp_err_t esp_supp_remote_dpp_deinit(void) +{ + check_transport_up(); + return rpc_supp_dpp_deinit(); } +esp_err_t esp_supp_remote_dpp_bootstrap_gen(const char *chan_list, + esp_supp_dpp_bootstrap_t type, + const char *key, const char *info) +{ + check_transport_up(); + return rpc_supp_dpp_bootstrap_gen(chan_list, type, key, info); +} + +esp_err_t esp_supp_remote_dpp_start_listen(void) +{ + check_transport_up(); + return rpc_supp_dpp_start_listen(); +} + +esp_err_t esp_supp_remote_dpp_stop_listen(void) +{ + check_transport_up(); + return rpc_supp_dpp_stop_listen(); +} +#endif + esp_err_t esp_hosted_get_coprocessor_fwversion(esp_hosted_coprocessor_fwver_t *ver_info) { + check_transport_up(); return rpc_get_coprocessor_fwversion(ver_info); } +#if H_WIFI_ENTERPRISE_SUPPORT +esp_err_t esp_wifi_remote_sta_enterprise_enable(void) +{ + check_transport_up(); + return rpc_wifi_sta_enterprise_enable(); +} + +esp_err_t esp_wifi_remote_sta_enterprise_disable(void) +{ + check_transport_up(); + return rpc_wifi_sta_enterprise_disable(); +} + +esp_err_t esp_eap_client_remote_set_identity(const unsigned char *identity, int len) +{ + check_transport_up(); + return rpc_eap_client_set_identity(identity, len); +} + +esp_err_t esp_eap_client_remote_clear_identity(void) +{ + check_transport_up(); + return rpc_eap_client_clear_identity(); +} + +esp_err_t esp_eap_client_remote_set_username(const unsigned char *username, int len) +{ + check_transport_up(); + return rpc_eap_client_set_username(username, len); +} + +esp_err_t esp_eap_client_remote_clear_username(void) +{ + check_transport_up(); + return rpc_eap_client_clear_username(); +} + +esp_err_t esp_eap_client_remote_set_password(const unsigned char *password, int len) +{ + check_transport_up(); + return rpc_eap_client_set_password(password, len); +} + +esp_err_t esp_eap_client_remote_clear_password(void) +{ + check_transport_up(); + return rpc_eap_client_clear_password(); +} + +esp_err_t esp_eap_client_remote_set_new_password(const unsigned char *new_password, int len) +{ + check_transport_up(); + return rpc_eap_client_set_new_password(new_password, len); +} + +esp_err_t esp_eap_client_remote_clear_new_password(void) +{ + check_transport_up(); + return rpc_eap_client_clear_new_password(); +} + +esp_err_t esp_eap_client_remote_set_ca_cert(const unsigned char *ca_cert, int ca_cert_len) +{ + check_transport_up(); + return rpc_eap_client_set_ca_cert(ca_cert, ca_cert_len); +} + +esp_err_t esp_eap_client_remote_clear_ca_cert(void) +{ + check_transport_up(); + return rpc_eap_client_clear_ca_cert(); +} + +esp_err_t esp_eap_client_remote_set_certificate_and_key(const unsigned char *client_cert, + int client_cert_len, + const unsigned char *private_key, + int private_key_len, + const unsigned char *private_key_password, + int private_key_passwd_len) +{ + check_transport_up(); + return rpc_eap_client_set_certificate_and_key(client_cert, client_cert_len, private_key, + private_key_len, private_key_password, private_key_passwd_len); +} + +esp_err_t esp_eap_client_remote_clear_certificate_and_key(void) +{ + check_transport_up(); + return rpc_eap_client_clear_certificate_and_key(); +} + +esp_err_t esp_eap_client_remote_set_disable_time_check(bool disable) +{ + check_transport_up(); + return rpc_eap_client_set_disable_time_check(disable); +} + +esp_err_t esp_eap_client_remote_get_disable_time_check(bool *disable) +{ + check_transport_up(); + return rpc_eap_client_get_disable_time_check(disable); +} + +esp_err_t esp_eap_client_remote_set_ttls_phase2_method(esp_eap_ttls_phase2_types type) +{ + check_transport_up(); + return rpc_eap_client_set_ttls_phase2_method(type); +} + +esp_err_t esp_eap_client_remote_set_suiteb_192bit_certification(bool enable) +{ + check_transport_up(); + return rpc_eap_client_set_suiteb_192bit_certification(enable); +} + +esp_err_t esp_eap_client_remote_set_pac_file(const unsigned char *pac_file, int pac_file_len) +{ + check_transport_up(); + return rpc_eap_client_set_pac_file(pac_file, pac_file_len); +} + +esp_err_t esp_eap_client_remote_set_fast_params(esp_eap_fast_config config) +{ + check_transport_up(); + return rpc_eap_client_set_fast_params(config); +} + +esp_err_t esp_eap_client_remote_use_default_cert_bundle(bool use_default_bundle) +{ + check_transport_up(); + return rpc_eap_client_use_default_cert_bundle(use_default_bundle); +} + +esp_err_t esp_wifi_remote_set_okc_support(bool enable) +{ + check_transport_up(); + return rpc_wifi_set_okc_support(enable); +} + +esp_err_t esp_eap_client_remote_set_domain_name(const char *domain_name) +{ + check_transport_up(); + return rpc_eap_client_set_domain_name(domain_name); +} + +#if H_GOT_SET_EAP_METHODS_API +esp_err_t esp_eap_client_remote_set_eap_methods(esp_eap_method_t methods) +{ + check_transport_up(); + return rpc_eap_client_set_eap_methods(methods); +} +#endif +#endif + +esp_err_t esp_hosted_bt_controller_init(void) +{ + return rpc_bt_controller_init(); +} + +esp_err_t esp_hosted_bt_controller_deinit(bool mem_release) +{ + return rpc_bt_controller_deinit(mem_release); +} + +esp_err_t esp_hosted_bt_controller_enable(void) +{ + return rpc_bt_controller_enable(); +} + +esp_err_t esp_hosted_bt_controller_disable(void) +{ + return rpc_bt_controller_disable(); +} + +static bool check_mac_len(size_t mac_len, esp_mac_type_t type) +{ + if (((type == ESP_MAC_IEEE802154) && (mac_len == 8)) || + ((type == ESP_MAC_EFUSE_EXT) && (mac_len == 2)) || + (mac_len == 6)) { + return true; + } + return false; +} + +esp_err_t esp_hosted_iface_mac_addr_set(uint8_t *mac, size_t mac_len, esp_mac_type_t type) +{ + // check that incoming mac_len is correct for the provided type + if (!check_mac_len(mac_len, type)) { + ESP_LOGE(TAG, "Invalid mac length for provided MAC type"); + return ESP_ERR_INVALID_ARG; + } + + return rpc_iface_mac_addr_set_get(true, mac, mac_len, type); +} + +esp_err_t esp_hosted_iface_mac_addr_get(uint8_t *mac, size_t mac_len, esp_mac_type_t type) +{ + // check that incoming mac_len is correct for the provided type + if (!check_mac_len(mac_len, type)) { + ESP_LOGE(TAG, "Invalid mac length for provided MAC type"); + return ESP_ERR_INVALID_ARG; + } + + return rpc_iface_mac_addr_set_get(false, mac, mac_len, type); +} + +size_t esp_hosted_iface_mac_addr_len_get(esp_mac_type_t type) +{ + // NOTE: this API returns size_t, not esp_err_t + // to match size_t esp_mac_addr_len_get(esp_mac_type_t type) + size_t len; + + if (ESP_OK != rpc_iface_mac_addr_len_get(&len, type)) { + return 0; + } else { + return len; + } +} + /* esp_err_t esp_wifi_remote_scan_get_ap_record(wifi_ap_record_t *ap_record) esp_err_t esp_wifi_remote_set_csi(_Bool en) esp_err_t esp_wifi_remote_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx) diff --git a/host/api/src/esp_hosted_ota_api.c b/host/api/src/esp_hosted_ota_api.c new file mode 100644 index 00000000..54f346bd --- /dev/null +++ b/host/api/src/esp_hosted_ota_api.c @@ -0,0 +1,41 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp_hosted.h" +#include "esp_log.h" +#include "rpc_wrap.h" + +static const char* TAG = "esp_hosted_ota"; + + +esp_err_t esp_hosted_slave_ota_begin(void) +{ + ESP_LOGD(TAG, "Starting OTA on slave device"); + return rpc_ota_begin(); +} + +esp_err_t esp_hosted_slave_ota_write(uint8_t* ota_data, uint32_t ota_data_len) +{ + if (!ota_data || ota_data_len == 0) { + ESP_LOGE(TAG, "Invalid OTA data parameters"); + return ESP_ERR_INVALID_ARG; + } + + ESP_LOGV(TAG, "Writing %ld bytes of OTA data", ota_data_len); + return rpc_ota_write(ota_data, ota_data_len); +} + +esp_err_t esp_hosted_slave_ota_end(void) +{ + ESP_LOGD(TAG, "Ending OTA on slave device"); + return rpc_ota_end(); +} + +esp_err_t esp_hosted_slave_ota_activate(void) +{ + ESP_LOGD(TAG, "Activating OTA on slave device"); + return rpc_ota_activate(); +} diff --git a/host/port/src/esp_hosted_transport_config.c b/host/api/src/esp_hosted_transport_config.c similarity index 81% rename from host/port/src/esp_hosted_transport_config.c rename to host/api/src/esp_hosted_transport_config.c index c9b1f8f5..85a13a79 100644 --- a/host/port/src/esp_hosted_transport_config.c +++ b/host/api/src/esp_hosted_transport_config.c @@ -4,14 +4,16 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "esp_hosted_transport_config.h" #include #include "esp_log.h" +#include "port_esp_hosted_host_config.h" +#include "esp_hosted_transport_config.h" + static const char *TAG = "esp_hosted_transport_config"; /* Static configurations */ -static struct esp_hosted_transport_config s_transport_config; +static struct esp_hosted_transport_config s_transport_config = { 0 }; /* Flags to track if configs were set */ static bool esp_hosted_transport_config_set; @@ -20,6 +22,14 @@ bool esp_hosted_transport_is_config_valid(void) { return esp_hosted_transport_config_set; } +esp_err_t esp_hosted_set_default_config(void) { + return esp_hosted_transport_set_default_config(); +} + +bool esp_hosted_is_config_valid(void) { + return esp_hosted_transport_is_config_valid(); +} + esp_hosted_transport_err_t esp_hosted_transport_set_default_config(void) { memset(&s_transport_config, 0, sizeof(s_transport_config)); @@ -48,6 +58,40 @@ esp_hosted_transport_err_t esp_hosted_transport_get_config(struct esp_hosted_tra return ESP_TRANSPORT_OK; } +esp_hosted_transport_err_t esp_hosted_transport_get_reset_config(gpio_pin_t *pin_config) +{ + if (!pin_config) { + return ESP_TRANSPORT_ERR_INVALID_ARG; + } + + switch(s_transport_config.transport_in_use) { + case H_TRANSPORT_SDIO: + pin_config->port = s_transport_config.u.sdio.pin_reset.port; + pin_config->pin = s_transport_config.u.sdio.pin_reset.pin; + break; + case H_TRANSPORT_SPI_HD: + pin_config->port = s_transport_config.u.spi_hd.pin_reset.port; + pin_config->pin = s_transport_config.u.spi_hd.pin_reset.pin; + break; + case H_TRANSPORT_SPI: + pin_config->port = s_transport_config.u.spi.pin_reset.port; + pin_config->pin = s_transport_config.u.spi.pin_reset.pin; + break; + case H_TRANSPORT_UART: + pin_config->port = s_transport_config.u.uart.pin_reset.port; + pin_config->pin = s_transport_config.u.uart.pin_reset.pin; + break; + case H_TRANSPORT_NONE: // drop through to default case + default: + // transport config not yet initialised. Use default Reset pin config + pin_config->port = H_GPIO_PORT_RESET; + pin_config->pin = H_GPIO_PIN_RESET; + break; + } + + return ESP_TRANSPORT_OK; +} + #if H_TRANSPORT_IN_USE == H_TRANSPORT_SDIO /* SDIO functions */ esp_hosted_transport_err_t esp_hosted_sdio_get_config(struct esp_hosted_sdio_config **config) diff --git a/host/api/src/esp_wifi_weak.c b/host/api/src/esp_wifi_weak.c index 33459d72..e182def0 100644 --- a/host/api/src/esp_wifi_weak.c +++ b/host/api/src/esp_wifi_weak.c @@ -1,17 +1,8 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2024 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /** * Weak version of esp_wifi API. @@ -19,259 +10,481 @@ * Used when WiFi-Remote does not provide required esp_wifi calls */ -#include "esp_hosted_api.h" -#include "esp_hosted_wifi_config.h" +#include "esp_hosted_api_priv.h" +#include "port_esp_hosted_host_config.h" +#include "port_esp_hosted_host_wifi_config.h" -#define WEAK __attribute__((weak)) +#if H_DPP_SUPPORT +#include "esp_dpp.h" +#endif -WEAK esp_err_t esp_wifi_init(const wifi_init_config_t *config) +H_WEAK_REF esp_err_t esp_wifi_init(const wifi_init_config_t *config) { return esp_wifi_remote_init(config); } -WEAK esp_err_t esp_wifi_deinit(void) +H_WEAK_REF esp_err_t esp_wifi_deinit(void) { return esp_wifi_remote_deinit(); } -WEAK esp_err_t esp_wifi_set_mode(wifi_mode_t mode) +H_WEAK_REF esp_err_t esp_wifi_set_mode(wifi_mode_t mode) { return esp_wifi_remote_set_mode(mode); } -WEAK esp_err_t esp_wifi_get_mode(wifi_mode_t *mode) +H_WEAK_REF esp_err_t esp_wifi_get_mode(wifi_mode_t *mode) { return esp_wifi_remote_get_mode(mode); } -WEAK esp_err_t esp_wifi_start(void) +H_WEAK_REF esp_err_t esp_wifi_start(void) { return esp_wifi_remote_start(); } -WEAK esp_err_t esp_wifi_stop(void) +H_WEAK_REF esp_err_t esp_wifi_stop(void) { return esp_wifi_remote_stop(); } -WEAK esp_err_t esp_wifi_restore(void) +H_WEAK_REF esp_err_t esp_wifi_restore(void) { return esp_wifi_remote_restore(); } -WEAK esp_err_t esp_wifi_connect(void) +H_WEAK_REF esp_err_t esp_wifi_connect(void) { return esp_wifi_remote_connect(); } -WEAK esp_err_t esp_wifi_disconnect(void) +H_WEAK_REF esp_err_t esp_wifi_disconnect(void) { return esp_wifi_remote_disconnect(); } -WEAK esp_err_t esp_wifi_clear_fast_connect(void) +H_WEAK_REF esp_err_t esp_wifi_clear_fast_connect(void) { return esp_wifi_remote_clear_fast_connect(); } -WEAK esp_err_t esp_wifi_deauth_sta(uint16_t aid) +H_WEAK_REF esp_err_t esp_wifi_deauth_sta(uint16_t aid) { return esp_wifi_remote_deauth_sta(aid); } -WEAK esp_err_t esp_wifi_scan_start(const wifi_scan_config_t *config, bool block) +H_WEAK_REF esp_err_t esp_wifi_scan_start(const wifi_scan_config_t *config, bool block) { return esp_wifi_remote_scan_start(config, block); } -WEAK esp_err_t esp_wifi_scan_stop(void) +H_WEAK_REF esp_err_t esp_wifi_scan_stop(void) { return esp_wifi_remote_scan_stop(); } -WEAK esp_err_t esp_wifi_scan_get_ap_num(uint16_t *number) +H_WEAK_REF esp_err_t esp_wifi_scan_get_ap_num(uint16_t *number) { return esp_wifi_remote_scan_get_ap_num(number); } -WEAK esp_err_t esp_wifi_scan_get_ap_record(wifi_ap_record_t *ap_record) +H_WEAK_REF esp_err_t esp_wifi_scan_get_ap_record(wifi_ap_record_t *ap_record) { return esp_wifi_remote_scan_get_ap_record(ap_record); } -WEAK esp_err_t esp_wifi_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records) +H_WEAK_REF esp_err_t esp_wifi_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records) { return esp_wifi_remote_scan_get_ap_records(number, ap_records); } -WEAK esp_err_t esp_wifi_clear_ap_list(void) +H_WEAK_REF esp_err_t esp_wifi_clear_ap_list(void) { return esp_wifi_remote_clear_ap_list(); } -WEAK esp_err_t esp_wifi_sta_get_ap_info(wifi_ap_record_t *ap_info) +H_WEAK_REF esp_err_t esp_wifi_sta_get_ap_info(wifi_ap_record_t *ap_info) { return esp_wifi_remote_sta_get_ap_info(ap_info); } -WEAK esp_err_t esp_wifi_set_ps(wifi_ps_type_t type) +H_WEAK_REF esp_err_t esp_wifi_set_ps(wifi_ps_type_t type) { return esp_wifi_remote_set_ps(type); } -WEAK esp_err_t esp_wifi_get_ps(wifi_ps_type_t *type) +H_WEAK_REF esp_err_t esp_wifi_get_ps(wifi_ps_type_t *type) { return esp_wifi_remote_get_ps(type); } -WEAK esp_err_t esp_wifi_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap) +H_WEAK_REF esp_err_t esp_wifi_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap) { return esp_wifi_remote_set_protocol(ifx, protocol_bitmap); } -WEAK esp_err_t esp_wifi_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap) +H_WEAK_REF esp_err_t esp_wifi_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap) { return esp_wifi_remote_get_protocol(ifx, protocol_bitmap); } -WEAK esp_err_t esp_wifi_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw) +H_WEAK_REF esp_err_t esp_wifi_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw) { return esp_wifi_remote_set_bandwidth(ifx, bw); } -WEAK esp_err_t esp_wifi_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw) +H_WEAK_REF esp_err_t esp_wifi_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw) { return esp_wifi_remote_get_bandwidth(ifx, bw); } -WEAK esp_err_t esp_wifi_set_channel(uint8_t primary, wifi_second_chan_t second) +H_WEAK_REF esp_err_t esp_wifi_set_channel(uint8_t primary, wifi_second_chan_t second) { return esp_wifi_remote_set_channel(primary, second); } -WEAK esp_err_t esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second) +H_WEAK_REF esp_err_t esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second) { return esp_wifi_remote_get_channel(primary, second); } -WEAK esp_err_t esp_wifi_set_country(const wifi_country_t *country) +H_WEAK_REF esp_err_t esp_wifi_set_country(const wifi_country_t *country) { return esp_wifi_remote_set_country(country); } -WEAK esp_err_t esp_wifi_get_country(wifi_country_t *country) +H_WEAK_REF esp_err_t esp_wifi_get_country(wifi_country_t *country) { return esp_wifi_remote_get_country(country); } -WEAK esp_err_t esp_wifi_set_mac(wifi_interface_t ifx, const uint8_t mac[6]) +H_WEAK_REF esp_err_t esp_wifi_set_mac(wifi_interface_t ifx, const uint8_t mac[6]) { return esp_wifi_remote_set_mac(ifx, mac); } -WEAK esp_err_t esp_wifi_get_mac(wifi_interface_t ifx, uint8_t mac[6]) +H_WEAK_REF esp_err_t esp_wifi_get_mac(wifi_interface_t ifx, uint8_t mac[6]) { return esp_wifi_remote_get_mac(ifx, mac); } -WEAK esp_err_t esp_wifi_set_config(wifi_interface_t interface, wifi_config_t *conf) +H_WEAK_REF esp_err_t esp_wifi_set_config(wifi_interface_t interface, wifi_config_t *conf) { return esp_wifi_remote_set_config(interface, conf); } -WEAK esp_err_t esp_wifi_get_config(wifi_interface_t interface, wifi_config_t *conf) +H_WEAK_REF esp_err_t esp_wifi_get_config(wifi_interface_t interface, wifi_config_t *conf) { return esp_wifi_remote_get_config(interface, conf); } -WEAK esp_err_t esp_wifi_ap_get_sta_list(wifi_sta_list_t *sta) +H_WEAK_REF esp_err_t esp_wifi_ap_get_sta_list(wifi_sta_list_t *sta) { return esp_wifi_remote_ap_get_sta_list(sta); } -WEAK esp_err_t esp_wifi_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid) +H_WEAK_REF esp_err_t esp_wifi_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid) { return esp_wifi_remote_ap_get_sta_aid(mac, aid); } -WEAK esp_err_t esp_wifi_set_storage(wifi_storage_t storage) +H_WEAK_REF esp_err_t esp_wifi_set_storage(wifi_storage_t storage) { return esp_wifi_remote_set_storage(storage); } -WEAK esp_err_t esp_wifi_set_max_tx_power(int8_t power) +H_WEAK_REF esp_err_t esp_wifi_set_max_tx_power(int8_t power) { return esp_wifi_remote_set_max_tx_power(power); } -WEAK esp_err_t esp_wifi_get_max_tx_power(int8_t *power) +H_WEAK_REF esp_err_t esp_wifi_get_max_tx_power(int8_t *power) { return esp_wifi_remote_get_max_tx_power(power); } -WEAK esp_err_t esp_wifi_set_country_code(const char *country, bool ieee80211d_enabled) +H_WEAK_REF esp_err_t esp_wifi_set_country_code(const char *country, bool ieee80211d_enabled) { return esp_wifi_remote_set_country_code(country, ieee80211d_enabled); } -WEAK esp_err_t esp_wifi_get_country_code(char *country) +H_WEAK_REF esp_err_t esp_wifi_get_country_code(char *country) { return esp_wifi_remote_get_country_code(country); } -WEAK esp_err_t esp_wifi_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode) +H_WEAK_REF esp_err_t esp_wifi_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode) { return esp_wifi_remote_sta_get_negotiated_phymode(phymode); } -WEAK esp_err_t esp_wifi_sta_get_aid(uint16_t *aid) +H_WEAK_REF esp_err_t esp_wifi_sta_get_aid(uint16_t *aid) { return esp_wifi_remote_sta_get_aid(aid); } -WEAK esp_err_t esp_wifi_sta_get_rssi(int *rssi) +H_WEAK_REF esp_err_t esp_wifi_sta_get_rssi(int *rssi) { return esp_wifi_remote_sta_get_rssi(rssi); } +H_WEAK_REF esp_err_t esp_wifi_set_inactive_time(wifi_interface_t ifx, uint16_t sec) +{ + return esp_wifi_remote_set_inactive_time(ifx, sec); +} + +H_WEAK_REF esp_err_t esp_wifi_get_inactive_time(wifi_interface_t ifx, uint16_t *sec) +{ + return esp_wifi_remote_get_inactive_time(ifx, sec); +} + +#if H_WIFI_HE_SUPPORT +H_WEAK_REF esp_err_t esp_wifi_sta_twt_config(wifi_twt_config_t *config) +{ + return esp_wifi_remote_sta_twt_config(config); +} + +#if H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 +H_WEAK_REF esp_err_t esp_wifi_sta_itwt_setup(wifi_itwt_setup_config_t *setup_config) +#else +H_WEAK_REF esp_err_t esp_wifi_sta_itwt_setup(wifi_twt_setup_config_t *setup_config) +#endif +{ + return esp_wifi_remote_sta_itwt_setup(setup_config); +} + +H_WEAK_REF esp_err_t esp_wifi_sta_itwt_teardown(int flow_id) +{ + return esp_wifi_remote_sta_itwt_teardown(flow_id); +} + +H_WEAK_REF esp_err_t esp_wifi_sta_itwt_suspend(int flow_id, int suspend_time_ms) +{ + return esp_wifi_remote_sta_itwt_suspend(flow_id, suspend_time_ms); +} + +H_WEAK_REF esp_err_t esp_wifi_sta_itwt_get_flow_id_status(int *flow_id_bitmap) +{ + return esp_wifi_remote_sta_itwt_get_flow_id_status(flow_id_bitmap); +} + +H_WEAK_REF esp_err_t esp_wifi_sta_itwt_send_probe_req(int timeout_ms) +{ + return esp_wifi_remote_sta_itwt_send_probe_req(timeout_ms); +} + +H_WEAK_REF esp_err_t esp_wifi_sta_itwt_set_target_wake_time_offset(int offset_us) +{ + return esp_wifi_remote_sta_itwt_set_target_wake_time_offset(offset_us); +} + +#endif + #if H_WIFI_DUALBAND_SUPPORT -WEAK esp_err_t esp_wifi_set_band(wifi_band_t band) +H_WEAK_REF esp_err_t esp_wifi_set_band(wifi_band_t band) { return esp_wifi_remote_set_band(band); } -WEAK esp_err_t esp_wifi_get_band(wifi_band_t *band) +H_WEAK_REF esp_err_t esp_wifi_get_band(wifi_band_t *band) { return esp_wifi_remote_get_band(band); } -WEAK esp_err_t esp_wifi_set_band_mode(wifi_band_mode_t band_mode) +H_WEAK_REF esp_err_t esp_wifi_set_band_mode(wifi_band_mode_t band_mode) { return esp_wifi_remote_set_band_mode(band_mode); } -WEAK esp_err_t esp_wifi_get_band_mode(wifi_band_mode_t *band_mode) +H_WEAK_REF esp_err_t esp_wifi_get_band_mode(wifi_band_mode_t *band_mode) { return esp_wifi_remote_get_band_mode(band_mode); } -WEAK esp_err_t esp_wifi_set_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols) +H_WEAK_REF esp_err_t esp_wifi_set_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols) { return esp_wifi_remote_set_protocols(ifx, protocols); } -WEAK esp_err_t esp_wifi_get_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols) +H_WEAK_REF esp_err_t esp_wifi_get_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols) { return esp_wifi_remote_get_protocols(ifx, protocols); } -WEAK esp_err_t esp_wifi_set_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) +H_WEAK_REF esp_err_t esp_wifi_set_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) { return esp_wifi_remote_set_bandwidths(ifx, bw); } -WEAK esp_err_t esp_wifi_get_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) +H_WEAK_REF esp_err_t esp_wifi_get_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) { return esp_wifi_remote_get_bandwidths(ifx, bw); } #endif + +#if H_WIFI_ENTERPRISE_SUPPORT +H_WEAK_REF esp_err_t esp_wifi_sta_enterprise_enable(void) +{ + return esp_wifi_remote_sta_enterprise_enable(); +} + +H_WEAK_REF esp_err_t esp_wifi_sta_enterprise_disable(void) +{ + return esp_wifi_remote_sta_enterprise_disable(); +} + +H_WEAK_REF esp_err_t esp_eap_client_set_identity(const unsigned char *identity, int len) +{ + return esp_eap_client_remote_set_identity(identity, len); +} + +H_WEAK_REF void esp_eap_client_clear_identity(void) +{ + esp_eap_client_remote_clear_identity(); +} + +H_WEAK_REF esp_err_t esp_eap_client_set_username(const unsigned char *username, int len) +{ + return esp_eap_client_remote_set_username(username, len); +} + +H_WEAK_REF void esp_eap_client_clear_username(void) +{ + esp_eap_client_remote_clear_username(); +} + +H_WEAK_REF esp_err_t esp_eap_client_set_password(const unsigned char *password, int len) +{ + return esp_eap_client_remote_set_password(password, len); +} + +H_WEAK_REF void esp_eap_client_clear_password(void) +{ + esp_eap_client_remote_clear_password(); +} + +H_WEAK_REF esp_err_t esp_eap_client_set_new_password(const unsigned char *new_password, int len) +{ + return esp_eap_client_remote_set_new_password(new_password, len); +} + +H_WEAK_REF void esp_eap_client_clear_new_password(void) +{ + esp_eap_client_remote_clear_new_password(); +} + +H_WEAK_REF esp_err_t esp_eap_client_set_ca_cert(const unsigned char *ca_cert, int ca_cert_len) +{ + return esp_eap_client_remote_set_ca_cert(ca_cert, ca_cert_len); +} + +H_WEAK_REF void esp_eap_client_clear_ca_cert(void) +{ + esp_eap_client_remote_clear_ca_cert(); +} + +H_WEAK_REF esp_err_t esp_eap_client_set_certificate_and_key(const unsigned char *client_cert, int client_cert_len, + const unsigned char *private_key, int private_key_len, + const unsigned char *private_key_password, int private_key_passwd_len) +{ + return esp_eap_client_remote_set_certificate_and_key(client_cert, client_cert_len, + private_key, private_key_len, + private_key_password, private_key_passwd_len); +} + +H_WEAK_REF void esp_eap_client_clear_certificate_and_key(void) +{ + esp_eap_client_remote_clear_certificate_and_key(); +} + +H_WEAK_REF esp_err_t esp_eap_client_set_disable_time_check(bool disable) +{ + return esp_eap_client_remote_set_disable_time_check(disable); +} + +H_WEAK_REF esp_err_t esp_eap_client_get_disable_time_check(bool *disable) +{ + return esp_eap_client_remote_get_disable_time_check(disable); +} + +H_WEAK_REF esp_err_t esp_eap_client_set_ttls_phase2_method(esp_eap_ttls_phase2_types type) +{ + return esp_eap_client_remote_set_ttls_phase2_method(type); +} + +H_WEAK_REF esp_err_t esp_eap_client_set_suiteb_192bit_certification(bool enable) +{ + return esp_eap_client_remote_set_suiteb_192bit_certification(enable); +} + +H_WEAK_REF esp_err_t esp_eap_client_set_pac_file(const unsigned char *pac_file, int pac_file_len) +{ + return esp_eap_client_remote_set_pac_file(pac_file, pac_file_len); +} + +H_WEAK_REF esp_err_t esp_eap_client_set_fast_params(esp_eap_fast_config config) +{ + return esp_eap_client_remote_set_fast_params(config); +} + +H_WEAK_REF esp_err_t esp_eap_client_use_default_cert_bundle(bool use_default_bundle) +{ + return esp_eap_client_remote_use_default_cert_bundle(use_default_bundle); +} + +H_WEAK_REF void esp_wifi_set_okc_support(bool enable) +{ + esp_wifi_remote_set_okc_support(enable); +} + +H_WEAK_REF esp_err_t esp_eap_client_set_domain_name(const char *domain_name) +{ + return esp_eap_client_remote_set_domain_name(domain_name); +} + +#if H_GOT_SET_EAP_METHODS_API +esp_err_t esp_eap_client_set_eap_methods(esp_eap_method_t methods) +{ + return esp_eap_client_remote_set_eap_methods(methods); +} +#endif +#endif + +#if H_DPP_SUPPORT +/** + * Weak version of esp_dpp API + */ +#if H_SUPP_DPP_SUPPORT +H_WEAK_REF esp_err_t esp_supp_dpp_init(esp_supp_dpp_event_cb_t evt_cb) +{ + return esp_supp_remote_dpp_init(evt_cb); +} +#else +H_WEAK_REF esp_err_t esp_supp_dpp_init(void) +{ + return esp_supp_remote_dpp_init(); +} +#endif + +H_WEAK_REF esp_err_t esp_supp_dpp_deinit(void) +{ + return esp_supp_remote_dpp_deinit(); +} + +H_WEAK_REF esp_err_t esp_supp_dpp_bootstrap_gen(const char *chan_list, + esp_supp_dpp_bootstrap_t type, + const char *key, const char *info) +{ + return esp_supp_remote_dpp_bootstrap_gen(chan_list, type, key, info); +} + +H_WEAK_REF esp_err_t esp_supp_dpp_start_listen(void) +{ + return esp_supp_remote_dpp_start_listen(); +} + +H_WEAK_REF esp_err_t esp_supp_dpp_stop_listen(void) +{ + return esp_supp_remote_dpp_stop_listen(); +} +#endif diff --git a/host/drivers/bt/hci_drv.h b/host/drivers/bt/hci_drv.h index 5eb01ff8..e02a7651 100644 --- a/host/drivers/bt/hci_drv.h +++ b/host/drivers/bt/hci_drv.h @@ -1,18 +1,16 @@ -// Copyright 2015-2024 Espressif Systems (Shanghai) PTE LTD -/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */ +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef __HOSTED_HCI_DRV_H #define __HOSTED_HCI_DRV_H -#include "common.h" - -#include "esp_hosted_bt_config.h" +#include "port_esp_hosted_host_bt_config.h" void hci_drv_init(void); void hci_drv_show_configuration(void); -// Handles BT Rx -int hci_rx_handler(interface_buffer_handle_t *buf_handle); - #endif diff --git a/host/drivers/bt/hci_stub_drv.c b/host/drivers/bt/hci_stub_drv.c index 72e3a3db..24be4a7b 100644 --- a/host/drivers/bt/hci_stub_drv.c +++ b/host/drivers/bt/hci_stub_drv.c @@ -1,5 +1,8 @@ -// Copyright 2015-2024 Espressif Systems (Shanghai) PTE LTD -/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */ +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "hci_drv.h" @@ -11,13 +14,16 @@ static const char TAG[] = "hci_stub_drv"; #include "nimble/transport.h" #endif -#if H_BT_HOST_ESP_BLUEDROID #include "esp_hosted_bt.h" +#include "port_esp_hosted_host_os.h" + +#if H_BT_HOST_ESP_BLUEDROID +#include "esp_hosted_bluedroid.h" #endif #define WEAK __attribute__((weak)) -int hci_rx_handler(interface_buffer_handle_t *buf_handle) +H_WEAK_REF int hci_rx_handler(uint8_t *buf, size_t buf_len) { /* Hosted transport received BT packets, but Hosted was not * configured to handle BT packets. Drop them. @@ -53,6 +59,14 @@ void hci_drv_show_configuration(void) * incoming data. */ +WEAK void ble_transport_ll_init(void) +{ +} + +WEAK void ble_transport_ll_deinit(void) +{ +} + WEAK int ble_transport_to_ll_acl_impl(struct os_mbuf *om) { os_mbuf_free_chain(om); diff --git a/host/drivers/bt/vhci_drv.c b/host/drivers/bt/vhci_drv.c index 97e9a999..66defb8f 100644 --- a/host/drivers/bt/vhci_drv.c +++ b/host/drivers/bt/vhci_drv.c @@ -1,12 +1,17 @@ -// Copyright 2015-2024 Espressif Systems (Shanghai) PTE LTD -/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */ +/* + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include +#include +#include #include "esp_hosted_transport.h" -#include "os_wrapper.h" +#include "esp_hosted_os_abstraction.h" #include "transport_drv.h" - +#include "port_esp_hosted_host_os.h" #include "hci_drv.h" #if H_BT_HOST_ESP_NIMBLE @@ -17,8 +22,10 @@ #include "nimble/hci_common.h" #endif -#if H_BT_HOST_ESP_BLUEDROID #include "esp_hosted_bt.h" + +#if H_BT_HOST_ESP_BLUEDROID +#include "esp_hosted_bluedroid.h" #endif #include "esp_hosted_log.h" @@ -44,10 +51,10 @@ void hci_drv_show_configuration(void) /** * HCI_H4_xxx is the first byte of the received data */ -int hci_rx_handler(interface_buffer_handle_t *buf_handle) +H_WEAK_REF int hci_rx_handler(uint8_t *buf, size_t buf_len) { - uint8_t * data = buf_handle->payload; - uint32_t len_total_read = buf_handle->payload_len; + uint8_t * data = buf; + uint32_t len_total_read = buf_len; int rc; @@ -135,6 +142,11 @@ void ble_transport_ll_init(void) { ESP_ERROR_CHECK(transport_drv_reconfigure()); } + +void ble_transport_ll_deinit(void) +{ + // transport may still be in used for other data (serial, Wi-Fi, ...) +} #endif int ble_transport_to_ll_acl_impl(struct os_mbuf *om) @@ -147,7 +159,7 @@ int ble_transport_to_ll_acl_impl(struct os_mbuf *om) uint8_t * data = NULL; int res; - data = MEM_ALLOC(data_len); + data = g_h.funcs->_h_malloc_align(data_len, HOSTED_MEM_ALIGNMENT_64); if (!data) { ESP_LOGE(TAG, "Tx %s: malloc failed", __func__); res = ESP_FAIL; @@ -158,11 +170,13 @@ int ble_transport_to_ll_acl_impl(struct os_mbuf *om) res = ble_hs_mbuf_to_flat(om, &data[1], OS_MBUF_PKTLEN(om), NULL); if (res) { ESP_LOGE(TAG, "Tx: Error copying HCI_H4_ACL data %d", res); + os_mbuf_free_chain(om); + g_h.funcs->_h_free_align(data); res = ESP_FAIL; goto exit; } - res = esp_hosted_tx(ESP_HCI_IF, 0, data, data_len, H_BUFF_NO_ZEROCOPY, H_DEFLT_FREE_FUNC); + res = esp_hosted_tx(ESP_HCI_IF, 0, data, data_len, H_BUFF_NO_ZEROCOPY, data, H_DEFLT_FREE_FUNC, 0); exit: os_mbuf_free_chain(om); @@ -180,7 +194,7 @@ int ble_transport_to_ll_cmd_impl(void *buf) uint8_t * data = NULL; int res; - data = MEM_ALLOC(buf_len); + data = g_h.funcs->_h_malloc_align(buf_len, HOSTED_MEM_ALIGNMENT_64); if (!data) { ESP_LOGE(TAG, "Tx %s: malloc failed", __func__); res = ESP_FAIL; @@ -190,7 +204,7 @@ int ble_transport_to_ll_cmd_impl(void *buf) data[0] = HCI_H4_CMD; memcpy(&data[1], buf, buf_len - 1); - res = esp_hosted_tx(ESP_HCI_IF, 0, data, buf_len, H_BUFF_NO_ZEROCOPY, H_DEFLT_FREE_FUNC); + res = esp_hosted_tx(ESP_HCI_IF, 0, data, buf_len, H_BUFF_NO_ZEROCOPY, data, H_DEFLT_FREE_FUNC, 0); exit: ble_transport_free(buf); @@ -202,16 +216,16 @@ int ble_transport_to_ll_cmd_impl(void *buf) #if H_BT_HOST_ESP_BLUEDROID static esp_bluedroid_hci_driver_callbacks_t s_callback = { 0 }; -int hci_rx_handler(interface_buffer_handle_t *buf_handle) +H_WEAK_REF int hci_rx_handler(uint8_t *buf, size_t buf_len) { - uint8_t * data = buf_handle->payload; - uint32_t len_total_read = buf_handle->payload_len; + uint8_t * data = buf; + uint32_t len_total_read = buf_len; if (s_callback.notify_host_recv) { s_callback.notify_host_recv(data, len_total_read); } - return ESP_FAIL; + return ESP_OK; } void hosted_hci_bluedroid_open(void) @@ -236,14 +250,14 @@ void hosted_hci_bluedroid_send(uint8_t *data, uint16_t len) int res; uint8_t * ptr = NULL; - ptr = MEM_ALLOC(len); + ptr = g_h.funcs->_h_malloc_align(len, HOSTED_MEM_ALIGNMENT_64); if (!ptr) { ESP_LOGE(TAG, "%s: malloc failed", __func__); return; } memcpy(ptr, data, len); - res = esp_hosted_tx(ESP_HCI_IF, 0, ptr, len, H_BUFF_NO_ZEROCOPY, H_DEFLT_FREE_FUNC); + res = esp_hosted_tx(ESP_HCI_IF, 0, ptr, len, H_BUFF_NO_ZEROCOPY, ptr, H_DEFLT_FREE_FUNC, 0); if (res) { ESP_LOGE(TAG, "%s: Tx failed", __func__); diff --git a/host/drivers/mempool/mempool.c b/host/drivers/mempool/mempool.c index 1dfa9274..6f6e146b 100644 --- a/host/drivers/mempool/mempool.c +++ b/host/drivers/mempool/mempool.c @@ -1,30 +1,19 @@ -// Copyright 2015-2022 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "mempool.h" -#include "esp_hosted_config.h" +#include "port_esp_hosted_host_config.h" #include "stats.h" #include "esp_log.h" -#define MEMPOOL_DEBUG 1 +#define MEMPOOL_DEBUG 1 static char * MEM_TAG = "mpool"; #if H_MEM_STATS #include "esp_log.h" - - #endif struct mempool * mempool_create(uint32_t block_size) @@ -112,7 +101,7 @@ void * mempool_alloc(struct mempool* mp, int nbytes, int need_memset) g_h.funcs->_h_unlock_mempool(mp->spinlock); - buf = MEM_ALLOC(MEMPOOL_ALIGNED(mp->block_size)); + buf = g_h.funcs->_h_malloc_align(MEMPOOL_ALIGNED(mp->block_size), MEMPOOL_ALIGNMENT_BYTES); #if H_MEM_STATS h_stats_g.mp_stats.num_fresh_alloc++; ESP_LOGV(MEM_TAG, "%p: num_alloc: %lu", mp, (unsigned long int)(h_stats_g.mp_stats.num_fresh_alloc)); diff --git a/host/drivers/mempool/mempool.h b/host/drivers/mempool/mempool.h index c654d065..bcc23ce9 100644 --- a/host/drivers/mempool/mempool.h +++ b/host/drivers/mempool/mempool.h @@ -9,7 +9,7 @@ #include #include #include -#include "os_wrapper.h" +#include "port_esp_hosted_host_os.h" #define MEMPOOL_OK 0 diff --git a/host/drivers/power_save/power_save_drv.c b/host/drivers/power_save/power_save_drv.c new file mode 100644 index 00000000..cf37d510 --- /dev/null +++ b/host/drivers/power_save/power_save_drv.c @@ -0,0 +1,367 @@ +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** Includes **/ +#include "esp_log.h" +#include "esp_hosted_log.h" +#include "power_save_drv.h" +#include "stats.h" +#include "transport_drv.h" +#include "port_esp_hosted_host_config.h" +#include "port_esp_hosted_host_os.h" +#include "esp_hosted_power_save.h" +#include "esp_hosted_transport_config.h" + +static const char TAG[] = "H_power_save"; + +static uint8_t power_save_on; + +static uint8_t power_save_drv_init_done; + +/* Add state tracking */ +static volatile bool reset_in_progress = false; + +#if H_HOST_PS_ALLOWED && H_HOST_WAKEUP_GPIO != -1 +/* ISR handler for wakeup GPIO */ +static void IRAM_ATTR wakeup_gpio_isr_handler(void* arg) +{ + + if (!power_save_on && !reset_in_progress) { + + int current_level = g_h.funcs->_h_read_gpio(H_HOST_WAKEUP_GPIO_PORT, H_HOST_WAKEUP_GPIO); + + /* Double check GPIO level and state before reset */ + if (current_level == H_HOST_WAKEUP_GPIO_LEVEL) { + ESP_EARLY_LOGW(TAG, "Slave reset detected via wakeup GPIO, level: %d", current_level); + ESP_EARLY_LOGE(TAG, "------------------ Reseting host -----------------"); + + /* Set flag to prevent re-entry */ + reset_in_progress = true; + + /* Disable interrupt and remove handler before reset */ + g_h.funcs->_h_teardown_gpio_interrupt(H_HOST_WAKEUP_GPIO_PORT, H_HOST_WAKEUP_GPIO); + + /* Force power save off and trigger reset */ + g_h.funcs->_h_restart_host(); + } + } +} +#endif + +/* Initialize power save driver and configure GPIO for slave reset detection */ +int esp_hosted_power_save_init(void) +{ + + if (power_save_drv_init_done) { + ESP_LOGI(TAG, "Power save driver already initialized"); + return 0; + } + +#if H_HOST_PS_ALLOWED + #if H_HOST_WAKEUP_GPIO + int ret = 0; + + uint32_t gpio_num = H_HOST_WAKEUP_GPIO; + void *gpio_port = H_HOST_WAKEUP_GPIO_PORT; + int level = H_HOST_WAKEUP_GPIO_LEVEL; + + ESP_LOGI(TAG, "power_save_drv_init with gpio_num: %" PRIu32, gpio_num); + + /* Reset state flags */ + power_save_on = 0; + reset_in_progress = false; + + // configure wakeup as GPIO input + g_h.funcs->_h_config_gpio(gpio_port, gpio_num, H_GPIO_MODE_DEF_INPUT); + + int initial_level = g_h.funcs->_h_read_gpio(gpio_port, gpio_num); + ESP_LOGI(TAG, "Initial GPIO level: %d", initial_level); + + g_h.funcs->_h_write_gpio(gpio_port, gpio_num, !level); + + /* Only proceed with ISR setup if conditions are right */ + if (!power_save_on && initial_level == 0) { + ret = g_h.funcs->_h_config_gpio_as_interrupt(gpio_port, gpio_num, level, wakeup_gpio_isr_handler, NULL); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to add GPIO ISR handler, err %d", ret); + return -1; + } + } + + ESP_LOGI(TAG, "Initialized wakeup/reset GPIO %" PRIu32 " for slave reset detection", gpio_num); + #else + ESP_LOGI(TAG, "power save driver not enabled at host/slave"); + return -1; + #endif + power_save_drv_init_done = 1; +#endif + + return 0; +} + +int esp_hosted_power_save_deinit(void) +{ +#if H_HOST_PS_ALLOWED + if (power_save_on) { + ESP_LOGE(TAG, "Power save is on, cannot deinit"); + return -1; + } + power_save_drv_init_done = 0; +#endif + +#if H_HOST_PS_ALLOWED && H_HOST_WAKEUP_GPIO != -1 + g_h.funcs->_h_teardown_gpio_interrupt(H_HOST_WAKEUP_GPIO_PORT, H_HOST_WAKEUP_GPIO); +#endif + return 0; +} + +int esp_hosted_power_save_enabled(void) +{ +#if H_HOST_PS_ALLOWED + return 1; +#endif + return 0; +} + + +int esp_hosted_woke_from_power_save(void) +{ +#if H_HOST_PS_ALLOWED + int reason = g_h.funcs->_h_get_host_wakeup_or_reboot_reason(); + if (reason == HOSTED_WAKEUP_DEEP_SLEEP) { + ESP_LOGI(TAG, "Wakeup from power save"); + return 1; + } else { + ESP_LOGI(TAG, "Wakeup using reason: %d", reason); + } +#endif + return 0; +} + +int esp_hosted_power_saving(void) +{ +#if H_HOST_PS_ALLOWED + return power_save_on; +#else + return 0; +#endif +} + + +#include "esp_hosted_transport_init.h" +#include "sdio_drv.h" +esp_err_t sdio_generate_slave_intr(uint8_t intr_no); + +#if H_HOST_PS_ALLOWED +static int notify_slave_host_power_save_start(void) +{ + ESP_LOGI(TAG, "Inform slave: Host PS start"); + return bus_inform_slave_host_power_save_start(); +} + + +static int notify_slave_host_power_save_stop(void) +{ + ESP_LOGI(TAG, "Inform slave: Host PS stop"); + return bus_inform_slave_host_power_save_stop(); +} +#endif + +int hold_slave_reset_gpio_pre_power_save(void) +{ +#if H_HOST_PS_ALLOWED + gpio_pin_t reset_pin = { .port = H_GPIO_PORT_RESET, .pin = H_GPIO_PIN_RESET }; + + if (ESP_TRANSPORT_OK != esp_hosted_transport_get_reset_config(&reset_pin)) { + ESP_LOGE(TAG, "Unable to get RESET config for transport"); + return -1; + } + + if(reset_pin.pin == -1) { + ESP_LOGE(TAG, "RESET pin is not configured"); + return -1; + } + + return g_h.funcs->_h_hold_gpio(reset_pin.port, reset_pin.pin, H_ENABLE); +#endif + return 0; +} + +int release_slave_reset_gpio_post_wakeup(void) +{ +#if H_HOST_PS_ALLOWED + gpio_pin_t reset_pin = { .port = H_GPIO_PORT_RESET, .pin = H_GPIO_PIN_RESET }; + + if (ESP_TRANSPORT_OK != esp_hosted_transport_get_reset_config(&reset_pin)) { + ESP_LOGE(TAG, "Unable to get RESET config for transport"); + return -1; + } + + if(reset_pin.pin == -1) { + ESP_LOGE(TAG, "RESET pin is not configured"); + return -1; + } + + return g_h.funcs->_h_hold_gpio(reset_pin.port, reset_pin.pin, H_DISABLE); +#endif + return 0; +} + + +int esp_hosted_power_save_start(esp_hosted_power_save_type_t power_save_type) +{ + + if (power_save_on) + return 0; + + if (!power_save_drv_init_done) { + ESP_LOGE(TAG, "Power save driver not initialized, might be disabled at host/slave"); + return -1; + } + +#if H_HOST_PS_ALLOWED + void* sleep_gpio_port = H_HOST_WAKEUP_GPIO_PORT; + int sleep_gpio = H_HOST_WAKEUP_GPIO; + int ret = 0; + + if (power_save_type != HOSTED_POWER_SAVE_TYPE_DEEP_SLEEP) { + ESP_LOGE(TAG, "Invalid or not supported power save type: %d", power_save_type); + return -1; + } + + /* Inform slave, host power save is started */ + if (notify_slave_host_power_save_start()) { + ESP_LOGE(TAG, "Failed to notify slave, host power save is started"); + return -1; + } + + if (reset_in_progress) { + ESP_LOGE(TAG, "Reset in progress is set"); + return -1; + } + + /* Clear prior configured interrupt */ + g_h.funcs->_h_teardown_gpio_interrupt(sleep_gpio_port, sleep_gpio); + + /* Hold reset pin of slave */ + if (hold_slave_reset_gpio_pre_power_save()) { + ESP_LOGE(TAG, "Failed to hold reset pin of slave"); + return -1; + } + + g_h.funcs->_h_msleep(50); + + /* Configure GPIO for deep sleep wakeup */ + ret = g_h.funcs->_h_config_host_power_save_hal_impl(power_save_type, sleep_gpio_port, sleep_gpio, H_HOST_WAKEUP_GPIO_LEVEL); + if (ret != 0) { + ESP_LOGE(TAG, "Failed to enable deep sleep wakeup for GPIO %d", sleep_gpio); + return -1; + } + + /* Lower GPIO to non-sleepable edge */ + if (sleep_gpio != -1) { + g_h.funcs->_h_write_gpio(sleep_gpio_port, sleep_gpio, !H_HOST_WAKEUP_GPIO_LEVEL); + } + + /* Disable pull-up and configure pull-down based on wakeup level */ + if (H_HOST_WAKEUP_GPIO_LEVEL) { + g_h.funcs->_h_pull_gpio(sleep_gpio_port, sleep_gpio, H_GPIO_PULL_UP, H_DISABLE); + g_h.funcs->_h_pull_gpio(sleep_gpio_port, sleep_gpio, H_GPIO_PULL_DOWN, H_ENABLE); + } else { + g_h.funcs->_h_pull_gpio(sleep_gpio_port, sleep_gpio, H_GPIO_PULL_DOWN, H_DISABLE); + g_h.funcs->_h_pull_gpio(sleep_gpio_port, sleep_gpio, H_GPIO_PULL_UP, H_ENABLE); + } + + power_save_on = 1; + + /* Start host power save with port layer */ + g_h.funcs->_h_start_host_power_save_hal_impl(power_save_type); + + + while (1) { + g_h.funcs->_h_msleep(1000); + /* dead loop */ + } +#endif + return -1; +} + +int stop_host_power_save(void) +{ + +#if H_HOST_PS_ALLOWED + /* Inform slave, host power save is stopped */ + if (notify_slave_host_power_save_stop()) { + ESP_LOGE(TAG, "Failed to notify slave, host power save is stopped"); + return -1; + } + + power_save_on = 0; +#endif + + return 0; +} + +#if H_HOST_PS_ALLOWED +static esp_timer_handle_t timer_handle = NULL; + +static void power_save_timer_callback(void *arg) +{ + ESP_LOGI(TAG, "Firing power save as timer expiry"); + esp_hosted_power_save_start(HOSTED_POWER_SAVE_TYPE_DEEP_SLEEP); +} +#endif +int esp_hosted_power_save_timer_start(uint32_t time_ms, int type) +{ + +#if H_HOST_PS_ALLOWED + int err = 0; + + if ((type != H_TIMER_TYPE_ONESHOT) && (type != H_TIMER_TYPE_PERIODIC)) { + ESP_LOGE(TAG, "Invalid timer type"); + return -1; + } + + if (time_ms == 0) { + ESP_LOGE(TAG, "Timer duration is 0, not starting timer"); + return -1; + } + + + if (timer_handle) { + ESP_LOGW(TAG, "Timer already exists"); + err = g_h.funcs->_h_timer_stop(timer_handle); + if (err != 0) { + ESP_LOGE(TAG, "Failed to stop timer"); + } + timer_handle = NULL; + return -1; + } + + + timer_handle = g_h.funcs->_h_timer_start("power_save_timer", time_ms, type, power_save_timer_callback, NULL); + if (err != 0) { + ESP_LOGE(TAG, "Failed to start timer"); + } +#endif + return 0; +} + +int esp_hosted_power_save_timer_stop(void) +{ +#if H_HOST_PS_ALLOWED + int err = 0; + if (!timer_handle) { + ESP_LOGW(TAG, "No timer exists"); + return -1; + } + err = g_h.funcs->_h_timer_stop(timer_handle); + if (err != 0) { + ESP_LOGE(TAG, "Failed to stop timer"); + } +#endif + return 0; +} diff --git a/host/drivers/power_save/power_save_drv.h b/host/drivers/power_save/power_save_drv.h new file mode 100644 index 00000000..5aaecb7c --- /dev/null +++ b/host/drivers/power_save/power_save_drv.h @@ -0,0 +1,37 @@ +/* + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* This file is internal to ESP-Hosted */ + +#ifndef __POWER_SAVE_DRV_H +#define __POWER_SAVE_DRV_H + +/** + * @brief Stops the host power save mode. + * @note This is an internal function called during the wake-up sequence. + * + * @return int Returns 0 on success, or a nonzero value on failure. + */ +int stop_host_power_save(void); + +/** + * @brief Holds the slave reset GPIO before deep sleep. + * @note Holding the slave reset GPIO before deep sleep is required, + * to ensure that the slave doesn't reset during deep sleep. + * However, this would consume some power. + * + * @return int Returns 0 on success, or a nonzero value on failure. + */ +int hold_slave_reset_gpio_pre_deep_sleep(void); + +/** + * @brief Releases the slave reset GPIO after wakeup from deep sleep. + * + * @return int Returns 0 on success, or a nonzero value on failure. + */ +int release_slave_reset_gpio_post_wakeup(void); + +#endif /* __POWER_SAVE_DRV_H */ diff --git a/host/drivers/rpc/core/rpc_core.c b/host/drivers/rpc/core/rpc_core.c index 389d6af8..b830409f 100644 --- a/host/drivers/rpc/core/rpc_core.c +++ b/host/drivers/rpc/core/rpc_core.c @@ -1,5 +1,8 @@ -// Copyright 2015-2022 Espressif Systems (Shanghai) PTE LTD -/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */ +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -9,12 +12,11 @@ #include "serial_if.h" #include "serial_drv.h" #include -#include "esp_log.h" #include "esp_task.h" -#include "esp_hosted_config.h" - +#include "port_esp_hosted_host_config.h" +#include "port_esp_hosted_host_log.h" -DEFINE_LOG_TAG(rpc_core); +static const char *TAG = "rpc_core"; #define RPC_LIB_STATE_INACTIVE 0 @@ -35,20 +37,8 @@ static queue_handle_t rpc_tx_q = NULL; static void * rpc_rx_thread_hdl; static void * rpc_tx_thread_hdl; static void * rpc_tx_sem; -static void * async_timer_hdl; static struct rpc_lib_context rpc_lib_ctxt; -static int call_event_callback(ctrl_cmd_t *app_event); -static int is_async_resp_callback_available(ctrl_cmd_t *app_resp); -static int is_sync_resp_sem_available(uint32_t uid); -static int clear_async_resp_callback(ctrl_cmd_t *app_resp); -static int call_async_resp_callback(ctrl_cmd_t *app_resp); -static int set_async_resp_callback(ctrl_cmd_t *app_req, rpc_rsp_cb_t resp_cb); -static int set_sync_resp_sem(ctrl_cmd_t *app_req); -static int wait_for_sync_response(ctrl_cmd_t *app_req); -static void rpc_async_timeout_handler(void *arg); -static int post_sync_resp_sem(ctrl_cmd_t *app_resp); - /* uid to link between requests and responses */ /* uids are incrementing values from 1 onwards. * 0 means not a valid id */ @@ -64,6 +54,7 @@ typedef struct { typedef struct { uint32_t uid; rpc_rsp_cb_t cb; + void * timer_hdl; } async_rsp_t; /* rpc response callbacks @@ -94,6 +85,19 @@ static async_rsp_t async_rsp_table[MAX_ASYNC_RPC_TRANSACTIONS] = { 0 }; */ static rpc_evt_cb_t rpc_evt_cb_table[RPC_ID__Event_Max - RPC_ID__Event_Base] = { NULL }; + +static int call_event_callback(ctrl_cmd_t *app_event); +static int is_async_resp_callback_available(ctrl_cmd_t *app_resp); +static int is_sync_resp_sem_available(uint32_t uid); +static int clear_async_resp_callback(async_rsp_t *async_rsp_item); +static int call_async_resp_callback(ctrl_cmd_t *app_resp); +static int set_async_resp_callback(ctrl_cmd_t *app_req, rpc_rsp_cb_t resp_cb, void *timer_hdl); +static int set_sync_resp_sem(ctrl_cmd_t *app_req); +static int wait_for_sync_response(ctrl_cmd_t *app_req); +static void rpc_async_timeout_handler(void *arg); +static int post_sync_resp_sem(ctrl_cmd_t *app_resp); + + /* Open serial interface * This function may fail if the ESP32 kernel module is not loaded **/ @@ -119,17 +123,24 @@ static inline void set_rpc_lib_state(int state) rpc_lib_ctxt.state = state; } -static inline int is_rpc_lib_state(int state) +static inline int is_rpc_lib_ready(void) { - if (rpc_lib_ctxt.state == state) + if (rpc_lib_ctxt.state >= RPC_LIB_STATE_READY) return 1; return 0; } +static inline int is_rpc_lib_inactive(void) +{ + if (rpc_lib_ctxt.state == RPC_LIB_STATE_INACTIVE) + return 1; + return 0; +} /* RPC TX indication */ static void rpc_tx_ind(void) { + ESP_LOGV(TAG, "posting rpc tx semaphore"); g_h.funcs->_h_post_semaphore(rpc_tx_sem); } @@ -194,29 +205,31 @@ static int process_rpc_tx_msg(ctrl_cmd_t *app_req) /* 5. Assign response callback, if valid */ if (app_req->rpc_rsp_cb) { - ret = set_async_resp_callback(app_req, app_req->rpc_rsp_cb); - if (ret < 0) { - ESP_LOGE(TAG, "could not set callback for req[%u]",req.msg_id); - failure_status = RPC_ERR_SET_ASYNC_CB; - goto fail_req; - } - } - /* 6. Start timeout for response for async only - * For sync procedures, g_h.funcs->_h_get_semaphore takes care to - * handle timeout situations */ - if (app_req->rpc_rsp_cb) { - async_timer_hdl = g_h.funcs->_h_timer_start(app_req->rsp_timeout_sec, RPC__TIMER_ONESHOT, + /* 5.1 Start timeout for response for async only + * For sync procedures, g_h.funcs->_h_get_semaphore takes care to + * handle timeout situations */ + ESP_LOGI(TAG, "starting async resp timer for req[%u]",req.msg_id); + void *timer_hdl = g_h.funcs->_h_timer_start("rpc_async_timeout_timer", SEC_TO_MILLISEC(app_req->rsp_timeout_sec), H_TIMER_TYPE_ONESHOT, rpc_async_timeout_handler, app_req); - if (!async_timer_hdl) { + if (!timer_hdl) { ESP_LOGE(TAG, "Failed to start async resp timer"); goto fail_req; } - } + /* 5.2 set async resp callback */ + ESP_LOGD(TAG, "setting async resp callback for req[%u]",req.msg_id); + ret = set_async_resp_callback(app_req, app_req->rpc_rsp_cb, timer_hdl); + if (ret < 0) { + ESP_LOGE(TAG, "could not set callback for req[%u]",req.msg_id); + failure_status = RPC_ERR_SET_ASYNC_CB; + goto fail_req; + } + } /* 7. Pack in protobuf and send the request */ rpc__pack(&req, tx_data); + ESP_LOGD(TAG, "sending rpc req[%u]",req.msg_id); if (transport_pserial_send(tx_data, tx_len)) { ESP_LOGE(TAG, "Send RPC req[0x%x] failed",req.msg_id); failure_status = RPC_ERR_TRANSPORT_SEND; @@ -262,7 +275,7 @@ static int process_rpc_tx_msg(ctrl_cmd_t *app_req) * Prevents timeout waiting for a response that will never come * as request was never sent */ - ESP_LOGV(TAG, "put failed response into rx queue"); + ESP_LOGW(TAG, "RPC Sync proc failed"); ctrl_cmd_t *app_resp = NULL; @@ -349,17 +362,6 @@ static int process_rpc_rx_msg(Rpc * proto_msg, rpc_rx_ind_t rpc_rx_func) /* Allocate app struct for response */ HOSTED_CALLOC(ctrl_cmd_t, app_resp, sizeof(ctrl_cmd_t), free_buffers); - - /* If this was async procedure, timer would have - * been running for response. - * As response received, stop timer */ - if (async_timer_hdl) { - ESP_LOGD(TAG, "Stopping the asyn timer for resp"); - /* async_timer_hdl will be cleaned in g_h.funcs->_h_timer_stop */ - g_h.funcs->_h_timer_stop(async_timer_hdl); - async_timer_hdl = NULL; - } - /* Decode protobuf buffer of response and * copy into app structures */ if (rpc_parse_rsp(proto_msg, app_resp)) { @@ -378,7 +380,6 @@ static int process_rpc_rx_msg(Rpc * proto_msg, rpc_rx_ind_t rpc_rx_func) * return to select */ call_async_resp_callback(app_resp); - clear_async_resp_callback(app_resp); } else { /* as RPC async response callback function is @@ -451,7 +452,7 @@ static void rpc_rx_thread(void const *arg) Rpc *resp = NULL; /* Block on read of protobuf encoded msg */ - if (is_rpc_lib_state(RPC_LIB_STATE_INACTIVE)) { + if (!is_rpc_lib_ready()) { g_h.funcs->_h_sleep(1); continue; } @@ -471,7 +472,9 @@ static void rpc_rx_thread(void const *arg) HOSTED_FREE(buf); /* Send for further processing as event or response */ + ESP_LOGV(TAG, "Before process_rpc_rx_msg"); process_rpc_rx_msg(resp, rpc_rx_func); + ESP_LOGV(TAG, "after process_rpc_rx_msg"); continue; /* Failed - cleanup */ @@ -507,22 +510,27 @@ static void rpc_tx_thread(void const *arg) /* Infinite loop to process incoming msg on serial interface */ while (1) { + ESP_LOGV(TAG, "Loop: Wait for next RPC request"); /* 4.1 Block on read of protobuf encoded msg */ - if (is_rpc_lib_state(RPC_LIB_STATE_INACTIVE)) { + if (!is_rpc_lib_ready()) { g_h.funcs->_h_sleep(1); - ESP_LOGV(TAG, "%s:%u rpc lib inactive",__func__,__LINE__); + ESP_LOGD(TAG, "%s:%u rpc lib not ready",__func__,__LINE__); continue; } + ESP_LOGV(TAG, "Waiting for RPC TX semaphore"); g_h.funcs->_h_get_semaphore(rpc_tx_sem, HOSTED_BLOCKING); + ESP_LOGV(TAG, "RPC TX semaphore acquired"); + ESP_LOGV(TAG, "Dequeueing RPC TX Q"); if (g_h.funcs->_h_dequeue_item(rpc_tx_q, &app_req, HOSTED_BLOCK_MAX)) { ESP_LOGE(TAG, "RPC TX Q Failed to dequeue"); continue; } if (app_req) { + ESP_LOGV(TAG, "Processing RPC TX msg"); process_rpc_tx_msg(app_req); } else { ESP_LOGE(TAG, "RPC Tx Q empty or uninitialised"); @@ -588,7 +596,7 @@ static ctrl_cmd_t * get_response(int *read_len, ctrl_cmd_t *app_req) /* Wait for response */ ret = wait_for_sync_response(app_req); if (ret) { - if (ret == RET_FAIL_TIMEOUT) + if ((ret == RET_FAIL_TIMEOUT) || (errno == ETIMEDOUT)) ESP_LOGW(TAG, "Timeout waiting for Resp for Req[0x%x]", app_req->msg_id); else ESP_LOGE(TAG, "ERR [%u] ret[%d] for Req[0x%x]", errno, ret, app_req->msg_id); @@ -615,19 +623,22 @@ static ctrl_cmd_t * get_response(int *read_len, ctrl_cmd_t *app_req) return NULL; } -static int clear_async_resp_callback(ctrl_cmd_t *app_resp) +static int clear_async_resp_callback(async_rsp_t *async_rsp_item) { - int i; + if (async_rsp_item->uid != 0) { - for (i = 0; i < MAX_ASYNC_RPC_TRANSACTIONS; i++) { - if (async_rsp_table[i].uid == app_resp->uid) { - async_rsp_table[i].uid = 0; - async_rsp_table[i].cb = NULL; - return ESP_OK; + if (async_rsp_item->timer_hdl) { + g_h.funcs->_h_timer_stop(async_rsp_item->timer_hdl); + async_rsp_item->timer_hdl = NULL; } - } - return CALLBACK_NOT_REGISTERED; + async_rsp_item->uid = 0; + async_rsp_item->cb = NULL; + return SUCCESS; + } else { + ESP_LOGW(TAG, "async_rsp_item to be cleared already has uid 0"); + } + return FAILURE; } /* Check and call rpc response asynchronous callback if available @@ -639,14 +650,19 @@ static int call_async_resp_callback(ctrl_cmd_t *app_resp) { int i; - if ((app_resp->msg_id <= RPC_ID__Resp_Base) || + // msg_id of RPC_ID__Resp_Base now means Invalid RPC Request + if ((app_resp->msg_id < RPC_ID__Resp_Base) || (app_resp->msg_id >= RPC_ID__Resp_Max)) { return MSG_ID_OUT_OF_ORDER; } for (i = 0; i < MAX_ASYNC_RPC_TRANSACTIONS; i++) { if (async_rsp_table[i].uid == app_resp->uid) { - return async_rsp_table[i].cb(app_resp); + int ret = async_rsp_table[i].cb(app_resp); + + clear_async_resp_callback(&async_rsp_table[i]); + + return ret; } } @@ -658,7 +674,8 @@ static int post_sync_resp_sem(ctrl_cmd_t *app_resp) { int i; - if ((app_resp->msg_id <= RPC_ID__Resp_Base) || + // msg_id of RPC_ID__Resp_Base now means Invalid RPC Request + if ((app_resp->msg_id < RPC_ID__Resp_Base) || (app_resp->msg_id >= RPC_ID__Resp_Max)) { return MSG_ID_OUT_OF_ORDER; } @@ -694,7 +711,7 @@ static int call_event_callback(ctrl_cmd_t *app_event) /* Set asynchronous rpc response callback from rpc **request** */ -static int set_async_resp_callback(ctrl_cmd_t *app_req, rpc_rsp_cb_t resp_cb) +static int set_async_resp_callback(ctrl_cmd_t *app_req, rpc_rsp_cb_t resp_cb, void *timer_hdl) { int i; @@ -708,6 +725,7 @@ static int set_async_resp_callback(ctrl_cmd_t *app_req, rpc_rsp_cb_t resp_cb) if (!async_rsp_table[i].uid) { async_rsp_table[i].uid = app_req->uid; async_rsp_table[i].cb = resp_cb; + async_rsp_table[i].timer_hdl = timer_hdl; return CALLBACK_SET_SUCCESS; } } @@ -798,7 +816,8 @@ static int is_async_resp_callback_available(ctrl_cmd_t *app_resp) { int i; - if ((app_resp->msg_id <= RPC_ID__Resp_Base) || (app_resp->msg_id >= RPC_ID__Resp_Max)) { + // msg_id of RPC_ID__Resp_Base now means Invalid RPC Request + if ((app_resp->msg_id < RPC_ID__Resp_Base) || (app_resp->msg_id >= RPC_ID__Resp_Max)) { ESP_LOGE(TAG, "resp id[0x%x] out of range", app_resp->msg_id); return MSG_ID_OUT_OF_ORDER; } @@ -919,7 +938,7 @@ int rpc_send_req(ctrl_cmd_t *app_req) ESP_LOGE(TAG, "Invalid param in rpc_send_req"); return FAILURE; } - ESP_LOGV(TAG, "app_req msgid[0x%x]", app_req->msg_id); + uid++; // handle rollover in uid value @@ -927,6 +946,7 @@ int rpc_send_req(ctrl_cmd_t *app_req) uid++; app_req->uid = uid; + ESP_LOGD(TAG, "app_req msgid[0x%x] with uid %" PRIu32, app_req->msg_id, app_req->uid); if (!app_req->rpc_rsp_cb) { /* sync proc only */ if (set_sync_resp_sem(app_req)) { @@ -937,6 +957,7 @@ int rpc_send_req(ctrl_cmd_t *app_req) app_req->msg_type = RPC_TYPE__Req; + ESP_LOGV(TAG, "queueing rpc tx q with uid %" PRIu32, app_req->uid); if (g_h.funcs->_h_queue_item(rpc_tx_q, &app_req, HOSTED_BLOCK_MAX)) { ESP_LOGE(TAG, "Failed to new app rpc req[0x%x] in tx queue", app_req->msg_id); goto fail_req; @@ -944,7 +965,8 @@ int rpc_send_req(ctrl_cmd_t *app_req) rpc_tx_ind(); - H_FREE_PTR_WITH_FUNC(app_req->app_free_buff_func, app_req->app_free_buff_hdl); + /* TODO : commenting, Review again to avoid duable free */ + //H_FREE_PTR_WITH_FUNC(app_req->app_free_buff_func, app_req->app_free_buff_hdl); return SUCCESS; @@ -958,12 +980,35 @@ int rpc_send_req(ctrl_cmd_t *app_req) return FAILURE; } +static int cleanup_sync_async_timer_table(void) +{ + for (int i = 0; i < MAX_ASYNC_RPC_TRANSACTIONS; i++) { + if (async_rsp_table[i].timer_hdl) { + g_h.funcs->_h_timer_stop(async_rsp_table[i].timer_hdl); + } + async_rsp_table[i].timer_hdl = NULL; + async_rsp_table[i].uid = 0; + async_rsp_table[i].cb = NULL; + } + + for (int i = 0; i < MAX_SYNC_RPC_TRANSACTIONS; i++) { + if (sync_rsp_table[i].sem) { + g_h.funcs->_h_get_semaphore(sync_rsp_table[i].sem, 0); + g_h.funcs->_h_destroy_semaphore(sync_rsp_table[i].sem); + } + sync_rsp_table[i].uid = 0; + sync_rsp_table[i].sem = NULL; + } + + return SUCCESS; +} + /* De-init hosted rpc lib */ int rpc_core_deinit(void) { int ret = SUCCESS; - if (is_rpc_lib_state(RPC_LIB_STATE_INACTIVE)) + if (is_rpc_lib_inactive()) return ret; set_rpc_lib_state(RPC_LIB_STATE_INACTIVE); @@ -981,11 +1026,7 @@ int rpc_core_deinit(void) ESP_LOGE(TAG, "read sem tx deinit failed"); } - if (async_timer_hdl) { - /* async_timer_hdl will be cleaned in g_h.funcs->_h_timer_stop */ - g_h.funcs->_h_timer_stop(async_timer_hdl); - async_timer_hdl = NULL; - } + cleanup_sync_async_timer_table(); if (serial_deinit()) { ret = FAILURE; @@ -1037,7 +1078,7 @@ int rpc_core_init(void) goto free_bufs; /* state init */ - set_rpc_lib_state(RPC_LIB_STATE_READY); + set_rpc_lib_state(RPC_LIB_STATE_INIT); return ret; @@ -1046,5 +1087,14 @@ int rpc_core_init(void) return FAILURE; } +int rpc_core_start(void) +{ + set_rpc_lib_state(RPC_LIB_STATE_READY); + return SUCCESS; +} - +int rpc_core_stop(void) +{ + set_rpc_lib_state(RPC_LIB_STATE_INIT); + return SUCCESS; +} diff --git a/host/drivers/rpc/core/rpc_core.h b/host/drivers/rpc/core/rpc_core.h index 690d4905..7ca8895b 100644 --- a/host/drivers/rpc/core/rpc_core.h +++ b/host/drivers/rpc/core/rpc_core.h @@ -1,8 +1,7 @@ /* - * Espressif Systems Wireless LAN device driver + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * - * Copyright (C) 2015-2022 Espressif Systems (Shanghai) PTE LTD - * SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 + * SPDX-License-Identifier: Apache-2.0 */ #ifndef __RPC_CORE_H @@ -11,8 +10,10 @@ #include #include #include +#include +#include "transport_drv.h" #include "rpc_slave_if.h" -#include "os_wrapper.h" +#include "port_esp_hosted_host_log.h" #ifndef BIT #define BIT(n) (1UL << (n)) @@ -88,11 +89,13 @@ typedef struct q_element { #define RPC_REQ_COPY_STR(DsT,SrC,MaxSizE) { \ if (SrC) { \ - RPC_REQ_COPY_BYTES(DsT, SrC, min(strlen((char*)SrC)+1,MaxSizE)); \ + RPC_REQ_COPY_BYTES(DsT, SrC, H_MIN(strlen((char*)SrC)+1,MaxSizE)); \ } \ } int rpc_core_init(void); +int rpc_core_start(void); +int rpc_core_stop(void); int rpc_core_deinit(void); /* * Allows user app to create low level protobuf request diff --git a/host/drivers/rpc/core/rpc_evt.c b/host/drivers/rpc/core/rpc_evt.c index dd40b04c..b833d5d6 100644 --- a/host/drivers/rpc/core/rpc_evt.c +++ b/host/drivers/rpc/core/rpc_evt.c @@ -1,10 +1,17 @@ -// Copyright 2015-2022 Espressif Systems (Shanghai) PTE LTD -/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */ +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "rpc_core.h" +#include "rpc_utils.h" #include "rpc_slave_if.h" -#include "esp_log.h" #include "esp_hosted_transport.h" +#include "port_esp_hosted_host_log.h" +#include "port_esp_hosted_host_config.h" +#include "esp_hosted_bitmasks.h" +#include "esp_hosted_os_abstraction.h" DEFINE_LOG_TAG(rpc_evt); @@ -81,10 +88,83 @@ int rpc_parse_evt(Rpc *rpc_msg, ctrl_cmd_t *app_ntfy) p_a->reason = p_c->reason; break; - } case RPC_ID__Event_WifiEventNoArgs: { +#if H_WIFI_HE_SUPPORT + } case RPC_ID__Event_StaItwtSetup: { + wifi_event_sta_itwt_setup_t * p_a = &(app_ntfy->u.e_wifi_sta_itwt_setup); + RpcEventStaItwtSetup * p_c = rpc_msg->event_sta_itwt_setup; + + ESP_LOGD(TAG, "EVENT: iTWT -> setup"); + RPC_FAIL_ON_NULL(event_sta_itwt_setup); + app_ntfy->resp_event_status = p_c->resp; + + p_a->config.setup_cmd = p_c->config->setup_cmd; + p_a->config.trigger = H_GET_BIT(WIFI_ITWT_CONFIG_1_trigger_BIT, p_c->config->bitmask_1); + p_a->config.flow_type = H_GET_BIT(WIFI_ITWT_CONFIG_1_flow_type_BIT, p_c->config->bitmask_1); + // WIFI_ITWT_CONFIG_1_flow_id_BIT is three bits wide + p_a->config.flow_id = (p_c->config->bitmask_1 >> WIFI_ITWT_CONFIG_1_flow_id_BIT) & 0x07; + // WIFI_ITWT_CONFIG_1_wake_invl_expn_BIT is five bits wide + p_a->config.wake_invl_expn = (p_c->config->bitmask_1 >> WIFI_ITWT_CONFIG_1_wake_invl_expn_BIT) & 0x1F; + p_a->config.wake_duration_unit = H_GET_BIT(WIFI_ITWT_CONFIG_1_wake_duration_unit_BIT, p_c->config->bitmask_1); +#if H_DECODE_WIFI_RESERVED_FIELD + p_a->config.reserved = (p_c->config->bitmask_1 >> WIFI_ITWT_CONFIG_1_MAX_USED_BIT) & WIFI_ITWT_CONFIG_1_RESERVED_BITMASK; +#endif + p_a->config.min_wake_dura = p_c->config->min_wake_dura; + p_a->config.wake_invl_mant = p_c->config->wake_invl_mant; + p_a->config.twt_id = p_c->config->twt_id; + p_a->config.timeout_time_ms = p_c->config->timeout_time_ms; + p_a->status = p_c->status; + p_a->reason = p_c->reason; + p_a->target_wake_time = p_c->target_wake_time; + + break; + } case RPC_ID__Event_StaItwtTeardown: { + wifi_event_sta_itwt_teardown_t * p_a = &(app_ntfy->u.e_wifi_sta_itwt_teardown); + RpcEventStaItwtTeardown * p_c = rpc_msg->event_sta_itwt_teardown; + + ESP_LOGD(TAG, "EVENT: iTWT -> teardown"); + RPC_FAIL_ON_NULL(event_sta_itwt_teardown); + app_ntfy->resp_event_status = p_c->resp; + + p_a->flow_id = p_c->flow_id; + p_a->status = p_c->status; + + break; + } case RPC_ID__Event_StaItwtSuspend: { + wifi_event_sta_itwt_suspend_t * p_a = &(app_ntfy->u.e_wifi_sta_itwt_suspend); + RpcEventStaItwtSuspend * p_c = rpc_msg->event_sta_itwt_suspend; + int num_elements = sizeof(p_a->actual_suspend_time_ms) / sizeof(p_a->actual_suspend_time_ms[0]); + int i; + + ESP_LOGD(TAG, "EVENT: iTWT -> suspend"); + RPC_FAIL_ON_NULL(event_sta_itwt_suspend); + app_ntfy->resp_event_status = p_c->resp; + + p_a->status = p_c->status; + p_a->flow_id_bitmap = p_c->flow_id_bitmap; + + memset(p_a->actual_suspend_time_ms, 0, sizeof(p_a->actual_suspend_time_ms)); + for (i = 0; i < H_MIN(num_elements, p_c->n_actual_suspend_time_ms); i++) { + p_a->actual_suspend_time_ms[i] = p_c->actual_suspend_time_ms[i]; + } + + break; + } case RPC_ID__Event_StaItwtProbe: { + wifi_event_sta_itwt_probe_t * p_a = &(app_ntfy->u.e_wifi_sta_itwt_probe); + RpcEventStaItwtProbe * p_c = rpc_msg->event_sta_itwt_probe; + + ESP_LOGD(TAG, "EVENT: iTWT -> probe"); + RPC_FAIL_ON_NULL(event_sta_itwt_probe); + app_ntfy->resp_event_status = p_c->resp; + + p_a->status = p_c->status; + p_a->reason = p_c->reason; + + break; +#endif + } case RPC_ID__Event_WifiEventNoArgs: { RPC_FAIL_ON_NULL(event_wifi_event_no_args); app_ntfy->resp_event_status = rpc_msg->event_wifi_event_no_args->resp; - ESP_LOGI(TAG, "Event [0x%lx] received", rpc_msg->event_wifi_event_no_args->event_id); + ESP_LOGI(TAG, "Event [0x%" PRIx32 "] received", rpc_msg->event_wifi_event_no_args->event_id); app_ntfy->u.e_wifi_simple.wifi_event_id = rpc_msg->event_wifi_event_no_args->event_id; switch (rpc_msg->event_wifi_event_no_args->event_id) { @@ -116,14 +196,20 @@ int rpc_parse_evt(Rpc *rpc_msg, ctrl_cmd_t *app_ntfy) case WIFI_EVENT_AP_STOP: ESP_LOGI(TAG, "EVT rcvd: Wi-Fi AP stop"); break; + case WIFI_EVENT_HOME_CHANNEL_CHANGE: + ESP_LOGI(TAG, "EVT rcvd: Wi-Fi Home channel change"); + break; + default: + ESP_LOGI(TAG, "EVT rcvd: Wi-Fi Event[%" PRId32 "] ignored", rpc_msg->event_wifi_event_no_args->event_id); + break; } break; - } case RPC_ID__Event_StaScanDone: { + } case RPC_ID__Event_StaScanDone: { RpcEventStaScanDone *p_c = rpc_msg->event_sta_scan_done; wifi_event_sta_scan_done_t *p_a = &app_ntfy->u.e_wifi_sta_scan_done; RPC_FAIL_ON_NULL(event_sta_scan_done); app_ntfy->resp_event_status = p_c->resp; - ESP_LOGI(TAG, "Event Scan Done, %ld items", rpc_msg->event_sta_scan_done->scan_done->number); + ESP_LOGI(TAG, "Event Scan Done, %" PRIu32 " items", rpc_msg->event_sta_scan_done->scan_done->number); p_a->status = p_c->scan_done->status; p_a->number = p_c->scan_done->number; p_a->scan_id = p_c->scan_done->scan_id; @@ -161,6 +247,92 @@ int rpc_parse_evt(Rpc *rpc_msg, ctrl_cmd_t *app_ntfy) p_a->rssi = p_c->rssi; } break; + } case RPC_ID__Event_DhcpDnsStatus: { + RPC_FAIL_ON_NULL(event_dhcp_dns); + RpcEventDhcpDnsStatus *p_c = rpc_msg->event_dhcp_dns; + rpc_set_dhcp_dns_status_t* p_a = &app_ntfy->u.slave_dhcp_dns_status; + app_ntfy->resp_event_status = rpc_msg->event_dhcp_dns->resp; + + p_a->iface = p_c->iface; + p_a->dhcp_up = p_c->dhcp_up; + p_a->dns_up = p_c->dns_up; + p_a->dns_type = p_c->dns_type; + p_a->net_link_up = p_c->net_link_up; + + g_h.funcs->_h_memcpy(p_a->dhcp_ip, p_c->dhcp_ip.data, p_c->dhcp_ip.len); + g_h.funcs->_h_memcpy(p_a->dhcp_nm, p_c->dhcp_nm.data, p_c->dhcp_nm.len); + g_h.funcs->_h_memcpy(p_a->dhcp_gw, p_c->dhcp_gw.data, p_c->dhcp_gw.len); + g_h.funcs->_h_memcpy(p_a->dns_ip, p_c->dns_ip.data, p_c->dns_ip.len); + + break; +#if H_SUPP_DPP_SUPPORT + } + case RPC_ID__Event_SuppDppUriReady: { + RpcEventSuppDppUriReady *p_c = rpc_msg->event_supp_dpp_uri_ready; + supp_wifi_event_dpp_uri_ready_t *p_a = &app_ntfy->u.e_dpp_uri_ready; + app_ntfy->resp_event_status = rpc_msg->event_supp_dpp_uri_ready->resp; + + g_h.funcs->_h_memset(p_a->uri, 0, DPP_URI_LEN_MAX); + + p_a->uri_data_len = p_c->qrcode.len; + if (p_a->uri_data_len <= DPP_URI_LEN_MAX) { + g_h.funcs->_h_memcpy(p_a->uri, p_c->qrcode.data, p_a->uri_data_len); + } else { + ESP_LOGE(TAG, "Incoming URI is too long (over %d bytes). Increase Kconfig ESP_HOSTED_DPP_URI_LEN_MAX for proper operation", DPP_URI_LEN_MAX - 1); + p_a->uri_data_len = 0; + } + break; + } + case RPC_ID__Event_SuppDppCfgRecvd: { + RpcEventSuppDppCfgRecvd *p_c = rpc_msg->event_supp_dpp_cfg_recvd; + supp_wifi_event_dpp_config_received_t *p_a = &app_ntfy->u.e_dpp_config_received; + app_ntfy->resp_event_status = rpc_msg->event_supp_dpp_uri_ready->resp; + + rpc_copy_wifi_sta_config(&p_a->wifi_cfg.sta, p_c->cfg->sta); + break; + } + case RPC_ID__Event_SuppDppFail: { + RpcEventSuppDppFail *p_c = rpc_msg->event_supp_dpp_fail; + supp_wifi_event_dpp_failed_t *p_a = &app_ntfy->u.e_dpp_failed; + app_ntfy->resp_event_status = rpc_msg->event_supp_dpp_fail->resp; + + p_a->failure_reason = p_c->reason; + break; +#endif // H_SUPP_DPP_SUPPORT +#if H_WIFI_DPP_SUPPORT + } + case RPC_ID__Event_WifiDppUriReady: { + RpcEventWifiDppUriReady *p_c = rpc_msg->event_wifi_dpp_uri_ready; + supp_wifi_event_dpp_uri_ready_t *p_a = &app_ntfy->u.e_dpp_uri_ready; + app_ntfy->resp_event_status = rpc_msg->event_supp_dpp_uri_ready->resp; + + g_h.funcs->_h_memset(p_a->uri, 0, DPP_URI_LEN_MAX); + + p_a->uri_data_len = p_c->qrcode.len; + if (p_a->uri_data_len <= DPP_URI_LEN_MAX) { + g_h.funcs->_h_memcpy(p_a->uri, p_c->qrcode.data, p_a->uri_data_len); + } else { + ESP_LOGE(TAG, "Incoming URI is too long (over %d bytes). Increase Kconfig ESP_HOSTED_DPP_URI_LEN_MAX for proper operation", DPP_URI_LEN_MAX - 1); + p_a->uri_data_len = 0; + } + break; + } + case RPC_ID__Event_WifiDppCfgRecvd: { + RpcEventWifiDppCfgRecvd *p_c = rpc_msg->event_wifi_dpp_cfg_recvd; + supp_wifi_event_dpp_config_received_t *p_a = &app_ntfy->u.e_dpp_config_received; + app_ntfy->resp_event_status = rpc_msg->event_supp_dpp_uri_ready->resp; + + rpc_copy_wifi_sta_config(&p_a->wifi_cfg.sta, p_c->cfg->sta); + break; + } + case RPC_ID__Event_WifiDppFail: { + RpcEventWifiDppFail *p_c = rpc_msg->event_wifi_dpp_fail; + supp_wifi_event_dpp_failed_t *p_a = &app_ntfy->u.e_dpp_failed; + app_ntfy->resp_event_status = rpc_msg->event_supp_dpp_fail->resp; + + p_a->failure_reason = p_c->reason; + break; +#endif // H_WIFI_DPP_SUPPORT } default: { ESP_LOGE(TAG, "Invalid/unsupported event[%u] received\n",rpc_msg->msg_id); goto fail_parse_rpc_msg; diff --git a/host/drivers/rpc/core/rpc_req.c b/host/drivers/rpc/core/rpc_req.c index 80bb6c69..80f30130 100644 --- a/host/drivers/rpc/core/rpc_req.c +++ b/host/drivers/rpc/core/rpc_req.c @@ -1,13 +1,18 @@ -// Copyright 2015-2022 Espressif Systems (Shanghai) PTE LTD -/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */ +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "rpc_core.h" #include "rpc_slave_if.h" #include "esp_hosted_rpc.h" -#include "esp_log.h" -#include "esp_hosted_wifi_config.h" +#include "port_esp_hosted_host_wifi_config.h" #include "esp_hosted_transport.h" #include "esp_hosted_bitmasks.h" +#include "esp_idf_version.h" +#include "port_esp_hosted_host_log.h" +#include "esp_hosted_os_abstraction.h" DEFINE_LOG_TAG(rpc_req); @@ -65,6 +70,7 @@ int compose_rpc_req(Rpc *req, ctrl_cmd_t *app_req, int32_t *failure_status) case RPC_ID__Req_WifiGetPs: case RPC_ID__Req_OTABegin: case RPC_ID__Req_OTAEnd: + case RPC_ID__Req_OTAActivate: case RPC_ID__Req_WifiDeinit: case RPC_ID__Req_WifiStart: case RPC_ID__Req_WifiStop: @@ -86,6 +92,21 @@ int compose_rpc_req(Rpc *req, ctrl_cmd_t *app_req, int32_t *failure_status) case RPC_ID__Req_WifiStaGetAid: case RPC_ID__Req_WifiGetBand: case RPC_ID__Req_WifiGetBandMode: +#if H_WIFI_ENTERPRISE_SUPPORT + case RPC_ID__Req_WifiStaEnterpriseEnable: + case RPC_ID__Req_WifiStaEnterpriseDisable: + case RPC_ID__Req_EapClearIdentity: + case RPC_ID__Req_EapClearUsername: + case RPC_ID__Req_EapClearPassword: + case RPC_ID__Req_EapClearNewPassword: + case RPC_ID__Req_EapClearCaCert: + case RPC_ID__Req_EapClearCertificateAndKey: +#endif +#if H_DPP_SUPPORT + case RPC_ID__Req_SuppDppDeinit: + case RPC_ID__Req_SuppDppStartListen: + case RPC_ID__Req_SuppDppStopListen: +#endif case RPC_ID__Req_WifiScanGetApRecord: { /* Intentional fallthrough & empty */ break; @@ -168,6 +189,8 @@ int compose_rpc_req(Rpc *req, ctrl_cmd_t *app_req, int32_t *failure_status) req_payload->cfg->tx_buf_type = p_a->tx_buf_type ; req_payload->cfg->static_tx_buf_num = p_a->static_tx_buf_num ; req_payload->cfg->dynamic_tx_buf_num = p_a->dynamic_tx_buf_num ; + req_payload->cfg->rx_mgmt_buf_type = p_a->rx_mgmt_buf_type ; + req_payload->cfg->rx_mgmt_buf_num = p_a->rx_mgmt_buf_num ; req_payload->cfg->cache_tx_buf_num = p_a->cache_tx_buf_num ; req_payload->cfg->csi_enable = p_a->csi_enable ; req_payload->cfg->ampdu_rx_enable = p_a->ampdu_rx_enable ; @@ -178,9 +201,12 @@ int compose_rpc_req(Rpc *req, ctrl_cmd_t *app_req, int32_t *failure_status) req_payload->cfg->rx_ba_win = p_a->rx_ba_win ; req_payload->cfg->wifi_task_core_id = p_a->wifi_task_core_id ; req_payload->cfg->beacon_max_len = p_a->beacon_max_len ; + req_payload->cfg->feature_caps = p_a->feature_caps ; req_payload->cfg->mgmt_sbuf_num = p_a->mgmt_sbuf_num ; req_payload->cfg->sta_disconnected_pm = p_a->sta_disconnected_pm ; req_payload->cfg->espnow_max_encrypt_num = p_a->espnow_max_encrypt_num ; + req_payload->cfg->tx_hetb_queue_num = p_a->tx_hetb_queue_num ; + req_payload->cfg->dump_hesigb_enable = p_a->dump_hesigb_enable ; req_payload->cfg->magic = p_a->magic ; /* uint64 - TODO: portable? */ @@ -226,60 +252,87 @@ int compose_rpc_req(Rpc *req, ctrl_cmd_t *app_req, int32_t *failure_status) RPC_ALLOC_ELEMENT(WifiScanThreshold, p_c_sta->threshold, wifi_scan_threshold__init); p_c_sta->threshold->rssi = p_a_sta->threshold.rssi; p_c_sta->threshold->authmode = p_a_sta->threshold.authmode; +#if H_PRESENT_IN_ESP_IDF_5_4_0 + p_c_sta->threshold->rssi_5g_adjustment = p_a_sta->threshold.rssi_5g_adjustment; +#endif RPC_ALLOC_ELEMENT(WifiPmfConfig, p_c_sta->pmf_cfg, wifi_pmf_config__init); p_c_sta->pmf_cfg->capable = p_a_sta->pmf_cfg.capable; p_c_sta->pmf_cfg->required = p_a_sta->pmf_cfg.required; if (p_a_sta->rm_enabled) - H_SET_BIT(STA_RM_ENABLED_BIT, p_c_sta->bitmask); + H_SET_BIT(WIFI_STA_CONFIG_1_rm_enabled, p_c_sta->bitmask); if (p_a_sta->btm_enabled) - H_SET_BIT(STA_BTM_ENABLED_BIT, p_c_sta->bitmask); + H_SET_BIT(WIFI_STA_CONFIG_1_btm_enabled, p_c_sta->bitmask); if (p_a_sta->mbo_enabled) - H_SET_BIT(STA_MBO_ENABLED_BIT, p_c_sta->bitmask); + H_SET_BIT(WIFI_STA_CONFIG_1_mbo_enabled, p_c_sta->bitmask); if (p_a_sta->ft_enabled) - H_SET_BIT(STA_FT_ENABLED_BIT, p_c_sta->bitmask); + H_SET_BIT(WIFI_STA_CONFIG_1_ft_enabled, p_c_sta->bitmask); if (p_a_sta->owe_enabled) - H_SET_BIT(STA_OWE_ENABLED_BIT, p_c_sta->bitmask); + H_SET_BIT(WIFI_STA_CONFIG_1_owe_enabled, p_c_sta->bitmask); if (p_a_sta->transition_disable) - H_SET_BIT(STA_TRASITION_DISABLED_BIT, p_c_sta->bitmask); - - WIFI_CONFIG_STA_SET_RESERVED_VAL(p_a_sta->reserved, p_c_sta->bitmask); + H_SET_BIT(WIFI_STA_CONFIG_1_transition_disable, p_c_sta->bitmask); + +#if H_DECODE_WIFI_RESERVED_FIELD + #if H_WIFI_NEW_RESERVED_FIELD_NAMES + WIFI_STA_CONFIG_2_SET_RESERVED_VAL(p_a_sta->reserved2, p_c_sta->he_bitmask); + #else + WIFI_STA_CONFIG_2_SET_RESERVED_VAL(p_a_sta->he_reserved, p_c_sta->he_bitmask); + #endif +#endif p_c_sta->sae_pwe_h2e = p_a_sta->sae_pwe_h2e; + p_c_sta->sae_pk_mode = p_a_sta->sae_pk_mode; p_c_sta->failure_retry_cnt = p_a_sta->failure_retry_cnt; if (p_a_sta->he_dcm_set) - H_SET_BIT(WIFI_HE_STA_CONFIG_he_dcm_set_BIT, p_c_sta->he_bitmask); + H_SET_BIT(WIFI_STA_CONFIG_2_he_dcm_set_BIT, p_c_sta->he_bitmask); // WIFI_HE_STA_CONFIG_he_dcm_max_constellation_tx is two bits wide if (p_a_sta->he_dcm_max_constellation_tx) - p_c_sta->he_bitmask |= ((p_a_sta->he_dcm_max_constellation_tx & 0x03) << WIFI_HE_STA_CONFIG_he_dcm_max_constellation_tx_BITS); + p_c_sta->he_bitmask |= ((p_a_sta->he_dcm_max_constellation_tx & 0x03) << WIFI_STA_CONFIG_2_he_dcm_max_constellation_tx_BITS); // WIFI_HE_STA_CONFIG_he_dcm_max_constellation_rx is two bits wide if (p_a_sta->he_dcm_max_constellation_rx) - p_c_sta->he_bitmask |= ((p_a_sta->he_dcm_max_constellation_rx & 0x03) << WIFI_HE_STA_CONFIG_he_dcm_max_constellation_rx_BITS); + p_c_sta->he_bitmask |= ((p_a_sta->he_dcm_max_constellation_rx & 0x03) << WIFI_STA_CONFIG_2_he_dcm_max_constellation_rx_BITS); if (p_a_sta->he_mcs9_enabled) - H_SET_BIT(WIFI_HE_STA_CONFIG_he_mcs9_enabled_BIT, p_c_sta->he_bitmask); + H_SET_BIT(WIFI_STA_CONFIG_2_he_mcs9_enabled_BIT, p_c_sta->he_bitmask); if (p_a_sta->he_su_beamformee_disabled) - H_SET_BIT(WIFI_HE_STA_CONFIG_he_su_beamformee_disabled_BIT, p_c_sta->he_bitmask); + H_SET_BIT(WIFI_STA_CONFIG_2_he_su_beamformee_disabled_BIT, p_c_sta->he_bitmask); if (p_a_sta->he_trig_su_bmforming_feedback_disabled) - H_SET_BIT(WIFI_HE_STA_CONFIG_he_trig_su_bmforming_feedback_disabled_BIT, p_c_sta->he_bitmask); + H_SET_BIT(WIFI_STA_CONFIG_2_he_trig_su_bmforming_feedback_disabled_BIT, p_c_sta->he_bitmask); if (p_a_sta->he_trig_mu_bmforming_partial_feedback_disabled) - H_SET_BIT(WIFI_HE_STA_CONFIG_he_trig_mu_bmforming_partial_feedback_disabled_BIT, p_c_sta->he_bitmask); + H_SET_BIT(WIFI_STA_CONFIG_2_he_trig_mu_bmforming_partial_feedback_disabled_BIT, p_c_sta->he_bitmask); if (p_a_sta->he_trig_cqi_feedback_disabled) - H_SET_BIT(WIFI_HE_STA_CONFIG_he_trig_cqi_feedback_disabled_BIT, p_c_sta->he_bitmask); + H_SET_BIT(WIFI_STA_CONFIG_2_he_trig_cqi_feedback_disabled_BIT, p_c_sta->he_bitmask); + +#if H_PRESENT_IN_ESP_IDF_5_5_0 + if (p_a_sta->vht_su_beamformee_disabled) + H_SET_BIT(WIFI_STA_CONFIG_2_vht_su_beamformee_disabled, p_c_sta->he_bitmask); + + if (p_a_sta->vht_mu_beamformee_disabled) + H_SET_BIT(WIFI_STA_CONFIG_2_vht_mu_beamformee_disabled, p_c_sta->he_bitmask); + + if (p_a_sta->vht_mcs8_enabled) + H_SET_BIT(WIFI_STA_CONFIG_2_vht_mcs8_enabled, p_c_sta->he_bitmask); +#endif - WIFI_HE_STA_SET_RESERVED_VAL(p_a_sta->he_reserved, p_c_sta->he_bitmask); +#if H_DECODE_WIFI_RESERVED_FIELD + #if H_WIFI_NEW_RESERVED_FIELD_NAMES + WIFI_STA_CONFIG_2_SET_RESERVED_VAL(p_a_sta->reserved2, p_c_sta->he_bitmask); + #else + WIFI_STA_CONFIG_2_SET_RESERVED_VAL(p_a_sta->he_reserved, p_c_sta->he_bitmask); + #endif +#endif RPC_REQ_COPY_BYTES(p_c_sta->sae_h2e_identifier, p_a_sta->sae_h2e_identifier, SAE_H2E_IDENTIFIER_LEN); break; @@ -298,11 +351,24 @@ int compose_rpc_req(Rpc *req, ctrl_cmd_t *app_req, int32_t *failure_status) p_c_ap->ssid_hidden = p_a_ap->ssid_hidden; p_c_ap->max_connection = p_a_ap->max_connection; p_c_ap->beacon_interval = p_a_ap->beacon_interval; + p_c_ap->csa_count = p_a_ap->csa_count; + p_c_ap->dtim_period = p_a_ap->dtim_period; p_c_ap->pairwise_cipher = p_a_ap->pairwise_cipher; p_c_ap->ftm_responder = p_a_ap->ftm_responder; RPC_ALLOC_ELEMENT(WifiPmfConfig, p_c_ap->pmf_cfg, wifi_pmf_config__init); p_c_ap->pmf_cfg->capable = p_a_ap->pmf_cfg.capable; p_c_ap->pmf_cfg->required = p_a_ap->pmf_cfg.required; + p_c_ap->sae_pwe_h2e = p_a_ap->sae_pwe_h2e; +#if H_GOT_AP_CONFIG_PARAM_TRANSITION_DISABLE + p_c_ap->transition_disable = p_a_ap->transition_disable; +#endif +#if H_PRESENT_IN_ESP_IDF_5_5_0 + p_c_ap->sae_ext = p_a_ap->sae_ext; + RPC_ALLOC_ELEMENT(WifiBssMaxIdleConfig, p_c_ap->bss_max_idle_cfg, wifi_bss_max_idle_config__init); + p_c_ap->bss_max_idle_cfg->period = p_a_ap->bss_max_idle_cfg.period; + p_c_ap->bss_max_idle_cfg->protected_keep_alive = p_a_ap->bss_max_idle_cfg.protected_keep_alive; + p_c_ap->gtk_rekey_interval = p_a_ap->gtk_rekey_interval; +#endif break; } default: { ESP_LOGE(TAG, "unexpected wifi iface [%u]\n", p_a->iface); @@ -345,6 +411,10 @@ int compose_rpc_req(Rpc *req, ctrl_cmd_t *app_req, int32_t *failure_status) p_c->home_chan_dwell_time = p_a->home_chan_dwell_time; + RPC_ALLOC_ELEMENT(WifiScanChannelBitmap, p_c->channel_bitmap, wifi_scan_channel_bitmap__init); + p_c->channel_bitmap->ghz_2_channels = p_a->channel_bitmap.ghz_2_channels; + p_c->channel_bitmap->ghz_5_channels = p_a->channel_bitmap.ghz_5_channels; + req_payload->config_set = 1; } ESP_LOGI(TAG, "Scan start Req\n"); @@ -423,6 +493,93 @@ int compose_rpc_req(Rpc *req, ctrl_cmd_t *app_req, int32_t *failure_status) RPC_ALLOC_ASSIGN(RpcReqGetCoprocessorFwVersion, req_get_coprocessor_fwversion, rpc__req__get_coprocessor_fw_version__init); break; + } case RPC_ID__Req_WifiSetInactiveTime: { + RPC_ALLOC_ASSIGN(RpcReqWifiSetInactiveTime, req_wifi_set_inactive_time, + rpc__req__wifi_set_inactive_time__init); + req_payload->ifx = app_req->u.wifi_inactive_time.ifx; + req_payload->sec = app_req->u.wifi_inactive_time.sec; + break; + } case RPC_ID__Req_WifiGetInactiveTime: { + RPC_ALLOC_ASSIGN(RpcReqWifiGetInactiveTime, req_wifi_get_inactive_time, + rpc__req__wifi_get_inactive_time__init); + req_payload->ifx = app_req->u.wifi_inactive_time.ifx; + break; +#if H_WIFI_HE_SUPPORT + } case RPC_ID__Req_WifiStaTwtConfig: { + RPC_ALLOC_ASSIGN(RpcReqWifiStaTwtConfig, req_wifi_sta_twt_config, + rpc__req__wifi_sta_twt_config__init); + RPC_ALLOC_ELEMENT(WifiTwtConfig, req_payload->config, wifi_twt_config__init); + req_payload->config->post_wakeup_event = app_req->u.wifi_twt_config.post_wakeup_event; +#if H_GOT_TWT_ENABLE_KEEP_ALIVE + req_payload->config->twt_enable_keep_alive = app_req->u.wifi_twt_config.twt_enable_keep_alive; +#endif + break; + } case RPC_ID__Req_WifiStaItwtSetup: { + RPC_ALLOC_ASSIGN(RpcReqWifiStaItwtSetup, req_wifi_sta_itwt_setup, + rpc__req__wifi_sta_itwt_setup__init); + RPC_ALLOC_ELEMENT(WifiItwtSetupConfig, req_payload->setup_config, wifi_itwt_setup_config__init); +#if H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 + wifi_itwt_setup_config_t * p_a_cfg = &app_req->u.wifi_itwt_setup_config; +#else + wifi_twt_setup_config_t * p_a_cfg = &app_req->u.wifi_twt_setup_config; +#endif + WifiItwtSetupConfig * p_c_cfg = req_payload->setup_config; + + p_c_cfg->setup_cmd = p_a_cfg->setup_cmd; + if (p_a_cfg->trigger) + H_SET_BIT(WIFI_ITWT_CONFIG_1_trigger_BIT, p_c_cfg->bitmask_1); + + if (p_a_cfg->flow_type) + H_SET_BIT(WIFI_ITWT_CONFIG_1_flow_type_BIT, p_c_cfg->bitmask_1); + + // WIFI_ITWT_CONFIG_1_flow_id_BIT is three bits wide + if (p_a_cfg->flow_id) + p_c_cfg->bitmask_1 |= ((p_a_cfg->flow_id & 0x07) << WIFI_ITWT_CONFIG_1_flow_id_BIT); + + // WIFI_ITWT_CONFIG_1_wake_invl_expn_BIT is five bits wide + if (p_a_cfg->wake_invl_expn) + p_c_cfg->bitmask_1 |= ((p_a_cfg->wake_invl_expn & 0x1F) << WIFI_ITWT_CONFIG_1_wake_invl_expn_BIT); + + if (p_a_cfg->wake_duration_unit) + H_SET_BIT(WIFI_ITWT_CONFIG_1_wake_duration_unit_BIT, p_c_cfg->bitmask_1); + +#if H_DECODE_WIFI_RESERVED_FIELD + WIFI_ITWT_CONFIG_1_SET_RESERVED_VAL(p_a_cfg->reserved, p_c_cfg->bitmask_1); +#endif + p_c_cfg->min_wake_dura = p_a_cfg->min_wake_dura; + p_c_cfg->wake_invl_mant = p_a_cfg->wake_invl_mant; + p_c_cfg->twt_id = p_a_cfg->twt_id; + p_c_cfg->timeout_time_ms = p_a_cfg->timeout_time_ms; + + break; + } case RPC_ID__Req_WifiStaItwtTeardown: { + RPC_ALLOC_ASSIGN(RpcReqWifiStaItwtTeardown, req_wifi_sta_itwt_teardown, + rpc__req__wifi_sta_itwt_teardown__init); + + req_payload->flow_id = app_req->u.wifi_itwt_flow_id; + break; + } case RPC_ID__Req_WifiStaItwtSuspend: { + RPC_ALLOC_ASSIGN(RpcReqWifiStaItwtSuspend, req_wifi_sta_itwt_suspend, + rpc__req__wifi_sta_itwt_suspend__init); + + req_payload->flow_id = app_req->u.wifi_itwt_suspend.flow_id; + req_payload->suspend_time_ms = app_req->u.wifi_itwt_suspend.suspend_time_ms; + break; + } case RPC_ID__Req_WifiStaItwtGetFlowIdStatus: { + RPC_ALLOC_ASSIGN(RpcReqWifiStaItwtGetFlowIdStatus, req_wifi_sta_itwt_get_flow_id_status, + rpc__req__wifi_sta_itwt_get_flow_id_status__init); + break; + } case RPC_ID__Req_WifiStaItwtSendProbeReq: { + RPC_ALLOC_ASSIGN(RpcReqWifiStaItwtSendProbeReq, req_wifi_sta_itwt_send_probe_req, + rpc__req__wifi_sta_itwt_send_probe_req__init); + req_payload->timeout_ms = app_req->u.wifi_itwt_probe_req_timeout_ms; + break; + } case RPC_ID__Req_WifiStaItwtSetTargetWakeTimeOffset: { + RPC_ALLOC_ASSIGN(RpcReqWifiStaItwtSetTargetWakeTimeOffset, req_wifi_sta_itwt_set_target_wake_time_offset, + rpc__req__wifi_sta_itwt_set_target_wake_time_offset__init); + req_payload->offset_us = app_req->u.wifi_itwt_set_target_wake_time_offset_us; + break; +#endif // H_WIFI_HE_SUPPORT #if H_WIFI_DUALBAND_SUPPORT } case RPC_ID__Req_WifiSetProtocols: { RPC_ALLOC_ASSIGN(RpcReqWifiSetProtocols, req_wifi_set_protocols, @@ -462,6 +619,256 @@ int compose_rpc_req(Rpc *req, ctrl_cmd_t *app_req, int32_t *failure_status) rpc__req__wifi_set_band_mode__init); req_payload->bandmode = app_req->u.wifi_band_mode; break; +#endif // H_WIFI_DUALBAND_SUPPORT + } case RPC_ID__Req_IfaceMacAddrSetGet: { + RPC_ALLOC_ASSIGN(RpcReqIfaceMacAddrSetGet, req_iface_mac_addr_set_get, + rpc__req__iface_mac_addr_set_get__init); + req_payload->set = app_req->u.iface_mac.set; + req_payload->type = app_req->u.iface_mac.type; + if (req_payload->set) { + RPC_REQ_COPY_BYTES(req_payload->mac, app_req->u.iface_mac.mac, + app_req->u.iface_mac.mac_len); + } + break; + } case RPC_ID__Req_FeatureControl: { + RPC_ALLOC_ASSIGN(RpcReqFeatureControl, req_feature_control, + rpc__req__feature_control__init); + // convert from rpc_slave_if.h enums to proto enums + switch (app_req->u.feature_control.feature) { + case FEATURE_BT: + req_payload->feature = RPC_FEATURE__Feature_Bluetooth; + break; + default: + req_payload->feature = RPC_FEATURE__Feature_None; + break; + } + switch (app_req->u.feature_control.command) { + case FEATURE_COMMAND_BT_INIT: + req_payload->command = RPC_FEATURE_COMMAND__Feature_Command_BT_Init; + break; + case FEATURE_COMMAND_BT_DEINIT: + req_payload->command = RPC_FEATURE_COMMAND__Feature_Command_BT_Deinit; + break; + case FEATURE_COMMAND_BT_ENABLE: + req_payload->command = RPC_FEATURE_COMMAND__Feature_Command_BT_Enable; + break; + case FEATURE_COMMAND_BT_DISABLE: + req_payload->command = RPC_FEATURE_COMMAND__Feature_Command_BT_Disable; + break; + default: + req_payload->command = RPC_FEATURE_COMMAND__Feature_Command_None; + break; + } + switch (app_req->u.feature_control.option) { + case FEATURE_OPTION_BT_DEINIT_RELEASE_MEMORY: + req_payload->option = RPC_FEATURE_OPTION__Feature_Option_BT_Deinit_Release_Memory; + break; + default: + req_payload->option = RPC_FEATURE_OPTION__Feature_Option_None; + break; + } + break; + } case RPC_ID__Req_IfaceMacAddrLenGet: { + RPC_ALLOC_ASSIGN(RpcReqIfaceMacAddrLenGet, req_iface_mac_addr_len_get, + rpc__req__iface_mac_addr_len_get__init); + req_payload->type = app_req->u.iface_mac_len.type; + break; + } case RPC_ID__Req_SetDhcpDnsStatus: { + RPC_ALLOC_ASSIGN(RpcReqSetDhcpDnsStatus, req_set_dhcp_dns, + rpc__req__set_dhcp_dns_status__init); + RpcReqSetDhcpDnsStatus *p_c = req_payload; + rpc_set_dhcp_dns_status_t* p_a = &app_req->u.slave_dhcp_dns_status; + + p_c->iface = p_a->iface; + p_c->dhcp_up = p_a->dhcp_up; + p_c->dns_up = p_a->dns_up; + p_c->dns_type = p_a->dns_type; + p_c->net_link_up = p_a->net_link_up; + + RPC_REQ_COPY_STR(p_c->dhcp_ip, p_a->dhcp_ip, 64); + RPC_REQ_COPY_STR(p_c->dhcp_nm, p_a->dhcp_nm, 64); + RPC_REQ_COPY_STR(p_c->dhcp_gw, p_a->dhcp_gw, 64); + RPC_REQ_COPY_STR(p_c->dns_ip, p_a->dns_ip, 64); + break; +#if H_WIFI_ENTERPRISE_SUPPORT + } case RPC_ID__Req_EapSetIdentity: { + RPC_ALLOC_ASSIGN(RpcReqEapSetIdentity, req_eap_set_identity, + rpc__req__eap_set_identity__init); + RPC_REQ_COPY_BYTES(req_payload->identity, (uint8_t *)app_req->u.eap_identity.identity, app_req->u.eap_identity.len); + req_payload->len = app_req->u.eap_identity.len; + break; + } case RPC_ID__Req_EapSetUsername: { + RPC_ALLOC_ASSIGN(RpcReqEapSetUsername, req_eap_set_username, + rpc__req__eap_set_username__init); + RPC_REQ_COPY_BYTES(req_payload->username, (uint8_t *)app_req->u.eap_username.username, app_req->u.eap_username.len); + req_payload->len = app_req->u.eap_username.len; + break; + } case RPC_ID__Req_EapSetPassword: { + RPC_ALLOC_ASSIGN(RpcReqEapSetPassword, req_eap_set_password, + rpc__req__eap_set_password__init); + RPC_REQ_COPY_BYTES(req_payload->password, (uint8_t *)app_req->u.eap_password.password, app_req->u.eap_password.len); + req_payload->len = app_req->u.eap_password.len; + break; + } case RPC_ID__Req_EapSetNewPassword: { + RPC_ALLOC_ASSIGN(RpcReqEapSetNewPassword, req_eap_set_new_password, + rpc__req__eap_set_new_password__init); + RPC_REQ_COPY_BYTES(req_payload->new_password, (uint8_t *)app_req->u.eap_password.password, app_req->u.eap_password.len); + req_payload->len = app_req->u.eap_password.len; + break; + } case RPC_ID__Req_EapSetCaCert: { + RPC_ALLOC_ASSIGN(RpcReqEapSetCaCert, req_eap_set_ca_cert, + rpc__req__eap_set_ca_cert__init); + RPC_REQ_COPY_BYTES(req_payload->ca_cert, (uint8_t *)app_req->u.eap_ca_cert.ca_cert, app_req->u.eap_ca_cert.len); + req_payload->ca_cert_len = app_req->u.eap_ca_cert.len; + break; + } case RPC_ID__Req_EapSetCertificateAndKey: { + RPC_ALLOC_ASSIGN(RpcReqEapSetCertificateAndKey, req_eap_set_certificate_and_key, + rpc__req__eap_set_certificate_and_key__init); + RPC_REQ_COPY_BYTES(req_payload->client_cert, (uint8_t *)app_req->u.eap_cert_key.client_cert, app_req->u.eap_cert_key.client_cert_len); + req_payload->client_cert_len = app_req->u.eap_cert_key.client_cert_len; + RPC_REQ_COPY_BYTES(req_payload->private_key, (uint8_t *)app_req->u.eap_cert_key.private_key, app_req->u.eap_cert_key.private_key_len); + req_payload->private_key_len = app_req->u.eap_cert_key.private_key_len; + RPC_REQ_COPY_BYTES(req_payload->private_key_password, (uint8_t *)app_req->u.eap_cert_key.private_key_password, app_req->u.eap_cert_key.private_key_passwd_len); + req_payload->private_key_passwd_len = app_req->u.eap_cert_key.private_key_passwd_len; + break; + } case RPC_ID__Req_EapSetDisableTimeCheck: { + RPC_ALLOC_ASSIGN(RpcReqEapSetDisableTimeCheck, req_eap_set_disable_time_check, + rpc__req__eap_set_disable_time_check__init); + req_payload->disable = app_req->u.eap_disable_time_check.disable; + break; + } case RPC_ID__Req_EapSetTtlsPhase2Method: { + RPC_ALLOC_ASSIGN(RpcReqEapSetTtlsPhase2Method, req_eap_set_ttls_phase2_method, + rpc__req__eap_set_ttls_phase2_method__init); + req_payload->type = app_req->u.eap_ttls_phase2; + break; + } case RPC_ID__Req_EapSetSuitebCertification: { + RPC_ALLOC_ASSIGN(RpcReqEapSetSuiteb192bitCertification, req_eap_set_suiteb_certification, + rpc__req__eap_set_suiteb192bit_certification__init); + req_payload->enable = app_req->u.eap_suiteb_192bit.enable; + break; + } case RPC_ID__Req_EapSetPacFile: { + RPC_ALLOC_ASSIGN(RpcReqEapSetPacFile, req_eap_set_pac_file, + rpc__req__eap_set_pac_file__init); + RPC_REQ_COPY_BYTES(req_payload->pac_file, (uint8_t *)app_req->u.eap_pac_file.pac_file, app_req->u.eap_pac_file.len); + req_payload->pac_file_len = app_req->u.eap_pac_file.len; + break; + } case RPC_ID__Req_EapSetFastParams: { + RPC_ALLOC_ASSIGN(RpcReqEapSetFastParams, req_eap_set_fast_params, + rpc__req__eap_set_fast_params__init); + RPC_ALLOC_ELEMENT(EapFastConfig, req_payload->eap_fast_config, eap_fast_config__init); + req_payload->eap_fast_config->fast_provisioning = app_req->u.eap_fast_config.fast_provisioning; + req_payload->eap_fast_config->fast_max_pac_list_len = app_req->u.eap_fast_config.fast_max_pac_list_len; + req_payload->eap_fast_config->fast_pac_format_binary = app_req->u.eap_fast_config.fast_pac_format_binary; + break; + } case RPC_ID__Req_EapUseDefaultCertBundle: { + RPC_ALLOC_ASSIGN(RpcReqEapUseDefaultCertBundle, req_eap_use_default_cert_bundle, + rpc__req__eap_use_default_cert_bundle__init); + req_payload->use_default_bundle = app_req->u.eap_default_cert_bundle.use_default; + break; +#if H_GOT_EAP_OKC_SUPPORT + } case RPC_ID__Req_WifiSetOkcSupport: { + RPC_ALLOC_ASSIGN(RpcReqWifiSetOkcSupport, req_wifi_set_okc_support, + rpc__req__wifi_set_okc_support__init); + req_payload->enable = app_req->u.wifi_okc_support.enable; + break; +#endif +#if H_GOT_EAP_SET_DOMAIN_NAME + } case RPC_ID__Req_EapSetDomainName: { + RPC_ALLOC_ASSIGN(RpcReqEapSetDomainName, req_eap_set_domain_name, + rpc__req__eap_set_domain_name__init); + + RPC_REQ_COPY_BYTES(req_payload->domain_name, (uint8_t *)app_req->u.eap_domain_name.domain_name, strlen(app_req->u.eap_domain_name.domain_name) + 1); + break; +#endif +#if H_GOT_SET_EAP_METHODS_API + } case RPC_ID__Req_EapSetEapMethods: { + RPC_ALLOC_ASSIGN(RpcReqEapSetEapMethods, req_eap_set_eap_methods, + rpc__req__eap_set_eap_methods__init); + req_payload->methods = app_req->u.methods; + break; +#endif +#endif +#if H_DPP_SUPPORT + } case RPC_ID__Req_SuppDppInit: { + RPC_ALLOC_ASSIGN(RpcReqSuppDppInit,req_supp_dpp_init, + rpc__req__supp_dpp_init__init); + req_payload->cb = app_req->u.dpp_enable_cb; + break; + } case RPC_ID__Req_SuppDppBootstrapGen: { + RPC_ALLOC_ASSIGN(RpcReqSuppDppBootstrapGen,req_supp_dpp_bootstrap_gen, + rpc__req__supp_dpp_bootstrap_gen__init); + int str_len; + RpcReqSuppDppBootstrapGen *p_c = req_payload; + rpc_supp_dpp_bootstrap_gen_t* p_a = &app_req->u.dpp_bootstrap_gen; + + p_c->type = p_a->type; + + // chan_list: copy terminating NULL + str_len = strlen(p_a->chan_list); + RPC_REQ_COPY_BYTES(p_c->chan_list, (uint8_t *)p_a->chan_list, str_len + 1); + + // key is a fixed length (if provided) + if (p_a->key) { + RPC_REQ_COPY_BYTES(p_c->key, (uint8_t *)p_a->key, DPP_BOOTSTRAP_GEN_KEY_LEN); + } + + // info: copy terminating NULL + if (p_a->info) { + str_len = strlen(p_a->info); + RPC_REQ_COPY_BYTES(p_c->info, (uint8_t *)p_a->info, str_len + 1); + } + break; +#endif +#if H_ENABLE_GPIO_CONTROL + } case RPC_ID__Req_GpioConfig: { + RPC_ALLOC_ASSIGN(RpcReqGpioConfig, req_gpio_config, + rpc__req__gpio_config__init); + RPC_ALLOC_ELEMENT(RpcGpioConfig, req_payload->config, rpc__gpio_config__init); + + req_payload->config->pin_bit_mask = app_req->u.gpio_config.pin_bit_mask; + req_payload->config->intr_type = app_req->u.gpio_config.intr_type; + req_payload->config->mode = app_req->u.gpio_config.mode; + req_payload->config->pull_up_en = app_req->u.gpio_config.pull_up_en; + req_payload->config->pull_down_en = app_req->u.gpio_config.pull_down_en; + break; + } case RPC_ID__Req_GpioResetPin: { + RPC_ALLOC_ASSIGN(RpcReqGpioReset, req_gpio_reset, + rpc__req__gpio_reset__init); + req_payload->gpio_num = app_req->u.gpio_num; + break; + } case RPC_ID__Req_GpioSetLevel: { + RPC_ALLOC_ASSIGN(RpcReqGpioSetLevel, req_gpio_set_level, + rpc__req__gpio_set_level__init); + + req_payload->gpio_num = app_req->u.gpio_set_level.gpio_num; + req_payload->level = app_req->u.gpio_set_level.level; + break; + } case RPC_ID__Req_GpioGetLevel: { + RPC_ALLOC_ASSIGN(RpcReqGpioGetLevel, req_gpio_get_level, + rpc__req__gpio_get_level__init); + + req_payload->gpio_num = app_req->u.gpio_num; + break; + } case RPC_ID__Req_GpioSetDirection: { + RPC_ALLOC_ASSIGN(RpcReqGpioSetDirection, req_gpio_set_direction, + rpc__req__gpio_set_direction__init); + + req_payload->gpio_num = app_req->u.gpio_set_direction.gpio_num; + req_payload->mode = app_req->u.gpio_set_direction.mode; + break; + } case RPC_ID__Req_GpioInputEnable: { + RPC_ALLOC_ASSIGN(RpcReqGpioInputEnable, req_gpio_input_enable, + rpc__req__gpio_input_enable__init); + + req_payload->gpio_num = app_req->u.gpio_num; + break; + } case RPC_ID__Req_GpioSetPullMode: { + RPC_ALLOC_ASSIGN(RpcReqGpioSetPullMode, req_gpio_set_pull_mode, + rpc__req__gpio_set_pull_mode__init); + + req_payload->gpio_num = app_req->u.gpio_set_pull_mode.gpio_num; + req_payload->pull = app_req->u.gpio_set_pull_mode.pull_mode; + break; #endif } default: { *failure_status = RPC_ERR_UNSUPPORTED_MSG; diff --git a/host/drivers/rpc/core/rpc_rsp.c b/host/drivers/rpc/core/rpc_rsp.c index cc47f0ac..06b6a276 100644 --- a/host/drivers/rpc/core/rpc_rsp.c +++ b/host/drivers/rpc/core/rpc_rsp.c @@ -1,12 +1,19 @@ -// Copyright 2015-2022 Espressif Systems (Shanghai) PTE LTD -/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */ +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "rpc_core.h" +#include "rpc_utils.h" #include "rpc_slave_if.h" -#include "esp_log.h" -#include "esp_hosted_wifi_config.h" #include "esp_hosted_transport.h" #include "esp_hosted_bitmasks.h" +#include "esp_idf_version.h" +#include "port_esp_hosted_host_config.h" +#include "port_esp_hosted_host_wifi_config.h" +#include "port_esp_hosted_host_log.h" +#include "esp_hosted_os_abstraction.h" DEFINE_LOG_TAG(rpc_rsp); @@ -35,7 +42,6 @@ DEFINE_LOG_TAG(rpc_rsp); goto fail_parse_rpc_msg; \ } - #define RPC_RSP_COPY_BYTES(dst,src) { \ if (src.data && src.len) { \ g_h.funcs->_h_memcpy(dst, src.data, src.len); \ @@ -133,7 +139,11 @@ int rpc_parse_rsp(Rpc *rpc_msg, ctrl_cmd_t *app_resp) /* 3. parse Rpc into ctrl_cmd_t */ switch (rpc_msg->msg_id) { - + case RPC_ID__Resp_Base : { + // RPC Request not supported + app_resp->resp_event_status = ESP_ERR_NOT_SUPPORTED; + goto fail_parse_rpc_msg; + } case RPC_ID__Resp_GetMACAddress : { RPC_FAIL_ON_NULL(resp_get_mac_address); RPC_ERR_IN_RESP(resp_get_mac_address); @@ -188,6 +198,13 @@ int rpc_parse_rsp(Rpc *rpc_msg, ctrl_cmd_t *app_resp) goto fail_parse_rpc_msg; } break; + } case RPC_ID__Resp_OTAActivate: { + RPC_FAIL_ON_NULL(resp_ota_activate); + if (rpc_msg->resp_ota_activate->resp) { + ESP_LOGE(TAG, "OTA activate failed"); + goto fail_parse_rpc_msg; + } + break; } case RPC_ID__Resp_WifiSetMaxTxPower: { RPC_FAIL_ON_NULL(resp_set_wifi_max_tx_power); RPC_ERR_IN_RESP(resp_set_wifi_max_tx_power); @@ -241,34 +258,7 @@ int rpc_parse_rsp(Rpc *rpc_msg, ctrl_cmd_t *app_resp) case WIFI_IF_STA: { wifi_sta_config_t * p_a_sta = &(app_resp->u.wifi_config.u.sta); WifiStaConfig * p_c_sta = rpc_msg->resp_wifi_get_config->cfg->sta; - RPC_RSP_COPY_BYTES(p_a_sta->ssid, p_c_sta->ssid); - RPC_RSP_COPY_BYTES(p_a_sta->password, p_c_sta->password); - p_a_sta->scan_method = p_c_sta->scan_method; - p_a_sta->bssid_set = p_c_sta->bssid_set; - - if (p_a_sta->bssid_set) - RPC_RSP_COPY_BYTES(p_a_sta->bssid, p_c_sta->bssid); - - p_a_sta->channel = p_c_sta->channel; - p_a_sta->listen_interval = p_c_sta->listen_interval; - p_a_sta->sort_method = p_c_sta->sort_method; - p_a_sta->threshold.rssi = p_c_sta->threshold->rssi; - p_a_sta->threshold.authmode = p_c_sta->threshold->authmode; - //p_a_sta->ssid_hidden = p_c_sta->ssid_hidden; - //p_a_sta->max_connections = p_c_sta->max_connections; - p_a_sta->pmf_cfg.capable = p_c_sta->pmf_cfg->capable; - p_a_sta->pmf_cfg.required = p_c_sta->pmf_cfg->required; - - p_a_sta->rm_enabled = H_GET_BIT(STA_RM_ENABLED_BIT, p_c_sta->bitmask); - p_a_sta->btm_enabled = H_GET_BIT(STA_BTM_ENABLED_BIT, p_c_sta->bitmask); - p_a_sta->mbo_enabled = H_GET_BIT(STA_MBO_ENABLED_BIT, p_c_sta->bitmask); - p_a_sta->ft_enabled = H_GET_BIT(STA_FT_ENABLED_BIT, p_c_sta->bitmask); - p_a_sta->owe_enabled = H_GET_BIT(STA_OWE_ENABLED_BIT, p_c_sta->bitmask); - p_a_sta->transition_disable = H_GET_BIT(STA_TRASITION_DISABLED_BIT, p_c_sta->bitmask); - p_a_sta->reserved = WIFI_CONFIG_STA_GET_RESERVED_VAL(p_c_sta->bitmask); - - p_a_sta->sae_pwe_h2e = p_c_sta->sae_pwe_h2e; - p_a_sta->failure_retry_cnt = p_c_sta->failure_retry_cnt; + rpc_copy_wifi_sta_config(p_a_sta, p_c_sta); break; } case WIFI_IF_AP: { @@ -283,10 +273,26 @@ int rpc_parse_rsp(Rpc *rpc_msg, ctrl_cmd_t *app_resp) p_a_ap->ssid_hidden = p_c_ap->ssid_hidden; p_a_ap->max_connection = p_c_ap->max_connection; p_a_ap->beacon_interval = p_c_ap->beacon_interval; + p_a_ap->csa_count = p_c_ap->csa_count; + p_a_ap->dtim_period = p_c_ap->dtim_period; p_a_ap->pairwise_cipher = p_c_ap->pairwise_cipher; p_a_ap->ftm_responder = p_c_ap->ftm_responder; - p_a_ap->pmf_cfg.capable = p_c_ap->pmf_cfg->capable; - p_a_ap->pmf_cfg.required = p_c_ap->pmf_cfg->required; + if (p_c_ap->pmf_cfg) { + p_a_ap->pmf_cfg.capable = p_c_ap->pmf_cfg->capable; + p_a_ap->pmf_cfg.required = p_c_ap->pmf_cfg->required; + } + p_a_ap->sae_pwe_h2e = p_c_ap->sae_pwe_h2e; +#if H_GOT_AP_CONFIG_PARAM_TRANSITION_DISABLE + p_a_ap->transition_disable = p_c_ap->transition_disable; +#endif +#if H_PRESENT_IN_ESP_IDF_5_5_0 + p_a_ap->sae_ext = p_c_ap->sae_ext; + if (p_c_ap->bss_max_idle_cfg) { + p_a_ap->bss_max_idle_cfg.period = p_c_ap->bss_max_idle_cfg->period; + p_a_ap->bss_max_idle_cfg.protected_keep_alive = p_c_ap->bss_max_idle_cfg->protected_keep_alive; + } + p_a_ap->gtk_rekey_interval = p_c_ap->gtk_rekey_interval; +#endif break; } default: @@ -517,6 +523,48 @@ int rpc_parse_rsp(Rpc *rpc_msg, ctrl_cmd_t *app_resp) app_resp->u.coprocessor_fwversion.patch1 = rpc_msg->resp_get_coprocessor_fwversion->patch1; break; + } case RPC_ID__Resp_WifiSetInactiveTime: { + RPC_FAIL_ON_NULL(resp_wifi_set_inactive_time); + RPC_ERR_IN_RESP(resp_wifi_set_inactive_time); + break; + } case RPC_ID__Resp_WifiGetInactiveTime: { + RPC_FAIL_ON_NULL(resp_wifi_get_inactive_time); + RPC_ERR_IN_RESP(resp_wifi_get_inactive_time); + app_resp->u.wifi_inactive_time.sec = + rpc_msg->resp_wifi_get_inactive_time->sec; + break; +#if H_WIFI_HE_SUPPORT + } case RPC_ID__Resp_WifiStaTwtConfig: { + RPC_FAIL_ON_NULL(resp_wifi_sta_twt_config); + RPC_ERR_IN_RESP(resp_wifi_sta_twt_config); + break; + } case RPC_ID__Resp_WifiStaItwtSetup: { + RPC_FAIL_ON_NULL(resp_wifi_sta_itwt_setup); + RPC_ERR_IN_RESP(resp_wifi_sta_itwt_setup); + break; + } case RPC_ID__Resp_WifiStaItwtTeardown: { + RPC_FAIL_ON_NULL(resp_wifi_sta_itwt_teardown); + RPC_ERR_IN_RESP(resp_wifi_sta_itwt_teardown); + break; + } case RPC_ID__Resp_WifiStaItwtSuspend: { + RPC_FAIL_ON_NULL(resp_wifi_sta_itwt_suspend); + RPC_ERR_IN_RESP(resp_wifi_sta_itwt_suspend); + break; + } case RPC_ID__Resp_WifiStaItwtGetFlowIdStatus: { + RPC_FAIL_ON_NULL(resp_wifi_sta_itwt_get_flow_id_status); + RPC_ERR_IN_RESP(resp_wifi_sta_itwt_get_flow_id_status); + app_resp->u.wifi_itwt_flow_id_bitmap = + rpc_msg->resp_wifi_sta_itwt_get_flow_id_status->flow_id_bitmap; + break; + } case RPC_ID__Resp_WifiStaItwtSendProbeReq: { + RPC_FAIL_ON_NULL(resp_wifi_sta_itwt_suspend); + RPC_ERR_IN_RESP(resp_wifi_sta_itwt_suspend); + break; + } case RPC_ID__Resp_WifiStaItwtSetTargetWakeTimeOffset: { + RPC_FAIL_ON_NULL(resp_wifi_sta_itwt_set_target_wake_time_offset); + RPC_ERR_IN_RESP(resp_wifi_sta_itwt_set_target_wake_time_offset); + break; +#endif // H_WIFI_HE_SUPPORT #if H_WIFI_DUALBAND_SUPPORT } case RPC_ID__Resp_WifiSetProtocols: { RPC_FAIL_ON_NULL(resp_wifi_set_protocols); @@ -570,7 +618,180 @@ int rpc_parse_rsp(Rpc *rpc_msg, ctrl_cmd_t *app_resp) app_resp->u.wifi_band_mode = rpc_msg->resp_wifi_get_bandmode->bandmode; break; +#endif // H_WIFI_DUALBAND_SUPPORT + } case RPC_ID__Resp_IfaceMacAddrSetGet: { + RPC_FAIL_ON_NULL(resp_iface_mac_addr_set_get); + RPC_ERR_IN_RESP(resp_iface_mac_addr_set_get); + RPC_RSP_COPY_BYTES(app_resp->u.iface_mac.mac, rpc_msg->resp_iface_mac_addr_set_get->mac); + break; + } case RPC_ID__Resp_IfaceMacAddrLenGet: { + RPC_FAIL_ON_NULL(resp_iface_mac_addr_len_get); + RPC_ERR_IN_RESP(resp_iface_mac_addr_len_get); + app_resp->u.iface_mac_len.type = + rpc_msg->resp_iface_mac_addr_len_get->type; + app_resp->u.iface_mac_len.len = + rpc_msg->resp_iface_mac_addr_len_get->len; + break; + } case RPC_ID__Resp_FeatureControl: { + RPC_FAIL_ON_NULL(resp_feature_control); + RPC_ERR_IN_RESP(resp_feature_control); + break; + } case RPC_ID__Resp_SetDhcpDnsStatus: { + RPC_FAIL_ON_NULL(resp_set_dhcp_dns); + RPC_ERR_IN_RESP(resp_set_dhcp_dns); + break; +#if H_WIFI_ENTERPRISE_SUPPORT + } case RPC_ID__Resp_WifiStaEnterpriseEnable: { + RPC_FAIL_ON_NULL(resp_wifi_sta_enterprise_enable); + RPC_ERR_IN_RESP(resp_wifi_sta_enterprise_enable); + break; + } case RPC_ID__Resp_WifiStaEnterpriseDisable: { + RPC_FAIL_ON_NULL(resp_wifi_sta_enterprise_disable); + RPC_ERR_IN_RESP(resp_wifi_sta_enterprise_disable); + break; + } case RPC_ID__Resp_EapSetIdentity: { + RPC_FAIL_ON_NULL(resp_eap_set_identity); + RPC_ERR_IN_RESP(resp_eap_set_identity); + break; + } case RPC_ID__Resp_EapClearIdentity: { + RPC_FAIL_ON_NULL(resp_eap_clear_identity); + RPC_ERR_IN_RESP(resp_eap_clear_identity); + break; + } case RPC_ID__Resp_EapSetUsername: { + RPC_FAIL_ON_NULL(resp_eap_set_username); + RPC_ERR_IN_RESP(resp_eap_set_username); + break; + } case RPC_ID__Resp_EapClearUsername: { + RPC_FAIL_ON_NULL(resp_eap_clear_username); + RPC_ERR_IN_RESP(resp_eap_clear_username); + break; + } case RPC_ID__Resp_EapSetPassword: { + RPC_FAIL_ON_NULL(resp_eap_set_password); + RPC_ERR_IN_RESP(resp_eap_set_password); + break; + } case RPC_ID__Resp_EapClearPassword: { + RPC_FAIL_ON_NULL(resp_eap_clear_password); + RPC_ERR_IN_RESP(resp_eap_clear_password); + break; + } case RPC_ID__Resp_EapSetNewPassword: { + RPC_FAIL_ON_NULL(resp_eap_set_new_password); + RPC_ERR_IN_RESP(resp_eap_set_new_password); + break; + } case RPC_ID__Resp_EapClearNewPassword: { + RPC_FAIL_ON_NULL(resp_eap_clear_new_password); + RPC_ERR_IN_RESP(resp_eap_clear_new_password); + break; + } case RPC_ID__Resp_EapSetCaCert: { + RPC_FAIL_ON_NULL(resp_eap_set_ca_cert); + RPC_ERR_IN_RESP(resp_eap_set_ca_cert); + break; + } case RPC_ID__Resp_EapClearCaCert: { + RPC_FAIL_ON_NULL(resp_eap_clear_ca_cert); + RPC_ERR_IN_RESP(resp_eap_clear_ca_cert); + break; + } case RPC_ID__Resp_EapSetCertificateAndKey: { + RPC_FAIL_ON_NULL(resp_eap_set_certificate_and_key); + RPC_ERR_IN_RESP(resp_eap_set_certificate_and_key); + break; + } case RPC_ID__Resp_EapClearCertificateAndKey: { + RPC_FAIL_ON_NULL(resp_eap_clear_certificate_and_key); + RPC_ERR_IN_RESP(resp_eap_clear_certificate_and_key); + break; + } case RPC_ID__Resp_EapGetDisableTimeCheck: { + RPC_FAIL_ON_NULL(resp_eap_get_disable_time_check); + RPC_ERR_IN_RESP(resp_eap_get_disable_time_check); + app_resp->u.eap_disable_time_check.disable = rpc_msg->resp_eap_get_disable_time_check->disable; + break; + } case RPC_ID__Resp_EapSetTtlsPhase2Method: { + RPC_FAIL_ON_NULL(resp_eap_set_ttls_phase2_method); + RPC_ERR_IN_RESP(resp_eap_set_ttls_phase2_method); + break; + } case RPC_ID__Resp_EapSetSuitebCertification: { + RPC_FAIL_ON_NULL(resp_eap_set_suiteb_certification); + RPC_ERR_IN_RESP(resp_eap_set_suiteb_certification); + break; + } case RPC_ID__Resp_EapSetPacFile: { + RPC_FAIL_ON_NULL(resp_eap_set_pac_file); + RPC_ERR_IN_RESP(resp_eap_set_pac_file); + break; + } case RPC_ID__Resp_EapSetFastParams: { + RPC_FAIL_ON_NULL(resp_eap_set_fast_params); + RPC_ERR_IN_RESP(resp_eap_set_fast_params); + break; + } case RPC_ID__Resp_EapUseDefaultCertBundle: { + RPC_FAIL_ON_NULL(resp_eap_use_default_cert_bundle); + RPC_ERR_IN_RESP(resp_eap_use_default_cert_bundle); + break; + } case RPC_ID__Resp_WifiSetOkcSupport: { + RPC_FAIL_ON_NULL(resp_wifi_set_okc_support); + RPC_ERR_IN_RESP(resp_wifi_set_okc_support); + break; + } case RPC_ID__Resp_EapSetDomainName: { + RPC_FAIL_ON_NULL(resp_eap_set_domain_name); + RPC_ERR_IN_RESP(resp_eap_set_domain_name); + break; + } case RPC_ID__Resp_EapSetDisableTimeCheck: { + RPC_FAIL_ON_NULL(resp_eap_set_disable_time_check); + RPC_ERR_IN_RESP(resp_eap_set_disable_time_check); + break; + } case RPC_ID__Resp_EapSetEapMethods: { + RPC_FAIL_ON_NULL(resp_eap_set_eap_methods); + RPC_ERR_IN_RESP(resp_eap_set_eap_methods); + break; +#endif +#if H_DPP_SUPPORT + } case RPC_ID__Resp_SuppDppInit: { + RPC_FAIL_ON_NULL(resp_supp_dpp_init); + RPC_ERR_IN_RESP(resp_supp_dpp_init); + break; + } case RPC_ID__Resp_SuppDppDeinit: { + RPC_FAIL_ON_NULL(resp_supp_dpp_deinit); + RPC_ERR_IN_RESP(resp_supp_dpp_deinit); + break; + } case RPC_ID__Resp_SuppDppBootstrapGen: { + RPC_FAIL_ON_NULL(resp_supp_dpp_bootstrap_gen); + RPC_ERR_IN_RESP(resp_supp_dpp_bootstrap_gen); + break; + } case RPC_ID__Resp_SuppDppStartListen: { + RPC_FAIL_ON_NULL(resp_supp_dpp_start_listen); + RPC_ERR_IN_RESP(resp_supp_dpp_start_listen); + break; + } case RPC_ID__Resp_SuppDppStopListen: { + RPC_FAIL_ON_NULL(resp_supp_dpp_stop_listen); + RPC_ERR_IN_RESP(resp_supp_dpp_stop_listen); + break; #endif +#if H_ENABLE_GPIO_CONTROL + } case RPC_ID__Resp_GpioConfig: { + RPC_FAIL_ON_NULL(resp_gpio_config); + RPC_ERR_IN_RESP(resp_gpio_config); + break; + } case RPC_ID__Resp_GpioResetPin: { + RPC_FAIL_ON_NULL(resp_gpio_reset); + RPC_ERR_IN_RESP(resp_gpio_reset); + break; + } case RPC_ID__Resp_GpioSetLevel: { + RPC_FAIL_ON_NULL(resp_gpio_set_level); + RPC_ERR_IN_RESP(resp_gpio_set_level); + break; + } case RPC_ID__Resp_GpioGetLevel: { + RPC_FAIL_ON_NULL(resp_gpio_get_level); + RPC_ERR_IN_RESP(resp_gpio_get_level); + app_resp->u.gpio_get_level = rpc_msg->resp_gpio_get_level->level; + break; + } case RPC_ID__Resp_GpioSetDirection: { + RPC_FAIL_ON_NULL(resp_gpio_set_direction); + RPC_ERR_IN_RESP(resp_gpio_set_direction); + break; + } case RPC_ID__Resp_GpioInputEnable: { + RPC_FAIL_ON_NULL(resp_gpio_input_enable); + RPC_ERR_IN_RESP(resp_gpio_input_enable); + break; + } case RPC_ID__Resp_GpioSetPullMode: { + RPC_FAIL_ON_NULL(resp_gpio_set_pull_mode); + RPC_ERR_IN_RESP(resp_gpio_set_pull_mode); + break; +#endif // H_ENABLE_GPIO_CONTROL } default: { ESP_LOGE(TAG, "Unsupported rpc Resp[%u]", rpc_msg->msg_id); goto fail_parse_rpc_msg; diff --git a/host/drivers/rpc/core/rpc_utils.c b/host/drivers/rpc/core/rpc_utils.c new file mode 100644 index 00000000..93237cf2 --- /dev/null +++ b/host/drivers/rpc/core/rpc_utils.c @@ -0,0 +1,97 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "rpc_utils.h" +#include "rpc_core.h" +#include "esp_hosted_bitmasks.h" +#include "esp_hosted_os_abstraction.h" + +#include "port_esp_hosted_host_wifi_config.h" +#include "port_esp_hosted_host_log.h" + +#include "esp_log.h" +DEFINE_LOG_TAG(rpc_utils); + +#define RPC_UTILS_COPY_BYTES(dst,src) { \ + if (src.data && src.len) { \ + g_h.funcs->_h_memcpy(dst, src.data, src.len); \ + } \ +} + +esp_err_t rpc_copy_wifi_sta_config(wifi_sta_config_t *dst, WifiStaConfig *src) +{ + wifi_sta_config_t * p_a_sta = dst; + WifiStaConfig * p_c_sta = src; + + ESP_LOGW(TAG, "Event: SSID %s", p_c_sta->ssid.data); + RPC_UTILS_COPY_BYTES(p_a_sta->ssid, p_c_sta->ssid); + RPC_UTILS_COPY_BYTES(p_a_sta->password, p_c_sta->password); + p_a_sta->scan_method = p_c_sta->scan_method; + p_a_sta->bssid_set = p_c_sta->bssid_set; + RPC_UTILS_COPY_BYTES(p_a_sta->bssid, p_c_sta->bssid); + p_a_sta->channel = p_c_sta->channel; + p_a_sta->listen_interval = p_c_sta->listen_interval; + p_a_sta->sort_method = p_c_sta->sort_method; + if (p_c_sta->threshold) { + p_a_sta->threshold.rssi = p_c_sta->threshold->rssi; + p_a_sta->threshold.authmode = p_c_sta->threshold->authmode; +#if H_PRESENT_IN_ESP_IDF_5_4_0 + p_a_sta->threshold.rssi_5g_adjustment = p_c_sta->threshold->rssi_5g_adjustment; +#endif + } + //p_a_sta->ssid_hidden = p_c_sta->ssid_hidden; + //p_a_sta->max_connections = p_c_sta->max_connections; + if (p_c_sta->pmf_cfg) { + p_a_sta->pmf_cfg.capable = p_c_sta->pmf_cfg->capable; + p_a_sta->pmf_cfg.required = p_c_sta->pmf_cfg->required; + } + p_a_sta->rm_enabled = H_GET_BIT(WIFI_STA_CONFIG_1_rm_enabled, p_c_sta->bitmask); + p_a_sta->btm_enabled = H_GET_BIT(WIFI_STA_CONFIG_1_btm_enabled, p_c_sta->bitmask); + p_a_sta->mbo_enabled = H_GET_BIT(WIFI_STA_CONFIG_1_mbo_enabled, p_c_sta->bitmask); + p_a_sta->ft_enabled = H_GET_BIT(WIFI_STA_CONFIG_1_ft_enabled, p_c_sta->bitmask); + p_a_sta->owe_enabled = H_GET_BIT(WIFI_STA_CONFIG_1_owe_enabled, p_c_sta->bitmask); + p_a_sta->transition_disable = H_GET_BIT(WIFI_STA_CONFIG_1_transition_disable, p_c_sta->bitmask); + +#if H_DECODE_WIFI_RESERVED_FIELD + #if H_WIFI_NEW_RESERVED_FIELD_NAMES + p_a_sta->reserved1 = WIFI_STA_CONFIG_1_GET_RESERVED_VAL(p_c_sta->bitmask); + #else + p_a_sta->reserved = WIFI_STA_CONFIG_1_GET_RESERVED_VAL(p_c_sta->bitmask); + #endif +#endif + + p_a_sta->sae_pwe_h2e = p_c_sta->sae_pwe_h2e; + p_a_sta->sae_pk_mode = p_c_sta->sae_pk_mode; + p_a_sta->failure_retry_cnt = p_c_sta->failure_retry_cnt; + + p_a_sta->he_dcm_set = H_GET_BIT(WIFI_STA_CONFIG_2_he_dcm_set_BIT, p_c_sta->he_bitmask); + + // WIFI_HE_STA_CONFIG_he_dcm_max_constellation_tx is two bits wide + p_a_sta->he_dcm_max_constellation_tx = (p_c_sta->he_bitmask >> WIFI_STA_CONFIG_2_he_dcm_max_constellation_tx_BITS) & 0x03; + // WIFI_HE_STA_CONFIG_he_dcm_max_constellation_rx is two bits wide + p_a_sta->he_dcm_max_constellation_rx = (p_c_sta->he_bitmask >> WIFI_STA_CONFIG_2_he_dcm_max_constellation_rx_BITS) & 0x03; + p_a_sta->he_mcs9_enabled = H_GET_BIT(WIFI_STA_CONFIG_2_he_mcs9_enabled_BIT, p_c_sta->he_bitmask); + p_a_sta->he_su_beamformee_disabled = H_GET_BIT(WIFI_STA_CONFIG_2_he_su_beamformee_disabled_BIT, p_c_sta->he_bitmask); + p_a_sta->he_trig_su_bmforming_feedback_disabled = H_GET_BIT(WIFI_STA_CONFIG_2_he_trig_su_bmforming_feedback_disabled_BIT, p_c_sta->bitmask); + p_a_sta->he_trig_mu_bmforming_partial_feedback_disabled = H_GET_BIT(WIFI_STA_CONFIG_2_he_trig_mu_bmforming_partial_feedback_disabled_BIT, p_c_sta->bitmask); + p_a_sta->he_trig_cqi_feedback_disabled = H_GET_BIT(WIFI_STA_CONFIG_2_he_trig_cqi_feedback_disabled_BIT, p_c_sta->bitmask); + +#if H_PRESENT_IN_ESP_IDF_5_5_0 + p_a_sta->vht_su_beamformee_disabled = H_GET_BIT(WIFI_STA_CONFIG_2_vht_su_beamformee_disabled, p_c_sta->he_bitmask); + p_a_sta->vht_mu_beamformee_disabled = H_GET_BIT(WIFI_STA_CONFIG_2_vht_mu_beamformee_disabled, p_c_sta->he_bitmask); + p_a_sta->vht_mcs8_enabled = H_GET_BIT(WIFI_STA_CONFIG_2_vht_mcs8_enabled, p_c_sta->he_bitmask); +#endif + +#if H_DECODE_WIFI_RESERVED_FIELD + #if H_WIFI_NEW_RESERVED_FIELD_NAMES + p_a_sta->reserved2 = WIFI_STA_CONFIG_2_GET_RESERVED_VAL(p_c_sta->he_bitmask); + #else + p_a_sta->he_reserved = WIFI_STA_CONFIG_2_GET_RESERVED_VAL(p_c_sta->he_bitmask); + #endif +#endif + + return ESP_FAIL; +} diff --git a/host/drivers/rpc/core/rpc_utils.h b/host/drivers/rpc/core/rpc_utils.h new file mode 100644 index 00000000..c50bf6a8 --- /dev/null +++ b/host/drivers/rpc/core/rpc_utils.h @@ -0,0 +1,19 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Common functions used by rpc code */ + +#ifndef __RPC_UTILS_H +#define __RPC_UTILS_H + +#include "esp_err.h" +#include "esp_wifi.h" + +#include "rpc_slave_if.h" + +esp_err_t rpc_copy_wifi_sta_config(wifi_sta_config_t *dst, WifiStaConfig *src); + +#endif diff --git a/host/drivers/rpc/slaveif/rpc_slave_if.c b/host/drivers/rpc/slaveif/rpc_slave_if.c index 75c081ec..9884bc49 100644 --- a/host/drivers/rpc/slaveif/rpc_slave_if.c +++ b/host/drivers/rpc/slaveif/rpc_slave_if.c @@ -1,13 +1,13 @@ /* - * Espressif Systems Wireless LAN device driver + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * - * Copyright (C) 2015-2022 Espressif Systems (Shanghai) PTE LTD - * SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 + * SPDX-License-Identifier: Apache-2.0 */ + #include "rpc_slave_if.h" #include "rpc_core.h" -#include "esp_hosted_wifi_config.h" -#include "esp_log.h" +#include "port_esp_hosted_host_wifi_config.h" +#include "port_esp_hosted_host_log.h" DEFINE_LOG_TAG(rpc_api); @@ -33,6 +33,18 @@ int rpc_slaveif_init(void) return rpc_core_init(); } +int rpc_slaveif_start(void) +{ + ESP_LOGD(TAG, "%s", __func__); + return rpc_core_start(); +} + +int rpc_slaveif_stop(void) +{ + ESP_LOGD(TAG, "%s", __func__); + return rpc_core_stop(); +} + int rpc_slaveif_deinit(void) { ESP_LOGD(TAG, "%s", __func__); @@ -40,388 +52,642 @@ int rpc_slaveif_deinit(void) } /** Control Req->Resp APIs **/ -ctrl_cmd_t * wifi_get_mac(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_get_mac(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_GetMACAddress); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_set_mac(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_mac(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_SetMacAddress); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_get_mode(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_get_mode(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_GetWifiMode); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_set_mode(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_mode(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_SetWifiMode); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_set_ps(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_ps(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiSetPs); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_get_ps(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_get_ps(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiGetPs); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -//ctrl_cmd_t * wifi_ap_scan_list(ctrl_cmd_t *req) -//{ -// RPC_SEND_REQ(RPC_ID__Req_GetAPScanList); -// RPC_DECODE_RSP_IF_NOT_ASYNC(); -//} -// -//ctrl_cmd_t * wifi_get_ap_config(ctrl_cmd_t *req) -//{ -// RPC_SEND_REQ(RPC_ID__Req_GetAPConfig); -// RPC_DECODE_RSP_IF_NOT_ASYNC(); -//} -// -//ctrl_cmd_t * wifi_connect_ap(ctrl_cmd_t *req) -//{ -// RPC_SEND_REQ(RPC_ID__Req_ConnectAP); -// RPC_DECODE_RSP_IF_NOT_ASYNC(); -//} -// -//ctrl_cmd_t * wifi_disconnect_ap(ctrl_cmd_t *req) -//{ -// RPC_SEND_REQ(RPC_ID__Req_DisconnectAP); -// RPC_DECODE_RSP_IF_NOT_ASYNC(); -//} -// -//ctrl_cmd_t * wifi_start_softap(ctrl_cmd_t *req) -//{ -// RPC_SEND_REQ(RPC_ID__Req_StartSoftAP); -// RPC_DECODE_RSP_IF_NOT_ASYNC(); -//} -// -//ctrl_cmd_t * wifi_get_softap_config(ctrl_cmd_t *req) -//{ -// RPC_SEND_REQ(RPC_ID__Req_GetSoftAPConfig); -// RPC_DECODE_RSP_IF_NOT_ASYNC(); -//} -// -//ctrl_cmd_t * wifi_stop_softap(ctrl_cmd_t *req) -//{ -// RPC_SEND_REQ(RPC_ID__Req_StopSoftAP); -// RPC_DECODE_RSP_IF_NOT_ASYNC(); -//} -// -//ctrl_cmd_t * wifi_get_softap_connected_station_list(ctrl_cmd_t *req) -//{ -// RPC_SEND_REQ(RPC_ID__Req_GetSoftAPConnectedSTAList); -// RPC_DECODE_RSP_IF_NOT_ASYNC(); -//} -// -//ctrl_cmd_t * wifi_set_vendor_specific_ie(ctrl_cmd_t *req) -//{ -// RPC_SEND_REQ(RPC_ID__Req_SetSoftAPVendorSpecificIE); -// RPC_DECODE_RSP_IF_NOT_ASYNC(); -//} - -ctrl_cmd_t * wifi_set_max_tx_power(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_max_tx_power(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiSetMaxTxPower); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_get_max_tx_power(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_get_max_tx_power(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiGetMaxTxPower); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * config_heartbeat(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_config_heartbeat(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_ConfigHeartbeat); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * ota_begin(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_ota_begin(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_OTABegin); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * ota_write(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_ota_write(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_OTAWrite); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * ota_end(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_ota_end(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_OTAEnd); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_init(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_ota_activate(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_OTAActivate); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_wifi_init(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiInit); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_deinit(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_deinit(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiDeinit); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_start(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_start(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiStart); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_stop(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_stop(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiStop); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_connect(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_connect(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiConnect); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_disconnect(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_disconnect(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiDisconnect); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_get_config(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_get_config(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiGetConfig); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_set_config(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_config(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiSetConfig); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_scan_start(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_scan_start(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiScanStart); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_scan_stop(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_scan_stop(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiScanStop); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_scan_get_ap_num(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_scan_get_ap_num(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiScanGetApNum); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_scan_get_ap_record(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_scan_get_ap_record(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiScanGetApRecord); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_scan_get_ap_records(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_scan_get_ap_records(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiScanGetApRecords); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_clear_ap_list(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_clear_ap_list(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiClearApList); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_restore(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_restore(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiRestore); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_clear_fast_connect(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_clear_fast_connect(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiClearFastConnect); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_deauth_sta(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_deauth_sta(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiDeauthSta); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_sta_get_ap_info(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_sta_get_ap_info(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiStaGetApInfo); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_set_storage(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_storage(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiSetStorage); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_set_bandwidth(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_bandwidth(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiSetBandwidth); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_get_bandwidth(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_get_bandwidth(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiGetBandwidth); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_set_channel(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_channel(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiSetChannel); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_get_channel(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_get_channel(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiGetChannel); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_set_country_code(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_country_code(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiSetCountryCode); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_get_country_code(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_get_country_code(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiGetCountryCode); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_set_country(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_country(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiSetCountry); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_get_country(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_get_country(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiGetCountry); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_ap_get_sta_list(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_ap_get_sta_list(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiApGetStaList); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_ap_get_sta_aid(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_ap_get_sta_aid(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiApGetStaAid); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_sta_get_rssi(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_sta_get_rssi(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiStaGetRssi); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_set_protocol(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_protocol(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiSetProtocol); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_get_protocol(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_get_protocol(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiGetProtocol); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_sta_get_negotiated_phymode(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_sta_get_negotiated_phymode(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiStaGetNegotiatedPhymode); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_sta_get_aid(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_sta_get_aid(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiStaGetAid); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_set_protocols(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_protocols(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiSetProtocols); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * get_coprocessor_fwversion(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_inactive_time(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_WifiSetInactiveTime); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_wifi_get_inactive_time(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_WifiGetInactiveTime); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +#if H_WIFI_HE_SUPPORT +ctrl_cmd_t * rpc_slaveif_wifi_sta_twt_config(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_WifiStaTwtConfig); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_wifi_sta_itwt_setup(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_WifiStaItwtSetup); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_wifi_sta_itwt_teardown(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_WifiStaItwtTeardown); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_wifi_sta_itwt_suspend(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_WifiStaItwtSuspend); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_wifi_sta_itwt_get_flow_id_status(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_WifiStaItwtGetFlowIdStatus); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_wifi_sta_itwt_send_probe_req(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_WifiStaItwtSendProbeReq); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_wifi_sta_itwt_set_target_wake_time_offset(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_WifiStaItwtSetTargetWakeTimeOffset); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} +#endif + +ctrl_cmd_t * rpc_slaveif_get_coprocessor_fwversion(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_GetCoprocessorFwVersion); RPC_DECODE_RSP_IF_NOT_ASYNC(); } +ctrl_cmd_t * rpc_slaveif_iface_mac_addr_set_get(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_IfaceMacAddrSetGet); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_feature_control(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_FeatureControl); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_iface_mac_addr_len_get(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_IfaceMacAddrLenGet); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + #if H_WIFI_DUALBAND_SUPPORT -ctrl_cmd_t * wifi_get_protocols(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_get_protocols(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiGetProtocols); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_set_bandwidths(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_bandwidths(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiSetBandwidths); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_get_bandwidths(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_get_bandwidths(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiGetBandwidths); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_set_band(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_band(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiSetBand); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_get_band(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_get_band(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiGetBand); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_set_band_mode(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_set_band_mode(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiSetBandMode); RPC_DECODE_RSP_IF_NOT_ASYNC(); } -ctrl_cmd_t * wifi_get_band_mode(ctrl_cmd_t *req) +ctrl_cmd_t * rpc_slaveif_wifi_get_band_mode(ctrl_cmd_t *req) { RPC_SEND_REQ(RPC_ID__Req_WifiGetBandMode); RPC_DECODE_RSP_IF_NOT_ASYNC(); } #endif + +ctrl_cmd_t * rpc_slaveif_set_slave_dhcp_dns_status(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_SetDhcpDnsStatus); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +#if H_WIFI_ENTERPRISE_SUPPORT +ctrl_cmd_t * rpc_slaveif_wifi_sta_enterprise_enable(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_WifiStaEnterpriseEnable); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_wifi_sta_enterprise_disable(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_WifiStaEnterpriseDisable); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_set_identity(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapSetIdentity); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_clear_identity(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapClearIdentity); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_set_username(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapSetUsername); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_clear_username(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapClearUsername); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_set_password(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapSetPassword); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_clear_password(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapClearPassword); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_set_new_password(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapSetNewPassword); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_clear_new_password(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapClearNewPassword); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_set_ca_cert(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapSetCaCert); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_clear_ca_cert(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapClearCaCert); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_set_certificate_and_key(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapSetCertificateAndKey); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_clear_certificate_and_key(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapClearCertificateAndKey); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_get_disable_time_check(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapGetDisableTimeCheck); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_set_ttls_phase2_method(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapSetTtlsPhase2Method); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_set_suiteb_certification(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapSetSuitebCertification); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_set_pac_file(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapSetPacFile); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_set_fast_params(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapSetFastParams); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_use_default_cert_bundle(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapUseDefaultCertBundle); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_wifi_set_okc_support(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_WifiSetOkcSupport); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_set_domain_name(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapSetDomainName); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_eap_set_disable_time_check(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapSetDisableTimeCheck); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +#if H_GOT_SET_EAP_METHODS_API +ctrl_cmd_t * rpc_slaveif_eap_set_eap_methods(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_EapSetEapMethods); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} +#endif +#endif +#if H_DPP_SUPPORT +ctrl_cmd_t * rpc_slaveif_supp_dpp_init(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_SuppDppInit); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_supp_dpp_deinit(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_SuppDppDeinit); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_supp_dpp_bootstrap_gen(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_SuppDppBootstrapGen); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_supp_dpp_start_listen(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_SuppDppStartListen); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_supp_dpp_stop_listen(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_SuppDppStopListen); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} +#endif +#if H_ENABLE_GPIO_CONTROL +ctrl_cmd_t * rpc_slaveif_gpio_config(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_GpioConfig); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_gpio_reset_pin(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_GpioResetPin); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_gpio_set_level(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_GpioSetLevel); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_gpio_get_level(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_GpioGetLevel); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_gpio_set_direction(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_GpioSetDirection); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_gpio_input_enable(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_GpioInputEnable); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} + +ctrl_cmd_t * rpc_slaveif_gpio_set_pull_mode(ctrl_cmd_t *req) +{ + RPC_SEND_REQ(RPC_ID__Req_GpioSetPullMode); + RPC_DECODE_RSP_IF_NOT_ASYNC(); +} +#endif //H_ENABLE_GPIO_CONTROL diff --git a/host/drivers/rpc/slaveif/rpc_slave_if.h b/host/drivers/rpc/slaveif/rpc_slave_if.h index 9fd09900..8388e564 100644 --- a/host/drivers/rpc/slaveif/rpc_slave_if.h +++ b/host/drivers/rpc/slaveif/rpc_slave_if.h @@ -1,8 +1,7 @@ /* - * Espressif Systems Wireless LAN device driver + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * - * Copyright (C) 2015-2022 Espressif Systems (Shanghai) PTE LTD - * SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 + * SPDX-License-Identifier: Apache-2.0 */ /** prevent recursive inclusion **/ @@ -12,8 +11,17 @@ #include #include "esp_hosted_rpc.pb-c.h" #include "esp_wifi.h" +#include "esp_mac.h" #include "esp_wifi_types.h" -#include "esp_hosted_wifi_config.h" +#include "port_esp_hosted_host_wifi_config.h" +#include "port_esp_hosted_host_config.h" + +#if H_WIFI_ENTERPRISE_SUPPORT +#include "esp_eap_client.h" +#endif +#if H_DPP_SUPPORT +#include "esp_dpp.h" +#endif #ifdef __cplusplus extern "C" { @@ -25,6 +33,8 @@ extern "C" { #define STATUS_LENGTH 14 #define VENDOR_OUI_BUF 3 +#define IFACE_MAC_SIZE 8 // 6 for MAC-48, 8 for EIU-64, 2 for EFUSE_EXT + /* #define SUCCESS 0 #define FAILURE -1 @@ -46,7 +56,7 @@ extern "C" { * */ //#define WAIT_TIME_B2B_RPC_REQ 5 #define DEFAULT_RPC_RSP_TIMEOUT 5 - +#define DEFAULT_RPC_RSP_SCAN_TIMEOUT 30 #define SUCCESS_STR "success" #define FAILURE_STR "failure" @@ -55,8 +65,35 @@ extern "C" { #define RPC_RX_QUEUE_SIZE 3 #define RPC_TX_QUEUE_SIZE 5 +typedef enum { + FEATURE_NONE, + FEATURE_BT, + // add additional features here +} rpc_feature; + +typedef enum { + FEATURE_COMMAND_NONE, + FEATURE_COMMAND_BT_INIT, + FEATURE_COMMAND_BT_DEINIT, + FEATURE_COMMAND_BT_ENABLE, + FEATURE_COMMAND_BT_DISABLE, + // add additional feature commands here +} rpc_feature_command; + +typedef enum { + FEATURE_OPTION_NONE, + FEATURE_OPTION_BT_DEINIT_RELEASE_MEMORY, + // add additional feature options here +} rpc_feature_option; + /*---- Control structures ----*/ +typedef struct { + rpc_feature feature; + rpc_feature_command command; + rpc_feature_option option; +} rcp_feature_control_t; + typedef struct { int mode; uint8_t mac[BSSID_BYTES_SIZE]; @@ -166,6 +203,70 @@ typedef struct { wifi_bandwidth_t ghz_5g; } rpc_wifi_bandwidths_t; +typedef struct { + int iface; + int net_link_up; + int dhcp_up; + uint8_t dhcp_ip[64]; + uint8_t dhcp_nm[64]; + uint8_t dhcp_gw[64]; + int dns_up; + uint8_t dns_ip[64]; + int dns_type; +} rpc_set_dhcp_dns_status_t; + +typedef struct { + bool set; + esp_mac_type_t type; + size_t mac_len; + uint8_t mac[IFACE_MAC_SIZE]; +} rpc_iface_mac_t; + +typedef struct { + size_t len; + esp_mac_type_t type; +} rpc_iface_mac_len_t; + +typedef struct { + wifi_interface_t ifx; + uint16_t sec; +} rpc_wifi_inactive_time_t; + +#if H_WIFI_HE_SUPPORT +typedef struct { + int flow_id; + int suspend_time_ms; +} rpc_wifi_itwt_suspend_t; +#endif + +#if H_DPP_SUPPORT +// current length of the optional bootstrap gen key length +// see documentation for `esp_supp_dpp_bootstrap_gen()` +#define DPP_BOOTSTRAP_GEN_KEY_LEN (32) + +#define DPP_URI_LEN_MAX (H_DPP_URI_LEN_MAX + 1) // include NULL at end of string + +typedef struct { + const char *chan_list; + esp_supp_dpp_bootstrap_t type; + const char *key; + const char *info; +} rpc_supp_dpp_bootstrap_gen_t; + +typedef struct { + uint32_t uri_data_len; /**< URI data length including null termination */ + char uri[DPP_URI_LEN_MAX]; /**< URI data */ +} supp_wifi_event_dpp_uri_ready_t; + +typedef struct { + wifi_config_t wifi_cfg; /**< Received WIFI config in DPP */ +} supp_wifi_event_dpp_config_received_t; + +typedef struct { + int failure_reason; /**< Failure reason */ +} supp_wifi_event_dpp_failed_t; +#endif + typedef struct { /* event */ uint32_t hb_num; @@ -178,6 +279,91 @@ typedef struct { int32_t wifi_event_id; } event_wifi_simple_t; +#if H_WIFI_ENTERPRISE_SUPPORT +typedef struct { + const unsigned char *identity; + int len; +} rpc_eap_identity_t; + +typedef struct { + const unsigned char *username; + int len; +} rpc_eap_username_t; + +typedef struct { + const unsigned char *password; + int len; +} rpc_eap_password_t; + +typedef struct { + const unsigned char *ca_cert; + int len; +} rpc_eap_ca_cert_t; + +typedef struct { + const unsigned char *client_cert; + int client_cert_len; + const unsigned char *private_key; + int private_key_len; + const unsigned char *private_key_password; + int private_key_passwd_len; +} rpc_eap_cert_key_t; + +typedef struct { + bool disable; +} rpc_eap_disable_time_check_t; + +typedef struct { + bool enable; +} rpc_eap_suiteb_192bit_t; + +typedef struct { + const unsigned char *pac_file; + int len; +} rpc_eap_pac_file_t; + + +typedef struct { + bool use_default; +} rpc_eap_default_cert_bundle_t; + +typedef struct { + bool enable; +} rpc_wifi_okc_support_t; + +typedef struct { + const char *domain_name; +} rpc_eap_domain_name_t; +#endif + +#if H_ENABLE_GPIO_CONTROL +typedef struct { + uint64_t pin_bit_mask; /*!< GPIO pin: set with bit mask, each bit maps to a GPIO */ + uint32_t mode; /*!< GPIO mode: set input/output mode */ + uint32_t pull_up_en; /*!< GPIO pull-up */ + uint32_t pull_down_en; /*!< GPIO pull-down */ + uint32_t intr_type; /*!< GPIO interrupt type */ +//#if SOC_GPIO_SUPPORT_PIN_HYS_FILTER +// uint32_t hys_ctrl_mode; /*!< GPIO hysteresis: hysteresis filter on slope input */ +//#endif +} rpc_gpio_config_t; + +typedef struct { + uint32_t gpio_num; + uint32_t level; +} rpc_gpio_set_level_t; + +typedef struct { + uint32_t gpio_num; + uint32_t mode; +} rpc_gpio_set_direction_t; + +typedef struct { + uint32_t gpio_num; + uint32_t pull_mode; +} rpc_gpio_set_pull_mode_t; +#endif + typedef struct Ctrl_cmd_t { /* msg type could be 1. req 2. resp 3. notification */ uint8_t msg_type; @@ -237,8 +423,38 @@ typedef struct Ctrl_cmd_t { rpc_wifi_sta_get_negotiated_phymode_t wifi_sta_get_negotiated_phymode; rpc_wifi_sta_get_aid_t wifi_sta_get_aid; + rpc_wifi_inactive_time_t wifi_inactive_time; + rpc_coprocessor_fwversion_t coprocessor_fwversion; + rpc_iface_mac_t iface_mac; + + rpc_iface_mac_len_t iface_mac_len; + + bool bt_mem_release; + + rcp_feature_control_t feature_control; + +#if H_WIFI_HE_SUPPORT + wifi_twt_config_t wifi_twt_config; + +#if H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 + wifi_itwt_setup_config_t wifi_itwt_setup_config; +#else + wifi_twt_setup_config_t wifi_twt_setup_config; +#endif + + int wifi_itwt_flow_id; + + rpc_wifi_itwt_suspend_t wifi_itwt_suspend; + + int wifi_itwt_flow_id_bitmap; + + int wifi_itwt_probe_req_timeout_ms; + + int wifi_itwt_set_target_wake_time_offset_us; +#endif + #if H_WIFI_DUALBAND_SUPPORT rpc_wifi_protocols_t wifi_protocols; @@ -249,6 +465,15 @@ typedef struct Ctrl_cmd_t { wifi_band_mode_t wifi_band_mode; #endif + rpc_set_dhcp_dns_status_t slave_dhcp_dns_status; + +#if H_DPP_SUPPORT + bool dpp_enable_cb; + + rpc_supp_dpp_bootstrap_gen_t dpp_bootstrap_gen; +#endif + + event_heartbeat_t e_heartbeat; event_wifi_simple_t e_wifi_simple; @@ -262,6 +487,67 @@ typedef struct Ctrl_cmd_t { wifi_event_sta_connected_t e_wifi_sta_connected; wifi_event_sta_disconnected_t e_wifi_sta_disconnected; + +#if H_WIFI_HE_SUPPORT + wifi_event_sta_itwt_setup_t e_wifi_sta_itwt_setup; + + wifi_event_sta_itwt_teardown_t e_wifi_sta_itwt_teardown; + + wifi_event_sta_itwt_suspend_t e_wifi_sta_itwt_suspend; + + wifi_event_sta_itwt_probe_t e_wifi_sta_itwt_probe; +#endif +#if H_WIFI_ENTERPRISE_SUPPORT + rpc_eap_identity_t eap_identity; + + rpc_eap_username_t eap_username; + + rpc_eap_password_t eap_password; + + rpc_eap_ca_cert_t eap_ca_cert; + + rpc_eap_cert_key_t eap_cert_key; + + rpc_eap_disable_time_check_t eap_disable_time_check; + + esp_eap_ttls_phase2_types eap_ttls_phase2; + + rpc_eap_suiteb_192bit_t eap_suiteb_192bit; + + rpc_eap_pac_file_t eap_pac_file; + + esp_eap_fast_config eap_fast_config; + + rpc_eap_default_cert_bundle_t eap_default_cert_bundle; + + rpc_wifi_okc_support_t wifi_okc_support; + + rpc_eap_domain_name_t eap_domain_name; + +#if H_GOT_SET_EAP_METHODS_API + esp_eap_method_t methods; +#endif +#endif +#if H_DPP_SUPPORT + supp_wifi_event_dpp_uri_ready_t e_dpp_uri_ready; + + supp_wifi_event_dpp_config_received_t e_dpp_config_received; + + supp_wifi_event_dpp_failed_t e_dpp_failed; +#endif +#if H_ENABLE_GPIO_CONTROL + rpc_gpio_config_t gpio_config; + + uint32_t gpio_num; + + rpc_gpio_set_level_t gpio_set_level; + + int gpio_get_level; + + rpc_gpio_set_direction_t gpio_set_direction; + + rpc_gpio_set_pull_mode_t gpio_set_pull_mode; +#endif }u; /* By default this callback is set to NULL. @@ -376,143 +662,159 @@ int rpc_slaveif_init(void); **/ int rpc_slaveif_deinit(void); +int rpc_slaveif_start(void); + +int rpc_slaveif_stop(void); + /* Get the MAC address of station or softAP interface of ESP32 */ -ctrl_cmd_t * wifi_get_mac(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_get_mac(ctrl_cmd_t *req); /* Set MAC address of ESP32 interface for given wifi mode */ -ctrl_cmd_t * wifi_set_mac(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_mac(ctrl_cmd_t *req); /* Get Wi-Fi mode of ESP32 */ -ctrl_cmd_t * wifi_get_mode(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_get_mode(ctrl_cmd_t *req); /* Set the Wi-Fi mode of ESP32 */ -ctrl_cmd_t * wifi_set_mode(ctrl_cmd_t *req); - -/* Set Wi-Fi power save mode of ESP32 */ -ctrl_cmd_t * wifi_set_power_save_mode(ctrl_cmd_t *req); - -/* Get the Wi-Fi power save mode of ESP32 */ -ctrl_cmd_t * wifi_get_power_save_mode(ctrl_cmd_t *req); - -///* Get list of available neighboring APs of ESP32 */ -//ctrl_cmd_t * wifi_ap_scan_list(ctrl_cmd_t *req); -// -///* Get the AP config to which ESP32 station is connected */ -//ctrl_cmd_t * wifi_get_ap_config(ctrl_cmd_t *req); -// -///* Set the AP config to which ESP32 station should connect to */ -//ctrl_cmd_t * wifi_connect_ap(ctrl_cmd_t *req); -// -///* Disconnect ESP32 station from AP */ -//ctrl_cmd_t * wifi_disconnect_ap(ctrl_cmd_t *req); -// -///* Set configuration of ESP32 softAP and start broadcasting */ -//ctrl_cmd_t * wifi_start_softap(ctrl_cmd_t *req); -// -///* Get configuration of ESP32 softAP */ -//ctrl_cmd_t * wifi_get_softap_config(ctrl_cmd_t *req); -// -///* Stop ESP32 softAP */ -//ctrl_cmd_t * wifi_stop_softap(ctrl_cmd_t *req); -// -///* Get list of connected stations to ESP32 softAP */ -//ctrl_cmd_t * wifi_get_softap_connected_station_list(ctrl_cmd_t *req); -// -///* Function set 802.11 Vendor-Specific Information Element. -// * It needs to get called before starting of ESP32 softAP */ -//ctrl_cmd_t * wifi_set_vendor_specific_ie(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_mode(ctrl_cmd_t *req); /* Sets maximum WiFi transmitting power at ESP32 */ -ctrl_cmd_t * wifi_set_max_tx_power(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_max_tx_power(ctrl_cmd_t *req); /* Gets maximum WiFi transmiting power at ESP32 */ -ctrl_cmd_t * wifi_get_max_tx_power(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_get_max_tx_power(ctrl_cmd_t *req); /* Configure heartbeat event. Be default heartbeat is not enabled. * To enable heartbeats, user need to use this API in addition * to setting event callback for heartbeat event */ -ctrl_cmd_t * config_heartbeat(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_config_heartbeat(ctrl_cmd_t *req); /* Performs an OTA begin operation for ESP32 which erases and * prepares existing flash partition for new flash writing */ -ctrl_cmd_t * ota_begin(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_ota_begin(ctrl_cmd_t *req); /* Performs an OTA write operation for ESP32, It writes bytes from `ota_data` * buffer with `ota_data_len` number of bytes to OTA partition in flash. Number * of bytes can be small than size of complete binary to be flashed. In that * case, this caller is expected to repeatedly call this function till * total size written equals size of complete binary */ -ctrl_cmd_t * ota_write(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_ota_write(ctrl_cmd_t *req); /* Performs an OTA end operation for ESP32, It validates written OTA image, * sets newly written OTA partition as boot partition for next boot, * Creates timer which reset ESP32 after 5 sec */ -ctrl_cmd_t * ota_end(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_ota_end(ctrl_cmd_t *req); + +/* Performs an OTA activate operation for ESP32, It reboots the ESP32 + * to activate the newly written OTA partition */ +ctrl_cmd_t * rpc_slaveif_ota_activate(ctrl_cmd_t *req); /* Gets the co-processor FW Version */ -ctrl_cmd_t * get_coprocessor_fwversion(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_get_coprocessor_fwversion(ctrl_cmd_t *req); /* TODO: add descriptions */ -ctrl_cmd_t * wifi_init(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_deinit(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_start(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_stop(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_connect(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_disconnect(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_set_config(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_get_config(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_scan_start(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_scan_stop(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_scan_get_ap_num(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_scan_get_ap_record(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_scan_get_ap_records(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_clear_ap_list(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_restore(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_clear_fast_connect(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_deauth_sta(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_sta_get_ap_info(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_set_ps(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_get_ps(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_set_storage(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_set_bandwidth(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_get_bandwidth(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_set_channel(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_get_channel(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_set_country_code(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_get_country_code(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_set_country(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_get_country(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_ap_get_sta_list(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_ap_get_sta_aid(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_sta_get_rssi(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_set_protocol(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_get_protocol(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_sta_get_negotiated_phymode(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_sta_get_aid(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_set_protocols(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_get_protocols(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_set_bandwidths(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_get_bandwidths(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_set_band(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_get_band(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_set_band_mode(ctrl_cmd_t *req); -ctrl_cmd_t * wifi_get_band_mode(ctrl_cmd_t *req); - -/* Get the interface up for interface `iface` */ -int interface_up(int sockfd, char* iface); - -/* Get the interface down for interface `iface` */ -int interface_down(int sockfd, char* iface); - -/* Set ethernet interface MAC address `mac` to interface `iface` */ -int set_hw_addr(int sockfd, char* iface, char* mac); - -/* Create an endpoint for communication */ -int create_socket(int domain, int type, int protocol, int *sock); - -/* Close an endpoint of the communication */ -int close_socket(int sock); - +ctrl_cmd_t * rpc_slaveif_wifi_init(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_deinit(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_start(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_stop(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_connect(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_disconnect(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_config(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_get_config(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_scan_start(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_scan_stop(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_scan_get_ap_num(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_scan_get_ap_record(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_scan_get_ap_records(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_clear_ap_list(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_restore(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_clear_fast_connect(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_deauth_sta(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_sta_get_ap_info(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_ps(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_get_ps(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_storage(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_bandwidth(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_get_bandwidth(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_channel(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_get_channel(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_country_code(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_get_country_code(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_country(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_get_country(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_ap_get_sta_list(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_ap_get_sta_aid(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_sta_get_rssi(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_protocol(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_get_protocol(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_sta_get_negotiated_phymode(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_sta_get_aid(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_protocols(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_get_protocols(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_bandwidths(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_get_bandwidths(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_band(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_get_band(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_band_mode(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_get_band_mode(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_set_slave_dhcp_dns_status(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_iface_mac_addr_set_get(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_feature_control(ctrl_cmd_t *req); + +ctrl_cmd_t * rpc_slaveif_iface_mac_addr_set_get(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slave_feature_command(ctrl_cmd_t *req);; +ctrl_cmd_t * rpc_slaveif_iface_mac_addr_len_get(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_inactive_time(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_get_inactive_time(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_sta_twt_config(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_sta_itwt_setup(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_sta_itwt_teardown(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_sta_itwt_suspend(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_sta_itwt_get_flow_id_status(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_sta_itwt_send_probe_req(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_sta_itwt_set_target_wake_time_offset(ctrl_cmd_t *req); +#if H_WIFI_ENTERPRISE_SUPPORT +ctrl_cmd_t * rpc_slaveif_wifi_sta_enterprise_enable(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_sta_enterprise_disable(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_set_identity(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_clear_identity(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_set_username(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_clear_username(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_set_password(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_clear_password(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_set_new_password(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_clear_new_password(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_set_ca_cert(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_clear_ca_cert(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_set_certificate_and_key(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_clear_certificate_and_key(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_set_disable_time_check(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_get_disable_time_check(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_set_ttls_phase2_method(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_set_suiteb_certification(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_set_pac_file(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_set_fast_params(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_use_default_cert_bundle(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_wifi_set_okc_support(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_set_domain_name(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_eap_set_eap_methods(ctrl_cmd_t *req); +#endif +#if H_DPP_SUPPORT +ctrl_cmd_t * rpc_slaveif_supp_dpp_init(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_supp_dpp_deinit(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_supp_dpp_bootstrap_gen(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_supp_dpp_start_listen(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_supp_dpp_stop_listen(ctrl_cmd_t *req); +#endif +#if H_ENABLE_GPIO_CONTROL +ctrl_cmd_t * rpc_slaveif_gpio_config(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_gpio_reset_pin(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_gpio_set_level(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_gpio_get_level(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_gpio_set_direction(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_gpio_input_enable(ctrl_cmd_t *req); +ctrl_cmd_t * rpc_slaveif_gpio_set_pull_mode(ctrl_cmd_t *req); +#endif #ifdef __cplusplus } #endif diff --git a/host/drivers/rpc/wrap/rpc_wrap.c b/host/drivers/rpc/wrap/rpc_wrap.c index 2a2b59ed..6fc76a24 100644 --- a/host/drivers/rpc/wrap/rpc_wrap.c +++ b/host/drivers/rpc/wrap/rpc_wrap.c @@ -1,40 +1,29 @@ /* - * Espressif Systems Wireless LAN device driver + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * - * Copyright (C) 2015-2021 Espressif Systems (Shanghai) PTE LTD - * - * This software file (the "File") is distributed by Espressif Systems (Shanghai) - * PTE LTD under the terms of the GNU General Public License Version 2, June 1991 - * (the "License"). You may use, redistribute and/or modify this File in - * accordance with the terms and conditions of the License, a copy of which - * is available by writing to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the - * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. - * - * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE - * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE - * ARE EXPRESSLY DISCLAIMED. The License provides additional details about - * this warranty disclaimer. + * SPDX-License-Identifier: Apache-2.0 */ - -#include "common.h" #include #include #include #include "rpc_slave_if.h" #include "string.h" -#include "os_wrapper.h" #include "rpc_wrap.h" #include "esp_hosted_rpc.h" #include "esp_log.h" -#include "esp_http_client.h" -#include "esp_hosted_wifi_config.h" -#include "esp_hosted_api.h" +#include "port_esp_hosted_host_wifi_config.h" +#include "port_esp_hosted_host_config.h" +#include "port_esp_hosted_host_os.h" #include "esp_hosted_transport.h" +#include "port_esp_hosted_host_log.h" +#include "transport_drv.h" + +#if H_DPP_SUPPORT +#include "esp_dpp.h" +#endif -DEFINE_LOG_TAG(rpc_wrap); -static char* OTA_TAG = "h_ota"; +static const char *TAG = "RPC_WRAP"; uint8_t restart_after_slave_ota = 0; @@ -45,10 +34,15 @@ uint8_t restart_after_slave_ota = 0; #define VENDOR_OUI_2 3 #define VENDOR_OUI_TYPE 22 #define CHUNK_SIZE 1400 + #define OTA_BEGIN_RSP_TIMEOUT_SEC 15 +#define WIFI_INIT_RSP_TIMEOUT_SEC 10 #define OTA_FROM_WEB_URL 1 +#define GET_FWVERSION_TIMEOUT_SEC 1 - +/* Forward declarations */ +static int rpc_wifi_connect_async(void); +static esp_err_t rpc_iface_feature_control(rcp_feature_control_t *feature_control); static ctrl_cmd_t * RPC_DEFAULT_REQ(void) { @@ -56,7 +50,7 @@ static ctrl_cmd_t * RPC_DEFAULT_REQ(void) assert(new_req); new_req->msg_type = RPC_TYPE__Req; new_req->rpc_rsp_cb = NULL; - new_req->rsp_timeout_sec = DEFAULT_RPC_RSP_TIMEOUT; /* 5 sec */ + new_req->rsp_timeout_sec = DEFAULT_RPC_RSP_TIMEOUT; /* new_req->wait_prev_cmd_completion = WAIT_TIME_B2B_RPC_REQ; */ return new_req; } @@ -77,9 +71,28 @@ static ctrl_cmd_t * RPC_DEFAULT_REQ(void) #define YES 1 #define NO 0 -#define MIN_TIMESTAMP_STR_SIZE 30 #define HEARTBEAT_DURATION_SEC 20 +#if H_SUPP_DPP_SUPPORT +// size of Callback queue used by the Supplicant DPP task +#define RPC_SUPP_CB_QUEUE_SIZE (5) + +typedef struct { + esp_supp_dpp_event_t dpp_event; + int dpp_reason; // to avoid doing malloc(sizeof(int)) as dpp_data + void * dpp_data; +} supp_cb_queue_item_t; + +static void * rpc_supp_cb_thread_hdl = NULL; +static queue_handle_t rpc_supp_cb_thread_q = NULL; + +static void rpc_supp_thread(void const *arg); +static esp_err_t rpc_supp_cb_thread_start(void); +static esp_err_t rpc_supp_cb_thread_stop(void); + +// evt_cb triggered when we receive a DPP callback event +static esp_supp_dpp_event_cb_t dpp_evt_cb = NULL; +#endif typedef struct { int event; @@ -92,26 +105,36 @@ int rpc_init(void) return rpc_slaveif_init(); } +int rpc_start(void) +{ + ESP_LOGD(TAG, "%s", __func__); + return rpc_slaveif_start(); +} + +int rpc_stop(void) +{ + ESP_LOGD(TAG, "%s", __func__); + return rpc_slaveif_stop(); +} + int rpc_deinit(void) { ESP_LOGD(TAG, "%s", __func__); return rpc_slaveif_deinit(); } -static char * get_timestamp_str(char *str, uint16_t str_size) -{ - if (str && str_size>=MIN_TIMESTAMP_STR_SIZE) { - time_t t = time(NULL); - struct tm tm = *localtime(&t); - sprintf(str, "%d-%02d-%02d %02d:%02d:%02d > ", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); - return str; - } - return NULL; +// returns true if the netif is up for the wifi interface +static bool is_wifi_netif_started(wifi_interface_t wifi_if) { + esp_netif_t* netif = esp_netif_get_handle_from_ifkey( + (wifi_if == WIFI_IF_STA) ? "WIFI_STA_DEF" : "WIFI_AP_DEF"); + return (netif != NULL) && esp_netif_is_netif_up(netif); } static int rpc_event_callback(ctrl_cmd_t * app_event) { - char ts[MIN_TIMESTAMP_STR_SIZE] = {'\0'}; + static bool netif_started = false; + static bool netif_connected = false; + static bool softap_started = false; ESP_LOGV(TAG, "%u",app_event->msg_id); if (!app_event || (app_event->msg_type != RPC_TYPE__Event)) { @@ -121,7 +144,7 @@ static int rpc_event_callback(ctrl_cmd_t * app_event) } if ((app_event->msg_id <= RPC_ID__Event_Base) || - (app_event->msg_id >= RPC_ID__Event_Max)) { + (app_event->msg_id >= RPC_ID__Event_Max)) { ESP_LOGE(TAG, "Event Msg ID[0x%x] is not correct",app_event->msg_id); goto fail_parsing; } @@ -129,19 +152,16 @@ static int rpc_event_callback(ctrl_cmd_t * app_event) switch(app_event->msg_id) { case RPC_ID__Event_ESPInit: { - ESP_LOGD(TAG, "Received Slave ESP Init"); + ESP_LOGI(TAG, "--- ESP Event: Slave ESP Init ---"); break; } case RPC_ID__Event_Heartbeat: { - ESP_LOGV(TAG, "%s ESP EVENT: Heartbeat event [%lu]", - get_timestamp_str(ts, MIN_TIMESTAMP_STR_SIZE), + ESP_LOGI(TAG, "ESP Event: Heartbeat event [%lu]", (long unsigned int)app_event->u.e_heartbeat.hb_num); break; } case RPC_ID__Event_AP_StaConnected: { wifi_event_ap_staconnected_t *p_e = &app_event->u.e_wifi_ap_staconnected; - if (strlen((char*)p_e->mac)) { - ESP_LOGV(TAG, "%s ESP EVENT: SoftAP mode: connected station", - get_timestamp_str(ts, MIN_TIMESTAMP_STR_SIZE)); + ESP_LOGI(TAG, "ESP Event: SoftAP mode: station connected with MAC Addr " MACSTR, MAC2STR(p_e->mac)); g_h.funcs->_h_event_wifi_post(WIFI_EVENT_AP_STACONNECTED, p_e, sizeof(wifi_event_ap_staconnected_t), HOSTED_BLOCK_MAX); } @@ -149,67 +169,190 @@ static int rpc_event_callback(ctrl_cmd_t * app_event) } case RPC_ID__Event_AP_StaDisconnected: { wifi_event_ap_stadisconnected_t *p_e = &app_event->u.e_wifi_ap_stadisconnected; if (strlen((char*)p_e->mac)) { - ESP_LOGV(TAG, "%s ESP EVENT: SoftAP mode: disconnected MAC", - get_timestamp_str(ts, MIN_TIMESTAMP_STR_SIZE)); + ESP_LOGI(TAG, "ESP Event: SoftAP mode: disconnected station"); g_h.funcs->_h_event_wifi_post(WIFI_EVENT_AP_STADISCONNECTED, p_e, sizeof(wifi_event_ap_stadisconnected_t), HOSTED_BLOCK_MAX); } break; } case RPC_ID__Event_StaConnected: { - ESP_LOGV(TAG, "%s ESP EVENT: Station mode: Connected", - get_timestamp_str(ts, MIN_TIMESTAMP_STR_SIZE)); + ESP_LOGI(TAG, "ESP Event: Station mode: Connected"); + wifi_event_sta_connected_t *p_e = &app_event->u.e_wifi_sta_connected; - g_h.funcs->_h_event_wifi_post(WIFI_EVENT_STA_CONNECTED, - p_e, sizeof(wifi_event_sta_connected_t), HOSTED_BLOCK_MAX); + + if (!netif_connected && netif_started) { + g_h.funcs->_h_event_wifi_post(WIFI_EVENT_STA_CONNECTED, + p_e, sizeof(wifi_event_sta_connected_t), HOSTED_BLOCK_MAX); + netif_connected = true; + } break; } case RPC_ID__Event_StaDisconnected: { - ESP_LOGV(TAG, "%s ESP EVENT: Station mode: Disconnected", - get_timestamp_str(ts, MIN_TIMESTAMP_STR_SIZE)); + ESP_LOGI(TAG, "ESP Event: Station mode: Disconnected"); wifi_event_sta_disconnected_t *p_e = &app_event->u.e_wifi_sta_disconnected; g_h.funcs->_h_event_wifi_post(WIFI_EVENT_STA_DISCONNECTED, p_e, sizeof(wifi_event_sta_disconnected_t), HOSTED_BLOCK_MAX); + netif_connected = false; + break; +#if H_WIFI_HE_SUPPORT + } case RPC_ID__Event_StaItwtSetup: { + ESP_LOGV(TAG, "ESP Event: iTWT: Setup"); + wifi_event_sta_itwt_setup_t *p_e = &app_event->u.e_wifi_sta_itwt_setup; + g_h.funcs->_h_event_wifi_post(WIFI_EVENT_ITWT_SETUP, + p_e, sizeof(wifi_event_sta_itwt_setup_t), HOSTED_BLOCK_MAX); + break; + } case RPC_ID__Event_StaItwtTeardown: { + ESP_LOGV(TAG, "ESP Event: iTWT: Teardown"); + wifi_event_sta_itwt_teardown_t *p_e = &app_event->u.e_wifi_sta_itwt_teardown; + g_h.funcs->_h_event_wifi_post(WIFI_EVENT_ITWT_TEARDOWN, + p_e, sizeof(wifi_event_sta_itwt_teardown_t), HOSTED_BLOCK_MAX); + break; + } case RPC_ID__Event_StaItwtSuspend: { + ESP_LOGV(TAG, "ESP Event: iTWT: Suspend"); + wifi_event_sta_itwt_suspend_t *p_e = &app_event->u.e_wifi_sta_itwt_suspend; + g_h.funcs->_h_event_wifi_post(WIFI_EVENT_ITWT_SUSPEND, + p_e, sizeof(wifi_event_sta_itwt_suspend_t), HOSTED_BLOCK_MAX); + break; + } case RPC_ID__Event_StaItwtProbe: { + ESP_LOGV(TAG, "ESP Event: iTWT: Probe"); + wifi_event_sta_itwt_probe_t *p_e = &app_event->u.e_wifi_sta_itwt_probe; + g_h.funcs->_h_event_wifi_post(WIFI_EVENT_ITWT_PROBE, + p_e, sizeof(wifi_event_sta_itwt_probe_t), HOSTED_BLOCK_MAX); + break; +#endif // H_WIFI_HE_SUPPORT +#if H_WIFI_DPP_SUPPORT + } case RPC_ID__Event_WifiDppUriReady: { + ESP_LOGV(TAG, "ESP Event: DPP: URI Ready"); + supp_wifi_event_dpp_uri_ready_t *p_e = &app_event->u.e_dpp_uri_ready; + int len = p_e->uri_data_len; + g_h.funcs->_h_event_wifi_post(WIFI_EVENT_DPP_URI_READY, + p_e, sizeof(wifi_event_sta_itwt_probe_t) + len, HOSTED_BLOCK_MAX); break; + } case RPC_ID__Event_WifiDppCfgRecvd: { + ESP_LOGV(TAG, "ESP Event: DPP: CFG Received"); + supp_wifi_event_dpp_config_received_t *p_e = &app_event->u.e_dpp_config_received; + g_h.funcs->_h_event_wifi_post(WIFI_EVENT_DPP_CFG_RECVD, + p_e, sizeof(wifi_event_dpp_config_received_t), HOSTED_BLOCK_MAX); + break; + } case RPC_ID__Event_WifiDppFail: { + ESP_LOGV(TAG, "ESP Event: DPP: Fail"); + supp_wifi_event_dpp_failed_t *p_e = &app_event->u.e_dpp_failed; + g_h.funcs->_h_event_wifi_post(WIFI_EVENT_DPP_FAILED, + p_e, sizeof(wifi_event_dpp_failed_t), HOSTED_BLOCK_MAX); + break; +#endif // H_WIFI_DPP_SUPPORT +#if H_SUPP_DPP_SUPPORT + // queue Supplicant DPP events on the dpp queue + } case RPC_ID__Event_SuppDppUriReady: { + if (rpc_supp_cb_thread_q) { + // copy the uri, push it to the queue + size_t len = strlen(app_event->u.e_dpp_uri_ready.uri) + 1; // include terminating NULL + supp_cb_queue_item_t item = { 0 }; + item.dpp_event = ESP_SUPP_DPP_URI_READY; + item.dpp_data = g_h.funcs->_h_malloc(len); + if (item.dpp_data) { + g_h.funcs->_h_memcpy(item.dpp_data, app_event->u.e_dpp_uri_ready.uri, len); + g_h.funcs->_h_queue_item(rpc_supp_cb_thread_q, &item, HOSTED_BLOCK_MAX); + } else { + ESP_LOGE(TAG, "malloc failed for dpp uri"); + } + } else { + ESP_LOGW(TAG, "no queue to push dpp uri: dropping event"); + } + break; + } case RPC_ID__Event_SuppDppCfgRecvd: { + if (rpc_supp_cb_thread_q) { + // copy the wifi config, push it to the queue + supp_cb_queue_item_t item = { 0 }; + item.dpp_event = ESP_SUPP_DPP_CFG_RECVD; + item.dpp_data = g_h.funcs->_h_malloc(sizeof(wifi_config_t)); + if (item.dpp_data) { + g_h.funcs->_h_memcpy(item.dpp_data, &app_event->u.e_dpp_config_received.wifi_cfg, + sizeof(wifi_config_t)); + g_h.funcs->_h_queue_item(rpc_supp_cb_thread_q, &item, HOSTED_BLOCK_MAX); + } else { + ESP_LOGE(TAG, "malloc failed for dpp wifi config"); + } + } else { + ESP_LOGW(TAG, "no queue to push dpp wifi config: dropping event"); + } + ESP_LOGW(TAG, "Finished Supplicant Event: Cfg Received"); + break; + } case RPC_ID__Event_SuppDppFail: { + if (rpc_supp_cb_thread_q) { + supp_cb_queue_item_t item = { 0 }; + item.dpp_event = ESP_SUPP_DPP_FAIL; + item.dpp_reason = app_event->u.e_dpp_failed.failure_reason; + g_h.funcs->_h_queue_item(rpc_supp_cb_thread_q, &item, HOSTED_BLOCK_MAX); + } else { + ESP_LOGW(TAG, "no queue to push dpp wifi config: dropping event"); + } + break; +#endif // H_SUPP_DPP_SUPPORT } case RPC_ID__Event_WifiEventNoArgs: { int wifi_event_id = app_event->u.e_wifi_simple.wifi_event_id; switch (wifi_event_id) { case WIFI_EVENT_STA_START: - ESP_LOGV(TAG, "%s ESP EVENT: WiFi Event[%s]", - get_timestamp_str(ts, MIN_TIMESTAMP_STR_SIZE), "WIFI_EVENT_STA_START"); + ESP_LOGI(TAG, "ESP Event: wifi station started"); + /* Trigger connection when station is started */ + if (!netif_started && !is_wifi_netif_started(WIFI_IF_STA)) { + g_h.funcs->_h_event_wifi_post(wifi_event_id, 0, 0, HOSTED_BLOCK_MAX); + rpc_wifi_connect_async(); + netif_started = true; + } break; case WIFI_EVENT_STA_STOP: - ESP_LOGV(TAG, "%s ESP EVENT: WiFi Event[%s]", - get_timestamp_str(ts, MIN_TIMESTAMP_STR_SIZE), "WIFI_EVENT_STA_STOP"); + ESP_LOGI(TAG, "ESP Event: wifi station stopped"); + netif_started = false; + netif_connected = false; + g_h.funcs->_h_event_wifi_post(wifi_event_id, 0, 0, HOSTED_BLOCK_MAX); break; case WIFI_EVENT_AP_START: - ESP_LOGD(TAG,"ESP EVENT: softap started"); + ESP_LOGI(TAG,"ESP Event: softap started"); + if (!softap_started && !is_wifi_netif_started(WIFI_IF_AP)) { + g_h.funcs->_h_event_wifi_post(wifi_event_id, 0, 0, HOSTED_BLOCK_MAX); + softap_started = true; + } break; case WIFI_EVENT_AP_STOP: - ESP_LOGD(TAG,"ESP EVENT: softap stopped"); + ESP_LOGI(TAG,"ESP Event: softap stopped"); + softap_started = false; + g_h.funcs->_h_event_wifi_post(wifi_event_id, 0, 0, HOSTED_BLOCK_MAX); + break; + + case WIFI_EVENT_HOME_CHANNEL_CHANGE: + ESP_LOGD(TAG,"ESP Event: Home channel changed"); + g_h.funcs->_h_event_wifi_post(wifi_event_id, 0, 0, HOSTED_BLOCK_MAX); + break; + + case WIFI_EVENT_AP_STACONNECTED: + // should be RPC_ID__Event_AP_StaConnected + ESP_LOGE(TAG,"Incorrect ESP Event: softap station connected"); + break; + + case WIFI_EVENT_AP_STADISCONNECTED: + // should be RPC_ID__Event_AP_StaDisconnected + ESP_LOGE(TAG,"Incorrect ESP Event: softap station disconnected"); break; default: - ESP_LOGV(TAG, "%s ESP EVENT: WiFi Event[%x]", - get_timestamp_str(ts, MIN_TIMESTAMP_STR_SIZE), wifi_event_id); + ESP_LOGV(TAG, "ESP Event: Event[%x]", wifi_event_id); break; } /* inner switch case */ - g_h.funcs->_h_event_wifi_post(wifi_event_id, 0, 0, HOSTED_BLOCK_MAX); - break; } case RPC_ID__Event_StaScanDone: { wifi_event_sta_scan_done_t *p_e = &app_event->u.e_wifi_sta_scan_done; - ESP_LOGV(TAG, "%s ESP EVENT: StaScanDone", - get_timestamp_str(ts, MIN_TIMESTAMP_STR_SIZE)); + ESP_LOGI(TAG, "ESP Event: StaScanDone"); ESP_LOGV(TAG, "scan: status: %lu number:%u scan_id:%u", p_e->status, p_e->number, p_e->scan_id); g_h.funcs->_h_event_wifi_post(WIFI_EVENT_SCAN_DONE, p_e, sizeof(wifi_event_sta_scan_done_t), HOSTED_BLOCK_MAX); break; + } case RPC_ID__Event_DhcpDnsStatus: { + break; } default: { - ESP_LOGW(TAG, "%s Invalid event[0x%x] to parse", - get_timestamp_str(ts, MIN_TIMESTAMP_STR_SIZE), app_event->msg_id); + ESP_LOGW(TAG, "Invalid event[0x%x] to parse", app_event->msg_id); break; } } @@ -306,15 +449,34 @@ int rpc_register_event_callbacks(void) event_callback_table_t events[] = { { RPC_ID__Event_ESPInit, rpc_event_callback }, -#if 0 { RPC_ID__Event_Heartbeat, rpc_event_callback }, -#endif { RPC_ID__Event_AP_StaConnected, rpc_event_callback }, { RPC_ID__Event_AP_StaDisconnected, rpc_event_callback }, { RPC_ID__Event_WifiEventNoArgs, rpc_event_callback }, { RPC_ID__Event_StaScanDone, rpc_event_callback }, { RPC_ID__Event_StaConnected, rpc_event_callback }, { RPC_ID__Event_StaDisconnected, rpc_event_callback }, + { RPC_ID__Event_DhcpDnsStatus, rpc_event_callback }, +#if H_WIFI_HE_SUPPORT + { RPC_ID__Event_StaItwtSetup, rpc_event_callback }, + { RPC_ID__Event_StaItwtTeardown, rpc_event_callback }, + { RPC_ID__Event_StaItwtSuspend, rpc_event_callback }, + { RPC_ID__Event_StaItwtProbe, rpc_event_callback }, +#endif // H_WIFI_HE_SUPPORT +#if H_DPP_SUPPORT +#if H_SUPP_DPP_SUPPORT + // supp events get sent to the separate supp callback handler + { RPC_ID__Event_SuppDppUriReady, rpc_event_callback }, + { RPC_ID__Event_SuppDppCfgRecvd, rpc_event_callback }, + { RPC_ID__Event_SuppDppFail, rpc_event_callback }, +#endif +#if H_WIFI_DPP_SUPPORT + // wifi events are handled via wifi event handler + { RPC_ID__Event_WifiDppUriReady, rpc_event_callback }, + { RPC_ID__Event_WifiDppCfgRecvd, rpc_event_callback }, + { RPC_ID__Event_WifiDppFail, rpc_event_callback }, +#endif +#endif }; for (evt=0; evtmsg_id <= RPC_ID__Resp_Base) || (app_resp->msg_id >= RPC_ID__Resp_Max)) { + // msg_id of RPC_ID__Resp_Base now means Invalid RPC Request + if ((app_resp->msg_id < RPC_ID__Resp_Base) || (app_resp->msg_id >= RPC_ID__Resp_Max)) { ESP_LOGE(TAG, "Response Msg ID[0x%x] is not correct",app_resp->msg_id); goto fail_resp; } @@ -350,7 +513,10 @@ int rpc_rsp_callback(ctrl_cmd_t * app_resp) } switch(app_resp->msg_id) { - + case RPC_ID__Resp_Base : { + ESP_LOGV(TAG, "RPC Request is not supported"); + break; + } case RPC_ID__Resp_GetMACAddress: { ESP_LOGV(TAG, "mac address is [" MACSTR "]", MAC2STR(app_resp->u.wifi_mac.mac)); break; @@ -397,6 +563,9 @@ int rpc_rsp_callback(ctrl_cmd_t * app_resp) } case RPC_ID__Resp_OTAEnd : { ESP_LOGV(TAG, "OTA end success"); break; + } case RPC_ID__Resp_OTAActivate : { + ESP_LOGV(TAG, "OTA activate success"); + break; } case RPC_ID__Resp_WifiSetMaxTxPower: { ESP_LOGV(TAG, "Set wifi max tx power success"); break; @@ -475,7 +644,65 @@ int rpc_rsp_callback(ctrl_cmd_t * app_resp) case RPC_ID__Resp_WifiGetBand: case RPC_ID__Resp_WifiSetBandMode: case RPC_ID__Resp_WifiGetBandMode: - case RPC_ID__Resp_GetCoprocessorFwVersion: { + case RPC_ID__Resp_SetDhcpDnsStatus: + case RPC_ID__Resp_WifiSetInactiveTime: + case RPC_ID__Resp_WifiGetInactiveTime: + case RPC_ID__Resp_IfaceMacAddrSetGet: + case RPC_ID__Resp_IfaceMacAddrLenGet: + case RPC_ID__Resp_FeatureControl: +#if H_WIFI_HE_SUPPORT + case RPC_ID__Resp_WifiStaTwtConfig: + case RPC_ID__Resp_WifiStaItwtSetup: + case RPC_ID__Resp_WifiStaItwtTeardown: + case RPC_ID__Resp_WifiStaItwtSuspend: + case RPC_ID__Resp_WifiStaItwtGetFlowIdStatus: + case RPC_ID__Resp_WifiStaItwtSendProbeReq: + case RPC_ID__Resp_WifiStaItwtSetTargetWakeTimeOffset: +#endif // H_WIFI_HE_SUPPORT +#if H_WIFI_ENTERPRISE_SUPPORT + case RPC_ID__Resp_WifiStaEnterpriseEnable: + case RPC_ID__Resp_WifiStaEnterpriseDisable: + case RPC_ID__Resp_EapSetIdentity: + case RPC_ID__Resp_EapClearIdentity: + case RPC_ID__Resp_EapSetUsername: + case RPC_ID__Resp_EapClearUsername: + case RPC_ID__Resp_EapSetPassword: + case RPC_ID__Resp_EapClearPassword: + case RPC_ID__Resp_EapSetNewPassword: + case RPC_ID__Resp_EapClearNewPassword: + case RPC_ID__Resp_EapSetCaCert: + case RPC_ID__Resp_EapClearCaCert: + case RPC_ID__Resp_EapSetCertificateAndKey: + case RPC_ID__Resp_EapClearCertificateAndKey: + case RPC_ID__Resp_EapGetDisableTimeCheck: + case RPC_ID__Resp_EapSetTtlsPhase2Method: + case RPC_ID__Resp_EapSetSuitebCertification: + case RPC_ID__Resp_EapSetPacFile: + case RPC_ID__Resp_EapSetFastParams: + case RPC_ID__Resp_EapUseDefaultCertBundle: + case RPC_ID__Resp_WifiSetOkcSupport: + case RPC_ID__Resp_EapSetDomainName: + case RPC_ID__Resp_EapSetDisableTimeCheck: + case RPC_ID__Resp_EapSetEapMethods: +#endif +#if H_DPP_SUPPORT + case RPC_ID__Resp_SuppDppInit: + case RPC_ID__Resp_SuppDppDeinit: + case RPC_ID__Resp_SuppDppBootstrapGen: + case RPC_ID__Resp_SuppDppStartListen: + case RPC_ID__Resp_SuppDppStopListen: +#endif +#if H_ENABLE_GPIO_CONTROL + case RPC_ID__Resp_GetCoprocessorFwVersion: + case RPC_ID__Resp_GpioConfig: + case RPC_ID__Resp_GpioResetPin: + case RPC_ID__Resp_GpioSetLevel: + case RPC_ID__Resp_GpioGetLevel: + case RPC_ID__Resp_GpioSetDirection: + case RPC_ID__Resp_GpioInputEnable: + case RPC_ID__Resp_GpioSetPullMode: +#endif + { /* Intended fallthrough */ break; } default: { @@ -504,7 +731,7 @@ int rpc_get_wifi_mode(void) /* register callback for reply */ req->rpc_rsp_cb = rpc_rsp_callback; - wifi_get_mode(req); + rpc_slaveif_wifi_get_mode(req); return SUCCESS; } @@ -517,7 +744,7 @@ int rpc_set_wifi_mode(wifi_mode_t mode) ctrl_cmd_t *resp = NULL; req->u.wifi_mode.mode = mode; - resp = wifi_set_mode(req); + resp = rpc_slaveif_wifi_set_mode(req); return rpc_rsp_callback(resp); } @@ -550,12 +777,13 @@ int rpc_wifi_get_mac(wifi_interface_t mode, uint8_t out_mac[6]) ctrl_cmd_t *req = RPC_DEFAULT_REQ(); req->u.wifi_mac.mode = mode; - resp = wifi_get_mac(req); + resp = rpc_slaveif_wifi_get_mac(req); if (resp && resp->resp_event_status == SUCCESS) { g_h.funcs->_h_memcpy(out_mac, resp->u.wifi_mac.mac, BSSID_BYTES_SIZE); - ESP_LOGV(TAG, "mac address is [" MACSTR "]", MAC2STR(out_mac)); + ESP_LOGD(TAG, "%s mac address is [" MACSTR "]", + mode==WIFI_IF_STA? "sta":"ap", MAC2STR(out_mac)); } return rpc_rsp_callback(resp); } @@ -574,7 +802,7 @@ int rpc_wifi_set_mac(wifi_interface_t mode, const uint8_t mac[6]) req->u.wifi_mac.mode = mode; g_h.funcs->_h_memcpy(req->u.wifi_mac.mac, mac, BSSID_BYTES_SIZE); - resp = wifi_set_mac(req); + resp = rpc_slaveif_wifi_set_mac(req); return rpc_rsp_callback(resp); } @@ -584,235 +812,6 @@ int rpc_softap_mode_get_mac_addr(uint8_t mac[6]) return rpc_wifi_get_mac(WIFI_MODE_AP, mac); } -//int rpc_async_station_mode_connect(char *ssid, char *pwd, char *bssid, -// int is_wpa3_supported, int listen_interval) -//{ -// /* implemented Asynchronous */ -// ctrl_cmd_t *req = RPC_DEFAULT_REQ(); -// -// strcpy((char *)&req->u.hosted_ap_config.ssid, ssid); -// strcpy((char *)&req->u.hosted_ap_config.pwd, pwd); -// strcpy((char *)&req->u.hosted_ap_config.bssid, bssid); -// req->u.hosted_ap_config.is_wpa3_supported = is_wpa3_supported; -// req->u.hosted_ap_config.listen_interval = listen_interval; -// -// /* register callback for handling reply asynch-ly */ -// req->rpc_rsp_cb = rpc_rsp_callback; -// -// wifi_connect_ap(req); -// -// return SUCCESS; -//} -// -//int rpc_station_mode_connect(char *ssid, char *pwd, char *bssid, -// int is_wpa3_supported, int listen_interval) -//{ -// /* implemented Asynchronous */ -// ctrl_cmd_t *req = RPC_DEFAULT_REQ(); -// ctrl_cmd_t *resp = NULL; -// -// strcpy((char *)&req->u.hosted_ap_config.ssid, ssid); -// strcpy((char *)&req->u.hosted_ap_config.pwd, pwd); -// strcpy((char *)&req->u.hosted_ap_config.bssid, bssid); -// req->u.hosted_ap_config.is_wpa3_supported = is_wpa3_supported; -// req->u.hosted_ap_config.listen_interval = listen_interval; -// -// resp = wifi_connect_ap(req); -// -// return rpc_rsp_callback(resp); -//} -// -//int rpc_station_mode_get_info(void) -//{ -// /* implemented synchronous */ -// ctrl_cmd_t *req = RPC_DEFAULT_REQ(); -// ctrl_cmd_t *resp = NULL; -// -// resp = wifi_get_ap_config(req); -// -// return rpc_rsp_callback(resp); -//} -// -//int rpc_get_available_wifi(void) -//{ -// /* implemented synchronous */ -// ctrl_cmd_t *req = RPC_DEFAULT_REQ(); -// req->rsp_timeout_sec = 300; -// -// ctrl_cmd_t *resp = NULL; -// -// resp = wifi_ap_scan_list(req); -// -// return rpc_rsp_callback(resp); -//} -// -//int rpc_station_mode_disconnect(void) -//{ -// /* implemented synchronous */ -// ctrl_cmd_t *req = RPC_DEFAULT_REQ(); -// ctrl_cmd_t *resp = NULL; -// -// resp = wifi_disconnect_ap(req); -// -// return rpc_rsp_callback(resp); -//} -// -//int rpc_softap_mode_start(char *ssid, char *pwd, int channel, -// int encryption_mode, int max_conn, int ssid_hidden, int bw) -//{ -// /* implemented synchronous */ -// ctrl_cmd_t *req = RPC_DEFAULT_REQ(); -// ctrl_cmd_t *resp = NULL; -// -// strncpy((char *)&req->u.wifi_softap_config.ssid, -// ssid, MAX_MAC_STR_LEN-1); -// strncpy((char *)&req->u.wifi_softap_config.pwd, -// pwd, MAX_MAC_STR_LEN-1); -// req->u.wifi_softap_config.channel = channel; -// req->u.wifi_softap_config.encryption_mode = encryption_mode; -// req->u.wifi_softap_config.max_connections = max_conn; -// req->u.wifi_softap_config.ssid_hidden = ssid_hidden; -// req->u.wifi_softap_config.bandwidth = bw; -// -// resp = wifi_start_softap(req); -// -// return rpc_rsp_callback(resp); -//} -// -//int rpc_softap_mode_get_info(void) -//{ -// /* implemented synchronous */ -// ctrl_cmd_t *req = RPC_DEFAULT_REQ(); -// ctrl_cmd_t *resp = NULL; -// -// resp = wifi_get_softap_config(req); -// -// return rpc_rsp_callback(resp); -//} -// -//int rpc_softap_mode_connected_clients_info(void) -//{ -// /* implemented synchronous */ -// ctrl_cmd_t *req = RPC_DEFAULT_REQ(); -// ctrl_cmd_t *resp = NULL; -// -// resp = wifi_get_softap_connected_station_list(req); -// -// return rpc_rsp_callback(resp); -//} -// -//int rpc_softap_mode_stop(void) -//{ -// /* implemented synchronous */ -// ctrl_cmd_t *req = RPC_DEFAULT_REQ(); -// ctrl_cmd_t *resp = NULL; -// -// resp = wifi_stop_softap(req); -// -// return rpc_rsp_callback(resp); -//} - -int rpc_set_wifi_power_save_mode(int psmode) -{ - /* implemented synchronous */ - ctrl_cmd_t *req = RPC_DEFAULT_REQ(); - ctrl_cmd_t *resp = NULL; - - req->u.wifi_ps.ps_mode = psmode; - resp = wifi_set_power_save_mode(req); - - return rpc_rsp_callback(resp); -} - -int rpc_set_wifi_power_save_mode_max(void) -{ - return rpc_set_wifi_power_save_mode(WIFI_PS_MAX_MODEM); -} - -int rpc_set_wifi_power_save_mode_min(void) -{ - return rpc_set_wifi_power_save_mode(WIFI_PS_MIN_MODEM); -} - -int rpc_get_wifi_power_save_mode(void) -{ - /* implemented synchronous */ - ctrl_cmd_t *req = RPC_DEFAULT_REQ(); - ctrl_cmd_t *resp = NULL; - - resp = wifi_get_power_save_mode(req); - - return rpc_rsp_callback(resp); -} - -//int rpc_reset_vendor_specific_ie(void) -//{ -// /* implemented synchronous */ -// ctrl_cmd_t *req = RPC_DEFAULT_REQ(); -// ctrl_cmd_t *resp = NULL; -// char *data = "Example vendor IE data"; -// -// char *v_data = (char*)g_h.funcs->_h_calloc(1, strlen(data)); -// if (!v_data) { -// ESP_LOGE(TAG, "Failed to allocate memory \n"); -// return FAILURE; -// } -// g_h.funcs->_h_memcpy(v_data, data, strlen(data)); -// -// req->u.wifi_softap_vendor_ie.enable = false; -// req->u.wifi_softap_vendor_ie.type = WIFI_VND_IE_TYPE_BEACON; -// req->u.wifi_softap_vendor_ie.idx = WIFI_VND_IE_ID_0; -// req->u.wifi_softap_vendor_ie.vnd_ie.element_id = WIFI_VENDOR_IE_ELEMENT_ID; -// req->u.wifi_softap_vendor_ie.vnd_ie.length = strlen(data)+OFFSET; -// req->u.wifi_softap_vendor_ie.vnd_ie.vendor_oui[0] = VENDOR_OUI_0; -// req->u.wifi_softap_vendor_ie.vnd_ie.vendor_oui[1] = VENDOR_OUI_1; -// req->u.wifi_softap_vendor_ie.vnd_ie.vendor_oui[2] = VENDOR_OUI_2; -// req->u.wifi_softap_vendor_ie.vnd_ie.vendor_oui_type = VENDOR_OUI_TYPE; -// req->u.wifi_softap_vendor_ie.vnd_ie.payload = (uint8_t *)v_data; -// //req->u.wifi_softap_vendor_ie.vnd_ie.payload_len = strlen(data); -// -// req->app_free_buff_func = g_h.funcs->_h_free; -// req->app_free_buff_hdl = v_data; -// -// resp = wifi_set_vendor_specific_ie(req); -// -// return rpc_rsp_callback(resp); -//} -// -//int rpc_set_vendor_specific_ie(void) -//{ -// /* implemented synchronous */ -// ctrl_cmd_t *req = RPC_DEFAULT_REQ(); -// ctrl_cmd_t *resp = NULL; -// char *data = "Example vendor IE data"; -// -// char *v_data = (char*)g_h.funcs->_h_calloc(1, strlen(data)); -// if (!v_data) { -// ESP_LOGE(TAG, "Failed to allocate memory \n"); -// return FAILURE; -// } -// g_h.funcs->_h_memcpy(v_data, data, strlen(data)); -// -// req->u.wifi_softap_vendor_ie.enable = true; -// req->u.wifi_softap_vendor_ie.type = WIFI_VND_IE_TYPE_BEACON; -// req->u.wifi_softap_vendor_ie.idx = WIFI_VND_IE_ID_0; -// req->u.wifi_softap_vendor_ie.vnd_ie.element_id = WIFI_VENDOR_IE_ELEMENT_ID; -// req->u.wifi_softap_vendor_ie.vnd_ie.length = strlen(data)+OFFSET; -// req->u.wifi_softap_vendor_ie.vnd_ie.vendor_oui[0] = VENDOR_OUI_0; -// req->u.wifi_softap_vendor_ie.vnd_ie.vendor_oui[1] = VENDOR_OUI_1; -// req->u.wifi_softap_vendor_ie.vnd_ie.vendor_oui[2] = VENDOR_OUI_2; -// req->u.wifi_softap_vendor_ie.vnd_ie.vendor_oui_type = VENDOR_OUI_TYPE; -// req->u.wifi_softap_vendor_ie.vnd_ie.payload = (uint8_t *)v_data; -// //req->u.wifi_softap_vendor_ie.vnd_ie.payload_len = strlen(data); -// -// req->app_free_buff_func = g_h.funcs->_h_free; -// req->app_free_buff_hdl = v_data; -// -// resp = wifi_set_vendor_specific_ie(req); -// -// return rpc_rsp_callback(resp); -//} - int rpc_ota_begin(void) { /* implemented synchronous */ @@ -822,7 +821,7 @@ int rpc_ota_begin(void) /* OTA begin takes some time to clear the partition */ req->rsp_timeout_sec = OTA_BEGIN_RSP_TIMEOUT_SEC; - resp = ota_begin(req); + resp = rpc_slaveif_ota_begin(req); return rpc_rsp_callback(resp); } @@ -836,7 +835,7 @@ int rpc_ota_write(uint8_t* ota_data, uint32_t ota_data_len) req->u.ota_write.ota_data = ota_data; req->u.ota_write.ota_data_len = ota_data_len; - resp = ota_write(req); + resp = rpc_slaveif_ota_write(req); return rpc_rsp_callback(resp); } @@ -847,286 +846,213 @@ int rpc_ota_end(void) ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = ota_end(req); + resp = rpc_slaveif_ota_end(req); return rpc_rsp_callback(resp); } -#if !OTA_FROM_WEB_URL -/* This assumes full slave binary is present locally */ -int rpc_ota(char* image_path) +int rpc_ota_activate(void) { - FILE* f = NULL; - char ota_chunk[CHUNK_SIZE] = {0}; - int ret = rpc_ota_begin(); - if (ret == SUCCESS) { - f = fopen(image_path,"rb"); - if (f == NULL) { - ESP_LOGE(OTA_TAG, "Failed to open file %s", image_path); - return FAILURE; - } else { - ESP_LOGV(OTA_TAG, "Success in opening %s file", image_path); - } - while (!feof(f)) { - fread(&ota_chunk, CHUNK_SIZE, 1, f); - ret = rpc_ota_write((uint8_t* )&ota_chunk, CHUNK_SIZE); - if (ret) { - ESP_LOGE(OTA_TAG, "OTA procedure failed!!"); - /* TODO: Do we need to do OTA end irrespective of success/failure? */ - rpc_ota_end(); - return FAILURE; - } - } - ret = rpc_ota_end(); - if (ret) { - return FAILURE; - } - } else { - return FAILURE; - } - ESP_LOGE(OTA_TAG, "ESP32 will restart after 5 sec"); - return SUCCESS; - ESP_LOGE(OTA_TAG, "For OTA, user need to integrate HTTP client lib and then invoke OTA"); - return FAILURE; + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + resp = rpc_slaveif_ota_activate(req); + + return rpc_rsp_callback(resp); } -#else -uint8_t http_err = 0; -static esp_err_t http_client_event_handler(esp_http_client_event_t *evt) + +esp_err_t rpc_get_coprocessor_fwversion(esp_hosted_coprocessor_fwver_t *ver_info) { - switch(evt->event_id) { + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + // change timeout value for this call + req->rsp_timeout_sec = GET_FWVERSION_TIMEOUT_SEC; + ctrl_cmd_t *resp = NULL; - case HTTP_EVENT_ERROR: - ESP_LOGI(OTA_TAG, "HTTP_EVENT_ERROR"); - http_err = 1; - break; - case HTTP_EVENT_ON_CONNECTED: - ESP_LOGI(OTA_TAG, "HTTP_EVENT_ON_CONNECTED"); - break; - case HTTP_EVENT_HEADER_SENT: - ESP_LOGI(OTA_TAG, "HTTP_EVENT_HEADER_SENT"); - break; - case HTTP_EVENT_ON_HEADER: - ESP_LOGI(OTA_TAG, "HTTP_EVENT_ON_HEADER, key=%s, value=%s", evt->header_key, evt->header_value); - break; - case HTTP_EVENT_ON_DATA: - /* Nothing to handle here */ - break; - case HTTP_EVENT_ON_FINISH: - ESP_LOGI(OTA_TAG, "HTTP_EVENT_ON_FINISH"); - break; - case HTTP_EVENT_DISCONNECTED: - ESP_LOGI(OTA_TAG, "HTTP_EVENT_DISCONNECTED"); - break; - case HTTP_EVENT_REDIRECT: - ESP_LOGW(TAG, "HTTP_EVENT_REDIRECT"); - break; + resp = rpc_slaveif_get_coprocessor_fwversion(req); + if (resp && resp->resp_event_status == SUCCESS) { + ver_info->major1 = resp->u.coprocessor_fwversion.major1; + ver_info->minor1 = resp->u.coprocessor_fwversion.minor1; + ver_info->patch1 = resp->u.coprocessor_fwversion.patch1; } - return ESP_OK; + return rpc_rsp_callback(resp); } -static esp_err_t _rpc_ota(const char* image_url) +int rpc_wifi_set_max_tx_power(int8_t in_power) { - uint8_t *ota_chunk = NULL; - esp_err_t err = 0; - int data_read = 0; - int ota_failed = 0; + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; - if (image_url == NULL) { - ESP_LOGE(TAG, "Invalid image URL"); - return FAILURE; - } + req->u.wifi_tx_power.power = in_power; + resp = rpc_slaveif_wifi_set_max_tx_power(req); - /* Initialize HTTP client configuration */ - esp_http_client_config_t config = { - .url = image_url, - .timeout_ms = 5000, - .event_handler = http_client_event_handler, - }; + return rpc_rsp_callback(resp); +} - esp_http_client_handle_t client = esp_http_client_init(&config); +int rpc_wifi_get_max_tx_power(int8_t *power) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; - ESP_LOGI(OTA_TAG, "http_open"); - if ((err = esp_http_client_open(client, 0)) != ESP_OK) { - ESP_LOGE(OTA_TAG, "Failed to open HTTP connection: %s", esp_err_to_name(err)); - ESP_LOGE(OTA_TAG, "Check if URL is correct and connectable: %s", image_url); - esp_http_client_cleanup(client); - return FAILURE; + resp = rpc_slaveif_wifi_get_max_tx_power(req); + if (resp && resp->resp_event_status == SUCCESS) { + *power = resp->u.wifi_tx_power.power; } + return rpc_rsp_callback(resp); +} - if (http_err) { - ESP_LOGE(TAG, "Exiting OTA, due to http failure"); - esp_http_client_close(client); - esp_http_client_cleanup(client); - http_err = 0; - return FAILURE; - } +esp_err_t rpc_wifi_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; - ESP_LOGI(OTA_TAG, "http_fetch_headers"); - int64_t content_length = esp_http_client_fetch_headers(client); - if (content_length <= 0) { - ESP_LOGE(OTA_TAG, "HTTP client fetch headers failed"); - ESP_LOGI(TAG, "HTTP GET Status = %d, content_length = %"PRId64, - esp_http_client_get_status_code(client), - esp_http_client_get_content_length(client)); - esp_http_client_close(client); - esp_http_client_cleanup(client); - return FAILURE; + resp = rpc_slaveif_wifi_sta_get_negotiated_phymode(req); + if (resp && resp->resp_event_status == SUCCESS) { + *phymode = resp->u.wifi_sta_get_negotiated_phymode.phymode; } + return rpc_rsp_callback(resp); +} - ESP_LOGI(TAG, "HTTP GET Status = %d, content_length = %"PRId64, - esp_http_client_get_status_code(client), - esp_http_client_get_content_length(client)); - - ESP_LOGW(OTA_TAG, "********* Started Slave OTA *******************"); - ESP_LOGI(TAG, "*** Please wait for 5 mins to let slave OTA complete ***"); +esp_err_t rpc_wifi_sta_get_aid(uint16_t *aid) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; - ESP_LOGI(OTA_TAG, "Preparing OTA"); - if ((err = rpc_ota_begin())) { - ESP_LOGW(OTA_TAG, "********* Slave OTA Begin Failed *******************"); - ESP_LOGI(OTA_TAG, "esp_ota_begin failed, error=%s", esp_err_to_name(err)); - esp_http_client_close(client); - esp_http_client_cleanup(client); - return FAILURE; + resp = rpc_slaveif_wifi_sta_get_aid(req); + if (resp && resp->resp_event_status == SUCCESS) { + *aid = resp->u.wifi_sta_get_aid.aid; } + return rpc_rsp_callback(resp); +} - ota_chunk = (uint8_t*)g_h.funcs->_h_calloc(1, CHUNK_SIZE); - if (!ota_chunk) { - ESP_LOGE(OTA_TAG, "Failed to allocate otachunk mem\n"); - err = -ENOMEM; - } +esp_err_t rpc_wifi_set_inactive_time(wifi_interface_t ifx, uint16_t sec) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; - ESP_LOGI(OTA_TAG, "Starting OTA"); + req->u.wifi_inactive_time.ifx = ifx; + req->u.wifi_inactive_time.sec = sec; + resp = rpc_slaveif_wifi_set_inactive_time(req); - if (!err) { - while ((data_read = esp_http_client_read(client, (char*)ota_chunk, CHUNK_SIZE)) > 0) { + return rpc_rsp_callback(resp); +} - ESP_LOGV(OTA_TAG, "Read image length %d", data_read); - if ((err = rpc_ota_write(ota_chunk, data_read))) { - ESP_LOGI(OTA_TAG, "rpc_ota_write failed"); - ota_failed = err; - break; - } - } - } +esp_err_t rpc_wifi_get_inactive_time(wifi_interface_t ifx, uint16_t *sec) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; - g_h.funcs->_h_free(ota_chunk); - if (err) { - ESP_LOGW(OTA_TAG, "********* Slave OTA Failed *******************"); - ESP_LOGI(OTA_TAG, "esp_ota_write failed, error=%s", esp_err_to_name(err)); - ota_failed = -1; + req->u.wifi_inactive_time.ifx = ifx; + resp = rpc_slaveif_wifi_get_inactive_time(req); + if (resp && resp->resp_event_status == SUCCESS) { + *sec = resp->u.wifi_inactive_time.sec; } + return rpc_rsp_callback(resp); +} - if (data_read < 0) { - ESP_LOGE(OTA_TAG, "Error: SSL data read error"); - ota_failed = -2; - } +#if H_WIFI_HE_SUPPORT +esp_err_t rpc_wifi_sta_twt_config(wifi_twt_config_t *config) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; - if ((err = rpc_ota_end())) { - ESP_LOGW(OTA_TAG, "********* Slave OTA Failed *******************"); - ESP_LOGI(OTA_TAG, "esp_ota_end failed, error=%s", esp_err_to_name(err)); - esp_http_client_close(client); - esp_http_client_cleanup(client); - ota_failed = err; + if (!config) return FAILURE; - } - esp_http_client_cleanup(client); - if (!ota_failed) { - ESP_LOGW(OTA_TAG, "********* Slave OTA Complete *******************"); - ESP_LOGI(OTA_TAG, "OTA Successful, Slave will restart in while"); - ESP_LOGE(TAG, "Need to restart host after slave OTA is complete, to avoid sync issues"); - sleep(5); - ESP_LOGE(OTA_TAG, "********* Restarting Host **********************"); - restart_after_slave_ota = 1; - esp_restart(); - } - return ota_failed; + g_h.funcs->_h_memcpy(&req->u.wifi_twt_config, config, sizeof(wifi_twt_config_t)); + resp = rpc_slaveif_wifi_sta_twt_config(req); + return rpc_rsp_callback(resp); } -esp_err_t rpc_ota(const char* image_url) +#if H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 +esp_err_t rpc_wifi_sta_itwt_setup(wifi_itwt_setup_config_t *setup_config) +#else +esp_err_t rpc_wifi_sta_itwt_setup(wifi_twt_setup_config_t *setup_config) +#endif { - uint8_t ota_retry = 2; - int ret = 0; - - do { - ret = _rpc_ota(image_url); + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; - ota_retry--; - if (ota_retry && ret) - ESP_LOGI(OTA_TAG, "OTA retry left: %u\n", ota_retry); - } while (ota_retry && ret); + if (!setup_config) + return FAILURE; - return ret; -} +#if H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 + g_h.funcs->_h_memcpy(&req->u.wifi_itwt_setup_config, setup_config, sizeof(wifi_itwt_setup_config_t)); +#else + g_h.funcs->_h_memcpy(&req->u.wifi_twt_setup_config, setup_config, sizeof(wifi_twt_setup_config_t)); #endif + resp = rpc_slaveif_wifi_sta_itwt_setup(req); + return rpc_rsp_callback(resp); +} -esp_err_t rpc_get_coprocessor_fwversion(esp_hosted_coprocessor_fwver_t *ver_info) +esp_err_t rpc_wifi_sta_itwt_teardown(int flow_id) { /* implemented synchronous */ ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = get_coprocessor_fwversion(req); - if (resp && resp->resp_event_status == SUCCESS) { - ver_info->major1 = resp->u.coprocessor_fwversion.major1; - ver_info->minor1 = resp->u.coprocessor_fwversion.minor1; - ver_info->patch1 = resp->u.coprocessor_fwversion.patch1; - } - + req->u.wifi_itwt_flow_id = flow_id; + resp = rpc_slaveif_wifi_sta_itwt_teardown(req); return rpc_rsp_callback(resp); } -int rpc_wifi_set_max_tx_power(int8_t in_power) +esp_err_t rpc_wifi_sta_itwt_suspend(int flow_id, int suspend_time_ms) { /* implemented synchronous */ ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - req->u.wifi_tx_power.power = in_power; - resp = wifi_set_max_tx_power(req); - + req->u.wifi_itwt_suspend.flow_id = flow_id; + req->u.wifi_itwt_suspend.suspend_time_ms = suspend_time_ms; + resp = rpc_slaveif_wifi_sta_itwt_suspend(req); return rpc_rsp_callback(resp); } -int rpc_wifi_get_max_tx_power(int8_t *power) +esp_err_t rpc_wifi_sta_itwt_get_flow_id_status(int *flow_id_bitmap) { /* implemented synchronous */ ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = wifi_get_max_tx_power(req); + resp = rpc_slaveif_wifi_sta_itwt_get_flow_id_status(req); if (resp && resp->resp_event_status == SUCCESS) { - *power = resp->u.wifi_tx_power.power; + *flow_id_bitmap = resp->u.wifi_itwt_flow_id_bitmap; } return rpc_rsp_callback(resp); } -esp_err_t rpc_wifi_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode) +esp_err_t rpc_wifi_sta_itwt_send_probe_req(int timeout_ms) { /* implemented synchronous */ ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = wifi_sta_get_negotiated_phymode(req); - if (resp && resp->resp_event_status == SUCCESS) { - *phymode = resp->u.wifi_sta_get_negotiated_phymode.phymode; - } + req->u.wifi_itwt_probe_req_timeout_ms = timeout_ms; + resp = rpc_slaveif_wifi_sta_itwt_send_probe_req(req); return rpc_rsp_callback(resp); } -esp_err_t rpc_wifi_sta_get_aid(uint16_t *aid) +esp_err_t rpc_wifi_sta_itwt_set_target_wake_time_offset(int offset_us) { /* implemented synchronous */ ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = wifi_sta_get_aid(req); - if (resp && resp->resp_event_status == SUCCESS) { - *aid = resp->u.wifi_sta_get_aid.aid; - } + req->u.wifi_itwt_set_target_wake_time_offset_us = offset_us; + resp = rpc_slaveif_wifi_sta_itwt_set_target_wake_time_offset(req); return rpc_rsp_callback(resp); } +#endif // H_WIFI_HE_SUPPORT #if H_WIFI_DUALBAND_SUPPORT esp_err_t rpc_wifi_set_band(wifi_band_t band) @@ -1136,7 +1062,7 @@ esp_err_t rpc_wifi_set_band(wifi_band_t band) ctrl_cmd_t *resp = NULL; req->u.wifi_band = band; - resp = wifi_set_band(req); + resp = rpc_slaveif_wifi_set_band(req); return rpc_rsp_callback(resp); } @@ -1147,7 +1073,7 @@ esp_err_t rpc_wifi_get_band(wifi_band_t *band) ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = wifi_get_band(req); + resp = rpc_slaveif_wifi_get_band(req); if (resp && resp->resp_event_status == SUCCESS) { *band = resp->u.wifi_band; } @@ -1161,7 +1087,7 @@ esp_err_t rpc_wifi_set_band_mode(wifi_band_mode_t band_mode) ctrl_cmd_t *resp = NULL; req->u.wifi_band_mode = band_mode; - resp = wifi_set_band_mode(req); + resp = rpc_slaveif_wifi_set_band_mode(req); return rpc_rsp_callback(resp); } @@ -1172,7 +1098,7 @@ esp_err_t rpc_wifi_get_band_mode(wifi_band_mode_t *band_mode) ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = wifi_get_band_mode(req); + resp = rpc_slaveif_wifi_get_band_mode(req); if (resp && resp->resp_event_status == SUCCESS) { *band_mode = resp->u.wifi_band_mode; } @@ -1189,7 +1115,7 @@ esp_err_t rpc_wifi_set_protocols(wifi_interface_t ifx, wifi_protocols_t *protoco req->u.wifi_protocols.ghz_2g = protocols->ghz_2g; req->u.wifi_protocols.ghz_5g = protocols->ghz_5g; - resp = wifi_set_protocols(req); + resp = rpc_slaveif_wifi_set_protocols(req); return rpc_rsp_callback(resp); } @@ -1201,7 +1127,7 @@ esp_err_t rpc_wifi_get_protocols(wifi_interface_t ifx, wifi_protocols_t *protoco req->u.wifi_protocols.ifx = ifx; - resp = wifi_get_protocols(req); + resp = rpc_slaveif_wifi_get_protocols(req); if (resp && resp->resp_event_status == SUCCESS) { protocols->ghz_2g = resp->u.wifi_protocols.ghz_2g; protocols->ghz_5g = resp->u.wifi_protocols.ghz_5g; @@ -1219,7 +1145,7 @@ esp_err_t rpc_wifi_set_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) req->u.wifi_bandwidths.ghz_2g = bw->ghz_2g; req->u.wifi_bandwidths.ghz_5g = bw->ghz_5g; - resp = wifi_set_bandwidths(req); + resp = rpc_slaveif_wifi_set_bandwidths(req); return rpc_rsp_callback(resp); } @@ -1232,7 +1158,7 @@ esp_err_t rpc_wifi_get_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) req->u.wifi_bandwidths.ifx = ifx; - resp = wifi_get_bandwidths(req); + resp = rpc_slaveif_wifi_get_bandwidths(req); if (resp && resp->resp_event_status == SUCCESS) { bw->ghz_2g = resp->u.wifi_bandwidths.ghz_2g; bw->ghz_5g = resp->u.wifi_bandwidths.ghz_5g; @@ -1249,7 +1175,7 @@ int rpc_config_heartbeat(void) req->u.e_heartbeat.enable = YES; req->u.e_heartbeat.duration = HEARTBEAT_DURATION_SEC; - resp = config_heartbeat(req); + resp = rpc_slaveif_config_heartbeat(req); return rpc_rsp_callback(resp); } @@ -1261,7 +1187,7 @@ int rpc_disable_heartbeat(void) ctrl_cmd_t *req = RPC_DEFAULT_REQ(); req->u.e_heartbeat.enable = NO; - resp = config_heartbeat(req); + resp = rpc_slaveif_config_heartbeat(req); return rpc_rsp_callback(resp); } @@ -1272,11 +1198,17 @@ int rpc_wifi_init(const wifi_init_config_t *arg) ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; + req->rsp_timeout_sec = WIFI_INIT_RSP_TIMEOUT_SEC; + if (!arg) return FAILURE; g_h.funcs->_h_memcpy(&req->u.wifi_init_config, (void*)arg, sizeof(wifi_init_config_t)); - resp = wifi_init(req); + +#ifdef CONFIG_ESP_WIFI_NVS_ENABLED + req->u.wifi_init_config.nvs_enable = YES; +#endif + resp = rpc_slaveif_wifi_init(req); return rpc_rsp_callback(resp); } @@ -1287,7 +1219,7 @@ int rpc_wifi_deinit(void) ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = wifi_deinit(req); + resp = rpc_slaveif_wifi_deinit(req); return rpc_rsp_callback(resp); } @@ -1305,7 +1237,7 @@ int rpc_wifi_get_mode(wifi_mode_t* mode) if (!mode) return FAILURE; - resp = wifi_get_mode(req); + resp = rpc_slaveif_wifi_get_mode(req); if (resp && resp->resp_event_status == SUCCESS) { *mode = resp->u.wifi_mode.mode; @@ -1320,7 +1252,7 @@ int rpc_wifi_start(void) ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = wifi_start(req); + resp = rpc_slaveif_wifi_start(req); return rpc_rsp_callback(resp); } @@ -1333,32 +1265,30 @@ int rpc_wifi_stop(void) ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = wifi_stop(req); + resp = rpc_slaveif_wifi_stop(req); return rpc_rsp_callback(resp); } int rpc_wifi_connect(void) { -#if 1 /* implemented synchronous */ ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = wifi_connect(req); + resp = rpc_slaveif_wifi_connect(req); return rpc_rsp_callback(resp); - return 0; -#else +} + +static int rpc_wifi_connect_async(void) +{ /* implemented asynchronous */ ctrl_cmd_t *req = RPC_DEFAULT_REQ(); - ctrl_cmd_t *resp = NULL; req->rpc_rsp_cb = rpc_rsp_callback; - ESP_LOGE(TAG, "Async call registerd: %p", rpc_rsp_callback); - wifi_connect(req); + rpc_slaveif_wifi_connect(req); return SUCCESS; -#endif } int rpc_wifi_disconnect(void) @@ -1367,7 +1297,7 @@ int rpc_wifi_disconnect(void) ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = wifi_disconnect(req); + resp = rpc_slaveif_wifi_disconnect(req); return rpc_rsp_callback(resp); } @@ -1383,7 +1313,7 @@ int rpc_wifi_set_config(wifi_interface_t interface, wifi_config_t *conf) g_h.funcs->_h_memcpy(&req->u.wifi_config.u, conf, sizeof(wifi_config_t)); req->u.wifi_config.iface = interface; - resp = wifi_set_config(req); + resp = rpc_slaveif_wifi_set_config(req); return rpc_rsp_callback(resp); } @@ -1398,7 +1328,7 @@ int rpc_wifi_get_config(wifi_interface_t interface, wifi_config_t *conf) req->u.wifi_config.iface = interface; - resp = wifi_get_config(req); + resp = rpc_slaveif_wifi_get_config(req); g_h.funcs->_h_memcpy(conf, &resp->u.wifi_config.u, sizeof(wifi_config_t)); @@ -1417,8 +1347,11 @@ int rpc_wifi_scan_start(const wifi_scan_config_t *config, bool block) } req->u.wifi_scan_config.block = block; - - resp = wifi_scan_start(req); + if (req->u.wifi_scan_config.block) { + // blocking while doing scan may take a long time: increase timeout value + req->rsp_timeout_sec = DEFAULT_RPC_RSP_SCAN_TIMEOUT; + } + resp = rpc_slaveif_wifi_scan_start(req); return rpc_rsp_callback(resp); } @@ -1430,7 +1363,7 @@ int rpc_wifi_scan_stop(void) ctrl_cmd_t *resp = NULL; ESP_LOGV(TAG, "scan stop"); - resp = wifi_scan_stop(req); + resp = rpc_slaveif_wifi_scan_stop(req); return rpc_rsp_callback(resp); } @@ -1443,7 +1376,7 @@ int rpc_wifi_scan_get_ap_num(uint16_t *number) if (!number) return FAILURE; - resp = wifi_scan_get_ap_num(req); + resp = rpc_slaveif_wifi_scan_get_ap_num(req); if (resp && resp->resp_event_status == SUCCESS) { *number = resp->u.wifi_scan_ap_list.number; @@ -1460,7 +1393,7 @@ int rpc_wifi_scan_get_ap_record(wifi_ap_record_t *ap_record) if (!ap_record) return FAILURE; - resp = wifi_scan_get_ap_record(req); + resp = rpc_slaveif_wifi_scan_get_ap_record(req); if (resp && resp->resp_event_status == SUCCESS) { g_h.funcs->_h_memcpy(ap_record, &resp->u.wifi_ap_record, sizeof(wifi_ap_record_t)); } @@ -1479,7 +1412,7 @@ int rpc_wifi_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records) g_h.funcs->_h_memset(ap_records, 0, (*number)*sizeof(wifi_ap_record_t)); req->u.wifi_scan_ap_list.number = *number; - resp = wifi_scan_get_ap_records(req); + resp = rpc_slaveif_wifi_scan_get_ap_records(req); if (resp && resp->resp_event_status == SUCCESS) { ESP_LOGV(TAG, "num: %u",resp->u.wifi_scan_ap_list.number); @@ -1495,7 +1428,7 @@ int rpc_wifi_clear_ap_list(void) ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = wifi_clear_ap_list(req); + resp = rpc_slaveif_wifi_clear_ap_list(req); return rpc_rsp_callback(resp); } @@ -1506,7 +1439,7 @@ int rpc_wifi_restore(void) ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = wifi_restore(req); + resp = rpc_slaveif_wifi_restore(req); return rpc_rsp_callback(resp); } @@ -1516,7 +1449,7 @@ int rpc_wifi_clear_fast_connect(void) ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = wifi_clear_fast_connect(req); + resp = rpc_slaveif_wifi_clear_fast_connect(req); return rpc_rsp_callback(resp); } @@ -1527,7 +1460,7 @@ int rpc_wifi_deauth_sta(uint16_t aid) ctrl_cmd_t *resp = NULL; req->u.wifi_deauth_sta.aid = aid; - resp = wifi_deauth_sta(req); + resp = rpc_slaveif_wifi_deauth_sta(req); return rpc_rsp_callback(resp); } @@ -1540,7 +1473,7 @@ int rpc_wifi_sta_get_ap_info(wifi_ap_record_t *ap_info) if (!ap_info) return FAILURE; - resp = wifi_sta_get_ap_info(req); + resp = rpc_slaveif_wifi_sta_get_ap_info(req); if (resp && resp->resp_event_status == SUCCESS) { g_h.funcs->_h_memcpy(ap_info, resp->u.wifi_scan_ap_list.out_list, @@ -1560,7 +1493,7 @@ int rpc_wifi_set_ps(wifi_ps_type_t type) req->u.wifi_ps.ps_mode = type; - resp = wifi_set_ps(req); + resp = rpc_slaveif_wifi_set_ps(req); return rpc_rsp_callback(resp); } @@ -1577,7 +1510,7 @@ int rpc_wifi_get_ps(wifi_ps_type_t *type) if (!type) return FAILURE; - resp = wifi_get_ps(req); + resp = rpc_slaveif_wifi_get_ps(req); *type = resp->u.wifi_ps.ps_mode; @@ -1591,7 +1524,7 @@ int rpc_wifi_set_storage(wifi_storage_t storage) ctrl_cmd_t *resp = NULL; req->u.wifi_storage = storage; - resp = wifi_set_storage(req); + resp = rpc_slaveif_wifi_set_storage(req); return rpc_rsp_callback(resp); } @@ -1603,7 +1536,7 @@ int rpc_wifi_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw) req->u.wifi_bandwidth.ifx = ifx; req->u.wifi_bandwidth.bw = bw; - resp = wifi_set_bandwidth(req); + resp = rpc_slaveif_wifi_set_bandwidth(req); return rpc_rsp_callback(resp); } @@ -1617,7 +1550,7 @@ int rpc_wifi_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw) return FAILURE; req->u.wifi_bandwidth.ifx = ifx; - resp = wifi_get_bandwidth(req); + resp = rpc_slaveif_wifi_get_bandwidth(req); if (resp && resp->resp_event_status == SUCCESS) { *bw = resp->u.wifi_bandwidth.bw; @@ -1633,7 +1566,7 @@ int rpc_wifi_set_channel(uint8_t primary, wifi_second_chan_t second) req->u.wifi_channel.primary = primary; req->u.wifi_channel.second = second; - resp = wifi_set_channel(req); + resp = rpc_slaveif_wifi_set_channel(req); return rpc_rsp_callback(resp); } @@ -1646,7 +1579,7 @@ int rpc_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second) if ((!primary) || (!second)) return FAILURE; - resp = wifi_get_channel(req); + resp = rpc_slaveif_wifi_get_channel(req); if (resp && resp->resp_event_status == SUCCESS) { *primary = resp->u.wifi_channel.primary; @@ -1666,7 +1599,7 @@ int rpc_wifi_set_country_code(const char *country, bool ieee80211d_enabled) memcpy(&req->u.wifi_country_code.cc[0], country, sizeof(req->u.wifi_country_code.cc)); req->u.wifi_country_code.ieee80211d_enabled = ieee80211d_enabled; - resp = wifi_set_country_code(req); + resp = rpc_slaveif_wifi_set_country_code(req); return rpc_rsp_callback(resp); } @@ -1679,7 +1612,7 @@ int rpc_wifi_get_country_code(char *country) if (!country) return FAILURE; - resp = wifi_get_country_code(req); + resp = rpc_slaveif_wifi_get_country_code(req); if (resp && resp->resp_event_status == SUCCESS) { memcpy(country, &resp->u.wifi_country_code.cc[0], sizeof(resp->u.wifi_country_code.cc)); @@ -1702,7 +1635,7 @@ int rpc_wifi_set_country(const wifi_country_t *country) req->u.wifi_country.max_tx_power = country->max_tx_power; req->u.wifi_country.policy = country->policy; - resp = wifi_set_country(req); + resp = rpc_slaveif_wifi_set_country(req); return rpc_rsp_callback(resp); } @@ -1715,7 +1648,7 @@ int rpc_wifi_get_country(wifi_country_t *country) if (!country) return FAILURE; - resp = wifi_get_country(req); + resp = rpc_slaveif_wifi_get_country(req); if (resp && resp->resp_event_status == SUCCESS) { memcpy(&country->cc[0], &resp->u.wifi_country.cc[0], sizeof(resp->u.wifi_country.cc)); country->schan = resp->u.wifi_country.schan; @@ -1735,7 +1668,7 @@ int rpc_wifi_ap_get_sta_list(wifi_sta_list_t *sta) if (!sta) return FAILURE; - resp = wifi_ap_get_sta_list(req); + resp = rpc_slaveif_wifi_ap_get_sta_list(req); if (resp && resp->resp_event_status == SUCCESS) { for (int i = 0; i < ESP_WIFI_MAX_CONN_NUM; i++) { memcpy(sta->sta[i].mac, resp->u.wifi_ap_sta_list.sta[i].mac, 6); @@ -1766,7 +1699,7 @@ int rpc_wifi_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid) memcpy(&req->u.wifi_ap_get_sta_aid.mac[0], &mac[0], MAC_SIZE_BYTES); - resp = wifi_ap_get_sta_aid(req); + resp = rpc_slaveif_wifi_ap_get_sta_aid(req); if (resp && resp->resp_event_status == SUCCESS) { *aid = resp->u.wifi_ap_get_sta_aid.aid; } @@ -1783,7 +1716,7 @@ int rpc_wifi_sta_get_rssi(int *rssi) if (!rssi) return FAILURE; - resp = wifi_sta_get_rssi(req); + resp = rpc_slaveif_wifi_sta_get_rssi(req); if (resp && resp->resp_event_status == SUCCESS) { *rssi = resp->u.wifi_sta_get_rssi.rssi; } @@ -1800,7 +1733,7 @@ int rpc_wifi_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap) req->u.wifi_protocol.ifx = ifx; req->u.wifi_protocol.protocol_bitmap = protocol_bitmap; - resp = wifi_set_protocol(req); + resp = rpc_slaveif_wifi_set_protocol(req); return rpc_rsp_callback(resp); } @@ -1813,10 +1746,755 @@ int rpc_wifi_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap) ctrl_cmd_t *req = RPC_DEFAULT_REQ(); ctrl_cmd_t *resp = NULL; - resp = wifi_get_protocol(req); + resp = rpc_slaveif_wifi_get_protocol(req); if (resp && resp->resp_event_status == SUCCESS) { *protocol_bitmap = resp->u.wifi_protocol.protocol_bitmap; } return rpc_rsp_callback(resp); } + +esp_err_t rpc_set_dhcp_dns_status(wifi_interface_t ifx, uint8_t link_up, + uint8_t dhcp_up, char *dhcp_ip, char *dhcp_nm, char *dhcp_gw, + uint8_t dns_up, char *dns_ip, uint8_t dns_type) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + ESP_LOGI(TAG, "iface:%u link_up:%u dhcp_up:%u dns_up:%u dns_type:%u", + ifx, link_up, dhcp_up, dns_up, dns_type); + ESP_LOGI(TAG, "dhcp ip:%s nm:%s gw:%s dns ip:%s", + dhcp_ip, dhcp_nm, dhcp_gw, dns_ip); + req->u.slave_dhcp_dns_status.iface = ifx; + req->u.slave_dhcp_dns_status.net_link_up = link_up; + req->u.slave_dhcp_dns_status.dhcp_up = dhcp_up; + req->u.slave_dhcp_dns_status.dns_up = dns_up; + req->u.slave_dhcp_dns_status.dns_type = dns_type; + + if (dhcp_ip) + strlcpy((char *)req->u.slave_dhcp_dns_status.dhcp_ip, dhcp_ip, 64); + if (dhcp_nm) + strlcpy((char *)req->u.slave_dhcp_dns_status.dhcp_nm, dhcp_nm, 64); + if (dhcp_gw) + strlcpy((char *)req->u.slave_dhcp_dns_status.dhcp_gw, dhcp_gw, 64); + + if (dns_ip) + strlcpy((char *)req->u.slave_dhcp_dns_status.dns_ip, dns_ip, 64); + + + resp = rpc_slaveif_set_slave_dhcp_dns_status(req); + return rpc_rsp_callback(resp); +} + +#if H_WIFI_ENTERPRISE_SUPPORT +esp_err_t rpc_wifi_sta_enterprise_enable(void) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + resp = rpc_slaveif_wifi_sta_enterprise_enable(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_wifi_sta_enterprise_disable(void) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + resp = rpc_slaveif_wifi_sta_enterprise_disable(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_set_identity(const unsigned char *identity, int len) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + if (!identity || len <= 0) { + return FAILURE; + } + + req->u.eap_identity.identity = identity; + req->u.eap_identity.len = len; + + resp = rpc_slaveif_eap_set_identity(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_clear_identity(void) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + resp = rpc_slaveif_eap_clear_identity(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_set_username(const unsigned char *username, int len) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + if (!username || len <= 0) { + return FAILURE; + } + + req->u.eap_username.username = username; + req->u.eap_username.len = len; + + resp = rpc_slaveif_eap_set_username(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_clear_username(void) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + resp = rpc_slaveif_eap_clear_username(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_set_password(const unsigned char *password, int len) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + if (!password || len <= 0) { + return FAILURE; + } + + req->u.eap_password.password = password; + req->u.eap_password.len = len; + + resp = rpc_slaveif_eap_set_password(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_clear_password(void) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + resp = rpc_slaveif_eap_clear_password(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_set_new_password(const unsigned char *new_password, int len) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + if (!new_password || len <= 0) { + return FAILURE; + } + + req->u.eap_password.password = new_password; + req->u.eap_password.len = len; + + resp = rpc_slaveif_eap_set_new_password(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_clear_new_password(void) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + resp = rpc_slaveif_eap_clear_new_password(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_set_ca_cert(const unsigned char *ca_cert, int ca_cert_len) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + if (!ca_cert || ca_cert_len <= 0) { + return FAILURE; + } + + req->u.eap_ca_cert.ca_cert = ca_cert; + req->u.eap_ca_cert.len = ca_cert_len; + + resp = rpc_slaveif_eap_set_ca_cert(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_clear_ca_cert(void) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + resp = rpc_slaveif_eap_clear_ca_cert(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_set_certificate_and_key(const unsigned char *client_cert, int client_cert_len, + const unsigned char *private_key, int private_key_len, + const unsigned char *private_key_password, int private_key_passwd_len) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + if (!client_cert || (client_cert_len <= 0) || + !private_key || (private_key_len <= 0) || + (private_key_password && private_key_passwd_len <= 0) || + (private_key_passwd_len > 0 && !private_key_password)) { + return FAILURE; + } + + req->u.eap_cert_key.client_cert = client_cert; + req->u.eap_cert_key.client_cert_len = client_cert_len; + + req->u.eap_cert_key.private_key = private_key; + req->u.eap_cert_key.private_key_len = private_key_len; + + req->u.eap_cert_key.private_key_password = private_key_password; + req->u.eap_cert_key.private_key_passwd_len = private_key_passwd_len; + + resp = rpc_slaveif_eap_set_certificate_and_key(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_clear_certificate_and_key(void) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + resp = rpc_slaveif_eap_clear_certificate_and_key(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_set_disable_time_check(bool disable) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.eap_disable_time_check.disable = disable; + resp = rpc_slaveif_eap_set_disable_time_check(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_get_disable_time_check(bool *disable) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + if (!disable) + return FAILURE; + + resp = rpc_slaveif_eap_get_disable_time_check(req); + + if (resp && resp->resp_event_status == SUCCESS) { + *disable = resp->u.eap_disable_time_check.disable; + } + + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_set_ttls_phase2_method(esp_eap_ttls_phase2_types type) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.eap_ttls_phase2 = type; + resp = rpc_slaveif_eap_set_ttls_phase2_method(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_set_suiteb_192bit_certification(bool enable) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.eap_suiteb_192bit.enable = enable; + resp = rpc_slaveif_eap_set_suiteb_certification(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_set_pac_file(const unsigned char *pac_file, int pac_file_len) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + if (!pac_file || pac_file_len <= 0) + return FAILURE; + + req->u.eap_pac_file.pac_file = pac_file; + req->u.eap_pac_file.len = pac_file_len; + + resp = rpc_slaveif_eap_set_pac_file(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_set_fast_params(esp_eap_fast_config config) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.eap_fast_config = config; + resp = rpc_slaveif_eap_set_fast_params(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_use_default_cert_bundle(bool use_default_bundle) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.eap_default_cert_bundle.use_default = use_default_bundle; + resp = rpc_slaveif_eap_use_default_cert_bundle(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_wifi_set_okc_support(bool enable) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.wifi_okc_support.enable = enable; + resp = rpc_slaveif_wifi_set_okc_support(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_eap_client_set_domain_name(const char *domain_name) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + if (!domain_name) + return FAILURE; + + req->u.eap_domain_name.domain_name = domain_name; + resp = rpc_slaveif_eap_set_domain_name(req); + return rpc_rsp_callback(resp); +} + +#if H_GOT_SET_EAP_METHODS_API +esp_err_t rpc_eap_client_set_eap_methods(esp_eap_method_t methods) +{ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.methods = methods; + resp = rpc_slaveif_eap_set_eap_methods(req); + return rpc_rsp_callback(resp); +} +#endif +#endif + +#if H_DPP_SUPPORT +#if H_SUPP_DPP_SUPPORT +esp_err_t rpc_supp_dpp_init(esp_supp_dpp_event_cb_t evt_cb) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + // save the incoming callback + dpp_evt_cb = evt_cb; + +#if H_SUPP_DPP_SUPPORT + // start the cb thread, if required + if (dpp_evt_cb) { + if (ESP_OK != rpc_supp_cb_thread_start()) { + ESP_LOGE(TAG, "failed to start supp_cb_thread"); + } + } +#endif + + if (evt_cb) { + req->u.dpp_enable_cb = true; + } else { + req->u.dpp_enable_cb = false; + } + resp = rpc_slaveif_supp_dpp_init(req); + return rpc_rsp_callback(resp); +} +#else // H_SUPP_DPP_SUPPORT +esp_err_t rpc_supp_dpp_init(void) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + // no callback + req->u.dpp_enable_cb = false; + + resp = rpc_slaveif_supp_dpp_init(req); + return rpc_rsp_callback(resp); +} +#endif + +esp_err_t rpc_supp_dpp_deinit(void) +{ +#if H_SUPP_DPP_SUPPORT + // stop the cb thread + rpc_supp_cb_thread_stop(); +#endif + + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + resp = rpc_slaveif_supp_dpp_deinit(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_supp_dpp_bootstrap_gen(const char *chan_list, + esp_supp_dpp_bootstrap_t type, + const char *key, const char *info) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + if (!chan_list) { + ESP_LOGE(TAG, "chan_list cannot be NULL"); + return ESP_FAIL; + } + req->u.dpp_bootstrap_gen.chan_list = chan_list; + req->u.dpp_bootstrap_gen.type = type; + req->u.dpp_bootstrap_gen.key = key; + req->u.dpp_bootstrap_gen.info = info; + + resp = rpc_slaveif_supp_dpp_bootstrap_gen(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_supp_dpp_start_listen(void) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + resp = rpc_slaveif_supp_dpp_start_listen(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_supp_dpp_stop_listen(void) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + resp = rpc_slaveif_supp_dpp_stop_listen(req); + return rpc_rsp_callback(resp); +} + +#if H_SUPP_DPP_SUPPORT +// creates the suplicant dpp queue and starts the thread +static esp_err_t rpc_supp_cb_thread_start(void) +{ + // create the queue + if (!rpc_supp_cb_thread_q) { + rpc_supp_cb_thread_q = g_h.funcs->_h_create_queue(RPC_SUPP_CB_QUEUE_SIZE, + sizeof(supp_cb_queue_item_t)); + } + if (!rpc_supp_cb_thread_q) { + ESP_LOGE(TAG, "Failed to create rpc_supp_cb_thread_q"); + return ESP_FAIL; + } + + // create and start the thread + if (!rpc_supp_cb_thread_hdl) { + rpc_supp_cb_thread_hdl = g_h.funcs->_h_thread_create("rpc_supp_cb", RPC_TASK_PRIO, + RPC_TASK_STACK_SIZE, rpc_supp_thread, NULL); + } + if (!rpc_supp_cb_thread_hdl) { + ESP_LOGE(TAG, "Failed to create rpc_supp_cb_thread_hdl"); + // destroy the created queue also + g_h.funcs->_h_destroy_queue(rpc_supp_cb_thread_q); + rpc_supp_cb_thread_q = NULL; + return ESP_FAIL; + } + + return ESP_OK; +} + +// stops the thread and destroys the queue +static esp_err_t rpc_supp_cb_thread_stop(void) +{ + int res; + int i; + int num_items; + + if (rpc_supp_cb_thread_hdl) { + // stop the thread + res = g_h.funcs->_h_thread_cancel(rpc_supp_cb_thread_hdl); + if (!res) { + rpc_supp_cb_thread_hdl = NULL; + } else { + ESP_LOGE(TAG, "Failed to cancel rpc_supp_cb_thread_hdl"); + } + } else { + ESP_LOGD(TAG, "No rpc_supp_cb_thread_hdl to cancel"); + } + + if (rpc_supp_cb_thread_q) { + // remove all items from the queue + num_items = g_h.funcs->_h_queue_msg_waiting(rpc_supp_cb_thread_q); + for (i = 0; i < num_items; i++) { + supp_cb_queue_item_t item; + res = g_h.funcs->_h_dequeue_item(rpc_supp_cb_thread_q, &item, 0); + if (res) { + ESP_LOGE(TAG, "Error removing item from rpc_supp_cb_thread_q"); + continue; + } + if (item.dpp_data) { + g_h.funcs->_h_free(item.dpp_data); + } + } + + // destroy the queue + if (!g_h.funcs->_h_destroy_queue(rpc_supp_cb_thread_q)) { + rpc_supp_cb_thread_q = NULL; + } else { + ESP_LOGE(TAG, "Failed to destroy rpc_supp_cb_thread_q"); + } + } else { + ESP_LOGD(TAG, "No rpc_supp_cb_thread_q to delete"); + } + + return ESP_OK; +} + +static void rpc_supp_thread(void const *arg) +{ + int res; + supp_cb_queue_item_t item; + + while (1) { + // wait until there is an item to process + res = g_h.funcs->_h_dequeue_item(rpc_supp_cb_thread_q, &item, HOSTED_BLOCK_MAX); + if (res) { + ESP_LOGE(TAG, "Error getting item from rpc_supp_cb_thread_q"); + continue; + } + // triggger the callback with the data; + if (dpp_evt_cb) { + if (item.dpp_event == ESP_SUPP_DPP_FAIL) { + // user cb expected to cast provided data back to a int + // see https://github.com/espressif/esp-idf/blob/7912b04e6bdf8c9aeea88baff9e46794d04e4200/examples/wifi/wifi_easy_connect/dpp-enrollee/main/dpp_enrollee_main.c#L96 + dpp_evt_cb(item.dpp_event, (void *)item.dpp_reason); + } + else if (item.dpp_data) { + dpp_evt_cb(item.dpp_event, item.dpp_data); + } else { + ESP_LOGW(TAG, "unknown supplicant DPP event: dropping"); + } + } else { + ESP_LOGW(TAG, "no registed supplicant dpp cb: dropping dpp event"); + } + // free allocated memory + if (item.dpp_data) { + g_h.funcs->_h_free(item.dpp_data); + } + } +} +#endif // H_SUPP_DPP_SUPPORT +#endif // H_DPP_SUPPORT + +esp_err_t rpc_iface_mac_addr_set_get(bool set, uint8_t *mac, size_t mac_len, esp_mac_type_t type) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.iface_mac.set = set; + req->u.iface_mac.type = type; + req->u.iface_mac.mac_len = mac_len; + memset(req->u.iface_mac.mac, 0, sizeof(req->u.iface_mac.mac)); + + if (set) { + memcpy(req->u.iface_mac.mac, mac, mac_len); + } + + resp = rpc_slaveif_iface_mac_addr_set_get(req); + + // copy mac address for get + if (!set && resp && resp->resp_event_status == SUCCESS) { + memcpy(mac, resp->u.iface_mac.mac, mac_len); + } + return rpc_rsp_callback(resp); +} + +int rpc_bt_controller_init(void) +{ + rcp_feature_control_t feature_control; + + feature_control.feature = FEATURE_BT; + feature_control.command = FEATURE_COMMAND_BT_INIT; + feature_control.option = FEATURE_OPTION_NONE; + + return rpc_iface_feature_control(&feature_control); +} + +int rpc_bt_controller_deinit(bool mem_release) +{ + rcp_feature_control_t feature_control; + + feature_control.feature = FEATURE_BT; + feature_control.command = FEATURE_COMMAND_BT_DEINIT; + if (mem_release) { + feature_control.option = FEATURE_OPTION_BT_DEINIT_RELEASE_MEMORY; + } else { + feature_control.option = FEATURE_OPTION_NONE; + } + + return rpc_iface_feature_control(&feature_control); +} + +int rpc_bt_controller_enable(void) +{ + rcp_feature_control_t feature_control; + + feature_control.feature = FEATURE_BT; + feature_control.command = FEATURE_COMMAND_BT_ENABLE; + feature_control.option = FEATURE_OPTION_NONE; + + return rpc_iface_feature_control(&feature_control); +} + +int rpc_bt_controller_disable(void) +{ + rcp_feature_control_t feature_control; + + feature_control.feature = FEATURE_BT; + feature_control.command = FEATURE_COMMAND_BT_DISABLE; + feature_control.option = FEATURE_OPTION_NONE; + + return rpc_iface_feature_control(&feature_control); +} + +esp_err_t rpc_iface_mac_addr_len_get(size_t *len, esp_mac_type_t type) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.iface_mac_len.type = type; + resp = rpc_slaveif_iface_mac_addr_len_get(req); + + if (resp && resp->resp_event_status == SUCCESS) { + *len = resp->u.iface_mac_len.len; + } + return rpc_rsp_callback(resp); +} + +static esp_err_t rpc_iface_feature_control(rcp_feature_control_t *feature_control) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.feature_control.feature = feature_control->feature; + req->u.feature_control.command = feature_control->command; + req->u.feature_control.option = feature_control->option; + + resp = rpc_slaveif_feature_control(req); + + return rpc_rsp_callback(resp); +} + +#if H_ENABLE_GPIO_CONTROL +esp_err_t rpc_gpio_config(const esp_hosted_gpio_config_t *pGPIOConfig) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + if (!pGPIOConfig) + return FAILURE; + + req->u.gpio_config.pin_bit_mask = pGPIOConfig->pin_bit_mask; + req->u.gpio_config.mode = pGPIOConfig->mode; + req->u.gpio_config.pull_up_en = pGPIOConfig->pull_up_en; + req->u.gpio_config.pull_down_en = pGPIOConfig->pull_down_en; + req->u.gpio_config.intr_type = pGPIOConfig->intr_type; + + resp = rpc_slaveif_gpio_config(req); + + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_gpio_reset(uint32_t gpio_num) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.gpio_num = gpio_num; + resp = rpc_slaveif_gpio_reset_pin(req); + + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_gpio_set_level(uint32_t gpio_num, uint32_t level) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.gpio_set_level.gpio_num = gpio_num; + req->u.gpio_set_level.level = level; + + resp = rpc_slaveif_gpio_set_level(req); + return rpc_rsp_callback(resp); +} + +int rpc_gpio_get_level(uint32_t gpio_num, int *level) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.gpio_num = gpio_num; + resp = rpc_slaveif_gpio_get_level(req); + + if (resp && resp->resp_event_status == SUCCESS) { + *level = resp->u.gpio_get_level; + } + + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_gpio_set_direction(uint32_t gpio_num, uint32_t mode) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.gpio_set_direction.gpio_num = gpio_num; + req->u.gpio_set_direction.mode = mode; + + resp = rpc_slaveif_gpio_set_direction(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_gpio_input_enable(uint32_t gpio_num) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.gpio_num = gpio_num; + resp = rpc_slaveif_gpio_input_enable(req); + return rpc_rsp_callback(resp); +} + +esp_err_t rpc_gpio_set_pull_mode(uint32_t gpio_num, uint32_t pull_mode) +{ + /* implemented synchronous */ + ctrl_cmd_t *req = RPC_DEFAULT_REQ(); + ctrl_cmd_t *resp = NULL; + + req->u.gpio_set_pull_mode.gpio_num = gpio_num; + req->u.gpio_set_pull_mode.pull_mode = pull_mode; + + resp = rpc_slaveif_gpio_set_pull_mode(req); + return rpc_rsp_callback(resp); +} +#endif diff --git a/host/drivers/rpc/wrap/rpc_wrap.h b/host/drivers/rpc/wrap/rpc_wrap.h index ebe39125..4159e533 100644 --- a/host/drivers/rpc/wrap/rpc_wrap.h +++ b/host/drivers/rpc/wrap/rpc_wrap.h @@ -1,17 +1,8 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /** prevent recursive inclusion **/ #ifndef __RPC_WRAP_H__ @@ -22,18 +13,29 @@ extern "C" { #endif /** Includes **/ -#include "common.h" #include "esp_wifi.h" -#include "esp_hosted_wifi_config.h" -#include "esp_hosted_api.h" +#include "port_esp_hosted_host_wifi_config.h" +#include "port_esp_hosted_host_config.h" +#include "esp_mac.h" #include "esp_hosted_api_types.h" +#if H_WIFI_ENTERPRISE_SUPPORT +#include "esp_eap_client.h" +#endif +#if H_DPP_SUPPORT +#include "esp_dpp.h" +#endif +#if H_ENABLE_GPIO_CONTROL +#include "esp_hosted_gpio.h" +#endif /** Exported variables **/ /** Inline functions **/ /** Exported Functions **/ esp_err_t rpc_init(void); +esp_err_t rpc_start(void); +esp_err_t rpc_stop(void); esp_err_t rpc_deinit(void); esp_err_t rpc_unregister_event_callbacks(void); esp_err_t rpc_register_event_callbacks(void); @@ -81,9 +83,37 @@ esp_err_t rpc_wifi_set_max_tx_power(int8_t power); esp_err_t rpc_wifi_get_max_tx_power(int8_t *power); esp_err_t rpc_wifi_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode); esp_err_t rpc_wifi_sta_get_aid(uint16_t *aid); -esp_err_t rpc_ota(const char* image_url); +esp_err_t rpc_wifi_set_inactive_time(wifi_interface_t ifx, uint16_t sec); +esp_err_t rpc_wifi_get_inactive_time(wifi_interface_t ifx, uint16_t *sec); esp_err_t rpc_get_coprocessor_fwversion(esp_hosted_coprocessor_fwver_t *ver_info); +esp_err_t rpc_bt_controller_init(void); +esp_err_t rpc_bt_controller_deinit(bool mem_release); +esp_err_t rpc_bt_controller_enable(void); +esp_err_t rpc_bt_controller_disable(void); + +esp_err_t rpc_iface_mac_addr_set_get(bool set, uint8_t *mac, size_t mac_len, esp_mac_type_t type); +esp_err_t rpc_iface_mac_addr_len_get(size_t *len, esp_mac_type_t type); + +esp_err_t rpc_ota_begin(void); +esp_err_t rpc_ota_write(uint8_t* ota_data, uint32_t ota_data_len); +esp_err_t rpc_ota_end(void); +esp_err_t rpc_ota_activate(void); + +#if H_WIFI_HE_SUPPORT +esp_err_t rpc_wifi_sta_twt_config(wifi_twt_config_t *config); +#if H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 +esp_err_t rpc_wifi_sta_itwt_setup(wifi_itwt_setup_config_t *setup_config); +#else +esp_err_t rpc_wifi_sta_itwt_setup(wifi_twt_setup_config_t *setup_config); +#endif +esp_err_t rpc_wifi_sta_itwt_teardown(int flow_id); +esp_err_t rpc_wifi_sta_itwt_suspend(int flow_id, int suspend_time_ms); +esp_err_t rpc_wifi_sta_itwt_get_flow_id_status(int *flow_id_bitmap); +esp_err_t rpc_wifi_sta_itwt_send_probe_req(int timeout_ms); +esp_err_t rpc_wifi_sta_itwt_set_target_wake_time_offset(int offset_us); +#endif + #if H_WIFI_DUALBAND_SUPPORT esp_err_t rpc_wifi_set_band(wifi_band_t band); esp_err_t rpc_wifi_get_band(wifi_band_t *band); @@ -95,6 +125,64 @@ esp_err_t rpc_wifi_set_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw); esp_err_t rpc_wifi_get_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw); #endif +esp_err_t rpc_set_dhcp_dns_status(wifi_interface_t interface, uint8_t link_up, + uint8_t dhcp_up, char *dhcp_ip, char *dhcp_nm, char *dhcp_gw, + uint8_t dns_up, char *dns_ip, uint8_t dns_type); + +#if H_WIFI_ENTERPRISE_SUPPORT +esp_err_t rpc_wifi_sta_enterprise_enable(void); +esp_err_t rpc_wifi_sta_enterprise_disable(void); +esp_err_t rpc_eap_client_set_identity(const unsigned char *identity, int len); +esp_err_t rpc_eap_client_clear_identity(void); +esp_err_t rpc_eap_client_set_username(const unsigned char *username, int len); +esp_err_t rpc_eap_client_clear_username(void); +esp_err_t rpc_eap_client_set_password(const unsigned char *password, int len); +esp_err_t rpc_eap_client_clear_password(void); +esp_err_t rpc_eap_client_set_new_password(const unsigned char *new_password, int len); +esp_err_t rpc_eap_client_clear_new_password(void); +esp_err_t rpc_eap_client_set_ca_cert(const unsigned char *ca_cert, int ca_cert_len); +esp_err_t rpc_eap_client_clear_ca_cert(void); + +esp_err_t rpc_eap_client_set_certificate_and_key(const unsigned char *client_cert, int client_cert_len, + const unsigned char *private_key, int private_key_len, + const unsigned char *private_key_password, int private_key_passwd_len); +esp_err_t rpc_eap_client_clear_certificate_and_key(void); +esp_err_t rpc_eap_client_set_disable_time_check(bool disable); +esp_err_t rpc_eap_client_get_disable_time_check(bool *disable); +esp_err_t rpc_eap_client_set_ttls_phase2_method(esp_eap_ttls_phase2_types type); +esp_err_t rpc_eap_client_set_suiteb_192bit_certification(bool enable); +esp_err_t rpc_eap_client_set_pac_file(const unsigned char *pac_file, int pac_file_len); +esp_err_t rpc_eap_client_set_fast_params(esp_eap_fast_config config); +esp_err_t rpc_eap_client_use_default_cert_bundle(bool use_default_bundle); +esp_err_t rpc_wifi_set_okc_support(bool enable); +esp_err_t rpc_eap_client_set_domain_name(const char *domain_name); +#if H_GOT_SET_EAP_METHODS_API +esp_err_t rpc_eap_client_set_eap_methods(esp_eap_method_t methods); +#endif +#endif +#if H_DPP_SUPPORT +#if H_SUPP_DPP_SUPPORT +esp_err_t rpc_supp_dpp_init(esp_supp_dpp_event_cb_t evt_cb); +#else +esp_err_t rpc_supp_dpp_init(void); +#endif +esp_err_t rpc_supp_dpp_deinit(void); +esp_err_t rpc_supp_dpp_bootstrap_gen(const char *chan_list, + esp_supp_dpp_bootstrap_t type, + const char *key, const char *info); +esp_err_t rpc_supp_dpp_start_listen(void); +esp_err_t rpc_supp_dpp_stop_listen(void); +#endif +#if H_ENABLE_GPIO_CONTROL +esp_err_t rpc_gpio_config(const esp_hosted_gpio_config_t *pGPIOConfig); +esp_err_t rpc_gpio_reset_pin(uint32_t gpio_num); +esp_err_t rpc_gpio_set_level(uint32_t gpio_num, uint32_t level); +int rpc_gpio_get_level(uint32_t gpio_num, int *level); +esp_err_t rpc_gpio_set_direction(uint32_t gpio_num, uint32_t mode); +esp_err_t rpc_gpio_input_enable(uint32_t gpio_num); +esp_err_t rpc_gpio_set_pull_mode(uint32_t gpio_num, uint32_t pull); +#endif + #ifdef __cplusplus } #endif diff --git a/host/drivers/serial/serial_drv.c b/host/drivers/serial/serial_drv.c index f9605b39..f310d5b9 100644 --- a/host/drivers/serial/serial_drv.c +++ b/host/drivers/serial/serial_drv.c @@ -14,8 +14,8 @@ #include "serial_if.h" #include "serial_ll_if.h" -#include "esp_log.h" #include "esp_hosted_log.h" +#include "port_esp_hosted_host_log.h" DEFINE_LOG_TAG(serial); @@ -69,7 +69,7 @@ int serial_drv_write (struct serial_drv_handle_t* serial_drv_handle, return RET_INVALID; } - ESP_HEXLOGV("serial_write", buf, in_count); + ESP_HEXLOGV("serial_write", buf, in_count, 32); ret = serial_ll_if_g->fops->write(serial_ll_if_g, buf, in_count); if (ret != RET_OK) { *out_count = 0; @@ -108,6 +108,7 @@ uint8_t * serial_drv_read(struct serial_drv_handle_t *serial_drv_handle, return NULL; } + ESP_LOGV(TAG, "Wait for serial_ll_semaphore"); g_h.funcs->_h_get_semaphore(readSemaphore, HOSTED_BLOCK_MAX); if( (!serial_ll_if_g) || @@ -116,6 +117,7 @@ uint8_t * serial_drv_read(struct serial_drv_handle_t *serial_drv_handle, ESP_LOGE(TAG,"serial interface refusing to read\n\r"); return NULL; } + ESP_LOGV(TAG, "Starting serial_ll read"); /* Get buffer from serial interface */ read_buf = serial_ll_if_g->fops->read(serial_ll_if_g, &rx_buf_len); @@ -123,7 +125,7 @@ uint8_t * serial_drv_read(struct serial_drv_handle_t *serial_drv_handle, ESP_LOGE(TAG,"serial read failed\n\r"); return NULL; } - ESP_HEXLOGV("serial_read", read_buf, rx_buf_len); + ESP_HEXLOGV("serial_read", read_buf, rx_buf_len, 32); /* * Read Operation happens in two steps because total read length is unknown @@ -167,6 +169,7 @@ uint8_t * serial_drv_read(struct serial_drv_handle_t *serial_drv_handle, ESP_LOGE(TAG,"Failed to parse RX data \n\r"); goto free_bufs; } + ESP_LOGV(TAG, "TLV parsed"); if (rx_buf_len < (init_read_len + buf_len)) { ESP_LOGE(TAG,"Buf read on serial iface is smaller than expected len\n"); @@ -189,6 +192,7 @@ uint8_t * serial_drv_read(struct serial_drv_handle_t *serial_drv_handle, HOSTED_FREE(read_buf); *out_nbyte = buf_len; + ESP_LOGV(TAG, "Serial payload size(after removing TLV): %" PRIu32, *out_nbyte); return buf; free_bufs: @@ -212,8 +216,8 @@ int serial_drv_close(struct serial_drv_handle_t** serial_drv_handle) int rpc_platform_init(void) { /* rpc semaphore */ - readSemaphore = g_h.funcs->_h_create_semaphore(CONFIG_ESP_HOSTED_MAX_SIMULTANEOUS_SYNC_RPC_REQUESTS + - CONFIG_ESP_HOSTED_MAX_SIMULTANEOUS_ASYNC_RPC_REQUESTS); + readSemaphore = g_h.funcs->_h_create_semaphore(H_MAX_SYNC_RPC_REQUESTS + + H_MAX_ASYNC_RPC_REQUESTS); assert(readSemaphore); /* grab the semaphore, so that task will be mandated to wait on semaphore */ diff --git a/host/drivers/serial/serial_ll_if.c b/host/drivers/serial/serial_ll_if.c index 9a056cae..f5c6c4d3 100644 --- a/host/drivers/serial/serial_ll_if.c +++ b/host/drivers/serial/serial_ll_if.c @@ -1,32 +1,23 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /** Includes **/ #include "string.h" #include "serial_ll_if.h" -#include "esp_log.h" #include "transport_drv.h" #include "esp_hosted_transport.h" #include "esp_hosted_header.h" +#include "port_esp_hosted_host_log.h" +#include "esp_hosted_log.h" DEFINE_LOG_TAG(serial_ll); /** Macros / Constants **/ #define MAX_SERIAL_INTF 2 -#define TO_SERIAL_INFT_QUEUE_SIZE 100 +#define TO_SERIAL_INFT_QUEUE_SIZE 10 typedef enum { INIT, @@ -74,11 +65,12 @@ static int serial_ll_open(serial_ll_handle_t *serial_ll_hdl) { if (! serial_ll_hdl) { ESP_LOGE(TAG, "serial invalid hdr"); - return STM_FAIL; + return -1; } if (serial_ll_hdl->queue) { /* clean up earlier queue */ + ESP_LOGW(TAG, "Flush existing serial queue"); g_h.funcs->_h_destroy_queue(serial_ll_hdl->queue); } @@ -88,11 +80,11 @@ static int serial_ll_open(serial_ll_handle_t *serial_ll_hdl) if (! serial_ll_hdl->queue) { serial_ll_close(serial_ll_hdl); - return STM_FAIL; + return -1; } serial_ll_hdl->state = ACTIVE; - return STM_OK; + return 0; } /** @@ -108,6 +100,7 @@ static serial_ll_handle_t * get_serial_ll_handle(const uint8_t iface_num) return interface_handle_g[iface_num]; } + ESP_LOGE(TAG, "%s Failed to get interface handle", __func__); return NULL; } @@ -121,6 +114,7 @@ static int serial_ll_close(serial_ll_handle_t * serial_ll_hdl) serial_ll_hdl->state = DESTROY; if (serial_ll_hdl->queue) { + ESP_LOGI(TAG, "Clean-up serial queue"); g_h.funcs->_h_destroy_queue(serial_ll_hdl->queue); serial_ll_hdl->queue = NULL; } @@ -134,7 +128,7 @@ static int serial_ll_close(serial_ll_handle_t * serial_ll_hdl) g_h.funcs->_h_free(serial_ll_hdl); serial_ll_hdl = NULL; } - return STM_OK; + return 0; } @@ -172,18 +166,23 @@ static uint8_t * serial_ll_read(const serial_ll_handle_t * serial_ll_hdl, * * In our example, first approach of blocking read is used. */ + ESP_LOGV(TAG, "before deQ for ll_read"); if (g_h.funcs->_h_dequeue_item(serial_ll_hdl->queue, &buf_handle, HOSTED_BLOCK_MAX)) { ESP_LOGE(TAG, "serial queue recv failed "); return NULL; } + ESP_LOGV(TAG, "after deQ for ll_read"); /* proceed only if payload and length are sane */ if (!buf_handle.payload || !buf_handle.payload_len) { + ESP_LOGE(TAG, "%s: Dequeue result in empty buffer",__func__); return NULL; } *rlen = buf_handle.payload_len; + ESP_HEXLOGV("ll_read", buf_handle.payload, buf_handle.payload_len, 32); + return buf_handle.payload; } @@ -192,7 +191,7 @@ static uint8_t * serial_ll_read(const serial_ll_handle_t * serial_ll_hdl, * @param serial_ll_hdl - handle * wlen - number of bytes to write * wbuffer - buffer to send - * @retval STM_FAIL/STM_OK + * @retval 0 on success, -1 on failure */ static int serial_ll_write(const serial_ll_handle_t * serial_ll_hdl, uint8_t * wbuffer, const uint16_t wlen) @@ -200,11 +199,57 @@ static int serial_ll_write(const serial_ll_handle_t * serial_ll_hdl, if ((! serial_ll_hdl) || (serial_ll_hdl->state != ACTIVE)) { ESP_LOGE(TAG, "serial invalid interface for write"); - return STM_FAIL; + return -1; + } + + if (!wbuffer || !wlen) { + return -1; + } + + if (wlen > MAX_FRAGMENTABLE_PAYLOAD_SIZE) { + ESP_LOGE(TAG, "Payload too large: %u bytes (max allowed: %u)", wlen, MAX_FRAGMENTABLE_PAYLOAD_SIZE); + return -1; + } + + uint16_t offset = 0; + uint16_t remaining_len = wlen; + void (*free_func)(void *) = NULL; + uint8_t *buf_to_free = NULL; + + while (remaining_len > 0) { + uint16_t frag_len = (remaining_len > MAX_PAYLOAD_SIZE) ? MAX_PAYLOAD_SIZE : remaining_len; + uint8_t *frag_ptr = wbuffer + offset; + + uint8_t flags = 0; + if (remaining_len > MAX_PAYLOAD_SIZE) { + flags |= MORE_FRAGMENT; + } + else { + // FRAGMENTATION COMPLETED + buf_to_free = wbuffer; + free_func = H_DEFLT_FREE_FUNC; + } + + int ret = esp_hosted_tx(serial_ll_hdl->if_type, + serial_ll_hdl->if_num, + frag_ptr, + frag_len, + H_BUFF_NO_ZEROCOPY, + buf_to_free, free_func, + flags); + if (ret != ESP_OK) { + if (flags & MORE_FRAGMENT) { + H_FREE_PTR_WITH_FUNC(H_DEFLT_FREE_FUNC, wbuffer); + } + ESP_LOGE(TAG, "esp_hosted_tx failed at offset=%u len=%u", offset, frag_len); + return ret; + } + + offset += frag_len; + remaining_len -= frag_len; } - return esp_hosted_tx(serial_ll_hdl->if_type, - serial_ll_hdl->if_num, wbuffer, wlen, H_BUFF_NO_ZEROCOPY, H_DEFLT_FREE_FUNC); + return 0; } /** @@ -217,7 +262,7 @@ static int serial_ll_write(const serial_ll_handle_t * serial_ll_hdl, * flag_more_frags - Flags for fragmentation * @retval 0 on success, else failure */ -stm_ret_t serial_ll_rx_handler(interface_buffer_handle_t * buf_handle) +int serial_ll_rx_handler(interface_buffer_handle_t * buf_handle) { #define SERIAL_ALLOC_REALLOC_RDATA() \ @@ -260,7 +305,7 @@ stm_ret_t serial_ll_rx_handler(interface_buffer_handle_t * buf_handle) g_h.funcs->_h_memcpy((r.data + r.len), buf_handle->payload, buf_handle->payload_len); r.len += buf_handle->payload_len; - return STM_OK; + return 0; } SERIAL_ALLOC_REALLOC_RDATA(); @@ -292,12 +337,14 @@ stm_ret_t serial_ll_rx_handler(interface_buffer_handle_t * buf_handle) g_h.funcs->_h_free(r.data); r.data = NULL; + ESP_LOGV(TAG, "before ENQ for ll_read"); /* send to serial queue */ if (g_h.funcs->_h_queue_item(serial_ll_hdl->queue, &new_buf_handle, HOSTED_BLOCK_MAX)) { ESP_LOGE(TAG, "Failed send serialif queue[%u]", new_buf_handle.if_num); goto serial_buff_cleanup; } + ESP_LOGV(TAG, "after ENQ for ll_read"); /* Indicate higher layer about data ready for consumption */ if (serial_ll_hdl->serial_rx_callback) { @@ -306,10 +353,11 @@ stm_ret_t serial_ll_rx_handler(interface_buffer_handle_t * buf_handle) goto serial_buff_cleanup; } - return STM_OK; + return 0; serial_buff_cleanup: + ESP_LOGE(TAG, "Err occured, discard current buffer"); H_FREE_PTR_WITH_FUNC(buf_handle->free_buf_handle, buf_handle->priv_buffer_handle); r.len = 0; @@ -317,7 +365,7 @@ stm_ret_t serial_ll_rx_handler(interface_buffer_handle_t * buf_handle) H_FREE_PTR_WITH_FUNC(new_buf_handle.free_buf_handle, new_buf_handle.priv_buffer_handle); g_h.funcs->_h_free(r.data); - return STM_FAIL; + return -1; } /** Exported Functions **/ diff --git a/host/drivers/serial/serial_ll_if.h b/host/drivers/serial/serial_ll_if.h index 08258b48..b5697e15 100644 --- a/host/drivers/serial/serial_ll_if.h +++ b/host/drivers/serial/serial_ll_if.h @@ -1,17 +1,8 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /*prevent recursive inclusion */ #ifndef __SERIAL_LL_IF_H @@ -23,7 +14,7 @@ extern "C" { /** includes **/ #include "transport_drv.h" -#include "os_wrapper.h" +#include "port_esp_hosted_host_os.h" struct serial_ll_operations; @@ -78,7 +69,7 @@ struct serial_ll_operations { * @param serial_ll_hdl - handle * wlen - number of bytes to write * wbuffer - buffer to send - * @retval STM_FAIL/STM_OK + * @retval 0 on success, -1 on failure */ int (*write) (const serial_ll_handle_t * serial_ll_hdl, uint8_t * wbuffer, const uint16_t wlen); @@ -99,7 +90,7 @@ struct serial_ll_operations { */ serial_ll_handle_t * serial_ll_init(void(*rx_data_ind)(void)); -stm_ret_t serial_ll_rx_handler(interface_buffer_handle_t * buf_handle); +int serial_ll_rx_handler(interface_buffer_handle_t * buf_handle); #ifdef __cplusplus } #endif diff --git a/host/drivers/transport/sdio/sdio_drv.c b/host/drivers/transport/sdio/sdio_drv.c index 0f991dab..482641d1 100644 --- a/host/drivers/transport/sdio/sdio_drv.c +++ b/host/drivers/transport/sdio/sdio_drv.c @@ -1,3 +1,62 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * SDIO Driver + * =========== + * + * TX Path (Host -> Slave): + * ------------------------ + * 1. `esp_hosted_tx()`: Higher-level modules call this function to send data. + * 2. `to_slave_queue`: The data is placed into a priority queue. + * 3. `sdio_write_task`: This thread waits for data on the queue, retrieves it, + * and writes it to the SDIO bus. + * + * RX Path (Slave -> Host): + * ------------------------ + * 1. `sdio_read_task`: This thread waits for an interrupt from the slave, + * reads the raw data stream into a double buffer, and signals the next + * thread. + * 2. `sdio_data_to_rx_buf_task`: Processes the stream from the double buffer, + * extracts individual packets, and places them onto the `from_slave_queue`. + * 3. `sdio_process_rx_task`: Retrieves packets from the queue and dispatches + * them to the appropriate higher-level handler (e.g., WiFi, BT). + * + * + * + * Host MCU + * +--------------------------------------------------------------------------------------------------+ + * | TX Path (Host -> Slave) RX Path (Slave -> Host) | + * | +------------------------------------------------------+ +-----------------------------------+ | + * | | Higher Layers (e.g. Wi-Fi) | | SDIO Bus | | + * | | | | | | | | + * | | v | | v | | + * | | esp_hosted_tx() | | sdio_read_task (Thread) | | + * | | | | | | | | + * | | v | | | Data Stream | | + * | | to_slave_queue (Queue) | | v | | + * | | | | | Double Buffer | | + * | | v | | | | | + * | | sdio_write_task (Thread) | | v | | + * | | | | | sdio_data_to_rx_buf_task (Thread) | | + * | | v | | | | | + * | | SDIO Bus | | | Packets | | + * | +------------------------------------------------------+ | v | | + * | | from_slave_queue (Queue) | | + * | | | | | + * | | v | | + * | | sdio_process_rx_task (Thread) | | + * | | | | | + * | | v | | + * | | Higher Layers (Wi-Fi, BT, etc) | | + * | +-----------------------------------+ | + * +--------------------------------------------------------------------------------------------------+ + * + * + */ // SPDX-License-Identifier: Apache-2.0 // Copyright 2015-2023 Espressif Systems (Shanghai) PTE LTD // @@ -19,11 +78,15 @@ #include "sdio_reg.h" #include "serial_drv.h" #include "stats.h" -#include "esp_log.h" #include "esp_hosted_log.h" #include "hci_drv.h" #include "endian.h" #include "esp_hosted_transport_init.h" +#include "power_save_drv.h" +#include "esp_hosted_power_save.h" +#include "esp_hosted_transport_config.h" +#include "esp_hosted_bt.h" +#include "port_esp_hosted_host_config.h" static const char TAG[] = "H_SDIO_DRV"; @@ -34,12 +97,15 @@ static const char TAG[] = "H_SDIO_DRV"; #define DO_COMBINED_REG_READ (1) /** Constants/Macros **/ -#define TO_SLAVE_QUEUE_SIZE H_SDIO_TX_Q -#define FROM_SLAVE_QUEUE_SIZE H_SDIO_RX_Q -#define RX_TASK_STACK_SIZE 4096 -#define TX_TASK_STACK_SIZE 4096 -#define PROCESS_RX_TASK_STACK_SIZE 4096 +// default queue sizes if unable to get from transport config +#define DEFAULT_TO_SLAVE_QUEUE_SIZE 20 +#define DEFAULT_FROM_SLAVE_QUEUE_SIZE 20 + +#define RX_TASK_STACK_SIZE CONFIG_ESP_HOSTED_DFLT_TASK_STACK +#define TX_TASK_STACK_SIZE CONFIG_ESP_HOSTED_DFLT_TASK_STACK +#define PROCESS_RX_TASK_STACK_SIZE CONFIG_ESP_HOSTED_DFLT_TASK_STACK +#define RX_BUF_TASK_STACK_SIZE CONFIG_ESP_HOSTED_DFLT_TASK_STACK #define RX_TIMEOUT_TICKS 50 #define BUFFER_AVAILABLE 1 @@ -48,8 +114,8 @@ static const char TAG[] = "H_SDIO_DRV"; // max number of time to try to read write buffer available reg #define MAX_WRITE_BUF_RETRIES 50 -// max number of times to try to write data to slave device -#define MAX_WRITE_RETRIES 2 +/* Actual data sdio_write max retry */ +#define MAX_SDIO_WRITE_RETRY 2 // this locks the sdio transaction at the driver level, instead of at the HAL layer #define USE_DRIVER_LOCK @@ -86,7 +152,6 @@ static uint8_t *reg_buf = NULL; /* Create mempool for cache mallocs */ static struct mempool * buf_mp_g; -/* TODO to move this in transport drv */ extern transport_channel_t *chan_arr[ESP_MAX_IF]; static void * sdio_handle = NULL; @@ -126,7 +191,9 @@ typedef struct { int write_index; } double_buf_t; -static double_buf_t double_buf; +static double_buf_t double_buf = { + .read_index = -1, +}; // sem to trigger sdio_data_to_rx_buf_task() static semaphore_handle_t sem_double_buf_xfer_data; @@ -134,7 +201,7 @@ static semaphore_handle_t sem_double_buf_xfer_data; static void * sdio_rx_buf_thread; static void sdio_data_to_rx_buf_task(void const* pvParameters); -static esp_err_t sdio_generate_slave_intr(uint8_t intr_no); +static int sdio_generate_slave_intr(uint8_t intr_no); static void sdio_write_task(void const* pvParameters); static void sdio_read_task(void const* pvParameters); @@ -164,9 +231,66 @@ static inline void sdio_buffer_free(void *buf) mempool_free(buf_mp_g, buf); } -void transport_deinit_internal(void) +void bus_deinit_internal(void *bus_handle) { - /* TODO */ + uint8_t prio_q_idx = 0; + + if (sdio_read_thread) { + g_h.funcs->_h_thread_cancel(sdio_read_thread); + sdio_read_thread = NULL; + } + + if (sdio_write_thread) { + g_h.funcs->_h_thread_cancel(sdio_write_thread); + sdio_write_thread = NULL; + } + + if (sdio_process_rx_thread) { + g_h.funcs->_h_thread_cancel(sdio_process_rx_thread); + sdio_process_rx_thread = NULL; + } + + if (sdio_rx_buf_thread) { + g_h.funcs->_h_thread_cancel(sdio_rx_buf_thread); + sdio_rx_buf_thread = NULL; + } + + for (prio_q_idx=0; prio_q_idx_h_destroy_queue(to_slave_queue[prio_q_idx]); + to_slave_queue[prio_q_idx] = NULL; + } + if (from_slave_queue[prio_q_idx]) { + g_h.funcs->_h_destroy_queue(from_slave_queue[prio_q_idx]); + from_slave_queue[prio_q_idx] = NULL; + } + } + + if (sem_to_slave_queue) { + g_h.funcs->_h_destroy_semaphore(sem_to_slave_queue); + sem_to_slave_queue = NULL; + } + if (sem_from_slave_queue) { + g_h.funcs->_h_destroy_semaphore(sem_from_slave_queue); + sem_from_slave_queue = NULL; + } + if (sem_double_buf_xfer_data) { + g_h.funcs->_h_destroy_semaphore(sem_double_buf_xfer_data); + sem_double_buf_xfer_data = NULL; + } + +#if defined(USE_DRIVER_LOCK) + if (sdio_bus_lock) { + g_h.funcs->_h_destroy_mutex(sdio_bus_lock); + sdio_bus_lock = NULL; + } +#endif + + sdio_mempool_destroy(); + if (bus_handle) { + g_h.funcs->_h_bus_deinit(bus_handle); + } + sdio_handle = NULL; } static int sdio_generate_slave_intr(uint8_t intr_no) @@ -303,25 +427,40 @@ static int sdio_get_len_from_slave(uint32_t *rx_size, bool is_lock_needed) #endif +#define MAX_BUFF_FETCH_PERIODICITY 30000 + static int sdio_is_write_buffer_available(uint32_t buf_needed) { static uint32_t buf_available = 0; uint8_t retry = MAX_WRITE_BUF_RETRIES; + uint32_t max_retry_sdio_not_responding = 2; + uint32_t interval_us = 400; /*If buffer needed are less than buffer available then only read for available buffer number from slave*/ if (buf_available < buf_needed) { while (retry) { - sdio_get_tx_buffer_num(&buf_available, ACQUIRE_LOCK); + if (sdio_get_tx_buffer_num(&buf_available, ACQUIRE_LOCK) == + ESP_HOSTED_SDIO_UNRESPONSIVE_CODE) { + max_retry_sdio_not_responding--; + /* restart the host to avoid the sdio locked out state */ + + if (!max_retry_sdio_not_responding) { + ESP_LOGE(TAG, "%s: SDIO slave unresponsive, restart host", __func__); + g_h.funcs->_h_restart_host(); + } + continue; + } if (buf_available < buf_needed) { ESP_LOGV(TAG, "Retry get write buffers %d", retry); retry--; - if (retry < MAX_WRITE_BUF_RETRIES/2) - g_h.funcs->_h_msleep(1); - + g_h.funcs->_h_usleep(interval_us); + if (interval_us < MAX_BUFF_FETCH_PERIODICITY) { + interval_us += 400; + } continue; } break; @@ -355,6 +494,7 @@ static void sdio_write_task(void const* pvParameters) uint32_t len_to_send; uint32_t buf_needed; uint8_t tx_needed = 1; + uint8_t flag = 0; while (!sdio_start_write_thread) g_h.funcs->_h_msleep(10); @@ -370,13 +510,19 @@ static void sdio_write_task(void const* pvParameters) tx_needed = 0; /* No Tx msg */ } - if (tx_needed) + if (tx_needed) { len = buf_handle.payload_len; + flag = buf_handle.flag; + } - if (!len) { + if (!flag && !len) { ESP_LOGE(TAG, "%s: Empty len", __func__); goto done; } +#if ESP_PKT_STATS + if (buf_handle.if_type == ESP_STA_IF) + pkt_stats.sta_tx_trans_in++; +#endif if (!buf_handle.payload_zcopy) { sendbuf = sdio_buffer_alloc(MEMSET_REQUIRED); @@ -410,6 +556,8 @@ static void sdio_write_task(void const* pvParameters) payload_header->seq_num = htole16(buf_handle.seq_num); payload_header->flags = buf_handle.flag; + UPDATE_HEADER_TX_PKT_NO(payload_header); + if (payload_header->if_type == ESP_HCI_IF) { // special handling for HCI if (!buf_handle.payload_zcopy) { @@ -437,13 +585,17 @@ static void sdio_write_task(void const* pvParameters) ret = sdio_is_write_buffer_available(buf_needed); if (ret != BUFFER_AVAILABLE) { ESP_LOGV(TAG, "no SDIO write buffers on slave device"); +#if ESP_PKT_STATS + if (payload_header->if_type == ESP_STA_IF) + pkt_stats.sta_tx_out_drop++; +#endif goto unlock_done; } pos = sendbuf; data_left = len + sizeof(struct esp_payload_header); - ESP_HEXLOGV("h_sdio_tx", sendbuf, min(32,data_left)); + ESP_HEXLOGV("bus_TX", sendbuf, data_left, 32); len_to_send = 0; retries = 0; @@ -468,12 +620,14 @@ static void sdio_write_task(void const* pvParameters) ESP_LOGE(TAG, "%s: %d: Failed to send data: %d %ld %ld", __func__, retries, ret, len_to_send, data_left); retries++; - if (retries < MAX_WRITE_RETRIES) { + if (retries < MAX_SDIO_WRITE_RETRY) { ESP_LOGD(TAG, "retry"); continue; } else { - ESP_LOGE(TAG, "abort sending of data"); - goto unlock_done; + SDIO_DRV_UNLOCK(); + ESP_LOGE(TAG, "Unrecoverable host sdio state, reset host mcu"); + g_h.funcs->_h_restart_host(); + goto done; } } @@ -485,8 +639,8 @@ static void sdio_write_task(void const* pvParameters) sdio_tx_buf_count = sdio_tx_buf_count % ESP_TX_BUFFER_MAX; #if ESP_PKT_STATS - if (buf_handle.if_type == ESP_STA_IF) - pkt_stats.sta_tx_out++; + if (buf_handle.if_type == ESP_STA_IF) + pkt_stats.sta_tx_out++; #endif unlock_done: @@ -507,13 +661,21 @@ static int is_valid_sdio_rx_packet(uint8_t *rxbuff_a, uint16_t *len_a, uint16_t #if H_SDIO_CHECKSUM uint16_t rx_checksum = 0, checksum = 0; #endif + uint8_t is_wakeup_pkt = 0; + UPDATE_HEADER_RX_PKT_NO(h); if (!h || !len_a || !offset_a) return 0; /* Fetch length and offset from payload header */ len = le16toh(h->len); offset = le16toh(h->offset); + is_wakeup_pkt = h->flags & FLAG_WAKEUP_PKT; + + if (is_wakeup_pkt && len<1500) { + ESP_LOGI(TAG, "Host wakeup triggered, len: %u ", len); + ESP_HEXLOGW("Wakeup_pkt", rxbuff_a+offset, len, H_MIN(len,128)); + } if ((!len) || (len > MAX_PAYLOAD_SIZE) || @@ -525,6 +687,12 @@ static int is_valid_sdio_rx_packet(uint8_t *rxbuff_a, uint16_t *len_a, uint16_t * 3. payload header size mismatch, * wrong header/bit packing? * */ + + if (len) { + ESP_LOGE(TAG, "len[%u]>max[%u] OR offset[%u] != exp[%u], Drop", + len, MAX_PAYLOAD_SIZE, offset, sizeof(struct esp_payload_header)); + } + return 0; } @@ -578,6 +746,11 @@ static esp_err_t sdio_push_pkt_to_queue(uint8_t * rxbuff, uint16_t len, uint16_t pkt_prio = PRIO_Q_BT; /* else OTHERS by default */ + if( (!from_slave_queue[pkt_prio]) || (!sem_from_slave_queue)) { + ESP_LOGI(TAG, "uninitialised from_slave_queue or sem_from_slave_queue"); + return ESP_FAIL; + } + g_h.funcs->_h_queue_item(from_slave_queue[pkt_prio], &buf_handle, HOSTED_BLOCK_MAX); g_h.funcs->_h_post_semaphore(sem_from_slave_queue); @@ -622,7 +795,7 @@ static esp_err_t sdio_push_data_to_queue(uint8_t * buf, uint32_t buf_len) * 3. payload header size mismatch, * wrong header/bit packing? * */ - ESP_LOGE(TAG, "Dropping packet"); + ESP_LOGW(TAG, "Dropping packet"); HOSTED_FREE(buf); return ESP_FAIL; } @@ -651,9 +824,9 @@ static uint8_t * sdio_rx_get_buffer(uint32_t len) if (len > double_buf.buffer[index].buf_size) { if (*buf) { // free already allocated memory - g_h.funcs->_h_free(*buf); + g_h.funcs->_h_free_align(*buf); } - *buf = (uint8_t *)MEM_ALLOC(len); + *buf = (uint8_t *)g_h.funcs->_h_malloc_align(len, HOSTED_MEM_ALIGNMENT_64); assert(*buf); double_buf.buffer[index].buf_size = len; ESP_LOGD(TAG, "buf %d size: %ld", index, double_buf.buffer[index].buf_size); @@ -681,6 +854,7 @@ static esp_err_t sdio_push_data_to_queue(uint8_t * buf, uint32_t buf_len) /* Have to drop packets in the stream as we cannot decode * them after this error */ ESP_LOGE(TAG, "Dropping packet(s) from stream"); + /* TODO: Free by caller? */ return ESP_FAIL; } /* Allocate rx buffer */ @@ -689,7 +863,8 @@ static esp_err_t sdio_push_data_to_queue(uint8_t * buf, uint32_t buf_len) packet_size = len + offset; if (packet_size > buf_len) { - ESP_LOGE(TAG, "packet size too big for remaining stream data"); + ESP_LOGE(TAG, "packet size[%lu]>[%lu] too big for remaining stream data", + packet_size, buf_len); return ESP_FAIL; } memcpy(pkt_rxbuff, buf, packet_size); @@ -713,6 +888,8 @@ static void sdio_data_to_rx_buf_task(void const* pvParameters) uint8_t * buf; uint32_t len; + ESP_LOGI(TAG, "sdio_data_to_rx_buf_task started"); + while (1) { g_h.funcs->_h_get_semaphore(sem_double_buf_xfer_data, HOSTED_BLOCK_MAX); @@ -732,9 +909,51 @@ static void sdio_data_to_rx_buf_task(void const* pvParameters) } } + +#if H_HOST_USES_STATIC_NETIF +esp_netif_t *s_netif_sta = NULL; + +esp_netif_t * create_sta_netif_with_static_ip(void) +{ + ESP_LOGI(TAG, "Create netif with static IP"); + /* Create "almost" default station, but with un-flagged DHCP client */ + esp_netif_inherent_config_t netif_cfg; + memcpy(&netif_cfg, ESP_NETIF_BASE_DEFAULT_WIFI_STA, sizeof(netif_cfg)); + netif_cfg.flags &= ~ESP_NETIF_DHCP_CLIENT; + esp_netif_config_t cfg_sta = { + .base = &netif_cfg, + .stack = ESP_NETIF_NETSTACK_DEFAULT_WIFI_STA, + }; + esp_netif_t *sta_netif = esp_netif_new(&cfg_sta); + assert(sta_netif); + + ESP_LOGI(TAG, "Creating slave sta netif with static IP"); + + ESP_ERROR_CHECK(esp_netif_attach_wifi_station(sta_netif)); + ESP_ERROR_CHECK(esp_wifi_set_default_wifi_sta_handlers()); + + /* stop dhcpc */ + ESP_ERROR_CHECK(esp_netif_dhcpc_stop(sta_netif)); + + return sta_netif; +} + +static esp_err_t create_static_netif(void) +{ + /* Only initialize networking stack if not already initialized */ + if (!s_netif_sta) { + esp_netif_init(); + esp_event_loop_create_default(); + s_netif_sta = create_sta_netif_with_static_ip(); + assert(s_netif_sta); + } + return ESP_OK; +} +#endif + static void sdio_read_task(void const* pvParameters) { - esp_err_t res; + esp_err_t res = ESP_OK; uint8_t *rxbuff = NULL; int ret; uint32_t len_from_slave; @@ -753,22 +972,18 @@ static void sdio_read_task(void const* pvParameters) // wait for transport to be in reset state while (true) { - vTaskDelay(pdMS_TO_TICKS(100)); + g_h.funcs->_h_msleep(100); if (is_transport_rx_ready()) { break; } } +#if H_HOST_USES_STATIC_NETIF + create_static_netif(); +#endif - res = g_h.funcs->_h_sdio_card_init(sdio_handle); - if (res != ESP_OK) { - ESP_LOGE(TAG, "sdio card init failed"); - return; - } - - create_debugging_tasks(); #if DO_COMBINED_REG_READ - reg_buf = MEM_ALLOC(REG_BUF_LEN); + reg_buf = g_h.funcs->_h_malloc_align(REG_BUF_LEN, HOSTED_MEM_ALIGNMENT_64); assert(reg_buf); #endif @@ -779,16 +994,18 @@ static void sdio_read_task(void const* pvParameters) ESP_LOGI(TAG, "SDIO Host operating in PACKET MODE"); #endif - ESP_LOGI(TAG, "generate slave intr"); + ESP_LOGI(TAG, "Open data path at slave"); + - // inform the slave device that we are ready sdio_generate_slave_intr(ESP_OPEN_DATA_PATH); for (;;) { // wait for sdio interrupt from slave - // call will block until there is an interrupt, timeout or error + /* call will block until there is an interrupt, timeout or error */ + ESP_LOGD(TAG, "--- Wait for SDIO intr ---"); res = g_h.funcs->_h_sdio_wait_slave_intr(sdio_handle, HOSTED_BLOCK_MAX); + ESP_LOGD(TAG, "--- SDIO intr received ---"); if (res != ESP_OK) { ESP_LOGE(TAG, "wait_slave_intr error: %d", res); @@ -802,6 +1019,8 @@ static void sdio_read_task(void const* pvParameters) ESP_LOGE(TAG, "failed to read registers"); SDIO_DRV_UNLOCK(); + ESP_LOGI(TAG, "Host is reseting itself, to avoid any sdio race condition"); + g_h.funcs->_h_restart_host(); continue; } @@ -815,6 +1034,8 @@ static void sdio_read_task(void const* pvParameters) ESP_LOGE(TAG, "failed to read interrupt register"); SDIO_DRV_UNLOCK(); + ESP_LOGI(TAG, "Host is reseting itself, to avoid any sdio race condition"); + g_h.funcs->_h_restart_host(); continue; } #endif @@ -851,10 +1072,12 @@ static void sdio_read_task(void const* pvParameters) ret = sdio_get_len_from_slave(&len_from_slave, ACQUIRE_LOCK); #endif if (ret || !len_from_slave) { - ESP_LOGD(TAG, "invalid ret or len_from_slave: %d %ld", ret, len_from_slave); + ESP_LOGW(TAG, "invalid ret or len_from_slave: %d %ld", ret, len_from_slave); SDIO_DRV_UNLOCK(); continue; + } else { + ESP_LOGD(TAG, "len_from_slave: %ld", len_from_slave); } #endif @@ -910,15 +1133,13 @@ static void sdio_read_task(void const* pvParameters) g_h.funcs->_h_post_semaphore(sem_double_buf_xfer_data); } else { // error: task to copy data to queue still running + sdio_rx_free_buffer(rxbuff); ESP_LOGE(TAG, "task still writing Rx data to queue!"); // don't send data to task, or update write_index } } } -/** - * TODO: unify sdio_process_rx_task() and spi_process_rx_task() - */ static void sdio_process_rx_task(void const* pvParameters) { interface_buffer_handle_t buf_handle_l = {0}; @@ -947,8 +1168,9 @@ static void sdio_process_rx_task(void const* pvParameters) buf_handle = &buf_handle_l; - ESP_LOGV(TAG, "h_sdio_rx: iftype:%d", (int)buf_handle->if_type); - ESP_HEXLOGV("h_sdio_rx", buf_handle->payload, min(buf_handle->payload_len,32)); + ESP_LOGV(TAG, "bus_rx: iftype:%d", (int)buf_handle->if_type); + ESP_HEXLOGV("bus_rx", buf_handle->priv_buffer_handle, + buf_handle->payload_len+H_ESP_PAYLOAD_HEADER_OFFSET, 32); if (buf_handle->if_type == ESP_SERIAL_IF) { /* serial interface path */ @@ -965,6 +1187,10 @@ static void sdio_process_rx_task(void const* pvParameters) memcpy(copy_payload, buf_handle->payload, buf_handle->payload_len); H_FREE_PTR_WITH_FUNC(buf_handle->free_buf_handle, buf_handle->priv_buffer_handle); +#if ESP_PKT_STATS + if (buf_handle->if_type == ESP_STA_IF) + pkt_stats.sta_rx_out++; +#endif ret = chan_arr[buf_handle->if_type]->rx(chan_arr[buf_handle->if_type]->api_chan, copy_payload, copy_payload, buf_handle->payload_len); if (unlikely(ret)) @@ -977,18 +1203,22 @@ static void sdio_process_rx_task(void const* pvParameters) } #endif } else if (buf_handle->if_type == ESP_PRIV_IF) { + ESP_LOGI(TAG, "Received ESP_PRIV_IF type message"); process_priv_communication(buf_handle); hci_drv_show_configuration(); /* priv transaction received */ ESP_LOGI(TAG, "Received INIT event"); - sdio_start_write_thread = true; event = (struct esp_priv_event *) (buf_handle->payload); + ESP_LOGI(TAG, "Event type: 0x%x", event->event_type); if (event->event_type != ESP_PRIV_EVENT_INIT) { /* User can re-use this type of transaction */ + ESP_LOGW(TAG, "Not an ESP_PRIV_EVENT_INIT event: 0x%x", event->event_type); } + ESP_LOGI(TAG, "Write thread started"); + sdio_start_write_thread = true; } else if (buf_handle->if_type == ESP_HCI_IF) { - hci_rx_handler(buf_handle); + hci_rx_handler(buf_handle->payload, buf_handle->payload_len); } else if (buf_handle->if_type == ESP_TEST_IF) { #if TEST_RAW_TP update_test_raw_tp_rx_len(buf_handle->payload_len + @@ -1010,19 +1240,41 @@ static void sdio_process_rx_task(void const* pvParameters) } } -void transport_init_internal(void) +void *bus_init_internal(void) { uint8_t prio_q_idx = 0; + + int tx_queue_size = DEFAULT_TO_SLAVE_QUEUE_SIZE; + int rx_queue_size = DEFAULT_FROM_SLAVE_QUEUE_SIZE; + + struct esp_hosted_sdio_config *psdio_config; + + // get queue sizes from transport config + if (ESP_TRANSPORT_OK == esp_hosted_sdio_get_config(&psdio_config)) { + tx_queue_size = psdio_config->tx_queue_size; + rx_queue_size = psdio_config->rx_queue_size; + if (!tx_queue_size) { + tx_queue_size = DEFAULT_TO_SLAVE_QUEUE_SIZE; + ESP_LOGW(TAG, "provided sdio tx queue size is zero! Setting to %d", tx_queue_size); + } + if (!rx_queue_size) { + rx_queue_size = DEFAULT_FROM_SLAVE_QUEUE_SIZE; + ESP_LOGW(TAG, "provided sdio rx queue size is zero! Setting to %d", rx_queue_size); + } + } else { + ESP_LOGW(TAG, "failed to get SDIO transport config: using default values"); + } + /* register callback */ sdio_bus_lock = g_h.funcs->_h_create_mutex(); assert(sdio_bus_lock); - sem_to_slave_queue = g_h.funcs->_h_create_semaphore(TO_SLAVE_QUEUE_SIZE*MAX_PRIORITY_QUEUES); + sem_to_slave_queue = g_h.funcs->_h_create_semaphore(tx_queue_size * MAX_PRIORITY_QUEUES); assert(sem_to_slave_queue); g_h.funcs->_h_get_semaphore(sem_to_slave_queue, 0); - sem_from_slave_queue = g_h.funcs->_h_create_semaphore(FROM_SLAVE_QUEUE_SIZE*MAX_PRIORITY_QUEUES); + sem_from_slave_queue = g_h.funcs->_h_create_semaphore(rx_queue_size * MAX_PRIORITY_QUEUES); assert(sem_from_slave_queue); g_h.funcs->_h_get_semaphore(sem_from_slave_queue, 0); @@ -1031,11 +1283,11 @@ void transport_init_internal(void) for (prio_q_idx=0; prio_q_idx_h_create_queue(FROM_SLAVE_QUEUE_SIZE, sizeof(interface_buffer_handle_t)); + from_slave_queue[prio_q_idx] = g_h.funcs->_h_create_queue(rx_queue_size, sizeof(interface_buffer_handle_t)); assert(from_slave_queue[prio_q_idx]); /* Queue - tx */ - to_slave_queue[prio_q_idx] = g_h.funcs->_h_create_queue(TO_SLAVE_QUEUE_SIZE, sizeof(interface_buffer_handle_t)); + to_slave_queue[prio_q_idx] = g_h.funcs->_h_create_queue(tx_queue_size, sizeof(interface_buffer_handle_t)); assert(to_slave_queue[prio_q_idx]); } @@ -1056,10 +1308,10 @@ void transport_init_internal(void) sem_double_buf_xfer_data = g_h.funcs->_h_create_semaphore(1); assert(sem_double_buf_xfer_data); - g_h.funcs->_h_get_semaphore(sem_double_buf_xfer_data, HOSTED_BLOCK_MAX); + g_h.funcs->_h_get_semaphore(sem_double_buf_xfer_data, 0); sdio_rx_buf_thread = g_h.funcs->_h_thread_create("sdio_rx_buf", - DFLT_TASK_PRIO, DFLT_TASK_STACK_SIZE, sdio_data_to_rx_buf_task, NULL); + DFLT_TASK_PRIO, RX_BUF_TASK_STACK_SIZE, sdio_data_to_rx_buf_task, NULL); sdio_read_thread = g_h.funcs->_h_thread_create("sdio_read", DFLT_TASK_PRIO, DFLT_TASK_STACK_SIZE, sdio_read_task, NULL); @@ -1075,35 +1327,48 @@ void transport_init_internal(void) sdio_bus_lock = g_h.funcs->_h_create_mutex(); assert(sdio_bus_lock); #endif + ESP_LOGD(TAG, "sdio bus init done"); + + return sdio_handle; } +/** + * @brief Send to slave + * @param iface_type -type of interface + * iface_num - interface number + * payload_buf - tx buffer + * payload_len - size of tx buffer + * buffer_to_free - buffer to be freed after tx + * free_buf_func - function used to free buffer_to_free + * flags - flags to set + * @retval int - ESP_OK or ESP_FAIL + */ int esp_hosted_tx(uint8_t iface_type, uint8_t iface_num, - uint8_t * wbuffer, uint16_t wlen, uint8_t buff_zcopy, - void (*free_wbuf_fun)(void* ptr)) + uint8_t *payload_buf, uint16_t payload_len, uint8_t buff_zcopy, + uint8_t *buffer_to_free, void (*free_buf_func)(void *ptr), uint8_t flags) { interface_buffer_handle_t buf_handle = {0}; void (*free_func)(void* ptr) = NULL; uint8_t pkt_prio = PRIO_Q_OTHERS; uint8_t transport_up = is_transport_tx_ready(); - if (free_wbuf_fun) - free_func = free_wbuf_fun; + if (free_buf_func) + free_func = free_buf_func; - if (!wbuffer || !wlen || - (wlen > MAX_PAYLOAD_SIZE) || - !transport_up) { + if (!payload_buf || !payload_len || (payload_len > MAX_PAYLOAD_SIZE) || !transport_up) { ESP_LOGE(TAG, "tx fail: NULL buff, invalid len (%u) or len > max len (%u), transport_up(%u))", - wlen, MAX_PAYLOAD_SIZE, transport_up); - H_FREE_PTR_WITH_FUNC(free_func, wbuffer); + payload_len, MAX_PAYLOAD_SIZE, transport_up); + H_FREE_PTR_WITH_FUNC(free_func, buffer_to_free); return ESP_FAIL; } buf_handle.payload_zcopy = buff_zcopy; buf_handle.if_type = iface_type; buf_handle.if_num = iface_num; - buf_handle.payload_len = wlen; - buf_handle.payload = wbuffer; - buf_handle.priv_buffer_handle = wbuffer; + buf_handle.payload_len = payload_len; + buf_handle.payload = payload_buf; + buf_handle.priv_buffer_handle = buffer_to_free; buf_handle.free_buf_handle = free_func; + buf_handle.flag = flags; if (buf_handle.if_type == ESP_SERIAL_IF) pkt_prio = PRIO_Q_SERIAL; @@ -1111,13 +1376,129 @@ int esp_hosted_tx(uint8_t iface_type, uint8_t iface_num, pkt_prio = PRIO_Q_BT; /* else OTHERS by default */ - g_h.funcs->_h_queue_item(to_slave_queue[pkt_prio], &buf_handle, HOSTED_BLOCK_MAX); - g_h.funcs->_h_post_semaphore(sem_to_slave_queue); - #if ESP_PKT_STATS if (buf_handle.if_type == ESP_STA_IF) pkt_stats.sta_tx_in_pass++; #endif + g_h.funcs->_h_queue_item(to_slave_queue[pkt_prio], &buf_handle, HOSTED_BLOCK_MAX); + g_h.funcs->_h_post_semaphore(sem_to_slave_queue); + + + return ESP_OK; +} + +void check_if_max_freq_used(uint8_t chip_type) +{ +#ifdef CONFIG_IDF_TARGET + if (H_SDIO_CLOCK_FREQ_KHZ < 40000) { + ESP_LOGW(TAG, "SDIO clock freq set to [%u]KHz, Max possible (on PCB) is 40000KHz", H_SDIO_CLOCK_FREQ_KHZ); + } +#else + if (H_SDIO_CLOCK_FREQ_KHZ < 50000) { + ESP_LOGW(TAG, "SDIO clock freq set to [%u]KHz, Max possible (on PCB) is 50000KHz", H_SDIO_CLOCK_FREQ_KHZ); + } +#endif +} + + +static esp_err_t transport_card_init(void *bus_handle) +{ + return g_h.funcs->_h_sdio_card_init(bus_handle); +} + +static esp_err_t transport_gpio_reset(void *bus_handle, gpio_pin_t reset_pin) +{ + g_h.funcs->_h_config_gpio(reset_pin.port, reset_pin.pin, H_GPIO_MODE_DEF_OUTPUT); + g_h.funcs->_h_write_gpio(reset_pin.port, reset_pin.pin, H_RESET_VAL_ACTIVE); + g_h.funcs->_h_msleep(1); + g_h.funcs->_h_write_gpio(reset_pin.port, reset_pin.pin, H_RESET_VAL_INACTIVE); + g_h.funcs->_h_msleep(1); + g_h.funcs->_h_write_gpio(reset_pin.port, reset_pin.pin, H_RESET_VAL_ACTIVE); + g_h.funcs->_h_msleep(1200); return ESP_OK; } + +int ensure_slave_bus_ready(void *bus_handle) +{ + int res = -1; + gpio_pin_t reset_pin = { .port = H_GPIO_PORT_RESET, .pin = H_GPIO_PIN_RESET }; + + if (ESP_TRANSPORT_OK != esp_hosted_transport_get_reset_config(&reset_pin)) { + ESP_LOGE(TAG, "Unable to get RESET config for transport"); + return -1; + } + + assert(reset_pin.pin != -1); + + release_slave_reset_gpio_post_wakeup(); + +#if H_SLAVE_RESET_ONLY_IF_NECESSARY + { + /* Reset will be done later if needed during communication initialization */ + res = transport_card_init(bus_handle); + if (res) { + ESP_LOGE(TAG, "card init failed"); + } else { + ESP_LOGI(TAG, "Card init success, TRANSPORT_RX_ACTIVE"); + set_transport_state(TRANSPORT_RX_ACTIVE); + return 0; + } + + /* Give a chance to reset and recover the slave */ + if (res) { + ESP_LOGI(TAG, "Attempt slave reset"); + transport_gpio_reset(bus_handle, reset_pin); + } + + res = transport_card_init(bus_handle); + if (res) { + ESP_LOGE(TAG, "card init failed even after slave reset"); + } else { + ESP_LOGI(TAG, "Card init success"); + set_transport_state(TRANSPORT_RX_ACTIVE); + return 0; + } + } +#else /* H_RESET_ON_EVERY_BOOTUP */ + if (esp_hosted_woke_from_power_save()) { + ESP_LOGI(TAG, "Host woke up from power save"); + + g_h.funcs->_h_msleep(500); + set_transport_state(TRANSPORT_RX_ACTIVE); + + res = transport_card_init(bus_handle); + if (res) { + ESP_LOGE(TAG, "card init failed"); + } else { + ESP_LOGI(TAG, "Card init success, TRANSPORT_RX_ACTIVE"); + stop_host_power_save(); + } + } else { + /* Always reset slave on host bootup */ + ESP_LOGW(TAG, "Reset slave using GPIO[%u]", reset_pin.pin); + transport_gpio_reset(bus_handle, reset_pin); + + res = transport_card_init(bus_handle); + if (res) { + ESP_LOGE(TAG, "card init failed"); + } else { + ESP_LOGI(TAG, "Card init success, TRANSPORT_RX_ACTIVE"); + set_transport_state(TRANSPORT_RX_ACTIVE); + } + } +#endif + return res; +} + +int bus_inform_slave_host_power_save_start(void) +{ + ESP_LOGI(TAG, "Inform slave, host power save is started"); + return sdio_generate_slave_intr(ESP_POWER_SAVE_ON); +} + +int bus_inform_slave_host_power_save_stop(void) +{ + ESP_LOGI(TAG, "Inform slave, host power save is stopped"); + return sdio_generate_slave_intr(ESP_POWER_SAVE_OFF); +} diff --git a/host/drivers/transport/sdio/sdio_drv.h b/host/drivers/transport/sdio/sdio_drv.h index 8de0d970..58bed27b 100644 --- a/host/drivers/transport/sdio/sdio_drv.h +++ b/host/drivers/transport/sdio/sdio_drv.h @@ -1,24 +1,14 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2023 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /** prevent recursive inclusion **/ #ifndef __SDIO_DRV_H #define __SDIO_DRV_H /** Includes **/ -#include "common.h" /** Constants/Macros **/ diff --git a/host/drivers/transport/sdio/sdio_reg.h b/host/drivers/transport/sdio/sdio_reg.h index 45e8c01a..3fb8b7cf 100644 --- a/host/drivers/transport/sdio/sdio_reg.h +++ b/host/drivers/transport/sdio/sdio_reg.h @@ -1,28 +1,14 @@ -// SPDX-License-Identifier: Apache-2.0 /* - * Espressif Systems Wireless LAN device driver + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * - * Copyright (C) 2015-2023 Espressif Systems (Shanghai) PTE LTD - * - * This software file (the "File") is distributed by Espressif Systems (Shanghai) - * PTE LTD under the terms of the GNU General Public License Version 2, June 1991 - * (the "License"). You may use, redistribute and/or modify this File in - * accordance with the terms and conditions of the License, a copy of which - * is available by writing to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the - * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. - * - * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE - * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE - * ARE EXPRESSLY DISCLAIMED. The License provides additional details about - * this warranty disclaimer. + * SPDX-License-Identifier: Apache-2.0 */ #ifndef __SDIO_REG_H #define __SDIO_REG_H /** Includes **/ -#include "common.h" +#include "port_esp_hosted_host_config.h" /** constants/macros **/ #define SD_IO_CCCR_FN_ENABLE 0x02 @@ -69,7 +55,7 @@ #define ESP_HOST_INT_ENA_REG (ESP_SLAVE_SLCHOST_BASE + 0xDC) /* Host side interrupts for ESP_HOST_INT_ENA_REG */ -#if H_SLAVE_TARGET_ESP32 || H_SLAVE_TARGET_ESP32C6 +#if H_SLAVE_TARGET_ESP32 || H_SLAVE_TARGET_ESP32C6 || H_SLAVE_TARGET_ESP32C5 || H_SLAVE_TARGET_ESP32C61 #define SDIO_INT_NEW_PACKET (23) #define SDIO_INT_START_THROTTLE (7) #define SDIO_INT_STOP_THROTTLE (6) diff --git a/host/drivers/transport/spi/spi_drv.c b/host/drivers/transport/spi/spi_drv.c index 8e3751a1..d3eaaa05 100644 --- a/host/drivers/transport/spi/spi_drv.c +++ b/host/drivers/transport/spi/spi_drv.c @@ -1,41 +1,32 @@ -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "mempool.h" -#include "common.h" -#include "esp_hosted_config.h" -//#include "netdev_if.h" #include "transport_drv.h" #include "spi_drv.h" #include "serial_drv.h" #include "esp_hosted_transport.h" -#include "esp_log.h" #include "esp_hosted_log.h" #include "stats.h" #include "hci_drv.h" #include "endian.h" +#include "power_save_drv.h" +#include "esp_hosted_power_save.h" +#include "esp_hosted_transport_config.h" +#include "esp_hosted_bt.h" +#include "port_esp_hosted_host_config.h" +#include "port_esp_hosted_host_log.h" +#include "port_esp_hosted_host_os.h" DEFINE_LOG_TAG(spi); void * spi_handle = NULL; semaphore_handle_t spi_trans_ready_sem; - -#if DEBUG_HOST_TX_SEMAPHORE -#define H_DEBUG_GPIO_PIN_Host_Tx_Port NULL -#define H_DEBUG_GPIO_PIN_Host_Tx_Pin -1 -#endif +static volatile uint8_t dr_isr_triggered = 0; static uint8_t schedule_dummy_rx = 0; @@ -65,6 +56,48 @@ static void spi_transaction_task(void const* pvParameters); static void spi_process_rx_task(void const* pvParameters); static uint8_t * get_next_tx_buffer(uint8_t *is_valid_tx_buf, void (**free_func)(void* ptr)); +#if H_HOST_USES_STATIC_NETIF +/* Netif creation is now handled by the example code */ +esp_netif_t *s_netif_sta = NULL; + +esp_netif_t * create_sta_netif_with_static_ip(void) +{ + ESP_LOGI(TAG, "Create netif with static IP"); + /* Create "almost" default station, but with un-flagged DHCP client */ + esp_netif_inherent_config_t netif_cfg; + memcpy(&netif_cfg, ESP_NETIF_BASE_DEFAULT_WIFI_STA, sizeof(netif_cfg)); + netif_cfg.flags &= ~ESP_NETIF_DHCP_CLIENT; + esp_netif_config_t cfg_sta = { + .base = &netif_cfg, + .stack = ESP_NETIF_NETSTACK_DEFAULT_WIFI_STA, + }; + esp_netif_t *sta_netif = esp_netif_new(&cfg_sta); + assert(sta_netif); + + ESP_LOGI(TAG, "Creating slave sta netif with static IP"); + + ESP_ERROR_CHECK(esp_netif_attach_wifi_station(sta_netif)); + ESP_ERROR_CHECK(esp_wifi_set_default_wifi_sta_handlers()); + + /* stop dhcpc */ + ESP_ERROR_CHECK(esp_netif_dhcpc_stop(sta_netif)); + + return sta_netif; +} + +static esp_err_t create_static_netif(void) +{ + /* Only initialize networking stack if not already initialized */ + if (!s_netif_sta) { + esp_netif_init(); + esp_event_loop_create_default(); + s_netif_sta = create_sta_netif_with_static_ip(); + assert(s_netif_sta); + } + return ESP_OK; +} +#endif + static inline void spi_mempool_create(void) { MEM_DUMP("spi_mempool_create"); @@ -116,12 +149,85 @@ This ISR is called when the handshake or data_ready line goes high. static void FAST_RAM_ATTR gpio_dr_isr_handler(void* arg) { g_h.funcs->_h_post_semaphore_from_isr(spi_trans_ready_sem); + dr_isr_triggered = 1; ESP_EARLY_LOGV(TAG, "%s", __func__); } -void transport_deinit_internal(void) +void bus_deinit_internal(void *bus_handle) { - /* TODO */ + if (!bus_handle) { + ESP_LOGE(TAG, "Invalid bus handle for deinit"); + return; + } + + ESP_LOGI(TAG, "Deinitializing SPI bus"); + + /* Disable interrupts first */ + if (H_GPIO_HANDSHAKE_Pin != -1) { + g_h.funcs->_h_teardown_gpio_interrupt(H_GPIO_HANDSHAKE_Port, H_GPIO_HANDSHAKE_Pin); + } + + if (H_GPIO_DATA_READY_Pin != -1) { + g_h.funcs->_h_teardown_gpio_interrupt(H_GPIO_DATA_READY_Port, H_GPIO_DATA_READY_Pin); + } + + /* Delete threads */ + if (spi_transaction_thread) { + g_h.funcs->_h_thread_cancel(spi_transaction_thread); + spi_transaction_thread = NULL; + } + + if (spi_rx_thread) { + g_h.funcs->_h_thread_cancel(spi_rx_thread); + spi_rx_thread = NULL; + } + + /* Deinitialize SPI bus through platform-specific handler */ + if (spi_handle) { + g_h.funcs->_h_bus_deinit(bus_handle); + spi_handle = NULL; + } + + /* Delete semaphores */ + if (spi_trans_ready_sem) { + g_h.funcs->_h_destroy_semaphore(spi_trans_ready_sem); + spi_trans_ready_sem = NULL; + } + + /* Destroy memory pool */ + spi_mempool_destroy(); + + /* Delete queues */ + for (uint8_t prio_q_idx = 0; prio_q_idx < MAX_PRIORITY_QUEUES; prio_q_idx++) { + if (from_slave_queue[prio_q_idx]) { + g_h.funcs->_h_destroy_queue(from_slave_queue[prio_q_idx]); + from_slave_queue[prio_q_idx] = NULL; + } + + if (to_slave_queue[prio_q_idx]) { + g_h.funcs->_h_destroy_queue(to_slave_queue[prio_q_idx]); + to_slave_queue[prio_q_idx] = NULL; + } + } + + /* Delete semaphores for queues */ + if (sem_from_slave_queue) { + g_h.funcs->_h_destroy_semaphore(sem_from_slave_queue); + sem_from_slave_queue = NULL; + } + + if (sem_to_slave_queue) { + g_h.funcs->_h_destroy_semaphore(sem_to_slave_queue); + sem_to_slave_queue = NULL; + } + + /* Delete mutex */ + if (spi_bus_lock) { + g_h.funcs->_h_destroy_mutex(spi_bus_lock); + spi_bus_lock = NULL; + } + + ESP_LOGI(TAG, "SPI bus deinitialized"); } /** @@ -129,7 +235,7 @@ void transport_deinit_internal(void) * @param transport_evt_handler_fp - event handler * @retval None */ -void transport_init_internal(void) +void *bus_init_internal(void) { uint8_t prio_q_idx; @@ -139,8 +245,10 @@ void transport_init_internal(void) sem_to_slave_queue = g_h.funcs->_h_create_semaphore(TO_SLAVE_QUEUE_SIZE*MAX_PRIORITY_QUEUES); assert(sem_to_slave_queue); + g_h.funcs->_h_get_semaphore(sem_to_slave_queue, 0); sem_from_slave_queue = g_h.funcs->_h_create_semaphore(FROM_SLAVE_QUEUE_SIZE*MAX_PRIORITY_QUEUES); assert(sem_from_slave_queue); + g_h.funcs->_h_get_semaphore(sem_from_slave_queue, 0); for (prio_q_idx=0; prio_q_idx_h_create_semaphore(1); assert(spi_trans_ready_sem); + g_h.funcs->_h_get_semaphore(spi_trans_ready_sem, 0); spi_handle = g_h.funcs->_h_bus_init(); if (!spi_handle) { @@ -173,6 +282,8 @@ void transport_init_internal(void) spi_rx_thread = g_h.funcs->_h_thread_create("spi_rx", DFLT_TASK_PRIO, DFLT_TASK_STACK_SIZE, spi_process_rx_task, NULL); assert(spi_rx_thread); + + return spi_handle; } @@ -186,30 +297,37 @@ void transport_init_internal(void) */ static int process_spi_rx_buf(uint8_t * rxbuff) { - struct esp_payload_header *payload_header; + struct esp_payload_header *h; uint16_t rx_checksum = 0, checksum = 0; interface_buffer_handle_t buf_handle = {0}; uint16_t len, offset; int ret = 0; uint8_t pkt_prio = PRIO_Q_OTHERS; + uint8_t is_wakeup_pkt = 0; if (!rxbuff) return -1; - ESP_HEXLOGV("h_spi_rx", rxbuff, 16); + ESP_HEXLOGD("h_spi_rx", rxbuff, 32, 32); /* create buffer rx handle, used for processing */ - payload_header = (struct esp_payload_header *) rxbuff; + h = (struct esp_payload_header *) rxbuff; /* Fetch length and offset from payload header */ - len = le16toh(payload_header->len); - offset = le16toh(payload_header->offset); + len = le16toh(h->len); + offset = le16toh(h->offset); + is_wakeup_pkt = h->flags & FLAG_WAKEUP_PKT; - if (ESP_MAX_IF == payload_header->if_type) + if (is_wakeup_pkt && len<1500) { + ESP_LOGW(TAG, "Host wakeup triggered, if_type: %u, len: %u ", h->if_type, len); + //ESP_HEXLOGW("Wakeup_pkt", rxbuff+offset, len, H_MIN(len, 128)); + } + + if (ESP_MAX_IF == h->if_type) schedule_dummy_rx = 0; if (!len) { - wifi_tx_throttling = payload_header->throttle_cmd; + wifi_tx_throttling = h->throttle_cmd; ret = -5; goto done; } @@ -228,8 +346,9 @@ static int process_spi_rx_buf(uint8_t * rxbuff) goto done; } else { - rx_checksum = le16toh(payload_header->checksum); - payload_header->checksum = 0; + dr_isr_triggered = 0; + rx_checksum = le16toh(h->checksum); + h->checksum = 0; checksum = compute_checksum(rxbuff, len+offset); //TODO: checksum needs to be configurable from menuconfig @@ -237,12 +356,12 @@ static int process_spi_rx_buf(uint8_t * rxbuff) buf_handle.priv_buffer_handle = rxbuff; buf_handle.free_buf_handle = spi_buffer_free; buf_handle.payload_len = len; - buf_handle.if_type = payload_header->if_type; - buf_handle.if_num = payload_header->if_num; + buf_handle.if_type = h->if_type; + buf_handle.if_num = h->if_num; buf_handle.payload = rxbuff + offset; - buf_handle.seq_num = le16toh(payload_header->seq_num); - buf_handle.flag = payload_header->flags; - wifi_tx_throttling = payload_header->throttle_cmd; + buf_handle.seq_num = le16toh(h->seq_num); + buf_handle.flag = h->flags; + wifi_tx_throttling = h->throttle_cmd; #if 0 #if CONFIG_H_LOWER_MEMCOPY if ((buf_handle.if_type == ESP_STA_IF) || @@ -309,12 +428,14 @@ static int check_and_execute_spi_transaction(void) gpio_rx_data_ready = g_h.funcs->_h_read_gpio(H_GPIO_DATA_READY_Port, H_GPIO_DATA_READY_Pin); + uint8_t data_ready_active = (gpio_rx_data_ready == H_DR_VAL_ACTIVE) || dr_isr_triggered; + if (gpio_handshake == H_HS_VAL_ACTIVE) { /* Get next tx buffer to be sent */ txbuff = get_next_tx_buffer(&is_valid_tx_buf, &tx_buff_free_func); - if ( (gpio_rx_data_ready == H_DR_VAL_ACTIVE) || + if ( (data_ready_active) || (is_valid_tx_buf) || schedule_dummy_tx || schedule_dummy_rx ) { if (!txbuff) { @@ -333,10 +454,10 @@ static int check_and_execute_spi_transaction(void) schedule_dummy_tx = 0; } else { schedule_dummy_tx = 1; - ESP_HEXLOGV("h_spi_tx", txbuff, 16); + ESP_HEXLOGD("h_spi_tx", txbuff, 32, 32); } - ESP_LOGV(TAG, "dr %u tx_valid %u\n", gpio_rx_data_ready, is_valid_tx_buf); + ESP_LOGD(TAG, "dr %u tx_valid %u\n", gpio_rx_data_ready, is_valid_tx_buf); /* Allocate rx buffer */ rxbuff = spi_buffer_alloc(MEMSET_REQUIRED); assert(rxbuff); @@ -384,43 +505,46 @@ static int check_and_execute_spi_transaction(void) return ret; } - - /** * @brief Send to slave via SPI * @param iface_type -type of interface * iface_num - interface number - * wbuffer - tx buffer - * wlen - size of wbuffer - * @retval sendbuf - Tx buffer + * payload_buf - tx buffer + * payload_len - size of tx buffer + * buffer_to_free - buffer to be freed after tx + * free_buf_func - function used to free buffer_to_free + * flags - flags to set + * @retval int - STM_PASS or STM_FAIL */ int esp_hosted_tx(uint8_t iface_type, uint8_t iface_num, - uint8_t * wbuffer, uint16_t wlen, uint8_t buff_zcopy, void (*free_wbuf_fun)(void* ptr)) + uint8_t *payload_buf, uint16_t payload_len, uint8_t buff_zcopy, + uint8_t *buffer_to_free, void (*free_buf_func)(void *ptr), uint8_t flags) { interface_buffer_handle_t buf_handle = {0}; void (*free_func)(void* ptr) = NULL; - uint8_t transport_up = is_transport_tx_ready(); uint8_t pkt_prio = PRIO_Q_OTHERS; - if (free_wbuf_fun) - free_func = free_wbuf_fun; + if (free_buf_func) + free_func = free_buf_func; - if (!wbuffer || !wlen || (wlen > MAX_PAYLOAD_SIZE) || !transport_up) { - ESP_LOGE(TAG, "write fail: trans_ready[%u] buff(%p) 0? OR (0 MAX_PAYLOAD_SIZE))) { + ESP_LOGE(TAG, "write fail: buff(%p) 0? OR (0_h_memset(&buf_handle, 0, sizeof(buf_handle)); buf_handle.payload_zcopy = buff_zcopy; buf_handle.if_type = iface_type; buf_handle.if_num = iface_num; - buf_handle.payload_len = wlen; - buf_handle.payload = wbuffer; - buf_handle.priv_buffer_handle = wbuffer; + buf_handle.payload_len = payload_len; + buf_handle.payload = payload_buf; + buf_handle.priv_buffer_handle = buffer_to_free; buf_handle.free_buf_handle = free_func; + buf_handle.flag = flags; - ESP_LOGV(TAG, "ifype: %u wbuff:%p, free: %p wlen:%u ", iface_type, wbuffer, free_func, wlen); + ESP_LOGV(TAG, "ifype: %u wbuff:%p, free: %p wlen:%u flag:%u", iface_type, payload_buf, free_func, payload_len, flags); if (buf_handle.if_type == ESP_SERIAL_IF) pkt_prio = PRIO_Q_SERIAL; @@ -436,13 +560,9 @@ int esp_hosted_tx(uint8_t iface_type, uint8_t iface_num, pkt_stats.sta_tx_in_pass++; #endif -#if DEBUG_HOST_TX_SEMAPHORE - if (H_DEBUG_GPIO_PIN_Host_Tx_Pin != -1) - g_h.funcs->_h_write_gpio(H_DEBUG_GPIO_PIN_Host_Tx_Port, H_DEBUG_GPIO_PIN_Host_Tx_Pin, H_GPIO_HIGH); -#endif g_h.funcs->_h_post_semaphore(spi_trans_ready_sem); - return STM_OK; + return 0; } @@ -456,18 +576,18 @@ int esp_hosted_tx(uint8_t iface_type, uint8_t iface_num, */ static void spi_transaction_task(void const* pvParameters) { - - ESP_LOGD(TAG, "Staring SPI task"); -#if DEBUG_HOST_TX_SEMAPHORE - if (H_DEBUG_GPIO_PIN_Host_Tx_Pin != -1) - g_h.funcs->_h_config_gpio(H_DEBUG_GPIO_PIN_Host_Tx_Port, H_DEBUG_GPIO_PIN_Host_Tx_Pin, H_GPIO_MODE_DEF_OUTPUT); + /* Netif creation is now handled by the example code */ +#if H_HOST_USES_STATIC_NETIF + create_static_netif(); #endif + ESP_LOGI(TAG, "Staring SPI task"); + g_h.funcs->_h_config_gpio_as_interrupt(H_GPIO_HANDSHAKE_Port, H_GPIO_HANDSHAKE_Pin, - H_HS_INTR_EDGE, gpio_hs_isr_handler); + H_HS_INTR_EDGE, gpio_hs_isr_handler, NULL); g_h.funcs->_h_config_gpio_as_interrupt(H_GPIO_DATA_READY_Port, H_GPIO_DATA_READY_Pin, - H_DR_INTR_EDGE, gpio_dr_isr_handler); + H_DR_INTR_EDGE, gpio_dr_isr_handler, NULL); #if !H_HANDSHAKE_ACTIVE_HIGH ESP_LOGI(TAG, "Handshake: Active Low"); @@ -478,13 +598,11 @@ static void spi_transaction_task(void const* pvParameters) ESP_LOGD(TAG, "SPI GPIOs configured"); - create_debugging_tasks(); - for (;;) { if ((!is_transport_rx_ready()) || (!spi_trans_ready_sem)) { - g_h.funcs->_h_msleep(300); + g_h.funcs->_h_msleep(100); continue; } @@ -493,12 +611,7 @@ static void spi_transaction_task(void const* pvParameters) * on Either Data ready and Handshake pin */ - if (!g_h.funcs->_h_get_semaphore(spi_trans_ready_sem, HOSTED_BLOCK_MAX)) { -#if DEBUG_HOST_TX_SEMAPHORE - if (H_DEBUG_GPIO_PIN_Host_Tx_Pin != -1) - g_h.funcs->_h_write_gpio(H_DEBUG_GPIO_PIN_Host_Tx_Port, H_DEBUG_GPIO_PIN_Host_Tx_Pin, H_GPIO_LOW); -#endif - + if (g_h.funcs->_h_get_semaphore(spi_trans_ready_sem, HOSTED_BLOCK_MAX) == SUCCESS) { check_and_execute_spi_transaction(); } } @@ -533,6 +646,7 @@ static void spi_process_rx_task(void const* pvParameters) /* process received buffer for all possible interface types */ if (buf_handle->if_type == ESP_SERIAL_IF) { + schedule_dummy_rx = 1; /* serial interface path */ serial_rx_handler(buf_handle); @@ -570,7 +684,7 @@ static void spi_process_rx_task(void const* pvParameters) /* User can re-use this type of transaction */ } } else if (buf_handle->if_type == ESP_HCI_IF) { - hci_rx_handler(buf_handle); + hci_rx_handler(buf_handle->payload, buf_handle->payload_len); } else if (buf_handle->if_type == ESP_TEST_IF) { #if TEST_RAW_TP update_test_raw_tp_rx_len(buf_handle->payload_len+H_ESP_PAYLOAD_HEADER_OFFSET); @@ -578,6 +692,12 @@ static void spi_process_rx_task(void const* pvParameters) } else { ESP_LOGW(TAG, "unknown type %d ", buf_handle->if_type); } + +#if ESP_PKT_STATS + if (buf_handle->if_type == ESP_STA_IF) + pkt_stats.sta_rx_out++; +#endif + /* Free buffer handle */ /* When buffer offloaded to other module, that module is * responsible for freeing buffer. In case not offloaded or @@ -636,9 +756,14 @@ static uint8_t * get_next_tx_buffer(uint8_t *is_valid_tx_buf, void (**free_func) len = buf_handle.payload_len; } - if (len) { + if (buf_handle.flag || len) { + /* Continue transfer if flag or buffer is valid */ + *is_valid_tx_buf = 1; + } + + if (*is_valid_tx_buf) { - ESP_HEXLOGD("h_spi_tx", buf_handle.payload, 16); + ESP_HEXLOGD("h_spi_tx", buf_handle.payload, len, 16); if (!buf_handle.payload_zcopy) { sendbuf = spi_buffer_alloc(MEMSET_REQUIRED); @@ -658,10 +783,6 @@ static uint8_t * get_next_tx_buffer(uint8_t *is_valid_tx_buf, void (**free_func) goto done; } - //g_h.funcs->_h_memset(sendbuf, 0, MAX_SPI_BUFFER_SIZE); - - *is_valid_tx_buf = 1; - /* Form Tx header */ payload_header = (struct esp_payload_header *) sendbuf; payload = sendbuf + sizeof(struct esp_payload_header); @@ -669,6 +790,7 @@ static uint8_t * get_next_tx_buffer(uint8_t *is_valid_tx_buf, void (**free_func) payload_header->offset = htole16(sizeof(struct esp_payload_header)); payload_header->if_type = buf_handle.if_type; payload_header->if_num = buf_handle.if_num; + payload_header->flags = buf_handle.flag; if (payload_header->if_type == ESP_HCI_IF) { // special handling for HCI @@ -680,9 +802,11 @@ static uint8_t * get_next_tx_buffer(uint8_t *is_valid_tx_buf, void (**free_func) payload_header->len = htole16(len); g_h.funcs->_h_memcpy(payload, &buf_handle.payload[1], len); } - } else - if (!buf_handle.payload_zcopy) - g_h.funcs->_h_memcpy(payload, buf_handle.payload, min(len, MAX_PAYLOAD_SIZE)); + } else { + /* Non HCI packets */ + if (!buf_handle.payload_zcopy && len) + g_h.funcs->_h_memcpy(payload, buf_handle.payload, H_MIN(len, MAX_PAYLOAD_SIZE)); + } //TODO: checksum should be configurable from menuconfig payload_header->checksum = htole16(compute_checksum(sendbuf, @@ -705,3 +829,180 @@ static uint8_t * get_next_tx_buffer(uint8_t *is_valid_tx_buf, void (**free_func) return sendbuf; } + +void check_if_max_freq_used(uint8_t chip_type) +{ + switch (chip_type) { + case ESP_PRIV_FIRMWARE_CHIP_ESP32: + if (H_SPI_FD_CLK_MHZ < 10) { + ESP_LOGW(TAG, "SPI FD clock in-use: [%u]MHz. Can optimize in 1MHz steps till Max[%u]MHz", H_SPI_FD_CLK_MHZ, 10); + } + break; + case ESP_PRIV_FIRMWARE_CHIP_ESP32S3: + case ESP_PRIV_FIRMWARE_CHIP_ESP32S2: + case ESP_PRIV_FIRMWARE_CHIP_ESP32C3: + case ESP_PRIV_FIRMWARE_CHIP_ESP32C2: + case ESP_PRIV_FIRMWARE_CHIP_ESP32C6: + case ESP_PRIV_FIRMWARE_CHIP_ESP32C5: + if (H_SPI_FD_CLK_MHZ < 40) { + ESP_LOGW(TAG, "SPI FDclock in-use: [%u]MHz. Can optimize in 1MHz steps till Max[%u]MHz", H_SPI_FD_CLK_MHZ, 40); + } + break; + } +} +static esp_err_t transport_gpio_reset(void *bus_handle, gpio_pin_t reset_pin) +{ + ESP_LOGI(TAG, "Resetting slave on SPI bus with pin %d", reset_pin.pin); + g_h.funcs->_h_config_gpio(reset_pin.port, reset_pin.pin, H_GPIO_MODE_DEF_OUTPUT); + g_h.funcs->_h_write_gpio(reset_pin.port, reset_pin.pin, H_RESET_VAL_ACTIVE); + g_h.funcs->_h_msleep(1); + g_h.funcs->_h_write_gpio(reset_pin.port, reset_pin.pin, H_RESET_VAL_INACTIVE); + g_h.funcs->_h_msleep(1); + g_h.funcs->_h_write_gpio(reset_pin.port, reset_pin.pin, H_RESET_VAL_ACTIVE); + /* Delay for a short while to allow co-processor to take control + * of GPIO signals after reset. Otherwise, we may false detect on + * the GPIOs going high during the reset. + */ + g_h.funcs->_h_msleep(500); + return ESP_OK; +} + +int ensure_slave_bus_ready(void *bus_handle) +{ + esp_err_t res = ESP_OK; + gpio_pin_t reset_pin = { .port = H_GPIO_PORT_RESET, .pin = H_GPIO_PIN_RESET }; + + if (ESP_TRANSPORT_OK != esp_hosted_transport_get_reset_config(&reset_pin)) { + ESP_LOGE(TAG, "Unable to get RESET config for transport"); + return ESP_FAIL; + } + + assert(reset_pin.pin != -1); + + release_slave_reset_gpio_post_wakeup(); + + if (esp_hosted_woke_from_power_save()) { + stop_host_power_save(); + } else { + ESP_LOGI(TAG, "Reseting slave"); + transport_gpio_reset(bus_handle, reset_pin); + } + + return res; +} + +int bus_inform_slave_host_power_save_start(void) +{ + ESP_LOGI(TAG, "Inform slave, host power save is started"); + int ret = ESP_OK; + + /* + * If the transport is not ready yet (which happens before receiving INIT event), + * we need to send the power save message directly to avoid deadlock. + * Otherwise, use the normal queue mechanism. + */ + if (!is_transport_rx_ready()) { + uint8_t *txbuff = NULL; + uint8_t *rxbuff = NULL; + struct esp_payload_header *h = NULL; + struct hosted_transport_context_t spi_trans = {0}; + + ESP_LOGI(TAG, "Sending power save start message directly"); + + /* Create tx buffer with power save flag */ + txbuff = spi_buffer_alloc(MEMSET_REQUIRED); + assert(txbuff); + + h = (struct esp_payload_header *) txbuff; + h->if_type = ESP_SERIAL_IF; + h->if_num = 0; + h->len = htole16(0); + h->offset = htole16(sizeof(struct esp_payload_header)); + h->seq_num = htole16(0); + h->flags = FLAG_POWER_SAVE_STARTED; + + /* Allocate rx buffer for transaction */ + rxbuff = spi_buffer_alloc(MEMSET_REQUIRED); + assert(rxbuff); + + /* Set up SPI transaction */ + spi_trans.tx_buf = txbuff; + spi_trans.tx_buf_size = MAX_SPI_BUFFER_SIZE; + spi_trans.rx_buf = rxbuff; + + /* Execute direct SPI transaction - bypass all queues */ + g_h.funcs->_h_lock_mutex(spi_bus_lock, HOSTED_BLOCK_MAX); + ret = g_h.funcs->_h_do_bus_transfer(&spi_trans); + g_h.funcs->_h_unlock_mutex(spi_bus_lock); + + /* Free buffers */ + spi_buffer_free(txbuff); + if (!ret) { + process_spi_rx_buf(spi_trans.rx_buf); + } + } else { + /* Use normal queue mechanism */ + ret = esp_hosted_tx(ESP_SERIAL_IF, 0, NULL, 0, + H_BUFF_NO_ZEROCOPY, NULL, NULL, FLAG_POWER_SAVE_STARTED); + } + + return ret; +} + +int bus_inform_slave_host_power_save_stop(void) +{ + ESP_LOGI(TAG, "Inform slave, host power save is stopped"); + int ret = ESP_OK; + + /* + * If the transport is not ready yet (which happens before receiving INIT event), + * we need to send the power save message directly to avoid deadlock. + * Otherwise, use the normal queue mechanism. + */ + if (!is_transport_rx_ready()) { + uint8_t *txbuff = NULL; + uint8_t *rxbuff = NULL; + struct esp_payload_header *h = NULL; + struct hosted_transport_context_t spi_trans = {0}; + + ESP_LOGI(TAG, "Sending power save stop message directly"); + + /* Create tx buffer with power save flag */ + txbuff = spi_buffer_alloc(MEMSET_REQUIRED); + assert(txbuff); + + h = (struct esp_payload_header *) txbuff; + h->if_type = ESP_SERIAL_IF; + h->if_num = 0; + h->len = htole16(0); + h->offset = htole16(sizeof(struct esp_payload_header)); + h->seq_num = htole16(0); + h->flags = FLAG_POWER_SAVE_STOPPED; + + /* Allocate rx buffer for transaction */ + rxbuff = spi_buffer_alloc(MEMSET_REQUIRED); + assert(rxbuff); + + /* Set up SPI transaction */ + spi_trans.tx_buf = txbuff; + spi_trans.tx_buf_size = MAX_SPI_BUFFER_SIZE; + spi_trans.rx_buf = rxbuff; + + /* Execute direct SPI transaction - bypass all queues */ + g_h.funcs->_h_lock_mutex(spi_bus_lock, HOSTED_BLOCK_MAX); + ret = g_h.funcs->_h_do_bus_transfer(&spi_trans); + g_h.funcs->_h_unlock_mutex(spi_bus_lock); + + /* Free buffers */ + spi_buffer_free(txbuff); + if (!ret) { + process_spi_rx_buf(spi_trans.rx_buf); + } + } else { + /* Use normal queue mechanism */ + ret = esp_hosted_tx(ESP_SERIAL_IF, 0, NULL, 0, + H_BUFF_NO_ZEROCOPY, NULL, NULL, FLAG_POWER_SAVE_STOPPED); + } + + return ret; +} diff --git a/host/drivers/transport/spi/spi_drv.h b/host/drivers/transport/spi/spi_drv.h index 54b9b539..29b6c1d0 100644 --- a/host/drivers/transport/spi/spi_drv.h +++ b/host/drivers/transport/spi/spi_drv.h @@ -1,17 +1,8 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /** prevent recursive inclusion **/ #ifndef __SPI_DRV_H @@ -22,10 +13,7 @@ extern "C" { #endif /** Includes **/ -#include "common.h" #include "transport_drv.h" -#include "os_wrapper.h" - /** Constants/Macros **/ #define TO_SLAVE_QUEUE_SIZE 20 @@ -44,4 +32,3 @@ extern "C" { #endif #endif - diff --git a/host/drivers/transport/spi_hd/spi_hd_drv.c b/host/drivers/transport/spi_hd/spi_hd_drv.c index e51b9e0b..bf01432a 100644 --- a/host/drivers/transport/spi_hd/spi_hd_drv.c +++ b/host/drivers/transport/spi_hd/spi_hd_drv.c @@ -1,17 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2024 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /** Includes **/ @@ -26,9 +18,15 @@ #include "transport_drv.h" #include "spi_hd_drv.h" -#include "esp_hosted_config.h" +#include "port_esp_hosted_host_config.h" #include "esp_hosted_log.h" +#include "power_save_drv.h" +#include "esp_hosted_power_save.h" +#include "esp_hosted_transport_config.h" +#include "esp_hosted_bt.h" +#include "port_esp_hosted_host_os.h" + static const char TAG[] = "H_SPI_HD_DRV"; // this locks the spi_hd transaction at the driver level, instead of at the HAL layer @@ -104,7 +102,7 @@ static void spi_hd_read_task(void const* pvParameters); static void spi_hd_process_rx_task(void const* pvParameters); static int update_flow_ctrl(uint8_t *rxbuff); -static inline void spi_hd_mempool_create() +static inline void spi_hd_mempool_create(void) { MEM_DUMP("spi_hd_mempool_create"); buf_mp_g = mempool_create(MAX_SPI_HD_BUFFER_SIZE); @@ -113,7 +111,7 @@ static inline void spi_hd_mempool_create() #endif } -static inline void spi_hd_mempool_destroy() +static inline void spi_hd_mempool_destroy(void) { mempool_destroy(buf_mp_g); } @@ -133,6 +131,7 @@ static inline void spi_hd_buffer_free(void *buf) */ static void FAST_RAM_ATTR gpio_dr_isr_handler(void* arg) { + ESP_EARLY_LOGD(TAG, "gpio_dr_isr_handler"); g_h.funcs->_h_post_semaphore_from_isr(spi_hd_data_ready_sem); } @@ -188,23 +187,19 @@ static int spi_hd_is_write_buffer_available(uint32_t buf_needed) return BUFFER_AVAILABLE; } +/* Forward declaration */ +static int spi_hd_write_packet(interface_buffer_handle_t *buf_handle); + static void spi_hd_write_task(void const* pvParameters) { - uint16_t len = 0; - uint8_t *sendbuf = NULL; - void (*free_func)(void* ptr) = NULL; interface_buffer_handle_t buf_handle = {0}; - uint8_t * payload = NULL; - struct esp_payload_header * payload_header = NULL; - - int ret = 0; - uint32_t data_left; - uint32_t buf_needed; uint8_t tx_needed = 1; while (!spi_hd_start_write_thread) g_h.funcs->_h_msleep(10); + ESP_LOGD(TAG, "spi_hd_write_task: write thread started"); + for (;;) { /* Check if higher layers have anything to transmit */ g_h.funcs->_h_get_semaphore(sem_to_slave_queue, HOSTED_BLOCK_MAX); @@ -216,103 +211,131 @@ static void spi_hd_write_task(void const* pvParameters) tx_needed = 0; /* No Tx msg */ } - if (tx_needed) - len = buf_handle.payload_len; + if (!tx_needed) + continue; - if (!len) { - ESP_LOGE(TAG, "%s: Empty len", __func__); - goto done; - } + /* Send the packet */ + spi_hd_write_packet(&buf_handle); + } +} - if (!buf_handle.payload_zcopy) { - sendbuf = spi_hd_buffer_alloc(MEMSET_REQUIRED); - assert(sendbuf); - free_func = spi_hd_buffer_free; - } else { - sendbuf = buf_handle.payload; - free_func = buf_handle.free_buf_handle; - } +/* + * Write a packet to the SPI HD bus + * Returns ESP_OK on success, ESP_FAIL on failure + */ +static int spi_hd_write_packet(interface_buffer_handle_t *buf_handle) +{ + uint16_t len = 0; + uint8_t *sendbuf = NULL; + void (*free_func)(void* ptr) = NULL; + uint8_t * payload = NULL; + struct esp_payload_header * payload_header = NULL; + int ret = 0; + uint32_t data_left; + uint32_t buf_needed; + int result = ESP_OK; + if (unlikely(!buf_handle)) + return ESP_FAIL; + + len = buf_handle->payload_len; + + if (unlikely(!buf_handle->flag && !len)) { + ESP_LOGE(TAG, "%s: Empty len", __func__); + return ESP_FAIL; + } + + if (!buf_handle->payload_zcopy) { + sendbuf = spi_hd_buffer_alloc(MEMSET_REQUIRED); if (!sendbuf) { ESP_LOGE(TAG, "spi_hd buff malloc failed"); - free_func = NULL; - goto done; + return ESP_FAIL; } + free_func = spi_hd_buffer_free; + } else { + sendbuf = buf_handle->payload; + free_func = buf_handle->free_buf_handle; + } - if (buf_handle.payload_len > MAX_SPI_HD_BUFFER_SIZE - sizeof(struct esp_payload_header)) { - ESP_LOGE(TAG, "Pkt len [%u] > Max [%u]. Drop", - buf_handle.payload_len, MAX_SPI_HD_BUFFER_SIZE - sizeof(struct esp_payload_header)); - goto done; - } + if (buf_handle->payload_len > MAX_SPI_HD_BUFFER_SIZE - sizeof(struct esp_payload_header)) { + ESP_LOGE(TAG, "Pkt len [%u] > Max [%u]. Drop", + buf_handle->payload_len, MAX_SPI_HD_BUFFER_SIZE - sizeof(struct esp_payload_header)); + result = ESP_FAIL; + goto done; + } - /* Form Tx header */ - payload_header = (struct esp_payload_header *) sendbuf; - payload = sendbuf + sizeof(struct esp_payload_header); - - payload_header->len = htole16(len); - payload_header->offset = htole16(sizeof(struct esp_payload_header)); - payload_header->if_type = buf_handle.if_type; - payload_header->if_num = buf_handle.if_num; - payload_header->seq_num = htole16(buf_handle.seq_num); - payload_header->flags = buf_handle.flag; - - if (payload_header->if_type == ESP_HCI_IF) { - // special handling for HCI - if (!buf_handle.payload_zcopy) { - // copy first byte of payload into header - payload_header->hci_pkt_type = buf_handle.payload[0]; - // adjust actual payload len - len -= 1; - payload_header->len = htole16(len); - g_h.funcs->_h_memcpy(payload, &buf_handle.payload[1], len); - } - } else - if (!buf_handle.payload_zcopy) - g_h.funcs->_h_memcpy(payload, buf_handle.payload, len); + /* Form Tx header */ + payload_header = (struct esp_payload_header *) sendbuf; + payload = sendbuf + sizeof(struct esp_payload_header); + + payload_header->len = htole16(len); + payload_header->offset = htole16(sizeof(struct esp_payload_header)); + payload_header->if_type = buf_handle->if_type; + payload_header->if_num = buf_handle->if_num; + payload_header->seq_num = htole16(buf_handle->seq_num); + payload_header->flags = buf_handle->flag; + + if (payload_header->if_type == ESP_HCI_IF) { + // special handling for HCI + if (!buf_handle->payload_zcopy) { + // copy first byte of payload into header + payload_header->hci_pkt_type = buf_handle->payload[0]; + // adjust actual payload len + len -= 1; + payload_header->len = htole16(len); + g_h.funcs->_h_memcpy(payload, &buf_handle->payload[1], len); + } + } else { + if (!buf_handle->payload_zcopy) { + g_h.funcs->_h_memcpy(payload, buf_handle->payload, len); + } + } #if H_SPI_HD_CHECKSUM - payload_header->checksum = htole16(compute_checksum(sendbuf, - sizeof(struct esp_payload_header) + len)); + payload_header->checksum = htole16(compute_checksum(sendbuf, + sizeof(struct esp_payload_header) + len)); #endif - buf_needed = (len + sizeof(struct esp_payload_header) + MAX_SPI_HD_BUFFER_SIZE - 1) - / MAX_SPI_HD_BUFFER_SIZE; + buf_needed = (len + sizeof(struct esp_payload_header) + MAX_SPI_HD_BUFFER_SIZE - 1) + / MAX_SPI_HD_BUFFER_SIZE; - SPI_HD_DRV_LOCK(); + SPI_HD_DRV_LOCK(); - // ESP_LOGW(TAG, "spi_hd_is_write_buffer_available()"); - ret = spi_hd_is_write_buffer_available(buf_needed); - if (ret != BUFFER_AVAILABLE) { - ESP_LOGV(TAG, "no SPI_HD write buffers on slave device"); - goto unlock_done; - } + ret = spi_hd_is_write_buffer_available(buf_needed); + if (ret != BUFFER_AVAILABLE) { + ESP_LOGW(TAG, "no SPI_HD write buffers on slave device, drop pkt"); + result = ESP_FAIL; + goto unlock_done; + } - data_left = len + sizeof(struct esp_payload_header); + data_left = len + sizeof(struct esp_payload_header); - ESP_HEXLOGV("h_spi_hd_tx", sendbuf, data_left); + ESP_HEXLOGD("h_spi_hd_tx", sendbuf, data_left, 32); - ret = g_h.funcs->_h_spi_hd_write_dma(sendbuf, data_left, ACQUIRE_LOCK); - if (ret) { - ESP_LOGE(TAG, "%s: Failed to send data", __func__); - goto unlock_done; - } + ret = g_h.funcs->_h_spi_hd_write_dma(sendbuf, data_left, ACQUIRE_LOCK); + if (ret) { + ESP_LOGE(TAG, "%s: Failed to send data", __func__); + result = ESP_FAIL; + goto unlock_done; + } - spi_hd_tx_buf_count += buf_needed; + spi_hd_tx_buf_count += buf_needed; #if ESP_PKT_STATS - if (buf_handle.if_type == ESP_STA_IF) - pkt_stats.sta_tx_out++; + if (buf_handle->if_type == ESP_STA_IF) + pkt_stats.sta_tx_out++; #endif unlock_done: - SPI_HD_DRV_UNLOCK(); + SPI_HD_DRV_UNLOCK(); done: - if (len && !buf_handle.payload_zcopy) { - /* free allocated buffer, only if zerocopy is not requested */ - H_FREE_PTR_WITH_FUNC(buf_handle.free_buf_handle, buf_handle.priv_buffer_handle); - } - H_FREE_PTR_WITH_FUNC(free_func, sendbuf); + if (len && !buf_handle->payload_zcopy) { + /* free allocated buffer, only if zerocopy is not requested */ + H_FREE_PTR_WITH_FUNC(buf_handle->free_buf_handle, buf_handle->priv_buffer_handle); } + H_FREE_PTR_WITH_FUNC(free_func, sendbuf); + + return result; } static int is_valid_spi_hd_rx_packet(uint8_t *rxbuff_a, uint16_t *len_a, uint16_t *offset_a) @@ -423,7 +446,7 @@ static esp_err_t spi_hd_push_data_to_queue(uint8_t * buf, uint32_t buf_len) if (update_flow_ctrl(buf)) { // detected and updated flow control // no need to further process the packet - HOSTED_FREE(buf); + spi_hd_buffer_free(buf); return ESP_OK; } @@ -436,12 +459,13 @@ static esp_err_t spi_hd_push_data_to_queue(uint8_t * buf, uint32_t buf_len) * wrong header/bit packing? * */ ESP_LOGE(TAG, "Dropping packet"); - HOSTED_FREE(buf); + spi_hd_buffer_free(buf); return ESP_FAIL; } if (spi_hd_push_pkt_to_queue(buf, len, offset)) { ESP_LOGE(TAG, "Failed to push Rx packet to queue"); + spi_hd_buffer_free(buf); return ESP_FAIL; } @@ -461,6 +485,7 @@ static void spi_hd_read_task(void const* pvParameters) while (true) { vTaskDelay(pdMS_TO_TICKS(100)); if (is_transport_rx_ready()) { + ESP_LOGI(TAG, "spi_hd_read_task: transport rx ready"); break; } } @@ -470,28 +495,28 @@ static void spi_hd_read_task(void const* pvParameters) res = g_h.funcs->_h_spi_hd_read_reg(SPI_HD_REG_SLAVE_READY, &data, POLLING_READ, ACQUIRE_LOCK); if (res) { ESP_LOGE(TAG, "Error reading slave register"); - } - else if (data == SPI_HD_STATE_SLAVE_READY) { - ESP_LOGV(TAG, "Slave is ready"); + } else if (data == SPI_HD_STATE_SLAVE_READY) { + ESP_LOGI(TAG, "Slave is ready"); break; } vTaskDelay(pdMS_TO_TICKS(100)); } - create_debugging_tasks(); - + ESP_LOGD(TAG, "Open Data path"); // slave is ready: initialise Data Ready as interrupt input - g_h.funcs->_h_config_gpio_as_interrupt(H_SPI_HD_GPIO_DATA_READY_Port, H_SPI_HD_PIN_DATA_READY, - H_SPI_HD_DR_INTR_EDGE, gpio_dr_isr_handler); + g_h.funcs->_h_config_gpio_as_interrupt(H_SPI_HD_PORT_DATA_READY, H_SPI_HD_PIN_DATA_READY, + H_SPI_HD_DR_INTR_EDGE, gpio_dr_isr_handler, NULL); // tell slave to open data path data = SPI_HD_CTRL_DATAPATH_ON; g_h.funcs->_h_spi_hd_write_reg(SPI_HD_REG_SLAVE_CTRL, &data, ACQUIRE_LOCK); + ESP_LOGD(TAG, "spi_hd_read_task: post open data path"); // we are now ready to receive data from slave while (1) { // wait for read semaphore to trigger g_h.funcs->_h_get_semaphore(spi_hd_data_ready_sem, HOSTED_BLOCK_MAX); + ESP_LOGV(TAG, "spi_hd_read_task: data ready intr received"); SPI_HD_DRV_LOCK(); @@ -505,6 +530,7 @@ static void spi_hd_read_task(void const* pvParameters) // send cmd9 to clear the interrupts on the slave g_h.funcs->_h_spi_hd_send_cmd9(); + ESP_LOGV(TAG, "spi_hd_read_task: sent cmd9"); // save the int mask int_mask = curr_rx_value & SPI_HD_INT_MASK; @@ -546,10 +572,22 @@ static void spi_hd_read_task(void const* pvParameters) continue; } + /* Validate transfer size to prevent buffer overflow */ + if (size_to_xfer > MAX_SPI_HD_BUFFER_SIZE) { + ESP_LOGE(TAG, "read_bytes[%"PRIu32"] > MAX_SPI_HD_BUFFER_SIZE[%d]. Ignoring read request", + size_to_xfer, MAX_SPI_HD_BUFFER_SIZE); + + SPI_HD_DRV_UNLOCK(); + continue; + } + // allocate rx buffer rxbuff = spi_hd_buffer_alloc(MEMSET_REQUIRED); assert(rxbuff); + ESP_LOGV(TAG, "spi_hd_read_task: spi hd dma read: read_bytes[%"PRIu32"], curr_rx[%"PRIu32"], rx_count[%"PRIu32"]", + size_to_xfer, curr_rx_value & SPI_HD_TX_BUF_LEN_MASK, spi_hd_rx_byte_count); + // read data res = g_h.funcs->_h_spi_hd_read_dma(rxbuff, size_to_xfer, ACQUIRE_LOCK); @@ -560,10 +598,11 @@ static void spi_hd_read_task(void const* pvParameters) if (res) { ESP_LOGE(TAG, "error reading data"); + spi_hd_buffer_free(rxbuff); continue; } - ESP_HEXLOGV("spi_hd_rx", rxbuff, size_to_xfer); + ESP_HEXLOGD("spi_hd_rx", rxbuff, size_to_xfer, 32); if (spi_hd_push_data_to_queue(rxbuff, size_to_xfer)) ESP_LOGE(TAG, "Failed to push data to rx queue"); @@ -581,10 +620,13 @@ static void spi_hd_process_rx_task(void const* pvParameters) while (true) { vTaskDelay(pdMS_TO_TICKS(100)); if (is_transport_rx_ready()) { + ESP_LOGI(TAG, "transport rx not yet up"); break; } } + ESP_LOGI(TAG, "spi_hd_process_rx_task: transport rx ready"); + while (1) { g_h.funcs->_h_get_semaphore(sem_from_slave_queue, HOSTED_BLOCK_MAX); @@ -598,7 +640,7 @@ static void spi_hd_process_rx_task(void const* pvParameters) buf_handle = &buf_handle_l; ESP_LOGV(TAG, "spi_hd iftype:%d", (int)buf_handle->if_type); - ESP_HEXLOGV("rx", buf_handle->payload, buf_handle->payload_len); + ESP_HEXLOGD("rx", buf_handle->payload, buf_handle->payload_len, 32); if (buf_handle->if_type == ESP_SERIAL_IF) { /* serial interface path */ @@ -638,7 +680,7 @@ static void spi_hd_process_rx_task(void const* pvParameters) /* User can re-use this type of transaction */ } } else if (buf_handle->if_type == ESP_HCI_IF) { - hci_rx_handler(buf_handle); + hci_rx_handler(buf_handle->payload, buf_handle->payload_len); } else if (buf_handle->if_type == ESP_TEST_IF) { #if TEST_RAW_TP update_test_raw_tp_rx_len(buf_handle->payload_len + @@ -648,6 +690,11 @@ static void spi_hd_process_rx_task(void const* pvParameters) ESP_LOGW(TAG, "unknown type %d ", buf_handle->if_type); } +#if ESP_PKT_STATS + if (buf_handle->if_type == ESP_STA_IF) + pkt_stats.sta_rx_out++; +#endif + /* Free buffer handle */ /* When buffer offloaded to other module, that module is * responsible for freeing buffer. In case not offloaded or @@ -660,7 +707,7 @@ static void spi_hd_process_rx_task(void const* pvParameters) } } -void transport_init_internal(void) +void * bus_init_internal(void) { uint8_t prio_q_idx = 0; @@ -705,18 +752,86 @@ void transport_init_internal(void) ESP_LOGE(TAG, "could not create spi_hd handle, exiting\n"); assert(spi_hd_handle); } + + ESP_LOGI(TAG, "Initialised SPI HD driver"); + return spi_hd_handle; } -void transport_deinit_internal(void) +void bus_deinit_internal(void *bus_handle) { - /* TODO */ + uint8_t prio_q_idx = 0; + + /* Stop threads */ + if (spi_hd_read_thread) { + g_h.funcs->_h_thread_cancel(spi_hd_read_thread); + spi_hd_read_thread = NULL; + } + + if (spi_hd_process_rx_thread) { + g_h.funcs->_h_thread_cancel(spi_hd_process_rx_thread); + spi_hd_process_rx_thread = NULL; + } + + if (spi_hd_write_thread) { + g_h.funcs->_h_thread_cancel(spi_hd_write_thread); + spi_hd_write_thread = NULL; + } + + /* Clean up queues */ + for (prio_q_idx = 0; prio_q_idx < MAX_PRIORITY_QUEUES; prio_q_idx++) { + if (from_slave_queue[prio_q_idx]) { + g_h.funcs->_h_destroy_queue(from_slave_queue[prio_q_idx]); + from_slave_queue[prio_q_idx] = NULL; + } + + if (to_slave_queue[prio_q_idx]) { + g_h.funcs->_h_destroy_queue(to_slave_queue[prio_q_idx]); + to_slave_queue[prio_q_idx] = NULL; + } + } + + /* Clean up semaphores */ + if (sem_to_slave_queue) { + g_h.funcs->_h_destroy_semaphore(sem_to_slave_queue); + sem_to_slave_queue = NULL; + } + + if (sem_from_slave_queue) { + g_h.funcs->_h_destroy_semaphore(sem_from_slave_queue); + sem_from_slave_queue = NULL; + } + + if (spi_hd_data_ready_sem) { + g_h.funcs->_h_destroy_semaphore(spi_hd_data_ready_sem); + spi_hd_data_ready_sem = NULL; + } + + /* Deinitialize the SPI HD bus */ + if (spi_hd_handle) { + g_h.funcs->_h_bus_deinit(bus_handle); + spi_hd_handle = NULL; + } SPI_HD_DRV_LOCK_DESTROY(); + + spi_hd_mempool_destroy(); + ESP_LOGI(TAG, "Deinitialised SPI HD driver"); } +/** + * @brief Send to slave + * @param iface_type -type of interface + * iface_num - interface number + * payload_buf - tx buffer + * payload_len - size of tx buffer + * buffer_to_free - buffer to be freed after tx + * free_buf_func - function used to free buffer_to_free + * flags - flags to set + * @retval int - ESP_OK or ESP_FAIL + */ int esp_hosted_tx(uint8_t iface_type, uint8_t iface_num, - uint8_t * wbuffer, uint16_t wlen, uint8_t buff_zcopy, - void (*free_wbuf_fun)(void* ptr)) + uint8_t *payload_buf, uint16_t payload_len, uint8_t buff_zcopy, + uint8_t *buffer_to_free, void (*free_buf_func)(void *ptr), uint8_t flags) { interface_buffer_handle_t buf_handle = {0}; void (*free_func)(void* ptr) = NULL; @@ -725,25 +840,25 @@ int esp_hosted_tx(uint8_t iface_type, uint8_t iface_num, // ESP_LOGW(TAG, "%s, %"PRIu8, __func__, transport_up); - if (free_wbuf_fun) - free_func = free_wbuf_fun; + if (free_buf_func) + free_func = free_buf_func; - if (!wbuffer || !wlen || - (wlen > MAX_PAYLOAD_SIZE) || - !transport_up) { + if ((flags == 0 || flags == MORE_FRAGMENT) && + (!payload_buf || !payload_len || (payload_len > MAX_PAYLOAD_SIZE) || !transport_up)) { ESP_LOGE(TAG, "tx fail: NULL buff, invalid len (%u) or len > max len (%u), transport_up(%u))", - wlen, MAX_PAYLOAD_SIZE, transport_up); - H_FREE_PTR_WITH_FUNC(free_func, wbuffer); + payload_len, MAX_PAYLOAD_SIZE, transport_up); + H_FREE_PTR_WITH_FUNC(free_func, buffer_to_free); return ESP_FAIL; } buf_handle.payload_zcopy = buff_zcopy; buf_handle.if_type = iface_type; buf_handle.if_num = iface_num; - buf_handle.payload_len = wlen; - buf_handle.payload = wbuffer; - buf_handle.priv_buffer_handle = wbuffer; + buf_handle.payload_len = payload_len; + buf_handle.payload = payload_buf; + buf_handle.priv_buffer_handle = buffer_to_free; buf_handle.free_buf_handle = free_func; + buf_handle.flag = flags; if (buf_handle.if_type == ESP_SERIAL_IF) pkt_prio = PRIO_Q_SERIAL; @@ -760,3 +875,106 @@ int esp_hosted_tx(uint8_t iface_type, uint8_t iface_num, return ESP_OK; } + +void check_if_max_freq_used(uint8_t chip_type) +{ + if (H_SPI_HD_CLK_MHZ < 40) { + ESP_LOGW(TAG, "SPI HD FD clock in-use: [%u]MHz. Can optimize in 1MHz steps till Max[%u]MHz", H_SPI_HD_CLK_MHZ, 40); + } +} + +int ensure_slave_bus_ready(void *bus_handle) +{ + esp_err_t res = ESP_OK; + gpio_pin_t reset_pin = { .port = H_GPIO_PORT_RESET, .pin = H_GPIO_PIN_RESET }; + + if (ESP_TRANSPORT_OK != esp_hosted_transport_get_reset_config(&reset_pin)) { + ESP_LOGE(TAG, "Unable to get RESET config for transport"); + return ESP_FAIL; + } + + assert(reset_pin.pin != -1); + + release_slave_reset_gpio_post_wakeup(); + + if (!esp_hosted_woke_from_power_save()) { + /* Reset the slave */ + ESP_LOGI(TAG, "Reseting slave on SPI HD bus with pin %d", reset_pin.pin); + g_h.funcs->_h_config_gpio(reset_pin.port, reset_pin.pin, H_GPIO_MODE_DEF_OUTPUT); + g_h.funcs->_h_write_gpio(reset_pin.port, reset_pin.pin, H_RESET_VAL_ACTIVE); + g_h.funcs->_h_msleep(1); + g_h.funcs->_h_write_gpio(reset_pin.port, reset_pin.pin, H_RESET_VAL_INACTIVE); + g_h.funcs->_h_msleep(1); + g_h.funcs->_h_write_gpio(reset_pin.port, reset_pin.pin, H_RESET_VAL_ACTIVE); + } else { + stop_host_power_save(); + } + + return res; +} + +int bus_inform_slave_host_power_save_start(void) +{ + ESP_LOGI(TAG, "Inform slave, host power save is started"); + int ret = ESP_OK; + + /* + * If the write thread is not started yet (which happens after receiving INIT event), + * we need to send the power save message directly to avoid deadlock. + * Otherwise, use the normal queue mechanism. + */ + if (!spi_hd_start_write_thread) { + interface_buffer_handle_t buf_handle = {0}; + + buf_handle.payload_zcopy = H_BUFF_NO_ZEROCOPY; + buf_handle.if_type = ESP_SERIAL_IF; + buf_handle.if_num = 0; + buf_handle.payload_len = 0; + buf_handle.payload = NULL; + buf_handle.priv_buffer_handle = NULL; + buf_handle.free_buf_handle = NULL; + buf_handle.flag = FLAG_POWER_SAVE_STARTED; + + ESP_LOGI(TAG, "Sending power save start message directly"); + ret = spi_hd_write_packet(&buf_handle); + } else { + /* Use normal queue mechanism */ + ret = esp_hosted_tx(ESP_SERIAL_IF, 0, NULL, 0, + H_BUFF_NO_ZEROCOPY, NULL, NULL, FLAG_POWER_SAVE_STARTED); + } + + return ret; +} + +int bus_inform_slave_host_power_save_stop(void) +{ + ESP_LOGI(TAG, "Inform slave, host power save is stopped"); + int ret = ESP_OK; + + /* + * If the write thread is not started yet (which happens after receiving INIT event), + * we need to send the power save message directly to avoid deadlock. + * Otherwise, use the normal queue mechanism. + */ + if (!spi_hd_start_write_thread) { + interface_buffer_handle_t buf_handle = {0}; + + buf_handle.payload_zcopy = H_BUFF_NO_ZEROCOPY; + buf_handle.if_type = ESP_SERIAL_IF; + buf_handle.if_num = 0; + buf_handle.payload_len = 0; + buf_handle.payload = NULL; + buf_handle.priv_buffer_handle = NULL; + buf_handle.free_buf_handle = NULL; + buf_handle.flag = FLAG_POWER_SAVE_STOPPED; + + ESP_LOGI(TAG, "Sending power save stop message directly"); + ret = spi_hd_write_packet(&buf_handle); + } else { + /* Use normal queue mechanism */ + ret = esp_hosted_tx(ESP_SERIAL_IF, 0, NULL, 0, + H_BUFF_NO_ZEROCOPY, NULL, NULL, FLAG_POWER_SAVE_STOPPED); + } + + return ret; +} diff --git a/host/drivers/transport/spi_hd/spi_hd_drv.h b/host/drivers/transport/spi_hd/spi_hd_drv.h index 6018be9e..73a18afa 100644 --- a/host/drivers/transport/spi_hd/spi_hd_drv.h +++ b/host/drivers/transport/spi_hd/spi_hd_drv.h @@ -1,22 +1,11 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2024 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /** prevent recursive inclusion **/ #ifndef __SPI_HD_DRV_H #define __SPI_HD_DRV_H -#include "common.h" - #endif /* __SPI_HD_DRV_H */ diff --git a/host/drivers/transport/transport_drv.c b/host/drivers/transport/transport_drv.c index bc35d503..e5d3565a 100644 --- a/host/drivers/transport/transport_drv.c +++ b/host/drivers/transport/transport_drv.c @@ -1,17 +1,8 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /** Includes **/ #include @@ -20,16 +11,22 @@ #include "transport_drv.h" #include "esp_hosted_transport.h" #include "esp_hosted_transport_init.h" +#include "esp_hosted_transport_config.h" +#include "esp_hosted_host_fw_ver.h" #include "stats.h" -#include "esp_log.h" #include "esp_hosted_log.h" #include "serial_drv.h" #include "serial_ll_if.h" -#include "esp_hosted_config.h" #include "mempool.h" #include "stats.h" #include "errno.h" #include "hci_drv.h" +#include "port_esp_hosted_host_config.h" +#include "port_esp_hosted_host_log.h" +#include "esp_hosted_power_save.h" + +#include "esp_hosted_cli.h" +#include "rpc_wrap.h" /** * @brief Slave capabilities are parsed @@ -43,12 +40,24 @@ static char chip_type = ESP_PRIV_FIRMWARE_CHIP_UNRECOGNIZED; void(*transport_esp_hosted_up_cb)(void) = NULL; transport_channel_t *chan_arr[ESP_MAX_IF]; volatile uint8_t wifi_tx_throttling; +void *bus_handle = NULL; -static uint8_t transport_state = TRANSPORT_INACTIVE; +static volatile uint8_t transport_state = TRANSPORT_INACTIVE; static void process_event(uint8_t *evt_buf, uint16_t len); +static int process_init_event(uint8_t *evt_buf, uint16_t len); + +#if H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE && H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE_TIMEOUT != -1 +static void *init_timeout_timer = NULL; + +static void init_timeout_cb(void *arg) +{ + ESP_LOGE(TAG, "Init event not received within timeout, Reseting myself"); + g_h.funcs->_h_restart_host(); +} +#endif uint8_t is_transport_rx_ready(void) { @@ -60,21 +69,6 @@ uint8_t is_transport_tx_ready(void) return (transport_state >= TRANSPORT_TX_ACTIVE); } -static void reset_slave(void) -{ - ESP_LOGI(TAG, "Reset slave using GPIO[%u]", H_GPIO_PIN_RESET_Pin); - g_h.funcs->_h_config_gpio(H_GPIO_PIN_RESET_Port, H_GPIO_PIN_RESET_Pin, H_GPIO_MODE_DEF_OUTPUT); - - g_h.funcs->_h_write_gpio(H_GPIO_PIN_RESET_Port, H_GPIO_PIN_RESET_Pin, H_RESET_VAL_ACTIVE); - g_h.funcs->_h_msleep(50); - g_h.funcs->_h_write_gpio(H_GPIO_PIN_RESET_Port, H_GPIO_PIN_RESET_Pin, H_RESET_VAL_INACTIVE); - g_h.funcs->_h_msleep(50); - g_h.funcs->_h_write_gpio(H_GPIO_PIN_RESET_Port, H_GPIO_PIN_RESET_Pin, H_RESET_VAL_ACTIVE); - - /* stop spi transactions short time to avoid slave sync issues */ - g_h.funcs->_h_sleep(1); -} - static void transport_driver_event_handler(uint8_t event) { switch(event) @@ -82,30 +76,66 @@ static void transport_driver_event_handler(uint8_t event) case TRANSPORT_TX_ACTIVE: { /* Initiate control path now */ - ESP_LOGI(TAG, "Base transport is set-up\n\r"); + ESP_LOGI(TAG, "Base transport is set-up, TRANSPORT_TX_ACTIVE"); if (transport_esp_hosted_up_cb) transport_esp_hosted_up_cb(); transport_state = TRANSPORT_TX_ACTIVE; break; } + case TRANSPORT_INACTIVE: + case TRANSPORT_RX_ACTIVE: + transport_state = event; + break; + default: - break; + break; } } -esp_err_t transport_drv_deinit(void) +void set_transport_state(uint8_t state) +{ + ESP_LOGI(TAG, "set_transport_state: %u", state); + transport_driver_event_handler(state); +} + +static void transport_drv_init(void) +{ + bus_handle = bus_init_internal(); + ESP_LOGD(TAG, "Bus handle: %p", bus_handle); + assert(bus_handle); +#if H_NETWORK_SPLIT_ENABLED + ESP_LOGI(TAG, "Network split enabled. Port ranges- Host:TCP(%d-%d), UDP(%d-%d), Slave:TCP(%d-%d), UDP(%d-%d)", + H_HOST_TCP_LOCAL_PORT_RANGE_START, H_HOST_TCP_LOCAL_PORT_RANGE_END, + H_HOST_UDP_LOCAL_PORT_RANGE_START, H_HOST_UDP_LOCAL_PORT_RANGE_END, + H_SLAVE_TCP_REMOTE_PORT_RANGE_START, H_SLAVE_TCP_REMOTE_PORT_RANGE_END, + H_SLAVE_UDP_REMOTE_PORT_RANGE_START, H_SLAVE_UDP_REMOTE_PORT_RANGE_END); +#endif + hci_drv_init(); +} + +esp_err_t teardown_transport(void) { - transport_deinit_internal(); + #if H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE && H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE_TIMEOUT != -1 + /* Stop and cleanup init timeout timer if still active */ + if (init_timeout_timer) { + g_h.funcs->_h_timer_stop(init_timeout_timer); + init_timeout_timer = NULL; + } + #endif + + if (bus_handle) { + bus_deinit_internal(bus_handle); + } + ESP_LOGI(TAG, "TRANSPORT_INACTIVE"); transport_state = TRANSPORT_INACTIVE; return ESP_OK; } -esp_err_t transport_drv_init(void(*esp_hosted_up_cb)(void)) +esp_err_t setup_transport(void(*esp_hosted_up_cb)(void)) { g_h.funcs->_h_hosted_init_hook(); - transport_init_internal(); - hci_drv_init(); + transport_drv_init(); transport_esp_hosted_up_cb = esp_hosted_up_cb; return ESP_OK; @@ -115,27 +145,56 @@ esp_err_t transport_drv_reconfigure(void) { static int retry_slave_connection = 0; - ESP_LOGI(TAG, "Attempt connection with slave: retry[%u]",retry_slave_connection); + ESP_LOGI(TAG, "Attempt connection with slave: retry[%u]", retry_slave_connection); + +#if H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE && H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE_TIMEOUT != -1 + /* Start init timeout timer if not already started */ + if (!init_timeout_timer) { + init_timeout_timer = g_h.funcs->_h_timer_start("slave_unresponsive_timer", H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE_TIMEOUT, H_TIMER_TYPE_ONESHOT, init_timeout_cb, NULL); + if (!init_timeout_timer) { + ESP_LOGE(TAG, "Failed to create init timeout timer"); + return ESP_FAIL; + } + ESP_LOGI(TAG, "Started host communication init timer of %u seconds", H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE_TIMEOUT); + } +#endif + + int retry_power_save_recover = 5; + if (esp_hosted_woke_from_power_save()) { + ESP_LOGI(TAG, "Waiting for power save to be off"); + g_h.funcs->_h_msleep(700); + + while (retry_power_save_recover) { + if (is_transport_tx_ready()) { + break; + } + retry_power_save_recover--; + } + } + + /* This would come into picture, only if the host has + * reset pin connected to slave's 'EN' or 'RST' GPIO */ if (!is_transport_tx_ready()) { - reset_slave(); + ensure_slave_bus_ready(bus_handle); transport_state = TRANSPORT_RX_ACTIVE; - + ESP_LOGI(TAG, "Waiting for esp_hosted slave to be ready"); while (!is_transport_tx_ready()) { if (retry_slave_connection < MAX_RETRY_TRANSPORT_ACTIVE) { retry_slave_connection++; - if (retry_slave_connection%10==0) { - ESP_LOGE(TAG, "Not able to connect with ESP-Hosted slave device"); - reset_slave(); + if (retry_slave_connection%50==0) { + ESP_LOGI(TAG, "Not able to connect with ESP-Hosted slave device"); + ensure_slave_bus_ready(bus_handle); } } else { - ESP_LOGE(TAG, "Failed to get ESP_Hosted slave transport up"); + ESP_LOGW(TAG, "Failed to get ESP_Hosted slave transport up"); return ESP_FAIL; } - g_h.funcs->_h_sleep(1); + g_h.funcs->_h_msleep(200); } } else { ESP_LOGI(TAG, "Transport is already up"); } + retry_slave_connection = 0; return ESP_OK; } @@ -167,29 +226,6 @@ esp_err_t transport_drv_remove_channel(transport_channel_t *channel) return ESP_OK; } -#if 0 -esp_err_t transport_drv_tx(void *h, void *buffer, size_t len) -{ - if (!h) { - esp_wifi_internal_free_rx_buffer(buffer); - return ESP_FAIL; - } - - /* Buffer will be freed always in the called function */ - return esp_hosted_tx(h->if_type, 0, buffer, len, H_BUFF_NO_ZEROCOPY, esp_wifi_internal_free_rx_buffer); - -} -#endif - -#if 0 -static esp_err_t transport_drv_sta_tx(void *h, void *buffer, transport_free_cb_t free_cb, size_t len) -{ - ESP_LOGI(TAG, "%s", __func__); - assert(h && h==chan_arr[ESP_STA_IF]->api_chan); - return esp_hosted_tx(ESP_STA_IF, 0, buffer, len, H_BUFF_NO_ZEROCOPY, free_cb); -} -#endif - static void transport_sta_free_cb(void *buf) { mempool_free(chan_arr[ESP_STA_IF]->memp, buf); @@ -214,7 +250,7 @@ static esp_err_t transport_drv_sta_tx(void *h, void *buffer, size_t len) if (unlikely(wifi_tx_throttling)) { #if ESP_PKT_STATS - pkt_stats.sta_tx_in_drop++; + pkt_stats.sta_tx_flowctrl_drop++; #endif errno = -ENOBUFS; //return ESP_ERR_NO_BUFFS; @@ -232,7 +268,7 @@ static esp_err_t transport_drv_sta_tx(void *h, void *buffer, size_t len) assert(copy_buff); g_h.funcs->_h_memcpy(copy_buff+H_ESP_PAYLOAD_HEADER_OFFSET, buffer, len); - return esp_hosted_tx(ESP_STA_IF, 0, copy_buff, len, H_BUFF_ZEROCOPY, transport_sta_free_cb); + return esp_hosted_tx(ESP_STA_IF, 0, copy_buff, len, H_BUFF_ZEROCOPY, copy_buff, transport_sta_free_cb, 0); } static esp_err_t transport_drv_ap_tx(void *h, void *buffer, size_t len) @@ -249,14 +285,14 @@ static esp_err_t transport_drv_ap_tx(void *h, void *buffer, size_t len) assert(copy_buff); g_h.funcs->_h_memcpy(copy_buff+H_ESP_PAYLOAD_HEADER_OFFSET, buffer, len); - return esp_hosted_tx(ESP_AP_IF, 0, copy_buff, len, H_BUFF_ZEROCOPY, transport_ap_free_cb); + return esp_hosted_tx(ESP_AP_IF, 0, copy_buff, len, H_BUFF_ZEROCOPY, copy_buff, transport_ap_free_cb, 0); } esp_err_t transport_drv_serial_tx(void *h, void *buffer, size_t len) { /* TODO */ assert(h && h==chan_arr[ESP_SERIAL_IF]->api_chan); - return esp_hosted_tx(ESP_SERIAL_IF, 0, buffer, len, H_BUFF_NO_ZEROCOPY, transport_serial_free_cb); + return esp_hosted_tx(ESP_SERIAL_IF, 0, buffer, len, H_BUFF_NO_ZEROCOPY, buffer, transport_serial_free_cb, 0); } @@ -264,6 +300,7 @@ transport_channel_t *transport_drv_add_channel(void *api_chan, esp_hosted_if_type_t if_type, uint8_t secure, transport_channel_tx_fn_t *tx, const transport_channel_rx_fn_t rx) { + ESP_LOGD(TAG, "Adding channel IF[%u]: S[%u] Tx[%p] Rx[%p]", if_type, secure, tx, rx); transport_channel_t *channel = NULL; ESP_ERROR_CHECK(if_type >= ESP_MAX_IF); @@ -322,7 +359,7 @@ transport_channel_t *transport_drv_add_channel(void *api_chan, return channel; } -void process_capabilities(uint8_t cap) +static void process_capabilities(uint8_t cap) { ESP_LOGI(TAG, "capabilities: 0x%x",cap); } @@ -349,7 +386,7 @@ void process_priv_communication(interface_buffer_handle_t *buf_handle) process_event(buf_handle->payload, buf_handle->payload_len); } -void print_capabilities(uint32_t cap) +static void print_capabilities(uint32_t cap) { ESP_LOGI(TAG, "Features supported are:"); if (cap & ESP_WLAN_SDIO_SUPPORT) @@ -411,11 +448,16 @@ static void process_event(uint8_t *evt_buf, uint16_t len) if (event->event_type == ESP_PRIV_EVENT_INIT) { ESP_LOGI(TAG, "Received INIT event from ESP32 peripheral"); - ESP_HEXLOGD("Slave_init_evt", event->event_data, event->event_len); + ESP_HEXLOGD("Slave_init_evt", event->event_data, event->event_len, 32); ret = process_init_event(event->event_data, event->event_len); if (ret) { ESP_LOGE(TAG, "failed to init event\n\r"); + } else { + +#if H_HOST_PS_ALLOWED && H_HOST_WAKEUP_GPIO + esp_hosted_power_save_init(); +#endif } } else { ESP_LOGW(TAG, "Drop unknown event\n\r"); @@ -449,6 +491,9 @@ static esp_err_t get_chip_str_from_id(int chip_id, char* chip_str) case ESP_PRIV_FIRMWARE_CHIP_ESP32C5: strcpy(chip_str, "esp32c5"); break; + case ESP_PRIV_FIRMWARE_CHIP_ESP32C61: + strcpy(chip_str, "esp32c61"); + break; default: ESP_LOGW(TAG, "Unsupported chip id: %u", chip_id); strcpy(chip_str, "unsupported"); @@ -477,20 +522,60 @@ static void verify_host_config_for_slave(uint8_t chip_type) exp_chip_id = ESP_PRIV_FIRMWARE_CHIP_ESP32S3; #elif H_SLAVE_TARGET_ESP32C5 exp_chip_id = ESP_PRIV_FIRMWARE_CHIP_ESP32C5; +#elif H_SLAVE_TARGET_ESP32C61 + exp_chip_id = ESP_PRIV_FIRMWARE_CHIP_ESP32C61; #else ESP_LOGW(TAG, "Incorrect host config for ESP slave chipset[%x]", chip_type); #endif - if (chip_type!=exp_chip_id) { - char slave_str[20], exp_str[20]; - - memset(slave_str, '\0', 20); - memset(exp_str, '\0', 20); + char slave_str[20] = {0}; + get_chip_str_from_id(chip_type, slave_str); - get_chip_str_from_id(chip_type, slave_str); + if (chip_type!=exp_chip_id) { + char exp_str[20] = {0}; get_chip_str_from_id(exp_chip_id, exp_str); ESP_LOGE(TAG, "Identified slave [%s] != Expected [%s]\n\t\trun 'idf.py menuconfig' at host to reselect the slave?\n\t\tAborting.. ", slave_str, exp_str); g_h.funcs->_h_sleep(10); assert(0!=0); + } else { + ESP_LOGI(TAG, "Identified slave [%s]", slave_str); + check_if_max_freq_used(chip_type); + } +} + +/** return values: + * - 0 if versions as the same + * - -1 if host version is smaller than slave version + * - 1 if host version is bigger than slave version + */ +static int compare_fw_version(uint32_t slave_version) +{ + uint32_t host_version = ESP_HOSTED_VERSION_VAL(ESP_HOSTED_VERSION_MAJOR_1, + ESP_HOSTED_VERSION_MINOR_1, + ESP_HOSTED_VERSION_PATCH_1); + + // mask out patch level + // compare major.minor only + slave_version &= 0xFFFFFF00; + host_version &= 0xFFFFFF00; + + if (host_version == slave_version) { + // versions match + return 0; + } else if (host_version > slave_version) { + // host version > slave version + ESP_LOGW(TAG, "=== ESP-Hosted Version Warning ==="); + printf("Version on Host is NEWER than version on co-processor\n"); + printf("RPC requests sent by host may encounter timeout errors\n"); + printf("or may not be supported by co-processor\n"); + ESP_LOGW(TAG, "=== ESP-Hosted Version Warning ==="); + return -1; + } else { + // host version < slave version + ESP_LOGW(TAG, "=== ESP-Hosted Version Warning ==="); + printf("Version on Host is OLDER than version on co-processor\n"); + printf("Host may not be compatible with co-processor\n"); + ESP_LOGW(TAG, "=== ESP-Hosted Version Warning ==="); + return 1; } } @@ -503,7 +588,7 @@ esp_err_t send_slave_config(uint8_t host_cap, uint8_t firmware_chip_id, uint16_t len = 0; uint8_t *sendbuf = NULL; - sendbuf = g_h.funcs->_h_malloc(512); + sendbuf = g_h.funcs->_h_malloc_align(MEMPOOL_ALIGNED(256), MEMPOOL_ALIGNMENT_BYTES); assert(sendbuf); /* Populate event data */ @@ -532,14 +617,20 @@ esp_err_t send_slave_config(uint8_t host_cap, uint8_t firmware_chip_id, *pos = LENGTH_1_BYTE; pos++;len++; *pos = raw_tp_direction; pos++;len++; - *pos = SLV_CONFIG_THROTTLE_HIGH_THRESHOLD; pos++;len++; + *pos = SLV_CONFIG_THROTTLE_HIGH_THRESHOLD; pos++;len++; *pos = LENGTH_1_BYTE; pos++;len++; *pos = high_thr_thesh; pos++;len++; - *pos = SLV_CONFIG_THROTTLE_LOW_THRESHOLD; pos++;len++; + *pos = SLV_CONFIG_THROTTLE_LOW_THRESHOLD; pos++;len++; *pos = LENGTH_1_BYTE; pos++;len++; *pos = low_thr_thesh; pos++;len++; + ESP_LOGI(TAG, "raw_tp_dir[%s], flow_ctrl: low[%u] high[%u]", + raw_tp_direction == ESP_TEST_RAW_TP__HOST_TO_ESP? "h2s": + raw_tp_direction == ESP_TEST_RAW_TP__ESP_TO_HOST? "s2h": + raw_tp_direction == ESP_TEST_RAW_TP__BIDIRECTIONAL? "bi-dir": + "-", low_thr_thesh, high_thr_thesh); + /* TLVs end */ event->event_len = len; @@ -547,19 +638,43 @@ esp_err_t send_slave_config(uint8_t host_cap, uint8_t firmware_chip_id, /* payload len = Event len + sizeof(event type) + sizeof(event len) */ len += 2; - return esp_hosted_tx(ESP_PRIV_IF, 0, sendbuf, len, H_BUFF_NO_ZEROCOPY, g_h.funcs->_h_free); + return esp_hosted_tx(ESP_PRIV_IF, 0, sendbuf, len, H_BUFF_NO_ZEROCOPY, sendbuf, g_h.funcs->_h_free, 0); +} + +static int transport_delayed_init(void) +{ + ESP_LOGI(TAG, "transport_delayed_init"); + rpc_start(); + /* Add up cli */ +#ifdef H_ESP_HOSTED_CLI_ENABLED + esp_hosted_cli_start(); +#endif + create_debugging_tasks(); + + return 0; } -int process_init_event(uint8_t *evt_buf, uint16_t len) + +static int process_init_event(uint8_t *evt_buf, uint16_t len) { uint8_t len_left = len, tag_len; uint8_t *pos; uint8_t raw_tp_config = H_TEST_RAW_TP_DIR; uint32_t ext_cap = 0; + uint32_t slave_fw_version = 0; if (!evt_buf) return ESP_FAIL; +#if H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE && H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE_TIMEOUT != -1 + /* Stop and delete the init timeout timer since we received the init event */ + if (init_timeout_timer) { + g_h.funcs->_h_timer_stop(init_timeout_timer); + init_timeout_timer = NULL; + ESP_LOGI(TAG, "Init event received within timeout, cleared timer"); + } +#endif + pos = evt_buf; ESP_LOGD(TAG, "Init event length: %u", len); if (len > 64) { @@ -597,6 +712,14 @@ int process_init_event(uint8_t *evt_buf, uint16_t len) ESP_LOGD(TAG, "slave rx queue size: %u", *(pos + 2)); } else if (*pos == ESP_PRIV_TX_Q_SIZE) { ESP_LOGD(TAG, "slave tx queue size: %u", *(pos + 2)); + } else if (*pos == ESP_PRIV_FIRMWARE_VERSION) { + // fw_version sent as a little-endian uint32_t + slave_fw_version = + *(pos + 2) | + (*(pos + 3) << 8) | + (*(pos + 4) << 16) | + (*(pos + 5) << 24); + ESP_LOGD(TAG, "slave fw version: 0x%08" PRIx32, slave_fw_version); } else { ESP_LOGD(TAG, "Unsupported EVENT: %2x", *pos); } @@ -604,13 +727,17 @@ int process_init_event(uint8_t *evt_buf, uint16_t len) len_left -= (tag_len+2); } + // if ESP_PRIV_FIRMWARE_VERSION was not received, slave version will be 0.0.0 + compare_fw_version(slave_fw_version); + if ((chip_type != ESP_PRIV_FIRMWARE_CHIP_ESP32) && (chip_type != ESP_PRIV_FIRMWARE_CHIP_ESP32S2) && (chip_type != ESP_PRIV_FIRMWARE_CHIP_ESP32S3) && (chip_type != ESP_PRIV_FIRMWARE_CHIP_ESP32C2) && (chip_type != ESP_PRIV_FIRMWARE_CHIP_ESP32C3) && (chip_type != ESP_PRIV_FIRMWARE_CHIP_ESP32C6) && - (chip_type != ESP_PRIV_FIRMWARE_CHIP_ESP32C5)) { + (chip_type != ESP_PRIV_FIRMWARE_CHIP_ESP32C5) && + (chip_type != ESP_PRIV_FIRMWARE_CHIP_ESP32C61)) { ESP_LOGI(TAG, "ESP board type is not mentioned, ignoring [%d]\n\r", chip_type); chip_type = ESP_PRIV_FIRMWARE_CHIP_UNRECOGNIZED; return -1; @@ -648,9 +775,14 @@ int process_init_event(uint8_t *evt_buf, uint16_t len) } transport_driver_event_handler(TRANSPORT_TX_ACTIVE); - return send_slave_config(0, chip_type, raw_tp_config, + + ESP_ERROR_CHECK(send_slave_config(0, chip_type, raw_tp_config, H_WIFI_TX_DATA_THROTTLE_LOW_THRESHOLD, - H_WIFI_TX_DATA_THROTTLE_HIGH_THRESHOLD); + H_WIFI_TX_DATA_THROTTLE_HIGH_THRESHOLD)); + + transport_delayed_init(); + + return 0; } int serial_rx_handler(interface_buffer_handle_t * buf_handle) diff --git a/host/drivers/transport/transport_drv.h b/host/drivers/transport/transport_drv.h index 58735d98..b85e190a 100644 --- a/host/drivers/transport/transport_drv.h +++ b/host/drivers/transport/transport_drv.h @@ -1,17 +1,8 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /** prevent recursive inclusion **/ #ifndef __TRANSPORT_DRV_H @@ -23,18 +14,25 @@ extern "C" { /** Includes **/ -#include "common.h" -#if 0 -#include "os_wrapper.h" -#include "trace.h" -#endif -//#include "netdev_if.h" +#include "esp_err.h" + #include "esp_hosted_transport.h" -#include "esp_hosted_config.h" #include "esp_hosted_api_types.h" #include "esp_hosted_interface.h" #include "esp_hosted_header.h" +#include "port_esp_hosted_host_config.h" + +#if H_TRANSPORT_IN_USE == H_TRANSPORT_SPI +#include "port_esp_hosted_host_spi.h" +#elif H_TRANSPORT_IN_USE == H_TRANSPORT_SDIO +#include "port_esp_hosted_host_sdio.h" +#elif H_TRANSPORT_IN_USE == H_TRANSPORT_SPI_HD +#include "port_esp_hosted_host_spi_hd.h" +#elif H_TRANSPORT_IN_USE == H_TRANSPORT_UART +#include "port_esp_hosted_host_uart.h" +#endif + /* ESP in sdkconfig has CONFIG_IDF_FIRMWARE_CHIP_ID entry. * supported values of CONFIG_IDF_FIRMWARE_CHIP_ID are - */ #define ESP_PRIV_FIRMWARE_CHIP_UNRECOGNIZED (0xff) @@ -45,18 +43,58 @@ extern "C" { #define ESP_PRIV_FIRMWARE_CHIP_ESP32C2 (0xC) #define ESP_PRIV_FIRMWARE_CHIP_ESP32C6 (0xD) #define ESP_PRIV_FIRMWARE_CHIP_ESP32C5 (0x17) +#define ESP_PRIV_FIRMWARE_CHIP_ESP32C61 (0x14) +#define MAX_SPI_BUFFER_SIZE ESP_TRANSPORT_SPI_MAX_BUF_SIZE +#define MAX_SDIO_BUFFER_SIZE ESP_TRANSPORT_SDIO_MAX_BUF_SIZE +#define MAX_SPI_HD_BUFFER_SIZE ESP_TRANSPORT_SPI_HD_MAX_BUF_SIZE +#define MAX_UART_BUFFER_SIZE ESP_TRANSPORT_UART_MAX_BUF_SIZE -#if H_TRANSPORT_IN_USE == H_TRANSPORT_SPI -#include "spi_wrapper.h" -#define SPI_MODE0 (0) -#define SPI_MODE1 (1) -#define SPI_MODE2 (2) -#define SPI_MODE3 (3) -#else -#include "sdio_wrapper.h" +#ifndef BIT +#define BIT(x) (1UL << (x)) +#endif + +#ifndef BIT64 +#define BIT64(nr) (1ULL << (nr)) #endif +#define H_MIN(a, b) (((a) < (b)) ? (a) : (b)) + +#define MHZ_TO_HZ(x) (1000000*(x)) + +#define H_FREE_PTR_WITH_FUNC(FreeFunc, FreePtr) do { \ + if (FreeFunc && FreePtr) { \ + FreeFunc(FreePtr); \ + FreePtr = NULL; \ + } \ +} while (0); + +#define SUCCESS 0 +#define FAILURE -1 + +typedef enum { + TRANSPORT_INACTIVE, + TRANSPORT_RX_ACTIVE, + TRANSPORT_TX_ACTIVE, +} transport_drv_events_e; + +/* interface header */ +typedef struct { + union { + void *priv_buffer_handle; + }; + uint8_t if_type; + uint8_t if_num; + uint8_t *payload; + uint8_t flag; + uint16_t payload_len; + uint16_t seq_num; + /* no need of memcpy at different layers */ + uint8_t payload_zcopy; + + void (*free_buf_handle)(void *buf_handle); +} interface_buffer_handle_t; + struct esp_private { uint8_t if_type; uint8_t if_num; @@ -64,9 +102,9 @@ struct esp_private { }; struct hosted_transport_context_t { - uint8_t *tx_buf; - uint32_t tx_buf_size; - uint8_t *rx_buf; + uint8_t *tx_buf; + uint32_t tx_buf_size; + uint8_t *rx_buf; }; extern volatile uint8_t wifi_tx_throttling; @@ -80,36 +118,27 @@ typedef esp_err_t (*transport_channel_rx_fn_t)(void *h, void *buffer, void * buf typedef struct { void * api_chan; esp_hosted_if_type_t if_type; - uint8_t secure; + uint8_t secure; transport_channel_tx_fn_t tx; transport_channel_rx_fn_t rx; void *memp; } transport_channel_t; -#if 0 -/* netdev APIs*/ -int esp_netdev_open(netdev_handle_t netdev); -int esp_netdev_close(netdev_handle_t netdev); -int esp_netdev_xmit(netdev_handle_t netdev, struct pbuf *net_buf); -#endif - -esp_err_t transport_drv_init(void(*esp_hosted_up_cb)(void)); -esp_err_t transport_drv_deinit(void); +esp_err_t setup_transport(void(*esp_hosted_up_cb)(void)); +esp_err_t teardown_transport(void); esp_err_t transport_drv_reconfigure(void); transport_channel_t *transport_drv_add_channel(void *api_chan, esp_hosted_if_type_t if_type, uint8_t secure, transport_channel_tx_fn_t *tx, const transport_channel_rx_fn_t rx); esp_err_t transport_drv_remove_channel(transport_channel_t *channel); -/* TODO To move to private header */ -void process_capabilities(uint8_t cap); -void transport_init_internal(void); -void transport_deinit_internal(void); + +void *bus_init_internal(void); +void bus_deinit_internal(void *bus_handle); void process_priv_communication(interface_buffer_handle_t *buf_handle); -void print_capabilities(uint32_t cap); -int process_init_event(uint8_t *evt_buf, uint16_t len); + esp_err_t send_slave_config(uint8_t host_cap, uint8_t firmware_chip_id, uint8_t raw_tp_direction, uint8_t low_thr_thesh, uint8_t high_thr_thesh); @@ -121,16 +150,22 @@ uint8_t is_transport_tx_ready(void); #define H_DEFLT_FREE_FUNC g_h.funcs->_h_free -#define MAX_RETRY_TRANSPORT_ACTIVE 1000 +#define MAX_RETRY_TRANSPORT_ACTIVE 100 int esp_hosted_tx(uint8_t iface_type, uint8_t iface_num, - uint8_t * buffer, uint16_t len, uint8_t buff_zerocopy, void (*free_buf_fun)(void* ptr)); - -int esp_hosted_register_wifi_rxcb(int ifx, hosted_rxcb_t fn); -int esp_hosted_register_wifi_txcb(int ifx, hosted_rxcb_t fn); + uint8_t *payload_buf, uint16_t payload_len, uint8_t buff_zerocopy, + uint8_t *buffer_to_free, void (*free_buf_func)(void *ptr), uint8_t flags); int serial_rx_handler(interface_buffer_handle_t * buf_handle); +void set_transport_state(uint8_t state); + +int ensure_slave_bus_ready(void *bus_handle); +void check_if_max_freq_used(uint8_t chip_type); + +int bus_inform_slave_host_power_save_start(void); +int bus_inform_slave_host_power_save_stop(void); + #ifdef __cplusplus } #endif diff --git a/host/drivers/transport/uart/uart_drv.c b/host/drivers/transport/uart/uart_drv.c index a5502ed3..f4054c1a 100644 --- a/host/drivers/transport/uart/uart_drv.c +++ b/host/drivers/transport/uart/uart_drv.c @@ -1,28 +1,24 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2024 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /** Includes **/ #include "drivers/bt/hci_drv.h" -#include "common.h" #include "endian.h" #include "esp_log.h" #include "esp_hosted_log.h" #include "transport_drv.h" #include "stats.h" +#include "esp_hosted_power_save.h" +#include "esp_hosted_transport_config.h" +#include "power_save_drv.h" +#include "esp_hosted_bt.h" +#include "port_esp_hosted_host_os.h" static const char TAG[] = "H_UART_DRV"; @@ -74,23 +70,115 @@ static inline void h_uart_buffer_free(void *buf) mempool_free(buf_mp_g, buf); } -static void h_uart_write_task(void const* pvParameters) +/* + * Write a packet to the UART bus + * Returns ESP_OK on success, ESP_FAIL on failure + */ +static int h_uart_write_packet(interface_buffer_handle_t *buf_handle) { uint16_t len = 0; uint8_t *sendbuf = NULL; void (*free_func)(void* ptr) = NULL; - interface_buffer_handle_t buf_handle = {0}; uint8_t * payload = NULL; struct esp_payload_header * payload_header = NULL; - - uint8_t tx_needed = 1; - int tx_len_to_send; int tx_len; + int result = ESP_OK; + + if (unlikely(!buf_handle)) + return ESP_FAIL; + + len = buf_handle->payload_len; + + if (unlikely(!buf_handle->flag && !len)) { + ESP_LOGE(TAG, "%s: Empty len", __func__); + return ESP_FAIL; + } + + if (!buf_handle->payload_zcopy) { + sendbuf = h_uart_buffer_alloc(MEMSET_REQUIRED); + if (!sendbuf) { + ESP_LOGE(TAG, "uart buff malloc failed"); + return ESP_FAIL; + } + free_func = h_uart_buffer_free; + } else { + sendbuf = buf_handle->payload; + free_func = buf_handle->free_buf_handle; + } + + if (buf_handle->payload_len > MAX_UART_BUFFER_SIZE - sizeof(struct esp_payload_header)) { + ESP_LOGE(TAG, "Pkt len [%u] > Max [%u]. Drop", + buf_handle->payload_len, MAX_UART_BUFFER_SIZE - sizeof(struct esp_payload_header)); + result = ESP_FAIL; + goto done; + } + + /* Form Tx header */ + payload_header = (struct esp_payload_header *) sendbuf; + payload = sendbuf + sizeof(struct esp_payload_header); + + payload_header->len = htole16(len); + payload_header->offset = htole16(sizeof(struct esp_payload_header)); + payload_header->if_type = buf_handle->if_type; + payload_header->if_num = buf_handle->if_num; + payload_header->seq_num = htole16(buf_handle->seq_num); + payload_header->flags = buf_handle->flag; + + if (payload_header->if_type == ESP_HCI_IF) { + // special handling for HCI + if (!buf_handle->payload_zcopy) { + // copy first byte of payload into header + payload_header->hci_pkt_type = buf_handle->payload[0]; + // adjust actual payload len + len -= 1; + payload_header->len = htole16(len); + g_h.funcs->_h_memcpy(payload, &buf_handle->payload[1], len); + } + } else { + if (!buf_handle->payload_zcopy) { + g_h.funcs->_h_memcpy(payload, buf_handle->payload, len); + } + } + +#if H_UART_CHECKSUM + payload_header->checksum = htole16(compute_checksum(sendbuf, + sizeof(struct esp_payload_header) + len)); +#endif + + tx_len_to_send = len + sizeof(struct esp_payload_header); + tx_len = g_h.funcs->_h_uart_write(uart_handle, sendbuf, tx_len_to_send); + if (tx_len != tx_len_to_send) { + ESP_LOGE(TAG, "failed to send uart data"); + result = ESP_FAIL; + goto done; + } + +#if ESP_PKT_STATS + if (buf_handle->if_type == ESP_STA_IF) + pkt_stats.sta_tx_out++; +#endif + +done: + if (len && !buf_handle->payload_zcopy) { + /* free allocated buffer, only if zerocopy is not requested */ + H_FREE_PTR_WITH_FUNC(buf_handle->free_buf_handle, buf_handle->priv_buffer_handle); + } + H_FREE_PTR_WITH_FUNC(free_func, sendbuf); + + return result; +} + +static void h_uart_write_task(void const* pvParameters) +{ + interface_buffer_handle_t buf_handle = {0}; + uint8_t tx_needed = 1; while (!uart_start_write_thread) g_h.funcs->_h_msleep(10); + ESP_LOGD(TAG, "h_uart_write_task: write thread started"); + while (1) { /* Check if higher layers have anything to transmit */ g_h.funcs->_h_get_semaphore(sem_to_slave_queue, HOSTED_BLOCK_MAX); @@ -102,77 +190,11 @@ static void h_uart_write_task(void const* pvParameters) tx_needed = 0; /* No Tx msg */ } - if (tx_needed) - len = buf_handle.payload_len; - - if (!len) { - ESP_LOGE(TAG, "%s: Empty len", __func__); - goto done; - } - - if (!buf_handle.payload_zcopy) { - sendbuf = h_uart_buffer_alloc(MEMSET_REQUIRED); - assert(sendbuf); - free_func = h_uart_buffer_free; - } else { - sendbuf = buf_handle.payload; - free_func = buf_handle.free_buf_handle; - } - - if (!sendbuf) { - ESP_LOGE(TAG, "uart buff malloc failed"); - free_func = NULL; - goto done; - } - - if (buf_handle.payload_len > MAX_UART_BUFFER_SIZE - sizeof(struct esp_payload_header)) { - ESP_LOGE(TAG, "Pkt len [%u] > Max [%u]. Drop", - buf_handle.payload_len, MAX_UART_BUFFER_SIZE - sizeof(struct esp_payload_header)); - goto done; - } - - /* Form Tx header */ - payload_header = (struct esp_payload_header *) sendbuf; - payload = sendbuf + sizeof(struct esp_payload_header); - - payload_header->len = htole16(len); - payload_header->offset = htole16(sizeof(struct esp_payload_header)); - payload_header->if_type = buf_handle.if_type; - payload_header->if_num = buf_handle.if_num; - payload_header->seq_num = htole16(buf_handle.seq_num); - payload_header->flags = buf_handle.flag; - - if (payload_header->if_type == ESP_HCI_IF) { - // special handling for HCI - if (!buf_handle.payload_zcopy) { - // copy first byte of payload into header - payload_header->hci_pkt_type = buf_handle.payload[0]; - // adjust actual payload len - len -= 1; - payload_header->len = htole16(len); - g_h.funcs->_h_memcpy(payload, &buf_handle.payload[1], len); - } - } else - if (!buf_handle.payload_zcopy) - g_h.funcs->_h_memcpy(payload, buf_handle.payload, len); - -#if H_UART_CHECKSUM - payload_header->checksum = htole16(compute_checksum(sendbuf, - sizeof(struct esp_payload_header) + len)); -#endif - - tx_len_to_send = len + sizeof(struct esp_payload_header); - tx_len = g_h.funcs->_h_uart_write(uart_handle, sendbuf, tx_len_to_send); - if (tx_len != tx_len_to_send) { - ESP_LOGE(TAG, "failed to send uart data"); - } + if (!tx_needed) + continue; -done: - if (len && !buf_handle.payload_zcopy) { - /* free allocated buffer, only if zerocopy is not requested */ - H_FREE_PTR_WITH_FUNC(buf_handle.free_buf_handle, buf_handle.priv_buffer_handle); - } - H_FREE_PTR_WITH_FUNC(free_func, sendbuf); + /* Send the packet */ + h_uart_write_packet(&buf_handle); } } @@ -221,7 +243,7 @@ static void h_uart_process_rx_task(void const* pvParameters) buf_handle = &buf_handle_l; - ESP_HEXLOGV("rx", buf_handle->payload, buf_handle->payload_len); + ESP_HEXLOGV("h_uart_rx", buf_handle->payload, buf_handle->payload_len, 32); if (buf_handle->if_type == ESP_SERIAL_IF) { /* serial interface path */ @@ -261,7 +283,7 @@ static void h_uart_process_rx_task(void const* pvParameters) /* User can re-use this type of transaction */ } } else if (buf_handle->if_type == ESP_HCI_IF) { - hci_rx_handler(buf_handle); + hci_rx_handler(buf_handle->payload, buf_handle->payload_len); } else if (buf_handle->if_type == ESP_TEST_IF) { #if TEST_RAW_TP update_test_raw_tp_rx_len(buf_handle->payload_len + @@ -271,6 +293,11 @@ static void h_uart_process_rx_task(void const* pvParameters) ESP_LOGW(TAG, "unknown type %d ", buf_handle->if_type); } +#if ESP_PKT_STATS + if (buf_handle->if_type == ESP_STA_IF) + pkt_stats.sta_rx_out++; +#endif + /* Free buffer handle */ /* When buffer offloaded to other module, that module is * responsible for freeing buffer. In case not offloaded or @@ -458,7 +485,7 @@ static void h_uart_read_task(void const* pvParameters) } } -void transport_init_internal(void) +void *bus_init_internal(void) { uint8_t prio_q_idx = 0; @@ -496,36 +523,49 @@ void transport_init_internal(void) h_uart_write_task_info = g_h.funcs->_h_thread_create("uart_tx", DFLT_TASK_PRIO, DFLT_TASK_STACK_SIZE, h_uart_write_task, NULL); + + return uart_handle; } +/** + * @brief Send to slave + * @param iface_type -type of interface + * iface_num - interface number + * payload_buf - tx buffer + * payload_len - size of tx buffer + * buffer_to_free - buffer to be freed after tx + * free_buf_func - function used to free buffer_to_free + * flags - flags to set + * @retval int - ESP_OK or ESP_FAIL + */ int esp_hosted_tx(uint8_t iface_type, uint8_t iface_num, - uint8_t * wbuffer, uint16_t wlen, uint8_t buff_zcopy, - void (*free_wbuf_fun)(void* ptr)) + uint8_t *payload_buf, uint16_t payload_len, uint8_t buff_zcopy, + uint8_t *buffer_to_free, void (*free_buf_func)(void *ptr), uint8_t flags) { interface_buffer_handle_t buf_handle = {0}; void (*free_func)(void* ptr) = NULL; uint8_t pkt_prio = PRIO_Q_OTHERS; uint8_t transport_up = is_transport_tx_ready(); - if (free_wbuf_fun) - free_func = free_wbuf_fun; + if (free_buf_func) + free_func = free_buf_func; - if (!wbuffer || !wlen || - (wlen > MAX_PAYLOAD_SIZE) || - !transport_up) { + if ((flags == 0 || flags == MORE_FRAGMENT) && + (!payload_buf || !payload_len || (payload_len > MAX_PAYLOAD_SIZE) || !transport_up)) { ESP_LOGE(TAG, "tx fail: NULL buff, invalid len (%u) or len > max len (%u), transport_up(%u))", - wlen, MAX_PAYLOAD_SIZE, transport_up); - H_FREE_PTR_WITH_FUNC(free_func, wbuffer); + payload_len, MAX_PAYLOAD_SIZE, transport_up); + H_FREE_PTR_WITH_FUNC(free_func, buffer_to_free); return ESP_FAIL; } buf_handle.payload_zcopy = buff_zcopy; buf_handle.if_type = iface_type; buf_handle.if_num = iface_num; - buf_handle.payload_len = wlen; - buf_handle.payload = wbuffer; - buf_handle.priv_buffer_handle = wbuffer; + buf_handle.payload_len = payload_len; + buf_handle.payload = payload_buf; + buf_handle.priv_buffer_handle = buffer_to_free; buf_handle.free_buf_handle = free_func; + buf_handle.flag = flags; if (buf_handle.if_type == ESP_SERIAL_IF) pkt_prio = PRIO_Q_SERIAL; @@ -542,3 +582,165 @@ int esp_hosted_tx(uint8_t iface_type, uint8_t iface_num, return ESP_OK; } + +void bus_deinit_internal(void *bus_handle) +{ + uint8_t prio_q_idx = 0; + + /* Stop threads */ + if (h_uart_write_task_info) { + g_h.funcs->_h_thread_cancel(h_uart_write_task_info); + h_uart_write_task_info = NULL; + } + + if (h_uart_read_task_info) { + g_h.funcs->_h_thread_cancel(h_uart_read_task_info); + h_uart_read_task_info = NULL; + } + + if (h_uart_process_rx_task_info) { + g_h.funcs->_h_thread_cancel(h_uart_process_rx_task_info); + h_uart_process_rx_task_info = NULL; + } + + /* Clean up queues */ + for (prio_q_idx = 0; prio_q_idx < MAX_PRIORITY_QUEUES; prio_q_idx++) { + if (from_slave_queue[prio_q_idx]) { + g_h.funcs->_h_destroy_queue(from_slave_queue[prio_q_idx]); + from_slave_queue[prio_q_idx] = NULL; + } + + if (to_slave_queue[prio_q_idx]) { + g_h.funcs->_h_destroy_queue(to_slave_queue[prio_q_idx]); + to_slave_queue[prio_q_idx] = NULL; + } + } + + /* Clean up semaphores */ + if (sem_to_slave_queue) { + g_h.funcs->_h_destroy_semaphore(sem_to_slave_queue); + sem_to_slave_queue = NULL; + } + + if (sem_from_slave_queue) { + g_h.funcs->_h_destroy_semaphore(sem_from_slave_queue); + sem_from_slave_queue = NULL; + } + + /* Deinitialize the UART bus */ + if (uart_handle) { + ESP_LOGI(TAG, "Deinitializing UART bus"); + if (bus_handle) { + g_h.funcs->_h_bus_deinit(bus_handle); + } + + if (buf_mp_g) { + mempool_destroy(buf_mp_g); + buf_mp_g = NULL; + } + uart_handle = NULL; + } +} + +int ensure_slave_bus_ready(void *bus_handle) +{ + esp_err_t res = ESP_OK; + gpio_pin_t reset_pin = { .port = H_GPIO_PORT_RESET, .pin = H_GPIO_PIN_RESET }; + + if (ESP_TRANSPORT_OK != esp_hosted_transport_get_reset_config(&reset_pin)) { + ESP_LOGE(TAG, "Unable to get RESET config for transport"); + return ESP_FAIL; + } + + assert(reset_pin.pin != -1); + + release_slave_reset_gpio_post_wakeup(); + + if (!esp_hosted_woke_from_power_save()) { + /* Reset the slave */ + ESP_LOGI(TAG, "Resetting slave on UART bus with pin %d", reset_pin.pin); + g_h.funcs->_h_config_gpio(reset_pin.port, reset_pin.pin, H_GPIO_MODE_DEF_OUTPUT); + g_h.funcs->_h_write_gpio(reset_pin.port, reset_pin.pin, H_RESET_VAL_ACTIVE); + g_h.funcs->_h_msleep(1); + g_h.funcs->_h_write_gpio(reset_pin.port, reset_pin.pin, H_RESET_VAL_INACTIVE); + g_h.funcs->_h_msleep(1); + g_h.funcs->_h_write_gpio(reset_pin.port, reset_pin.pin, H_RESET_VAL_ACTIVE); + g_h.funcs->_h_msleep(1500); + } else { + stop_host_power_save(); + } + + return res; +} + +int bus_inform_slave_host_power_save_start(void) +{ + ESP_LOGI(TAG, "Inform slave, host power save is started"); + int ret = ESP_OK; + + /* + * If the write thread is not started yet (which happens after receiving INIT event), + * we need to send the power save message directly to avoid deadlock. + * Otherwise, use the normal queue mechanism. + */ + if (!uart_start_write_thread) { + interface_buffer_handle_t buf_handle = {0}; + + buf_handle.payload_zcopy = H_BUFF_NO_ZEROCOPY; + buf_handle.if_type = ESP_SERIAL_IF; + buf_handle.if_num = 0; + buf_handle.payload_len = 0; + buf_handle.payload = NULL; + buf_handle.priv_buffer_handle = NULL; + buf_handle.free_buf_handle = NULL; + buf_handle.flag = FLAG_POWER_SAVE_STARTED; + + ESP_LOGI(TAG, "Sending power save start message directly"); + ret = h_uart_write_packet(&buf_handle); + } else { + /* Use normal queue mechanism */ + ret = esp_hosted_tx(ESP_SERIAL_IF, 0, NULL, 0, + H_BUFF_NO_ZEROCOPY, NULL, NULL, FLAG_POWER_SAVE_STARTED); + } + + return ret; +} + +int bus_inform_slave_host_power_save_stop(void) +{ + ESP_LOGI(TAG, "Inform slave, host power save is stopped"); + int ret = ESP_OK; + + + /* + * If the write thread is not started yet (which happens after receiving INIT event), + * we need to send the power save message directly to avoid deadlock. + * Otherwise, use the normal queue mechanism. + */ + if (!uart_start_write_thread) { + interface_buffer_handle_t buf_handle = {0}; + + buf_handle.payload_zcopy = H_BUFF_NO_ZEROCOPY; + buf_handle.if_type = ESP_SERIAL_IF; + buf_handle.if_num = 0; + buf_handle.payload_len = 0; + buf_handle.payload = NULL; + buf_handle.priv_buffer_handle = NULL; + buf_handle.free_buf_handle = NULL; + buf_handle.flag = FLAG_POWER_SAVE_STOPPED; + + ESP_LOGI(TAG, "Sending power save start message directly"); + ret = h_uart_write_packet(&buf_handle); + } else { + /* Use normal queue mechanism */ + ret = esp_hosted_tx(ESP_SERIAL_IF, 0, NULL, 0, + H_BUFF_NO_ZEROCOPY, NULL, NULL, FLAG_POWER_SAVE_STOPPED); + } + + return ret; +} + +void check_if_max_freq_used(uint8_t chip_type) +{ + /* TODO: Implement */ +} diff --git a/host/drivers/virtual_serial_if/serial_if.c b/host/drivers/virtual_serial_if/serial_if.c index 569b0992..ea808dfc 100644 --- a/host/drivers/virtual_serial_if/serial_if.c +++ b/host/drivers/virtual_serial_if/serial_if.c @@ -3,10 +3,9 @@ /** Includes **/ #include -#include "os_wrapper.h" #include "serial_if.h" #include "serial_drv.h" -#include "esp_log.h" +#include "port_esp_hosted_host_log.h" DEFINE_LOG_TAG(serial_if); @@ -18,24 +17,6 @@ DEFINE_LOG_TAG(serial_if); #define PROTO_PSER_TLV_T_EPNAME 0x01 #define PROTO_PSER_TLV_T_DATA 0x02 -#if 0 -#ifdef MCU_SYS -#define command_log(format, ...) printf(format "\r", ##__VA_ARGS__); -#else -#define command_log(...) printf("%s:%u ",__func__,__LINE__); \ - printf(__VA_ARGS__); -#endif -#endif - -#if 0 -#define HOSTED_CALLOC(buff,nbytes) do { \ - buff = (uint8_t *)g_h.funcs->_h_calloc(1, nbytes); \ - if (!buff) { \ - printf("%s, Failed to allocate memory \n", __func__); \ - goto free_bufs; \ - } \ -} while(0); -#endif /** Exported variables **/ struct serial_drv_handle_t* serial_handle = NULL; @@ -171,6 +152,11 @@ int transport_pserial_send(uint8_t* data, uint16_t data_length) uint16_t buf_len = 0; uint8_t *write_buf = NULL; + if (!data || !data_length) { + ESP_LOGW(TAG, "Empty RPC data, ignored"); + return FAILURE; + } + /* * TLV (Type - Length - Value) structure is as follows: * -------------------------------------------------------------------------------------------- @@ -185,30 +171,31 @@ int transport_pserial_send(uint8_t* data, uint16_t data_length) buf_len = SIZE_OF_TYPE + SIZE_OF_LENGTH + strlen(ep_name) + SIZE_OF_TYPE + SIZE_OF_LENGTH + data_length; - HOSTED_CALLOC(uint8_t,write_buf,buf_len,free_bufs); + HOSTED_CALLOC(uint8_t,write_buf,buf_len,free_bufs2); if (!serial_handle) { ESP_LOGE(TAG, "Serial connection closed?\n"); - goto free_bufs; + goto free_bufs1; } count = compose_tlv(write_buf, data, data_length); if (!count) { ESP_LOGE(TAG, "Failed to compose TX data\n"); - goto free_bufs; + goto free_bufs1; } ret = serial_drv_write(serial_handle, write_buf, count, &count); if (ret != SUCCESS) { ESP_LOGE(TAG, "Failed to write TX data\n"); - goto free_bufs; - } - return SUCCESS; -free_bufs: - if (write_buf) { - g_h.funcs->_h_free(write_buf); + goto free_bufs2; } + return ret; + +free_bufs1: + HOSTED_FREE(write_buf); +free_bufs2: + /* write_buf is supposed to be freed by serial_drv_write() */ return FAILURE; } diff --git a/host/drivers/virtual_serial_if/serial_if.h b/host/drivers/virtual_serial_if/serial_if.h index 00a341da..d303526d 100644 --- a/host/drivers/virtual_serial_if/serial_if.h +++ b/host/drivers/virtual_serial_if/serial_if.h @@ -9,7 +9,6 @@ #include #include #include "esp_hosted_transport.h" -#include "os_wrapper.h" #define SIZE_OF_TYPE 1 #define SIZE_OF_LENGTH 2 diff --git a/host/esp_hosted.h b/host/esp_hosted.h index cfff1d3b..2f7c3691 100644 --- a/host/esp_hosted.h +++ b/host/esp_hosted.h @@ -1,17 +1,44 @@ /* -* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD -* -* SPDX-License-Identifier: Apache-2.0 -*/ + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef __ESP_HOSTED_H__ #define __ESP_HOSTED_H__ -#include "esp_hosted_api.h" -#include "esp_hosted_config.h" -#include "esp_hosted_bt_config.h" -#include "esp_hosted_transport_config.h" +#ifdef __cplusplus +extern "C" { +#endif + +#include "esp_hosted_api_types.h" +#include "esp_hosted_host_fw_ver.h" +#include "esp_hosted_misc.h" +#include "esp_hosted_ota.h" typedef struct esp_hosted_transport_config esp_hosted_config_t; +/* --------- Hosted Minimal APIs --------- */ +int esp_hosted_init(void); +int esp_hosted_deinit(void); + +int esp_hosted_connect_to_slave(void); +int esp_hosted_get_coprocessor_fwversion(esp_hosted_coprocessor_fwver_t *ver_info); + +/* --------- Exhaustive API list --------- */ +/* + * 1. All Wi-Fi supported APIs + * File: host/api/src/esp_wifi_weak.c + * + * 2. Communication Bus APIs (Set and get transport config) + * File : host/api/include/esp_hosted_transport_config.h + * + * 3. Co-Processor OTA API + * File : host/api/include/esp_hosted_ota.h + */ + +#ifdef __cplusplus +} +#endif + #endif /* __ESP_HOSTED_H__ */ diff --git a/host/esp_hosted_bluedroid.h b/host/esp_hosted_bluedroid.h new file mode 100644 index 00000000..022fcbfc --- /dev/null +++ b/host/esp_hosted_bluedroid.h @@ -0,0 +1,23 @@ +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ESP_HOSTED_BLUEDROID_H +#define __ESP_HOSTED_BLUEDROID_H + +// ESP-Hosted Bluedroid interface for Host +// Only include if using ESP-IDF Bluedroid + +#include "esp_hosted_bt.h" +#include "esp_bluedroid_hci.h" + +// BT Bluedroid interface for Host +void hosted_hci_bluedroid_open(void); +void hosted_hci_bluedroid_close(void); +void hosted_hci_bluedroid_send(uint8_t *data, uint16_t len); +bool hosted_hci_bluedroid_check_send_available(void); +esp_err_t hosted_hci_bluedroid_register_host_callback(const esp_bluedroid_hci_driver_callbacks_t *callback); + +#endif // __ESP_HOSTED_BLUEDROID_H diff --git a/host/esp_hosted_bt.h b/host/esp_hosted_bt.h index 3e6d86a0..c282d8c1 100644 --- a/host/esp_hosted_bt.h +++ b/host/esp_hosted_bt.h @@ -1,21 +1,15 @@ -// Copyright 2015-2024 Espressif Systems (Shanghai) PTE LTD -/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */ +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef __ESP_HOSTED_BT_H #define __ESP_HOSTED_BT_H -#include "esp_hosted_bt_config.h" +#include -#if H_BT_HOST_ESP_BLUEDROID -#include "esp_bluedroid_hci.h" +// Handles BT Rx +int hci_rx_handler(uint8_t *buf, size_t buf_len); -// BT Bluedroid interface for Host -void hosted_hci_bluedroid_open(void); -void hosted_hci_bluedroid_close(void); -void hosted_hci_bluedroid_send(uint8_t *data, uint16_t len); -bool hosted_hci_bluedroid_check_send_available(void); -esp_err_t hosted_hci_bluedroid_register_host_callback(const esp_bluedroid_hci_driver_callbacks_t *callback); - -#endif // H_BT_HOST_ESP_BLUEDROID - -#endif // __ESP_HOSTED_BT_H +#endif diff --git a/host/esp_hosted_host_fw_ver.h b/host/esp_hosted_host_fw_ver.h new file mode 100644 index 00000000..f191545e --- /dev/null +++ b/host/esp_hosted_host_fw_ver.h @@ -0,0 +1,17 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef __ESP_HOSTED_HOST_FW_VERSION_H__ +#define __ESP_HOSTED_HOST_FW_VERSION_H__ +#define ESP_HOSTED_VERSION_MAJOR_1 2 +#define ESP_HOSTED_VERSION_MINOR_1 6 +#define ESP_HOSTED_VERSION_PATCH_1 1 + +/** + * Macro to convert version number into an integer + */ +#define ESP_HOSTED_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch)) + +#endif diff --git a/host/esp_hosted_misc.h b/host/esp_hosted_misc.h new file mode 100644 index 00000000..29e6ad9f --- /dev/null +++ b/host/esp_hosted_misc.h @@ -0,0 +1,83 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ESP_HOSTED_MISC_H__ +#define __ESP_HOSTED_MISC_H__ + +#include +#include "esp_mac.h" + +/** + * @brief Initialise the BT Controller on the co-processor + * + * @return ESP_OK on success + */ +esp_err_t esp_hosted_bt_controller_init(void); + +/** + * @brief Deinitialise the BT Controller on the co-processor + * + * @param mem_release. Also releases memory used by controller. Once released, the BT controller cannot reuse the memory and cannot be initialised + * + * @return ESP_OK on success + */ +esp_err_t esp_hosted_bt_controller_deinit(bool mem_release); + +/** + * @brief Enables the BT Controller on the co-processor. Call only after initialising the BT controller. + * + * @return ESP_OK on success + */ +esp_err_t esp_hosted_bt_controller_enable(void); + +/** + * @brief Disables the BT Controller on the co-processor. Call before deinitialising the BT controller. + * + * @return ESP_OK on success + */ +esp_err_t esp_hosted_bt_controller_disable(void); + +/** + * @brief Set custom MAC address of the interface. + * + * This function allows you to overwrite the MAC addresses of the + * interfaces set by the base MAC address. + * + * @param mac MAC address, length: 6 bytes/8 bytes. + * length: 6 bytes for MAC-48 + * 8 bytes for EUI-64(used for ESP_MAC_IEEE802154 type) + * @param mac_len Length of the mac array + * @param type Type of MAC address + * + * @return ESP_OK on success + */ +esp_err_t esp_hosted_iface_mac_addr_set(uint8_t *mac, size_t mac_len, esp_mac_type_t type); + +/** + * @brief Read MAC address of the interface. + * + * @param mac base MAC address, length: 6 bytes/8 bytes. + * length: 6 bytes for MAC-48 + * 8 bytes for EUI-64(used for IEEE 802.15.4) + * @param mac_len Length of the mac array + * @param type Type of MAC address + * + * @return ESP_OK on success + */ +esp_err_t esp_hosted_iface_mac_addr_get(uint8_t *mac, size_t mac_len, esp_mac_type_t type); + +/** + * @brief Return the size of the MAC type in bytes. + * + * @param type Type of MAC address + * + * @return 0 MAC type not found (not supported) + * 6 bytes for MAC-48. + * 8 bytes for EUI-64. + */ +size_t esp_hosted_iface_mac_addr_len_get(esp_mac_type_t type); + +#endif diff --git a/host/hosted_os_abstraction.h b/host/esp_hosted_os_abstraction.h similarity index 63% rename from host/hosted_os_abstraction.h rename to host/esp_hosted_os_abstraction.h index 6ba1ddd1..5ad12af7 100644 --- a/host/hosted_os_abstraction.h +++ b/host/esp_hosted_os_abstraction.h @@ -2,10 +2,8 @@ * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD * SPDX-License-Identifier: Apache-2.0 */ -#ifndef __HOSTED_OS_ABSTRACTION_H__ -#define __HOSTED_OS_ABSTRACTION_H__ - -#include "esp_hosted_config.h" +#ifndef __ESP_HOSTED_OS_ABSTRACTION_H__ +#define __ESP_HOSTED_OS_ABSTRACTION_H__ typedef struct { /* Memory */ @@ -19,7 +17,7 @@ typedef struct { /* 8 */ void (*_h_free_align)(void* ptr); /* Thread */ -/* 11 */ void* (*_h_thread_create)(char *tname, uint32_t tprio, uint32_t tstack_size, void (*start_routine)(void const *), void *sr_arg); +/* 11 */ void* (*_h_thread_create)(const char *tname, uint32_t tprio, uint32_t tstack_size, void (*start_routine)(void const *), void *sr_arg); /* 12 */ int (*_h_thread_cancel)(void *thread_handle); /* Sleeps */ @@ -53,7 +51,7 @@ typedef struct { /* Timer */ /* 32 */ int (*_h_timer_stop)(void *timer_handle); -/* 33 */ void* (*_h_timer_start)(int duration, int type, void (*timeout_handler)(void *), void *arg); +/* 33 */ void* (*_h_timer_start)(const char *name, int duration_ms, int type, void (*timeout_handler)(void *), void *arg); /* Mempool */ #ifdef H_USE_MEMPOOL @@ -64,45 +62,57 @@ typedef struct { /* GPIO */ /* 37 */ int (*_h_config_gpio)(void* gpio_port, uint32_t gpio_num, uint32_t mode); -/* 38 */ int (*_h_config_gpio_as_interrupt)(void* gpio_port, uint32_t gpio_num, uint32_t intr_type, void (*gpio_isr_handler)(void* arg)); +/* 38 */ int (*_h_config_gpio_as_interrupt)(void* gpio_port, uint32_t gpio_num, uint32_t intr_type, void (*gpio_isr_handler)(void* arg), void *arg); +/* 39 */ int (*_h_teardown_gpio_interrupt)(void* gpio_port, uint32_t gpio_num); /* 39 */ int (*_h_read_gpio)(void* gpio_port, uint32_t gpio_num); /* 40 */ int (*_h_write_gpio)(void* gpio_port, uint32_t gpio_num, uint32_t value); - +/* 40 */ int (*_h_pull_gpio)(void* gpio_port, uint32_t gpio_num, uint32_t pull_value, uint32_t enable); +/* 41 */ int (*_h_hold_gpio)(void* gpio_port, uint32_t gpio_num, uint32_t hold_value); +/* 42 */ int (*_h_get_host_wakeup_or_reboot_reason)(void); /* All Transports - Init */ /* 41 */ void * (*_h_bus_init)(void); +/* 42 */ int (*_h_bus_deinit)(void*); /* Transport - SPI */ #if H_TRANSPORT_IN_USE == H_TRANSPORT_SPI -/* 42 */ int (*_h_do_bus_transfer)(void *transfer_context); +/* 43 */ int (*_h_do_bus_transfer)(void *transfer_context); #endif -/* 43 */ int (*_h_event_wifi_post)(int32_t event_id, void* event_data, size_t event_data_size, uint32_t ticks_to_wait); -/* 44 */ void (*_h_printf)(int level, const char *tag, const char *format, ...); -/* 45 */ void (*_h_hosted_init_hook)(void); +/* 44 */ int (*_h_event_wifi_post)(int32_t event_id, void* event_data, size_t event_data_size, uint32_t ticks_to_wait); +// 45 - int (*_h_event_ip_post)(int32_t event_id, void* event_data, size_t event_data_size, uint32_t ticks_to_wait); +/* 45 */ void (*_h_printf)(int level, const char *tag, const char *format, ...); +/* 46 */ void (*_h_hosted_init_hook)(void); #if H_TRANSPORT_IN_USE == H_TRANSPORT_SDIO /* Transport - SDIO */ -/* 46 */ int (*_h_sdio_card_init)(void *ctx); -/* 47 */ int (*_h_sdio_read_reg)(void *ctx, uint32_t reg, uint8_t *data, uint16_t size, bool lock_required); -/* 48 */ int (*_h_sdio_write_reg)(void *ctx, uint32_t reg, uint8_t *data, uint16_t size, bool lock_required); -/* 49 */ int (*_h_sdio_read_block)(void *ctx, uint32_t reg, uint8_t *data, uint16_t size, bool lock_required); -/* 50 */ int (*_h_sdio_write_block)(void *ctx, uint32_t reg, uint8_t *data, uint16_t size, bool lock_required); -/* 51 */ int (*_h_sdio_wait_slave_intr)(void *ctx, uint32_t ticks_to_wait); +/* 47 */ int (*_h_sdio_card_init)(void *ctx); +/* 48 */ int (*_h_sdio_card_deinit)(void*ctx); +/* 49 */ int (*_h_sdio_read_reg)(void *ctx, uint32_t reg, uint8_t *data, uint16_t size, bool lock_required); +/* 50 */ int (*_h_sdio_write_reg)(void *ctx, uint32_t reg, uint8_t *data, uint16_t size, bool lock_required); +/* 51 */ int (*_h_sdio_read_block)(void *ctx, uint32_t reg, uint8_t *data, uint16_t size, bool lock_required); +/* 52 */ int (*_h_sdio_write_block)(void *ctx, uint32_t reg, uint8_t *data, uint16_t size, bool lock_required); +/* 53 */ int (*_h_sdio_wait_slave_intr)(void *ctx, uint32_t ticks_to_wait); #endif #if H_TRANSPORT_IN_USE == H_TRANSPORT_SPI_HD /* Transport - SPI HD */ -/* 51 */ int (*_h_spi_hd_read_reg)(uint32_t reg, uint32_t *data, int poll, bool lock_required); -/* 52 */ int (*_h_spi_hd_write_reg)(uint32_t reg, uint32_t *data, bool lock_required); -/* 53 */ int (*_h_spi_hd_read_dma)(uint8_t *data, uint16_t size, bool lock_required); -/* 54 */ int (*_h_spi_hd_write_dma)(uint8_t *data, uint16_t size, bool lock_required); -/* 55 */ int (*_h_spi_hd_set_data_lines)(uint32_t data_lines); -/* 56 */ int (*_h_spi_hd_send_cmd9)(void); +/* 54 */ int (*_h_spi_hd_read_reg)(uint32_t reg, uint32_t *data, int poll, bool lock_required); +/* 55 */ int (*_h_spi_hd_write_reg)(uint32_t reg, uint32_t *data, bool lock_required); +/* 56 */ int (*_h_spi_hd_read_dma)(uint8_t *data, uint16_t size, bool lock_required); +/* 57 */ int (*_h_spi_hd_write_dma)(uint8_t *data, uint16_t size, bool lock_required); +/* 58 */ int (*_h_spi_hd_set_data_lines)(uint32_t data_lines); +/* 59 */ int (*_h_spi_hd_send_cmd9)(void); #endif #if H_TRANSPORT_IN_USE == H_TRANSPORT_UART /* Transport - UART */ -/* 57 */ int (*_h_uart_read)(void *ctx, uint8_t *data, uint16_t size); -/* 58 */ int (*_h_uart_write)(void *ctx, uint8_t *data, uint16_t size); +/* 60 */ int (*_h_uart_read)(void *ctx, uint8_t *data, uint16_t size); +/* 61 */ int (*_h_uart_write)(void *ctx, uint8_t *data, uint16_t size); #endif + +/* 62 */ int (*_h_restart_host)(void); + +/* 63 */ int (*_h_config_host_power_save_hal_impl)(uint32_t power_save_type, void* gpio_port, uint32_t gpio_num, int level); +/* 64 */ int (*_h_start_host_power_save_hal_impl)(uint32_t power_save_type); + } hosted_osi_funcs_t; struct hosted_config_t { @@ -117,4 +127,4 @@ extern hosted_osi_funcs_t g_hosted_osi_funcs; extern struct hosted_config_t g_h; -#endif /*__HOSTED_OS_ABSTRACTION_H__*/ +#endif diff --git a/host/api/include/esp_hosted_bt_config.h b/host/port/esp/freertos/include/port_esp_hosted_host_bt_config.h similarity index 67% rename from host/api/include/esp_hosted_bt_config.h rename to host/port/esp/freertos/include/port_esp_hosted_host_bt_config.h index 4b3aa325..44ad41e0 100644 --- a/host/api/include/esp_hosted_bt_config.h +++ b/host/port/esp/freertos/include/port_esp_hosted_host_bt_config.h @@ -1,10 +1,19 @@ /* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * SPDX-License-Identifier: Apache-2.0 */ -#ifndef __ESP_HOSTED_BT_CONFIG_H__ -#define __ESP_HOSTED_BT_CONFIG_H__ +#ifndef __PORT_ESP_HOSTED_HOST_BT_CONFIG_H__ +#define __PORT_ESP_HOSTED_HOST_BT_CONFIG_H__ + +#include "esp_idf_version.h" + +// check: if co-processor SOC is ESP32, only BT BLE 4.2 is supported +#if CONFIG_SLAVE_IDF_TARGET_ESP32 +#if CONFIG_BT_BLE_50_FEATURES_SUPPORTED || CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT +#error "ESP32 co-processor only supports BLE 4.2" +#endif +#endif // Hosted BT defines for NimBLE #if CONFIG_ESP_HOSTED_ENABLE_BT_NIMBLE diff --git a/host/port/esp/freertos/include/port_esp_hosted_host_config.h b/host/port/esp/freertos/include/port_esp_hosted_host_config.h new file mode 100644 index 00000000..94bf070e --- /dev/null +++ b/host/port/esp/freertos/include/port_esp_hosted_host_config.h @@ -0,0 +1,579 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __PORT_ESP_HOSTED_HOST_CONFIG_H__ +#define __PORT_ESP_HOSTED_HOST_CONFIG_H__ + +#include "sdkconfig.h" +#include "esp_task.h" + +#ifdef CONFIG_ESP_HOSTED_ENABLED + #define H_ESP_HOSTED_HOST 1 +#endif + +#ifdef CONFIG_ESP_HOSTED_DFLT_TASK_STACK + #define H_ESP_HOSTED_DFLT_TASK_STACK CONFIG_ESP_HOSTED_DFLT_TASK_STACK +#endif + +// to allow external code to override Hosted Functions if required +#define H_WEAK_REF __attribute__((weak)) + +#define H_TRANSPORT_NONE 0 +#define H_TRANSPORT_SDIO 1 +#define H_TRANSPORT_SPI_HD 2 +#define H_TRANSPORT_SPI 3 +#define H_TRANSPORT_UART 4 + +#ifdef CONFIG_ESP_HOSTED_UART_HOST_INTERFACE + #include "hal/uart_types.h" +#endif + +/* This file is to tune the main ESP-Hosted configurations. + * In case you are not sure of some value, Let it be default. + **/ + +#define H_GPIO_LOW 0 +#define H_GPIO_HIGH 1 + +#define H_ENABLE 1 +#define H_DISABLE 0 + +enum { + H_GPIO_INTR_DISABLE = 0, /*!< Disable GPIO interrupt */ + H_GPIO_INTR_POSEDGE = 1, /*!< GPIO interrupt type : rising edge */ + H_GPIO_INTR_NEGEDGE = 2, /*!< GPIO interrupt type : falling edge */ + H_GPIO_INTR_ANYEDGE = 3, /*!< GPIO interrupt type : both rising and falling edge */ + H_GPIO_INTR_LOW_LEVEL = 4, /*!< GPIO interrupt type : input low level trigger */ + H_GPIO_INTR_HIGH_LEVEL = 5, /*!< GPIO interrupt type : input high level trigger */ + H_GPIO_INTR_MAX, +}; + +#if CONFIG_SLAVE_IDF_TARGET_ESP32 + #define H_SLAVE_TARGET_ESP32 1 +#elif CONFIG_SLAVE_IDF_TARGET_ESP32S2 + #define H_SLAVE_TARGET_ESP32S2 1 +#elif CONFIG_SLAVE_IDF_TARGET_ESP32C3 + #define H_SLAVE_TARGET_ESP32C3 1 +#elif CONFIG_SLAVE_IDF_TARGET_ESP32S3 + #define H_SLAVE_TARGET_ESP32S3 1 +#elif CONFIG_SLAVE_IDF_TARGET_ESP32C2 + #define H_SLAVE_TARGET_ESP32C2 1 +#elif CONFIG_SLAVE_IDF_TARGET_ESP32C6 + #define H_SLAVE_TARGET_ESP32C6 1 +#elif CONFIG_SLAVE_IDF_TARGET_ESP32C5 + #define H_SLAVE_TARGET_ESP32C5 1 +#elif CONFIG_SLAVE_IDF_TARGET_ESP32C61 + #define H_SLAVE_TARGET_ESP32C61 1 +#else + #error "Unknown Slave Target" +#endif + +#if CONFIG_ESP_HOSTED_USE_MEMPOOL + #define H_USE_MEMPOOL 1 +#endif + +#define H_MAX_SYNC_RPC_REQUESTS CONFIG_ESP_HOSTED_MAX_SIMULTANEOUS_SYNC_RPC_REQUESTS +#define H_MAX_ASYNC_RPC_REQUESTS CONFIG_ESP_HOSTED_MAX_SIMULTANEOUS_ASYNC_RPC_REQUESTS + +#undef H_TRANSPORT_IN_USE + +#ifdef CONFIG_ESP_HOSTED_SPI_HOST_INTERFACE + #define H_TRANSPORT_IN_USE H_TRANSPORT_SPI + /* -------------------------- SPI Master Config start ---------------------- */ + /* Pins in use. The SPI Master can use the GPIO mux, + so feel free to change these if needed. + */ + + + /* SPI config */ + + #ifdef CONFIG_ESP_HOSTED_HS_ACTIVE_LOW + #define H_HANDSHAKE_ACTIVE_HIGH 0 + #else + /* Default HS: Active High */ + #define H_HANDSHAKE_ACTIVE_HIGH 1 + #endif + + #ifdef CONFIG_ESP_HOSTED_DR_ACTIVE_LOW + #define H_DATAREADY_ACTIVE_HIGH 0 + #else + /* Default DR: Active High */ + #define H_DATAREADY_ACTIVE_HIGH 1 + #endif + + #if H_HANDSHAKE_ACTIVE_HIGH + #define H_HS_VAL_ACTIVE H_GPIO_HIGH + #define H_HS_VAL_INACTIVE H_GPIO_LOW + #define H_HS_INTR_EDGE H_GPIO_INTR_POSEDGE + #else + #define H_HS_VAL_ACTIVE H_GPIO_LOW + #define H_HS_VAL_INACTIVE H_GPIO_HIGH + #define H_HS_INTR_EDGE H_GPIO_INTR_NEGEDGE + #endif + + #if H_DATAREADY_ACTIVE_HIGH + #define H_DR_VAL_ACTIVE H_GPIO_HIGH + #define H_DR_VAL_INACTIVE H_GPIO_LOW + #define H_DR_INTR_EDGE H_GPIO_INTR_POSEDGE + #else + #define H_DR_VAL_ACTIVE H_GPIO_LOW + #define H_DR_VAL_INACTIVE H_GPIO_HIGH + #define H_DR_INTR_EDGE H_GPIO_INTR_NEGEDGE + #endif + + #define H_GPIO_HANDSHAKE_Port NULL + #define H_GPIO_HANDSHAKE_Pin CONFIG_ESP_HOSTED_SPI_GPIO_HANDSHAKE + #define H_GPIO_DATA_READY_Port NULL + #define H_GPIO_DATA_READY_Pin CONFIG_ESP_HOSTED_SPI_GPIO_DATA_READY + + + + #define H_GPIO_MOSI_Port NULL + #define H_GPIO_MOSI_Pin CONFIG_ESP_HOSTED_SPI_GPIO_MOSI + #define H_GPIO_MISO_Port NULL + #define H_GPIO_MISO_Pin CONFIG_ESP_HOSTED_SPI_GPIO_MISO + #define H_GPIO_SCLK_Port NULL + #define H_GPIO_SCLK_Pin CONFIG_ESP_HOSTED_SPI_GPIO_CLK + #define H_GPIO_CS_Port NULL + #define H_GPIO_CS_Pin CONFIG_ESP_HOSTED_SPI_GPIO_CS + + #define H_SPI_TX_Q CONFIG_ESP_HOSTED_SPI_TX_Q_SIZE + #define H_SPI_RX_Q CONFIG_ESP_HOSTED_SPI_RX_Q_SIZE + + #define H_SPI_MODE CONFIG_ESP_HOSTED_SPI_MODE + #define H_SPI_FD_CLK_MHZ CONFIG_ESP_HOSTED_SPI_CLK_FREQ + + /* -------------------------- SPI Master Config end ------------------------ */ +#endif + +#ifdef CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE + #define H_TRANSPORT_IN_USE H_TRANSPORT_SDIO + /* -------------------------- SDIO Host Config start ----------------------- */ + + #ifdef CONFIG_SOC_SDMMC_USE_GPIO_MATRIX + #define H_SDIO_SOC_USE_GPIO_MATRIX + #endif + + #define H_SDIO_CLOCK_FREQ_KHZ CONFIG_ESP_HOSTED_SDIO_CLOCK_FREQ_KHZ + #define H_SDIO_BUS_WIDTH CONFIG_ESP_HOSTED_SDIO_BUS_WIDTH + #define H_SDMMC_HOST_SLOT CONFIG_ESP_HOSTED_SDIO_SLOT + + #define H_SDIO_PORT_CLK NULL + #define H_SDIO_PORT_CMD NULL + #define H_SDIO_PORT_D0 NULL + #define H_SDIO_PORT_D1 NULL + #define H_SDIO_PORT_D2 NULL + #define H_SDIO_PORT_D3 NULL + + #ifdef H_SDIO_SOC_USE_GPIO_MATRIX + #define H_SDIO_PIN_CLK CONFIG_ESP_HOSTED_SDIO_PIN_CLK + #define H_SDIO_PIN_CMD CONFIG_ESP_HOSTED_SDIO_PIN_CMD + #define H_SDIO_PIN_D0 CONFIG_ESP_HOSTED_SDIO_PIN_D0 + #define H_SDIO_PIN_D1 CONFIG_ESP_HOSTED_SDIO_PIN_D1 + #if (H_SDIO_BUS_WIDTH == 4) + #define H_SDIO_PIN_D2 CONFIG_ESP_HOSTED_SDIO_PIN_D2 + #define H_SDIO_PIN_D3 CONFIG_ESP_HOSTED_SDIO_PIN_D3 + #else + #define H_SDIO_PIN_D2 -1 + #define H_SDIO_PIN_D3 -1 + #endif + #else + #define H_SDIO_PIN_CLK -1 + #define H_SDIO_PIN_CMD -1 + #define H_SDIO_PIN_D0 -1 + #define H_SDIO_PIN_D1 -1 + #if (H_SDIO_BUS_WIDTH == 4) + #define H_SDIO_PIN_D2 -1 + #define H_SDIO_PIN_D3 -1 + #else + #define H_SDIO_PIN_D2 -1 + #define H_SDIO_PIN_D3 -1 + #endif + #endif + + #define H_SDIO_TX_Q CONFIG_ESP_HOSTED_SDIO_TX_Q_SIZE + #define H_SDIO_RX_Q CONFIG_ESP_HOSTED_SDIO_RX_Q_SIZE + + #define H_SDIO_CHECKSUM CONFIG_ESP_HOSTED_SDIO_CHECKSUM + + #define H_SDIO_HOST_STREAMING_MODE 1 + #define H_SDIO_ALWAYS_HOST_RX_MAX_TRANSPORT_SIZE 2 + #define H_SDIO_OPTIMIZATION_RX_NONE 3 + + #ifdef CONFIG_ESP_HOSTED_SDIO_OPTIMIZATION_RX_STREAMING_MODE + #define H_SDIO_HOST_RX_MODE H_SDIO_HOST_STREAMING_MODE + #elif defined(CONFIG_ESP_HOSTED_SDIO_OPTIMIZATION_RX_MAX_SIZE) + #define H_SDIO_HOST_RX_MODE H_SDIO_ALWAYS_HOST_RX_MAX_TRANSPORT_SIZE + #else + /* Use this if unsure */ + #define H_SDIO_HOST_RX_MODE H_SDIO_OPTIMIZATION_RX_NONE + #endif + + // Pad transfer len for host operation + #define H_SDIO_TX_LEN_TO_TRANSFER(x) ((x + 3) & (~3)) + #define H_SDIO_RX_LEN_TO_TRANSFER(x) ((x + 3) & (~3)) + + /* Do Block Mode only transfers + * + * When enabled, SDIO only uses block mode transfers for higher + * throughput. Data lengths are padded to multiples of ESP_BLOCK_SIZE. + * + * This is safe for the SDIO slave: + * - for Host Tx: slave will ignore extra data sent by Host + * - for Host Rx: slave will send extra 0 data, ignored by Host + */ + #define H_SDIO_TX_BLOCK_ONLY_XFER (1) + #define H_SDIO_RX_BLOCK_ONLY_XFER (1) + + // workarounds for some SDIO transfer errors that may occur + #if 0 + /* Below workarounds could be enabled for non-ESP MCUs to test first + * Once everything is stable, can disable workarounds and test again + * */ + #define H_SDIO_TX_LIMIT_XFER_SIZE_WORKAROUND // limit transfer to one ESP_BLOCK_SIZE at a time + #define H_SDIO_RX_LIMIT_XFER_SIZE_WORKDAROUND // limit transfer to one ESP_BLOCK_SIZE at a time + #endif + + #if defined(H_SDIO_TX_LIMIT_XFER_SIZE_WORKAROUND) + #define H_SDIO_TX_BLOCKS_TO_TRANSFER(x) (1) + #else + #define H_SDIO_TX_BLOCKS_TO_TRANSFER(x) (x / ESP_BLOCK_SIZE) + #endif + + #if defined(H_SDIO_RX_LIMIT_XFER_SIZE_WORKDAROUND) + #define H_SDIO_RX_BLOCKS_TO_TRANSFER(x) (1) + #else + #define H_SDIO_RX_BLOCKS_TO_TRANSFER(x) (x / ESP_BLOCK_SIZE) + #endif + + /* -------------------------- SDIO Host Config end ------------------------- */ +#endif + +#ifdef CONFIG_ESP_HOSTED_SPI_HD_HOST_INTERFACE + #define H_TRANSPORT_IN_USE H_TRANSPORT_SPI_HD + /* -------------------------- SPI_HD Host Config start ----------------------- */ + + #define H_SPI_HD_HOST_INTERFACE 1 + + enum { + H_SPI_HD_CONFIG_2_DATA_LINES, + H_SPI_HD_CONFIG_4_DATA_LINES, + }; + + #if CONFIG_ESP_HOSTED_SPI_HD_DR_ACTIVE_HIGH + #define H_SPI_HD_DATAREADY_ACTIVE_HIGH 1 + #else + #define H_SPI_HD_DATAREADY_ACTIVE_HIGH 0 + #endif + + #if H_SPI_HD_DATAREADY_ACTIVE_HIGH + #define H_SPI_HD_DR_VAL_ACTIVE H_GPIO_HIGH + #define H_SPI_HD_DR_VAL_INACTIVE H_GPIO_LOW + #define H_SPI_HD_DR_INTR_EDGE H_GPIO_INTR_POSEDGE + #else + #define H_SPI_HD_DR_VAL_ACTIVE H_GPIO_LOW + #define H_SPI_HD_DR_VAL_INACTIVE H_GPIO_HIGH + #define H_SPI_HD_DR_INTR_EDGE H_GPIO_INTR_NEGEDGE + #endif + + #define H_SPI_HD_HOST_NUM_DATA_LINES CONFIG_ESP_HOSTED_SPI_HD_INTERFACE_NUM_DATA_LINES + + #define H_SPI_HD_PORT_D0 NULL + #define H_SPI_HD_PORT_D1 NULL + #define H_SPI_HD_PORT_D2 NULL + #define H_SPI_HD_PORT_D3 NULL + #define H_SPI_HD_PORT_CS NULL + #define H_SPI_HD_PORT_CLK NULL + + #define H_SPI_HD_PIN_D0 CONFIG_ESP_HOSTED_SPI_HD_GPIO_D0 + #define H_SPI_HD_PIN_D1 CONFIG_ESP_HOSTED_SPI_HD_GPIO_D1 + #if (CONFIG_ESP_HOSTED_SPI_HD_INTERFACE_NUM_DATA_LINES == 4) + #define H_SPI_HD_PIN_D2 CONFIG_ESP_HOSTED_SPI_HD_GPIO_D2 + #define H_SPI_HD_PIN_D3 CONFIG_ESP_HOSTED_SPI_HD_GPIO_D3 + #else + #define H_SPI_HD_PIN_D2 -1 + #define H_SPI_HD_PIN_D3 -1 + #endif + + #define H_SPI_HD_PIN_CS CONFIG_ESP_HOSTED_SPI_HD_GPIO_CS + #define H_SPI_HD_PIN_CLK CONFIG_ESP_HOSTED_SPI_HD_GPIO_CLK + #define H_SPI_HD_PORT_DATA_READY NULL + #define H_SPI_HD_PIN_DATA_READY CONFIG_ESP_HOSTED_SPI_HD_GPIO_DATA_READY + + #define H_SPI_HD_CLK_MHZ CONFIG_ESP_HOSTED_SPI_HD_CLK_FREQ + #define H_SPI_HD_MODE CONFIG_ESP_HOSTED_SPI_HD_MODE + #define H_SPI_HD_TX_QUEUE_SIZE CONFIG_ESP_HOSTED_SPI_HD_TX_Q_SIZE + #define H_SPI_HD_RX_QUEUE_SIZE CONFIG_ESP_HOSTED_SPI_HD_RX_Q_SIZE + + #define H_SPI_HD_CHECKSUM CONFIG_ESP_HOSTED_SPI_HD_CHECKSUM + + #define H_SPI_HD_NUM_COMMAND_BITS 8 + #define H_SPI_HD_NUM_ADDRESS_BITS 8 + #define H_SPI_HD_NUM_DUMMY_BITS 8 + +/* -------------------------- SPI_HD Host Config end ------------------------- */ +#else + #define H_SPI_HD_HOST_INTERFACE 0 +#endif + +#ifdef CONFIG_ESP_HOSTED_UART_HOST_INTERFACE + #define H_TRANSPORT_IN_USE H_TRANSPORT_UART + /* -------------------------- UART Host Config start ------------------------- */ + + #define H_UART_HOST_TRANSPORT 1 + + #define H_UART_PORT CONFIG_ESP_HOSTED_UART_PORT + #define H_UART_NUM_DATA_BITS CONFIG_ESP_HOSTED_UART_NUM_DATA_BITS + #define H_UART_PARITY CONFIG_ESP_HOSTED_UART_PARITY + #define H_UART_START_BITS 1 + #define H_UART_STOP_BITS CONFIG_ESP_HOSTED_UART_STOP_BITS + #define H_UART_FLOWCTRL UART_HW_FLOWCTRL_DISABLE + #define H_UART_CLK_SRC UART_SCLK_DEFAULT + + #define H_UART_CHECKSUM CONFIG_ESP_HOSTED_UART_CHECKSUM + #define H_UART_BAUD_RATE CONFIG_ESP_HOSTED_UART_BAUDRATE + #define H_UART_PIN_TX CONFIG_ESP_HOSTED_UART_PIN_TX + #define H_UART_PORT_TX NULL + #define H_UART_PIN_RX CONFIG_ESP_HOSTED_UART_PIN_RX + #define H_UART_PORT_RX NULL + #define H_UART_TX_QUEUE_SIZE CONFIG_ESP_HOSTED_UART_TX_Q_SIZE + #define H_UART_RX_QUEUE_SIZE CONFIG_ESP_HOSTED_UART_RX_Q_SIZE + + /* -------------------------- UART Host Config end ------------------------- */ +#else + #define H_UART_HOST_TRANSPORT 0 +#endif + +/* Generic reset pin config */ +#define H_GPIO_PIN_RESET CONFIG_ESP_HOSTED_GPIO_SLAVE_RESET_SLAVE +#define H_GPIO_PORT_RESET NULL + +/* If Reset pin is Enable, it is Active High. + * If it is RST, active low */ +#ifdef CONFIG_ESP_HOSTED_RESET_GPIO_ACTIVE_LOW + #define H_RESET_ACTIVE_HIGH 0 +#else + #define H_RESET_ACTIVE_HIGH 1 +#endif + +#if H_RESET_ACTIVE_HIGH + #define H_RESET_VAL_ACTIVE H_GPIO_HIGH + #define H_RESET_VAL_INACTIVE H_GPIO_LOW +#else + #define H_RESET_VAL_ACTIVE H_GPIO_LOW + #define H_RESET_VAL_INACTIVE H_GPIO_HIGH +#endif + +/* --------------------- Common slave reset strategy ------------------- */ + +#if defined(CONFIG_ESP_HOSTED_SLAVE_RESET_ON_EVERY_HOST_BOOTUP) + /* Always reset the slave when host boots up + * This ensures a clean transport state and prevents any inconsistent states, + * but causes the slave to reboot every time the host boots up + */ + #define H_SLAVE_RESET_ON_EVERY_HOST_BOOTUP 1 + #define H_SLAVE_RESET_ONLY_IF_NECESSARY 0 +#elif defined(CONFIG_ESP_HOSTED_SLAVE_RESET_ONLY_IF_NECESSARY) + /* Only reset the slave if initialization fails + * This reduces slave reboots but assumes the slave interface is in a consistent state. + * If initialization fails, the host will assume the slave is in an inconsistent + * or deinitialized state and will reset it. + */ + #define H_SLAVE_RESET_ON_EVERY_HOST_BOOTUP 0 + #define H_SLAVE_RESET_ONLY_IF_NECESSARY 1 +#else + /* Default to always reset for backward compatibility */ + #define H_SLAVE_RESET_ON_EVERY_HOST_BOOTUP 1 + #define H_SLAVE_RESET_ONLY_IF_NECESSARY 0 +#endif + +#if !defined(CONFIG_ESP_SDIO_HOST_INTERFACE) && H_SLAVE_RESET_ONLY_IF_NECESSARY +#error "Invalid combination. H_SLAVE_RESET_ONLY_IF_NECESSARY is only supported for SDIO host interface, for now" +#endif + +/* Auto-restart on communication failure */ +#ifdef CONFIG_ESP_HOSTED_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE + /* Enable host auto-restart if communication with slave is lost + * When enabled, the host will reset itself to recover the connection + * if the slave becomes non-responsive for the configured timeout period. + * This acts as a safeguard in case the slave does not issue the first event. + */ + #define H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE 1 +#else + /* Disable host auto-restart on communication failure */ + #define H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE 0 +#endif + +#if defined(CONFIG_ESP_HOSTED_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE_TIMEOUT) + /* Timeout in seconds before host restarts due to no communication + * Maximum time that the host will wait for a response from the slave + * before triggering an automatic restart. + */ + #define H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE_TIMEOUT CONFIG_ESP_HOSTED_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE_TIMEOUT +#else + /* Default timeout value (-1 means disabled) */ + #define H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE_TIMEOUT -1 +#endif + +#if H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE && H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE_TIMEOUT == -1 + #error "Invalid combination. Host Restart No Communication With Slave is enabled but timeout is not configured" +#endif + +#if H_SLAVE_RESET_ON_EVERY_HOST_BOOTUP && H_SLAVE_RESET_ONLY_IF_NECESSARY + #error "Invalid combination. Reset on every bootup and reset only if necessary cannot be enabled at the same time" +#endif + +#if H_SLAVE_RESET_ON_EVERY_HOST_BOOTUP && H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE + #error "Invalid combination. H_HOST_RESTART_NO_COMMUNICATION_WITH_SLAVE should not be logically required if H_SLAVE_RESET_ONLY_IF_NECESSARY is enabled" +#endif + + +#define TIMEOUT_PSERIAL_RESP 30 + + +#define PRE_FORMAT_NEWLINE_CHAR "" +#define POST_FORMAT_NEWLINE_CHAR "\n" + +#define USE_STD_C_LIB_MALLOC 0 + +#ifdef CONFIG_HOST_TO_ESP_WIFI_DATA_THROTTLE + #define H_WIFI_TX_DATA_THROTTLE_LOW_THRESHOLD CONFIG_ESP_HOSTED_TO_WIFI_DATA_THROTTLE_LOW_THRESHOLD + #define H_WIFI_TX_DATA_THROTTLE_HIGH_THRESHOLD CONFIG_ESP_HOSTED_TO_WIFI_DATA_THROTTLE_HIGH_THRESHOLD +#else + #define H_WIFI_TX_DATA_THROTTLE_LOW_THRESHOLD 0 + #define H_WIFI_TX_DATA_THROTTLE_HIGH_THRESHOLD 0 +#endif + +#define H_PKT_STATS CONFIG_ESP_HOSTED_PKT_STATS + +/* Raw Throughput Testing */ +#define H_TEST_RAW_TP CONFIG_ESP_HOSTED_RAW_THROUGHPUT_TRANSPORT + +#if H_TEST_RAW_TP + + #define H_RAW_TP_REPORT_INTERVAL CONFIG_ESP_HOSTED_RAW_TP_REPORT_INTERVAL + #define H_RAW_TP_PKT_LEN CONFIG_ESP_HOSTED_RAW_TP_HOST_TO_ESP_PKT_LEN + + #if CONFIG_ESP_HOSTED_RAW_THROUGHPUT_TX_TO_SLAVE + #define H_TEST_RAW_TP_DIR (ESP_TEST_RAW_TP__HOST_TO_ESP) + #elif CONFIG_ESP_HOSTED_RAW_THROUGHPUT_RX_FROM_SLAVE + #define H_TEST_RAW_TP_DIR (ESP_TEST_RAW_TP__ESP_TO_HOST) + #elif CONFIG_ESP_HOSTED_RAW_THROUGHPUT_BIDIRECTIONAL + #define H_TEST_RAW_TP_DIR (ESP_TEST_RAW_TP__BIDIRECTIONAL) + #else + #error Test Raw TP direction not defined + #endif + +#else + #define H_TEST_RAW_TP_DIR (ESP_TEST_RAW_TP_NONE) +#endif + +/* ----------------------- Enable packet stats ------------------------------- */ +#ifdef CONFIG_ESP_PKT_STATS + #define ESP_PKT_STATS 1 + #define ESP_PKT_STATS_REPORT_INTERVAL CONFIG_ESP_PKT_STATS_INTERVAL_SEC +#endif + +/* ----------------- Host to slave Wi-Fi flow control ------------------------ */ +/* Bit0: slave request host to enable flow control */ +#define H_EVTGRP_BIT_FC_ALLOW_WIFI BIT(0) + + +/* --------------------- Host Power saving ----------------------------------- */ + +#if defined(CONFIG_ESP_HOSTED_HOST_POWER_SAVE_ENABLED) + #if defined(CONFIG_ESP_HOSTED_HOST_DEEP_SLEEP_ALLOWED) + #define H_HOST_PS_ALLOWED 1 + #define H_HOST_PS_ALLOWED_LIGHT_SLEEP 0 + #else + #define H_HOST_PS_ALLOWED 0 + #endif + + /* Amend later for light sleep */ +#else + #define H_HOST_PS_ALLOWED 0 +#endif + +#if defined(CONFIG_ESP_HOSTED_HOST_WAKEUP_GPIO) + #define H_HOST_WAKEUP_GPIO_PORT NULL + #define H_HOST_WAKEUP_GPIO CONFIG_ESP_HOSTED_HOST_WAKEUP_GPIO +#else + #define H_HOST_WAKEUP_GPIO -1 +#endif + +#if defined(CONFIG_ESP_HOSTED_HOST_WAKEUP_GPIO_LEVEL) + #define H_HOST_WAKEUP_GPIO_LEVEL CONFIG_ESP_HOSTED_HOST_WAKEUP_GPIO_LEVEL +#else + #define H_HOST_WAKEUP_GPIO_LEVEL 1 /* High */ +#endif + +/* Conflict checks for host power save configuration */ +#if (H_HOST_PS_ALLOWED == 1) + #if (H_HOST_WAKEUP_GPIO == -1) + #error "Conflict: Host wake-up GPIO is mandatory when deep sleep is allowed" + #endif +#endif + +/* --------------------- Host CLI -------------------------------------------- */ +#ifdef CONFIG_ESP_HOSTED_CLI_ENABLED + #define H_ESP_HOSTED_CLI_ENABLED 1 +#endif + +/* ---------------------- ESP-IDF Specific Config start -------------------- */ +/* This section is for ESP-IDF specific support. + * Can be ignored on other hosts MCUs. + */ + +/* Controls whether an Internal LDO powers the SDIO connection */ +#if CONFIG_ESP_HOSTED_SD_PWR_CTRL_LDO_INTERNAL_IO + #define H_SDIO_PWR_CTRL_LDO 1 + #define H_SDIO_PWR_CTRL_LDO_ID CONFIG_ESP_HOSTED_SD_PWR_CTRL_LDO_IO_ID +#else + #define H_SDIO_PWR_CTRL_LDO 0 +#endif + +/* ---------------------- ESP-IDF Specific Config end ---------------------- */ + +/* --------------------- Network Split -------------------------------------- */ +#ifdef CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED + #define H_NETWORK_SPLIT_ENABLED 1 +#else + #define H_NETWORK_SPLIT_ENABLED 0 +#endif + +#if H_NETWORK_SPLIT_ENABLED +#if !defined(CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_START) || \ + !defined(CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_END) || \ + !defined(CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_START) || \ + !defined(CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_END) +#error "LWIP ports at host need to configured, ensure they are exclusive and different from slave" +#endif + +#define H_HOST_TCP_LOCAL_PORT_RANGE_START CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_START +#define H_HOST_TCP_LOCAL_PORT_RANGE_END CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_END +#define H_HOST_UDP_LOCAL_PORT_RANGE_START CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_START +#define H_HOST_UDP_LOCAL_PORT_RANGE_END CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_END + +#define H_SLAVE_TCP_REMOTE_PORT_RANGE_START CONFIG_LWIP_TCP_REMOTE_PORT_RANGE_START +#define H_SLAVE_TCP_REMOTE_PORT_RANGE_END CONFIG_LWIP_TCP_REMOTE_PORT_RANGE_END +#define H_SLAVE_UDP_REMOTE_PORT_RANGE_START CONFIG_LWIP_UDP_REMOTE_PORT_RANGE_START +#define H_SLAVE_UDP_REMOTE_PORT_RANGE_END CONFIG_LWIP_UDP_REMOTE_PORT_RANGE_END + +#endif + + +#define H_HOST_USES_STATIC_NETIF 0 /* yet unsupported */ + +esp_err_t esp_hosted_set_default_config(void); +bool esp_hosted_is_config_valid(void); + +#if CONFIG_ESP_HOSTED_ENABLE_GPIO_CONTROL +#define H_ENABLE_GPIO_CONTROL 1 +#else +#define H_ENABLE_GPIO_CONTROL 0 +#endif + +#endif /*__ESP_HOSTED_CONFIG_H__*/ diff --git a/host/port/esp/freertos/include/port_esp_hosted_host_log.h b/host/port/esp/freertos/include/port_esp_hosted_host_log.h new file mode 100644 index 00000000..663e8d26 --- /dev/null +++ b/host/port/esp/freertos/include/port_esp_hosted_host_log.h @@ -0,0 +1,16 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __PORT_ESP_HOSTED_HOST_LOG_H +#define __PORT_ESP_HOSTED_HOST_LOG_H + +#include "esp_log.h" + +#ifndef DEFINE_LOG_TAG +#define DEFINE_LOG_TAG(sTr) static const char TAG[] = #sTr +#endif + +#endif diff --git a/host/port/include/os_wrapper.h b/host/port/esp/freertos/include/port_esp_hosted_host_os.h similarity index 70% rename from host/port/include/os_wrapper.h rename to host/port/esp/freertos/include/port_esp_hosted_host_os.h index 19d5fe21..99793a72 100644 --- a/host/port/include/os_wrapper.h +++ b/host/port/esp/freertos/include/port_esp_hosted_host_os.h @@ -1,38 +1,47 @@ -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */ +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ -#ifndef __OS_WRAPPER_H -#define __OS_WRAPPER_H +#ifndef __PORT_ESP_HOSTED_HOST_OS_H +#define __PORT_ESP_HOSTED_HOST_OS_H + +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "freertos/semphr.h" +#include "freertos/queue.h" +#include "freertos/event_groups.h" -#include "os_header.h" #include "esp_task.h" #include #include #include #include "mempool.h" -//#include "esp_hosted_config.h" -#include "esp_hosted_config.h" -#include "hosted_os_abstraction.h" +#include "port_esp_hosted_host_config.h" +#include "esp_hosted_os_abstraction.h" #include "esp_timer.h" #include "esp_event.h" +#include "esp_heap_caps.h" #include "esp_netif_types.h" #include "esp_wifi_types.h" #include "esp_wifi_default.h" - ESP_EVENT_DECLARE_BASE(WIFI_EVENT); #define MCU_SYS 1 -#include "common.h" #include "esp_dma_utils.h" #define MAX_PAYLOAD_SIZE (MAX_TRANSPORT_BUFFER_SIZE-H_ESP_PAYLOAD_HEADER_OFFSET) -#define RPC__TIMER_ONESHOT 0 -#define RPC__TIMER_PERIODIC 1 +typedef enum { + H_TIMER_TYPE_ONESHOT = 0, + H_TIMER_TYPE_PERIODIC = 1, +} esp_hosted_timer_type_t; + #define HOSTED_BLOCKING -1 #define HOSTED_NON_BLOCKING 0 @@ -73,23 +82,8 @@ enum { H_GPIO_MODE_INPUT_OUTPUT = ((H_GPIO_MODE_DEF_INPUT) | (H_GPIO_MODE_DEF_OUTPUT)), /*!< GPIO mode : output and input mode */ }; -#if 0 -#if 0 //defined OS_CMSIS -#define thread_handle_t osThreadId -#define osThreadId osThreadId -#define semaphore_handle_t osSemaphoreId -#define mutex_handle_t osMutexId -#else //if defined OS_FREERTOS -#define thread_handle_t TaskHandle_t -#define queue_handle_t QueueHandle_t -#define semaphore_handle_t SemaphoreHandle_t -#define mutex_handle_t SemaphoreHandle_t -#define osDelay vTaskDelay -//#else -//#error "Port the os calls to your system" -#endif -#endif - +#define H_GPIO_PULL_UP (1) +#define H_GPIO_PULL_DOWN (0) #define RET_OK 0 #define RET_FAIL -1 @@ -98,29 +92,14 @@ enum { #define RET_FAIL4 -4 #define RET_FAIL_TIMEOUT -5 -/* without alignment */ -#define MALLOC(x) malloc(x) - -/* This is [malloc + aligned DMA] */ -#define MEM_ALLOC(x) ({ \ - esp_dma_mem_info_t dma_mem_info = { \ - .extra_heap_caps = 0, \ - .dma_alignment_bytes = 64, \ - }; \ - void *tmp_buf = NULL; \ - size_t actual_size = 0; \ - esp_err_t err = ESP_OK; \ - err = esp_dma_capable_malloc((x), &dma_mem_info, &tmp_buf, &actual_size);\ - if (err) tmp_buf = NULL; \ - tmp_buf;}) - -#define FREE(x) free(x); - +#define HOSTED_MEM_ALIGNMENT_4 4 +#define HOSTED_MEM_ALIGNMENT_32 32 +#define HOSTED_MEM_ALIGNMENT_64 64 /** Enumeration **/ enum hardware_type_e { HARDWARE_TYPE_ESP32, - HARDWARE_TYPE_OTHER_ESP_CHIPS, + HARDWARE_TYPE_OTHER_ESP_CHIPSETS, HARDWARE_TYPE_INVALID, }; @@ -133,7 +112,7 @@ enum hardware_type_e { #define TICKS_PER_SEC(x) (1000*(x) / portTICK_PERIOD_MS) #define SEC_TO_MILLISEC(x) (1000*(x)) #define SEC_TO_MICROSEC(x) (1000*1000*(x)) - +#define MILLISEC_TO_MICROSEC(x) (1000*(x)) #define MEM_DUMP(s) \ printf("%s free:%lu min-free:%lu lfb-def:%u lfb-8bit:%u\n\n", s, \ @@ -141,16 +120,6 @@ enum hardware_type_e { heap_caps_get_largest_free_block(MALLOC_CAP_DEFAULT), \ heap_caps_get_largest_free_block(MALLOC_CAP_8BIT)) -#if 0 -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0) - #define ESP_MUTEX_INIT(mUtEx) portMUX_INITIALIZE(&(mUtEx)); -#else - #define ESP_MUTEX_INIT(mUtEx) vPortCPUInitializeMutex(&(mUtEx)); -#endif -#endif - - - /* -------- Create handle ------- */ #define HOSTED_CREATE_HANDLE(tYPE, hANDLE) { \ @@ -161,6 +130,13 @@ enum hardware_type_e { } \ } +#define HOSTED_FREE_HANDLE(handle) { \ + if (handle) { \ + g_h.funcs->_h_free(handle); \ + handle = NULL; \ + } \ +} + /* -------- Calloc, Free handle ------- */ #define HOSTED_FREE(buff) if (buff) { g_h.funcs->_h_free(buff); buff = NULL; } #define HOSTED_CALLOC(struct_name, buff, nbytes, gotosym) do { \ @@ -186,4 +162,4 @@ struct serial_drv_handle_t; struct timer_handle_t; extern struct mempool * nw_mp_g; -#endif /*__OS_WRAPPER_H*/ +#endif diff --git a/host/port/include/sdio_wrapper.h b/host/port/esp/freertos/include/port_esp_hosted_host_sdio.h similarity index 88% rename from host/port/include/sdio_wrapper.h rename to host/port/esp/freertos/include/port_esp_hosted_host_sdio.h index eccf243d..730a2029 100644 --- a/host/port/include/sdio_wrapper.h +++ b/host/port/esp/freertos/include/port_esp_hosted_host_sdio.h @@ -15,13 +15,14 @@ /* Wrapper interfaces for SDMMC to communicated with slave using SDIO */ -#ifndef __SDIO_WRAPPER_H_ -#define __SDIO_WRAPPER_H_ +#ifndef __PORT_ESP_HOSTED_HOST_SDIO_H_ +#define __PORT_ESP_HOSTED_HOST_SDIO_H_ #include "esp_check.h" #include "sdmmc_cmd.h" #define MAX_TRANSPORT_BUFFER_SIZE MAX_SDIO_BUFFER_SIZE +#define ESP_HOSTED_SDIO_UNRESPONSIVE_CODE 0x107 /* Hosted init function to init the SDIO host * returns a pointer to the sdio context */ @@ -29,11 +30,14 @@ void * hosted_sdio_init(void); /* Hosted SDIO deinit function * expects a pointer to the sdio context */ -esp_err_t hosted_sdio_deinit(void *ctx); +int hosted_sdio_deinit(void *ctx); /* Hosted SDIO to initialise the SDIO card */ int hosted_sdio_card_init(void *ctx); +/* Hosted SDIO to deinitialise the SDIO card */ +int hosted_sdio_card_deinit(void *ctx); + /* Hosted SDIO functions to read / write to slave scratch registers * and to read / write block data * If lock_required is true, call will hold a mutex for the duration of the call */ diff --git a/host/port/include/spi_wrapper.h b/host/port/esp/freertos/include/port_esp_hosted_host_spi.h similarity index 86% rename from host/port/include/spi_wrapper.h rename to host/port/esp/freertos/include/port_esp_hosted_host_spi.h index 057ade85..e7b2b094 100644 --- a/host/port/include/spi_wrapper.h +++ b/host/port/esp/freertos/include/port_esp_hosted_host_spi.h @@ -15,14 +15,17 @@ /* Wrapper interfaces for SPI to communicated with slave using SDIO */ -#ifndef __SPI_WRAPPER_H_ -#define __SPI_WRAPPER_H_ +#ifndef __PORT_ESP_HOSTED_HOST_SPI_H_ +#define __PORT_ESP_HOSTED_HOST_SPI_H_ #define MAX_TRANSPORT_BUFFER_SIZE MAX_SPI_BUFFER_SIZE /* Hosted SPI init function * returns a pointer to the spi context */ void * hosted_spi_init(void); +/* Hosted SPI deinit function */ +int hosted_spi_deinit(void *handle); + /* Hosted SPI transfer function */ int hosted_do_spi_transfer(void *trans); diff --git a/host/port/include/spi_hd_wrapper.h b/host/port/esp/freertos/include/port_esp_hosted_host_spi_hd.h similarity index 96% rename from host/port/include/spi_hd_wrapper.h rename to host/port/esp/freertos/include/port_esp_hosted_host_spi_hd.h index b13edcf1..e1b25de7 100644 --- a/host/port/include/spi_hd_wrapper.h +++ b/host/port/esp/freertos/include/port_esp_hosted_host_spi_hd.h @@ -15,8 +15,8 @@ /* Wrapper interfaces for SDMMC to communicated with slave using SDIO */ -#ifndef __SPI_HD_WRAPPER_H_ -#define __SPI_HD_WRAPPER_H_ +#ifndef __PORT_ESP_HOSTED_HOST_SPI_HD_H_ +#define __PORT_ESP_HOSTED_HOST_SPI_HD_H_ #include diff --git a/host/port/include/uart_wrapper.h b/host/port/esp/freertos/include/port_esp_hosted_host_uart.h similarity index 90% rename from host/port/include/uart_wrapper.h rename to host/port/esp/freertos/include/port_esp_hosted_host_uart.h index 75d404ba..1d7abc11 100644 --- a/host/port/include/uart_wrapper.h +++ b/host/port/esp/freertos/include/port_esp_hosted_host_uart.h @@ -15,8 +15,10 @@ /* Wrapper interfaces for UART to communicated with slave using UART */ -#ifndef __UART_WRAPPER_H_ -#define __UART_WRAPPER_H_ +#ifndef __PORT_ESP_HOSTED_HOST_UART_H_ +#define __PORT_ESP_HOSTED_HOST_UART_H_ + +#define MAX_TRANSPORT_BUFFER_SIZE MAX_UART_BUFFER_SIZE /* Hosted init function to init the UART interface * returns a pointer to the UART context */ diff --git a/host/port/esp/freertos/include/port_esp_hosted_host_wifi_config.h b/host/port/esp/freertos/include/port_esp_hosted_host_wifi_config.h new file mode 100644 index 00000000..9dd80cbd --- /dev/null +++ b/host/port/esp/freertos/include/port_esp_hosted_host_wifi_config.h @@ -0,0 +1,137 @@ +/* + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __PORT_ESP_HOSTED_HOST_WIFI_CONFIG_H__ +#define __PORT_ESP_HOSTED_HOST_WIFI_CONFIG_H__ + +#include "esp_idf_version.h" + +#if CONFIG_ESP_HOSTED_ENABLE_ITWT && CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT + #define H_WIFI_HE_SUPPORT 1 +#else + #define H_WIFI_HE_SUPPORT 0 +#endif + +// HE support (structs, API) changed after ESP-IDF v5.3 +#if H_WIFI_HE_SUPPORT && (ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 3, 0)) + #define H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 1 +#else + #define H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 0 +#endif + +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) + /* dual band API support available */ + #define H_WIFI_DUALBAND_SUPPORT 1 +#else + #define H_WIFI_DUALBAND_SUPPORT 0 +#endif + +#ifdef CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED + #define H_WIFI_ENTERPRISE_SUPPORT 1 +#else + #define H_WIFI_ENTERPRISE_SUPPORT 0 +#endif + +/* ESP-IDF 5.5.0 breaking change: reserved/he_reserved renamed to reserved1/reserved2 */ +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0) + #define H_WIFI_NEW_RESERVED_FIELD_NAMES 1 + #define H_PRESENT_IN_ESP_IDF_5_5_0 1 +#else + #define H_WIFI_NEW_RESERVED_FIELD_NAMES 0 + #define H_PRESENT_IN_ESP_IDF_5_5_0 0 +#endif + +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) + #define H_PRESENT_IN_ESP_IDF_5_4_0 1 +#else + #define H_PRESENT_IN_ESP_IDF_5_4_0 0 +#endif + +/* User-controllable reserved field decoding - works regardless of IDF version */ +#ifdef CONFIG_ESP_HOSTED_DECODE_WIFI_RESERVED_FIELD + #define H_DECODE_WIFI_RESERVED_FIELD 1 +#else + #define H_DECODE_WIFI_RESERVED_FIELD 0 +#endif + +/* + * wifi_twt_config_t::twt_enable_keep_alive only found in + * IDF v5.3.2 and above + */ +#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 3, 1) +#define H_GOT_TWT_ENABLE_KEEP_ALIVE 1 +#else +#define H_GOT_TWT_ENABLE_KEEP_ALIVE 0 +#endif + +/* wifi_ap_config_t::transition_disable only found in + * IDF v5.3.3 and above, or + * IDF v5.4.1 and above + */ +#if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 3)) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 1)) +#define H_GOT_AP_CONFIG_PARAM_TRANSITION_DISABLE 0 +#else +#define H_GOT_AP_CONFIG_PARAM_TRANSITION_DISABLE 1 +#endif + +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) + #define H_PRESENT_IN_ESP_IDF_6_0_0 1 +#else + #define H_PRESENT_IN_ESP_IDF_6_0_0 0 +#endif + +#if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 4)) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 3)) || ESP_IDF_VERSION == ESP_IDF_VERSION_VAL(5, 5, 0) +#define H_GOT_SET_EAP_METHODS_API 0 +#else +#define H_GOT_SET_EAP_METHODS_API 1 +#endif +#if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 4)) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 3)) +#define H_GOT_EAP_SET_DOMAIN_NAME 0 +#else +#define H_GOT_EAP_SET_DOMAIN_NAME 1 +#endif + +#if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 3)) +#define H_GOT_EAP_OKC_SUPPORT 0 +#else +#define H_GOT_EAP_OKC_SUPPORT 1 +#endif +/** + * Wi-Fi Easy Connect (DPP) events is returned to user via + * Supplicant Callback or Wi-Fi DPP events, + * depending on IDF version + * + * IDF v6.0 and above only support Wi-Fi DPP events + * IDF v5.5 support Wi-Fi and Supplicant DPP events + * earlier versions support only Supplicant DPP events + */ +// Supplicant Callback DPP Events: still available, but deprecated +#if CONFIG_ESP_HOSTED_ENABLE_DPP && (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0)) +#define H_SUPP_DPP_SUPPORT 1 +#else +#define H_SUPP_DPP_SUPPORT 0 +#endif + +// Wi-Fi DPP Events: only in IDF v5.5 and above +#if CONFIG_ESP_HOSTED_ENABLE_DPP && (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0)) +#define H_WIFI_DPP_SUPPORT 1 +#else +#define H_WIFI_DPP_SUPPORT 0 +#endif + +// for generic DPP support +#if H_SUPP_DPP_SUPPORT || H_WIFI_DPP_SUPPORT +#define H_DPP_SUPPORT 1 +#else +#define H_DPP_SUPPORT 0 +#endif + +// this sets the maximum length of the URI we can receive to generate +// the QR code +#if H_DPP_SUPPORT +#define H_DPP_URI_LEN_MAX CONFIG_ESP_HOSTED_DPP_URI_LEN_MAX +#endif + +#endif /* __ESP_HOSTED_WIFI_CONFIG_H__ */ diff --git a/host/port/esp/freertos/src/port_esp_hosted_host_gpio.c b/host/port/esp/freertos/src/port_esp_hosted_host_gpio.c new file mode 100644 index 00000000..25b8e8bc --- /dev/null +++ b/host/port/esp/freertos/src/port_esp_hosted_host_gpio.c @@ -0,0 +1,52 @@ +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp_log.h" + +#include "rpc_wrap.h" +#include "port_esp_hosted_host_config.h" + +#if H_ENABLE_GPIO_CONTROL +#include "esp_hosted_gpio.h" + +esp_err_t esp_hosted_gpio_config(const esp_hosted_gpio_config_t *pGPIOConfig) +{ + return rpc_gpio_config(pGPIOConfig); +} + +esp_err_t esp_hosted_gpio_reset_pin(uint32_t gpio_num) +{ + return rpc_gpio_reset_pin(gpio_num); +} + +esp_err_t esp_hosted_gpio_set_level(uint32_t gpio_num, uint32_t level) +{ + return rpc_gpio_set_level(gpio_num, level); +} + +int esp_hosted_gpio_get_level(uint32_t gpio_num) +{ + int level = 0; + rpc_gpio_get_level(gpio_num, &level); + return level; +} + +esp_err_t esp_hosted_gpio_set_direction(uint32_t gpio_num, uint32_t mode) +{ + return rpc_gpio_set_direction(gpio_num, mode); +} + +esp_err_t esp_hosted_gpio_input_enable(uint32_t gpio_num) +{ + return rpc_gpio_input_enable(gpio_num); +} + +esp_err_t esp_hosted_gpio_set_pull_mode(uint32_t gpio_num, uint32_t pull) +{ + return rpc_gpio_set_pull_mode(gpio_num, pull); +} + +#endif // H_ENABLE_GPIO_CONTROL diff --git a/host/esp_hosted_host_init.c b/host/port/esp/freertos/src/port_esp_hosted_host_init.c similarity index 71% rename from host/esp_hosted_host_init.c rename to host/port/esp/freertos/src/port_esp_hosted_host_init.c index 30479e06..c0d39213 100644 --- a/host/esp_hosted_host_init.c +++ b/host/port/esp/freertos/src/port_esp_hosted_host_init.c @@ -1,13 +1,14 @@ /* -* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD -* -* SPDX-License-Identifier: Apache-2.0 -*/ + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ -#include "os_header.h" -#include "os_wrapper.h" #include "esp_log.h" -#include "esp_hosted_api.h" +#include "esp_hosted.h" + +#include "port_esp_hosted_host_log.h" + #include "esp_private/startup_internal.h" DEFINE_LOG_TAG(host_init); diff --git a/host/port/src/os_wrapper.c b/host/port/esp/freertos/src/port_esp_hosted_host_os.c similarity index 77% rename from host/port/src/os_wrapper.c rename to host/port/esp/freertos/src/port_esp_hosted_host_os.c index 009bfd9f..a53471b9 100644 --- a/host/port/src/os_wrapper.c +++ b/host/port/esp/freertos/src/port_esp_hosted_host_os.c @@ -1,61 +1,60 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "string.h" #include "esp_log.h" -#include "os_wrapper.h" +#include "port_esp_hosted_host_os.h" #include "esp_log.h" +#include #include "driver/gpio.h" #include "esp_event.h" +#include "esp_heap_caps.h" #include "freertos/portmacro.h" #include "esp_macros.h" -#include "esp_hosted_config.h" +#include "esp_wifi.h" +#include "port_esp_hosted_host_config.h" +#include "port_esp_hosted_host_wifi_config.h" +#include "port_esp_hosted_host_log.h" +#include "esp_hosted_power_save.h" + +#if H_HOST_PS_ALLOWED +#include "esp_sleep.h" +#endif /* Wi-Fi headers are reused at ESP-Hosted */ #include "esp_wifi_crypto_types.h" #include "esp_private/wifi_os_adapter.h" #if H_TRANSPORT_IN_USE == H_TRANSPORT_SDIO -#include "sdio_wrapper.h" +#include "port_esp_hosted_host_sdio.h" #endif #if H_TRANSPORT_IN_USE == H_TRANSPORT_SPI -#include "spi_wrapper.h" +#include "port_esp_hosted_host_spi.h" #endif #if H_TRANSPORT_IN_USE == H_TRANSPORT_SPI_HD -#include "spi_hd_wrapper.h" +#include "port_esp_hosted_host_spi_hd.h" #endif #if H_TRANSPORT_IN_USE == H_TRANSPORT_UART -#include "uart_wrapper.h" +#include "port_esp_hosted_host_uart.h" #endif DEFINE_LOG_TAG(os_wrapper_esp); struct mempool * nw_mp_g = NULL; -wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; +const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; wifi_osi_funcs_t g_wifi_osi_funcs; -//ESP_EVENT_DECLARE_BASE(WIFI_EVENT); -ESP_EVENT_DEFINE_BASE(WIFI_EVENT); +ESP_EVENT_DECLARE_BASE(WIFI_EVENT); struct hosted_config_t g_h = HOSTED_CONFIG_INIT_DEFAULT(); struct timer_handle_t { - //osTimerId timer_id; esp_timer_handle_t timer_id; }; @@ -84,7 +83,8 @@ void * hosted_memset(void* buf, int val, size_t len) void* hosted_malloc(size_t size) { - return MALLOC(size); + /* without alignment */ + return malloc(size); } void* hosted_calloc(size_t blk_no, size_t size) @@ -101,7 +101,7 @@ void* hosted_calloc(size_t blk_no, size_t size) void hosted_free(void* ptr) { if(ptr) { - FREE(ptr); + free(ptr); ptr=NULL; } } @@ -128,23 +128,12 @@ void *hosted_realloc(void *mem, size_t newsize) void *hosted_malloc_align(size_t size, size_t align) { - esp_dma_mem_info_t dma_mem_info = { - .extra_heap_caps = 0, - .dma_alignment_bytes = align, - }; - void *tmp_buf = NULL; - size_t actual_size = 0; - esp_err_t err = ESP_OK; - - err = esp_dma_capable_malloc((size), &dma_mem_info, &tmp_buf, &actual_size); - if (err) tmp_buf = NULL; - - return tmp_buf; + return heap_caps_aligned_alloc(align, size, MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA | MALLOC_CAP_8BIT); } void hosted_free_align(void* ptr) { - FREE(ptr); + free(ptr); } void hosted_init_hook(void) @@ -155,7 +144,7 @@ void hosted_init_hook(void) /* -------- Threads ---------- */ -void *hosted_thread_create(char *tname, uint32_t tprio, uint32_t tstack_size, void (*start_routine)(void const *), void *sr_arg) +void *hosted_thread_create(const char *tname, uint32_t tprio, uint32_t tstack_size, void (*start_routine)(void const *), void *sr_arg) { int task_created = RET_OK; @@ -171,14 +160,6 @@ void *hosted_thread_create(char *tname, uint32_t tprio, uint32_t tstack_size, vo return NULL; } -#if 0 - osThreadDef( - Ctrl_port_tsk, - start_routine, - CTRL_PATH_TASK_PRIO, 0, - CTRL_PATH_TASK_STACK_SIZE); - *thread_handle = osThreadCreate(osThread(Ctrl_port_tsk), arg); -#endif task_created = xTaskCreate((void (*)(void *))start_routine, tname, tstack_size, sr_arg, tprio, thread_handle); if (!(*thread_handle)) { ESP_LOGE(TAG, "Failed to create thread: %s\n", tname); @@ -207,12 +188,6 @@ int hosted_thread_cancel(void *thread_handle) thread_hdl = (thread_handle_t *)thread_handle; - //ret = osThreadTerminate(*thread_hdl); - //if (ret) { - // ESP_LOGE(TAG, "Prob in pthread_cancel, destroy handle anyway\n"); - // HOSTED_FREE(thread_handle); - // return RET_INVALID; - //} vTaskDelete(*thread_hdl); HOSTED_FREE(thread_handle); @@ -222,9 +197,7 @@ int hosted_thread_cancel(void *thread_handle) /* -------- Sleeps -------------- */ unsigned int hosted_msleep(unsigned int mseconds) { - //osDelay(mseconds); vTaskDelay(pdMS_TO_TICKS(mseconds)); - //usleep(mseconds*1000UL); return 0; } @@ -236,7 +209,6 @@ unsigned int hosted_usleep(unsigned int useconds) unsigned int hosted_sleep(unsigned int seconds) { - //osDelay(seconds * 1000); return hosted_msleep(seconds * 1000UL); } @@ -651,22 +623,22 @@ int hosted_timer_stop(void *timer_handle) * } **/ -//void *hosted_timer_start(int duration, int type, -// void (*timeout_handler)(void const *), void *arg) -void *hosted_timer_start(int duration, int type, +void *hosted_timer_start(const char *name, int duration_ms, int type, void (*timeout_handler)(void *), void *arg) { struct timer_handle_t *timer_handle = NULL; int ret = RET_OK; - ESP_LOGD(TAG, "Start the timer %u\n", duration); + esp_hosted_timer_type_t esp_timer_type = type; + + ESP_LOGD(TAG, "Start the timer %u\n", duration_ms); //os_timer_type timer_type = osTimerOnce; //osTimerDef (timerNew, timeout_handler); const esp_timer_create_args_t timerNew_args = { .callback = timeout_handler, /* argument specified here will be passed to timer callback function */ .arg = (void*) arg, - .name = "one-shot" + .name = name, }; @@ -690,16 +662,18 @@ void *hosted_timer_start(int duration, int type, } /* Start depending upon timer type */ - if (type == RPC__TIMER_PERIODIC) { - ret = esp_timer_start_periodic(timer_handle->timer_id, SEC_TO_MICROSEC(duration)); - } else if (type == RPC__TIMER_ONESHOT) { - ret = esp_timer_start_once(timer_handle->timer_id, SEC_TO_MICROSEC(duration)); + if (esp_timer_type == H_TIMER_TYPE_PERIODIC) { + ret = esp_timer_start_periodic(timer_handle->timer_id, MILLISEC_TO_MICROSEC(duration_ms)); + } else if (esp_timer_type == H_TIMER_TYPE_ONESHOT) { + ret = esp_timer_start_once(timer_handle->timer_id, MILLISEC_TO_MICROSEC(duration_ms)); } else { ESP_LOGE(TAG, "Unsupported timer type. supported: one_shot, periodic\n"); esp_timer_delete(timer_handle->timer_id); HOSTED_FREE(timer_handle); return NULL; } + /* This is a workaround to kick the timer task to pick up the timer */ + vTaskDelay(100); if (ret) { esp_timer_delete(timer_handle->timer_id); @@ -727,11 +701,14 @@ int hosted_config_gpio(void* gpio_port, uint32_t gpio_num, uint32_t mode) return 0; } -int hosted_config_gpio_as_interrupt(void* gpio_port, uint32_t gpio_num, uint32_t intr_type, void (*new_gpio_isr_handler)(void* arg)) +int hosted_setup_gpio_interrupt(void* gpio_port, uint32_t gpio_num, uint32_t intr_type, void (*fn)(void *), void *arg) { + int ret = 0; + static bool isr_service_installed = false; + gpio_config_t new_gpio_io_conf={ - .intr_type=intr_type, .mode=GPIO_MODE_INPUT, + .intr_type = GPIO_INTR_DISABLE, .pin_bit_mask=(1ULL<sdmmc_host_init_slot() IOMUX GPIO checking + */ + if (slot_config->width == 1) { + ESP_LOGW(TAG, "workaround: setting D2-D3 in 1 bit mode for slot %d", slot); + slot_config->d2 = SDMMC_SLOT0_IOMUX_PIN_NUM_D2; + slot_config->d3 = SDMMC_SLOT0_IOMUX_PIN_NUM_D3; + } +#endif + } +} + +static bool hosted_sdio_enable_ldo(sdmmc_host_t *config) +{ +#if H_SDIO_PWR_CTRL_LDO + // enable LDO Power for slot, if required + sd_pwr_ctrl_ldo_config_t ldo_config = { + .ldo_chan_id = H_SDIO_PWR_CTRL_LDO_ID, + }; + sd_pwr_ctrl_handle_t pwr_ctrl_handle = NULL; + + esp_err_t ret = sd_pwr_ctrl_new_on_chip_ldo(&ldo_config, &pwr_ctrl_handle); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to create a new on-chip LDO power control driver"); + return false; + } + config->pwr_ctrl_handle = pwr_ctrl_handle; +#endif + return true; +} + static esp_err_t hosted_sdio_print_cis_information(sdmmc_card_t* card) { uint8_t cis_buffer[CIS_BUFFER_SIZE]; @@ -116,6 +160,7 @@ static esp_err_t hosted_sdio_card_fn_init(sdmmc_card_t *card) SDIO_FAIL_IF_NULL(card); ESP_ERROR_CHECK(sdmmc_io_read_byte(card, SDIO_FUNC_0, SD_IO_CCCR_FN_ENABLE, &ioe)); + ESP_LOGD(TAG, "IOE: 0x%02x", ioe); ESP_ERROR_CHECK(sdmmc_io_read_byte(card, SDIO_FUNC_0, SD_IO_CCCR_FN_READY, &ior)); @@ -245,6 +290,16 @@ static esp_err_t sdio_write_toio(sdmmc_card_t *card, uint32_t function, uint32_t return ESP_OK; } +int hosted_sdio_deinit(void* ctx) +{ + sdmmc_host_t *host = (sdmmc_host_t *)ctx; + if (host) { + sdmmc_host_deinit(); + HOSTED_FREE(host); + } + return ESP_OK; +} + void * hosted_sdio_init(void) { esp_err_t res; @@ -285,8 +340,10 @@ void * hosted_sdio_init(void) // initialise SDMMC host res = sdmmc_host_init(); - if (res != ESP_OK) + if (res != ESP_OK) { + ESP_LOGE(TAG, "Failed to initialize SDMMC host"); return NULL; + } // configure SDIO interface and slot slot_config.width = context.config.bus_width; @@ -299,6 +356,8 @@ void * hosted_sdio_init(void) slot_config.d3 = context.config.pin_d3.pin; #endif + hosted_sdio_workaround(context.config.slot, &slot_config); + res = sdmmc_host_init_slot(context.config.slot, &slot_config); if (res != ESP_OK) { ESP_LOGE(TAG, "init SDMMC Host slot %d failed", H_SDMMC_HOST_SLOT); @@ -307,8 +366,10 @@ void * hosted_sdio_init(void) // initialise connected SDIO card/slave context.card = (sdmmc_card_t *)g_h.funcs->_h_malloc(sizeof(sdmmc_card_t)); - if (!context.card) + if (!context.card) { + ESP_LOGE(TAG, "Failed to allocate memory for SDMMC card"); return NULL; + } // initialise mutex for bus locking sdio_bus_lock = g_h.funcs->_h_create_mutex(); @@ -322,32 +383,39 @@ int hosted_sdio_card_init(void *ctx) SDIO_FAIL_IF_NULL(ctx); sdmmc_context_t *context = (sdmmc_context_t *)ctx; + SDIO_FAIL_IF_NULL(ctx); + struct esp_hosted_sdio_config *sdio_config = &context->config; + SDIO_FAIL_IF_NULL(sdio_config); + SDIO_FAIL_IF_NULL(context->card); sdmmc_host_t config = SDMMC_HOST_DEFAULT(); + config.slot = sdio_config->slot; // override default slot set + + if (!hosted_sdio_enable_ldo(&config)) { + goto fail; + } - if (sdio_config->bus_width == 4) - config.flags = SDMMC_HOST_FLAG_4BIT; - else - config.flags = SDMMC_HOST_FLAG_1BIT; config.max_freq_khz = sdio_config->clock_freq_khz; - ESP_LOGI(TAG, "SDIO master: Data-Lines: %d-bit Freq(KHz)[%u KHz]", sdio_config->bus_width==4? 4:1, + ESP_LOGI(TAG, "SDIO master: Slot %d, Data-Lines: %d-bit Freq(KHz)[%u KHz]", + config.slot, + sdio_config->bus_width==4? 4:1, config.max_freq_khz); if (sdio_config->bus_width == 4) { ESP_LOGI(TAG, "GPIOs: CLK[%u] CMD[%u] D0[%u] D1[%u] D2[%u] D3[%u] Slave_Reset[%u]", sdio_config->pin_clk.pin, sdio_config->pin_cmd.pin, sdio_config->pin_d0.pin, sdio_config->pin_d1.pin, sdio_config->pin_d2.pin, sdio_config->pin_d3.pin, - H_GPIO_PIN_RESET_Pin); + sdio_config->pin_reset.pin); } else { ESP_LOGI(TAG, "GPIOs: CLK[%u] CMD[%u] D0[%u] D1[%u] Slave_Reset[%u]", sdio_config->pin_clk.pin, sdio_config->pin_cmd.pin, sdio_config->pin_d0.pin, sdio_config->pin_d1.pin, - H_GPIO_PIN_RESET_Pin); + sdio_config->pin_reset.pin); } ESP_LOGI(TAG, "Queues: Tx[%u] Rx[%u] SDIO-Rx-Mode[%u]", - H_SDIO_TX_Q, H_SDIO_RX_Q, - H_SDIO_HOST_RX_MODE); + sdio_config->tx_queue_size, sdio_config->rx_queue_size, + sdio_config->rx_mode); #ifdef CONFIG_IDF_TARGET_ESP32P4 // Set this flag to allocate aligned buffer of 512 bytes to meet @@ -385,7 +453,7 @@ int hosted_sdio_card_init(void *ctx) return ESP_FAIL; } -esp_err_t hosted_sdio_deinit(void *ctx) +int hosted_sdio_card_deinit(void *ctx) { SDIO_FAIL_IF_NULL(ctx); @@ -394,7 +462,6 @@ esp_err_t hosted_sdio_deinit(void *ctx) if (card) { sdmmc_host_deinit(); - HOSTED_FREE(card); return ESP_OK; } return ESP_FAIL; @@ -408,9 +475,11 @@ int hosted_sdio_read_reg(void *ctx, uint32_t reg, uint8_t *data, uint16_t size, sdmmc_context_t *context = (sdmmc_context_t *)ctx; sdmmc_card_t *card = context->card; + SDIO_FAIL_IF_NULL(card); /* Need to apply address mask when reading/writing slave registers */ reg &= ESP_ADDRESS_MASK; + ESP_LOGV(TAG, "%s: reg[0x%" PRIx32"] size[%u]", __func__, reg, size); SDIO_LOCK(lock_required); if (size <= 1) { @@ -433,6 +502,7 @@ int hosted_sdio_write_reg(void *ctx, uint32_t reg, uint8_t *data, uint16_t size, /* Need to apply address mask when reading/writing slave registers */ reg &= ESP_ADDRESS_MASK; + ESP_LOGV(TAG, "%s: reg[0x%" PRIx32"] size[%u]", __func__, reg, size); SDIO_LOCK(lock_required); if (size <= 1) { @@ -452,6 +522,8 @@ int hosted_sdio_read_block(void *ctx, uint32_t reg, uint8_t *data, uint16_t size sdmmc_context_t *context = (sdmmc_context_t *)ctx; sdmmc_card_t *card = context->card; + SDIO_FAIL_IF_NULL(card); + ESP_LOGV(TAG, "%s: reg[0x%" PRIx32"] size[%u]", __func__, reg, size); SDIO_LOCK(lock_required); if (size <= 1) { @@ -471,6 +543,8 @@ int hosted_sdio_write_block(void *ctx, uint32_t reg, uint8_t *data, uint16_t siz sdmmc_context_t *context = (sdmmc_context_t *)ctx; sdmmc_card_t *card = context->card; + SDIO_FAIL_IF_NULL(card); + ESP_LOGV(TAG, "%s: reg[0x%" PRIx32"] size[%u]", __func__, reg, size); SDIO_LOCK(lock_required); if (size <= 1) { @@ -490,5 +564,7 @@ int hosted_sdio_wait_slave_intr(void *ctx, uint32_t ticks_to_wait) sdmmc_context_t *context = (sdmmc_context_t *)ctx; sdmmc_card_t *card = context->card; + SDIO_FAIL_IF_NULL(card); + return sdmmc_io_wait_int(card, ticks_to_wait); } diff --git a/host/port/src/spi_wrapper.c b/host/port/esp/freertos/src/port_esp_hosted_host_spi.c similarity index 66% rename from host/port/src/spi_wrapper.c rename to host/port/esp/freertos/src/port_esp_hosted_host_spi.c index 88b8edd3..470c66c7 100644 --- a/host/port/src/spi_wrapper.c +++ b/host/port/esp/freertos/src/port_esp_hosted_host_spi.c @@ -1,27 +1,19 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "esp_check.h" #include "esp_log.h" #include "driver/spi_master.h" -#include "os_wrapper.h" #include "transport_drv.h" -#include "spi_wrapper.h" +#include "port_esp_hosted_host_spi.h" +#include "port_esp_hosted_host_os.h" #include "driver/gpio.h" +#include "port_esp_hosted_host_log.h" #ifdef CONFIG_IDF_TARGET_ESP32P4 /* Enable workaround if got SPI Read Errors on ESP32-P4 due to caching */ @@ -38,24 +30,21 @@ DEFINE_LOG_TAG(spi_wrapper); extern void * spi_handle; -void * hosted_spi_init(void) -{ #ifdef CONFIG_IDF_TARGET_ESP32 -#define SENDER_HOST HSPI_HOST - + #define SENDER_HOST HSPI_HOST #else -#define SENDER_HOST SPI2_HOST - + #define SENDER_HOST SPI2_HOST #endif - +void * hosted_spi_init(void) +{ esp_err_t ret; - ESP_LOGI(TAG, "Transport: SPI, Mode:%u Freq:%uMHz TxQ:%u RxQ:%u\n GPIOs: MOSI:%u MISO:%u CLK:%u CS:%u HS:%u DR:%u SlaveReset:%u", - H_SPI_MODE, H_SPI_INIT_CLK_MHZ, H_SPI_TX_Q, H_SPI_RX_Q, - H_GPIO_MOSI_Pin, H_GPIO_MISO_Pin, H_GPIO_SCLK_Pin, + ESP_LOGI(TAG, "Transport: SPI, Mode:%u Freq:%uMHz TxQ:%u RxQ:%u\n GPIOs: CLK:%u MOSI:%u MISO:%u CS:%u HS:%u DR:%u SlaveReset:%u", + H_SPI_MODE, H_SPI_FD_CLK_MHZ, H_SPI_TX_Q, H_SPI_RX_Q, + H_GPIO_SCLK_Pin, H_GPIO_MOSI_Pin, H_GPIO_MISO_Pin, H_GPIO_CS_Pin, H_GPIO_HANDSHAKE_Pin, H_GPIO_DATA_READY_Pin, - H_GPIO_PIN_RESET_Pin); + H_GPIO_PIN_RESET); HOSTED_CREATE_HANDLE(spi_device_handle_t, spi_handle); assert(spi_handle); @@ -78,7 +67,7 @@ void * hosted_spi_init(void) #ifdef CONFIG_IDF_TARGET_ESP32P4 .clock_source = SPI_CLK_SRC_SPLL, #endif - .clock_speed_hz=MHZ_TO_HZ(H_SPI_INIT_CLK_MHZ), + .clock_speed_hz=MHZ_TO_HZ(H_SPI_FD_CLK_MHZ), .duty_cycle_pos=128, //50% duty cycle .mode=H_SPI_MODE, .spics_io_num=H_GPIO_CS_Pin, @@ -99,6 +88,38 @@ void * hosted_spi_init(void) return spi_handle; } +int hosted_spi_deinit(void *handle) +{ + if (!handle) { + ESP_LOGE(TAG, "Invalid handle for SPI deinit"); + return -1; + } + + spi_device_handle_t *spi_dev_handle = (spi_device_handle_t *)handle; + + /* Remove device from SPI bus */ + esp_err_t ret = spi_bus_remove_device(*spi_dev_handle); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to remove SPI device: %d", ret); + return -1; + } + + /* Free the SPI bus */ + ret = spi_bus_free(SENDER_HOST); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to free SPI bus: %d", ret); + return -1; + } + + /* Free the handle */ + HOSTED_FREE_HANDLE(handle); + spi_handle = NULL; + + ESP_LOGI(TAG, "SPI deinitialized"); + return 0; +} + + int hosted_do_spi_transfer(void *trans) { spi_transaction_t t = {0}; diff --git a/host/port/src/spi_hd_wrapper.c b/host/port/esp/freertos/src/port_esp_hosted_host_spi_hd.c similarity index 94% rename from host/port/src/spi_hd_wrapper.c rename to host/port/esp/freertos/src/port_esp_hosted_host_spi_hd.c index 99699b29..48ddf605 100644 --- a/host/port/src/spi_hd_wrapper.c +++ b/host/port/esp/freertos/src/port_esp_hosted_host_spi_hd.c @@ -1,17 +1,8 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2024 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -20,10 +11,10 @@ #include "driver/spi_master.h" #include "hal/spi_ll.h" -#include "common.h" -#include "esp_hosted_config.h" -#include "os_wrapper.h" -#include "spi_hd_wrapper.h" +#include "port_esp_hosted_host_config.h" +#include "port_esp_hosted_host_spi_hd.h" +#include "port_esp_hosted_host_os.h" +#include "transport_drv.h" #if SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE /* Use DMA Aligned Buffers for reg reads, buf read / writes */ @@ -328,6 +319,14 @@ void * hosted_spi_hd_init(void) .data2_io_num = -1, .data3_io_num = -1, #endif + /** set other data pins to -1 to prevent warnings about gpio + * conflict in ESP-IDF spi_common.c + */ + .data4_io_num = -1, + .data5_io_num = -1, + .data6_io_num = -1, + .data7_io_num = -1, + .sclk_io_num = H_SPI_HD_PIN_CLK, .max_transfer_sz = MAX_SPI_HD_BUFFER_SIZE, #if (H_SPI_HD_HOST_NUM_DATA_LINES == 4) diff --git a/host/port/esp/freertos/src/port_esp_hosted_host_transport_defaults.c b/host/port/esp/freertos/src/port_esp_hosted_host_transport_defaults.c new file mode 100644 index 00000000..efee7474 --- /dev/null +++ b/host/port/esp/freertos/src/port_esp_hosted_host_transport_defaults.c @@ -0,0 +1,111 @@ +/* + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp_hosted_transport_config.h" +#include "port_esp_hosted_host_config.h" + +#ifdef CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE +struct esp_hosted_sdio_config esp_hosted_get_default_sdio_config(void) +{ + return (struct esp_hosted_sdio_config) { + .clock_freq_khz = H_SDIO_CLOCK_FREQ_KHZ, + .bus_width = H_SDIO_BUS_WIDTH, + .slot = H_SDMMC_HOST_SLOT, + .pin_clk = {.port = H_SDIO_PORT_CLK, .pin = H_SDIO_PIN_CLK}, + .pin_cmd = {.port = H_SDIO_PORT_CMD, .pin = H_SDIO_PIN_CMD}, + .pin_d0 = {.port = H_SDIO_PORT_D0, .pin = H_SDIO_PIN_D0}, + .pin_d1 = {.port = H_SDIO_PORT_D1, .pin = H_SDIO_PIN_D1}, + .pin_d2 = {.port = H_SDIO_PORT_D2, .pin = H_SDIO_PIN_D2}, + .pin_d3 = {.port = H_SDIO_PORT_D3, .pin = H_SDIO_PIN_D3}, + .pin_reset = {.port = H_GPIO_PORT_RESET, .pin = H_GPIO_PIN_RESET}, + .rx_mode = H_SDIO_HOST_RX_MODE, + .block_mode = H_SDIO_TX_BLOCK_ONLY_XFER && H_SDIO_RX_BLOCK_ONLY_XFER, + .iomux_enable = false, + .tx_queue_size = H_SDIO_TX_Q, + .rx_queue_size = H_SDIO_RX_Q, + }; +} + + +struct esp_hosted_sdio_config esp_hosted_get_default_sdio_iomux_config(void) +{ + return (struct esp_hosted_sdio_config) { + .clock_freq_khz = H_SDIO_CLOCK_FREQ_KHZ, + .bus_width = H_SDIO_BUS_WIDTH, + .slot = H_SDMMC_HOST_SLOT, + .rx_mode = H_SDIO_HOST_RX_MODE, + .block_mode = H_SDIO_TX_BLOCK_ONLY_XFER && H_SDIO_RX_BLOCK_ONLY_XFER, + .iomux_enable = true, + .tx_queue_size = H_SDIO_TX_Q, + .rx_queue_size = H_SDIO_RX_Q, + }; +} +#endif + +#ifdef CONFIG_ESP_HOSTED_SPI_HD_HOST_INTERFACE +struct esp_hosted_spi_hd_config esp_hosted_get_default_spi_hd_config(void) +{ + return (struct esp_hosted_spi_hd_config) { + .num_data_lines = H_SPI_HD_HOST_NUM_DATA_LINES, + .pin_cs = {.port = H_SPI_HD_PORT_CS, .pin = H_SPI_HD_PIN_CS}, + .pin_clk = {.port = H_SPI_HD_PORT_CLK, .pin = H_SPI_HD_PIN_CLK}, + .pin_data_ready = {.port = H_SPI_HD_PORT_DATA_READY, .pin = H_SPI_HD_PIN_DATA_READY}, + .pin_d0 = {.port = H_SPI_HD_PORT_D0, .pin = H_SPI_HD_PIN_D0}, + .pin_d1 = {.port = H_SPI_HD_PORT_D1, .pin = H_SPI_HD_PIN_D1}, + .pin_d2 = {.port = H_SPI_HD_PORT_D2, .pin = H_SPI_HD_PIN_D2}, + .pin_d3 = {.port = H_SPI_HD_PORT_D3, .pin = H_SPI_HD_PIN_D3}, + .pin_reset = {.port = H_GPIO_PORT_RESET, .pin = H_GPIO_PIN_RESET}, + .clk_mhz = H_SPI_HD_CLK_MHZ, + .mode = H_SPI_HD_MODE, + .tx_queue_size = H_SPI_HD_TX_QUEUE_SIZE, + .rx_queue_size = H_SPI_HD_RX_QUEUE_SIZE, + .checksum_enable = H_SPI_HD_CHECKSUM, + .num_command_bits = H_SPI_HD_NUM_COMMAND_BITS, + .num_address_bits = H_SPI_HD_NUM_ADDRESS_BITS, + .num_dummy_bits = H_SPI_HD_NUM_DUMMY_BITS, + }; +} +#endif + +#ifdef CONFIG_ESP_HOSTED_SPI_HOST_INTERFACE +struct esp_hosted_spi_config esp_hosted_get_default_spi_config(void) +{ + return (struct esp_hosted_spi_config) { + .pin_mosi = {.port = H_GPIO_MOSI_Port, .pin = H_GPIO_MOSI_Pin}, + .pin_miso = {.port = H_GPIO_MISO_Port, .pin = H_GPIO_MISO_Pin}, + .pin_sclk = {.port = H_GPIO_SCLK_Port, .pin = H_GPIO_SCLK_Pin}, + .pin_cs = {.port = H_GPIO_CS_Port, .pin = H_GPIO_CS_Pin}, + .pin_handshake = {.port = H_GPIO_HANDSHAKE_Port, .pin = H_GPIO_HANDSHAKE_Pin}, + .pin_data_ready = {.port = H_GPIO_DATA_READY_Port, .pin = H_GPIO_DATA_READY_Pin}, + .pin_reset = {.port = H_GPIO_PORT_RESET, .pin = H_GPIO_PIN_RESET}, + .tx_queue_size = H_SPI_TX_Q, + .rx_queue_size = H_SPI_RX_Q, + .mode = H_SPI_MODE, + .clk_mhz = H_SPI_FD_CLK_MHZ, + }; +} +#endif + +#ifdef CONFIG_ESP_HOSTED_UART_HOST_INTERFACE +struct esp_hosted_uart_config esp_hosted_get_default_uart_config(void) +{ + return (struct esp_hosted_uart_config) { + .port = H_UART_PORT, + .pin_tx = {.port = H_UART_PORT_TX, .pin = H_UART_PIN_TX}, + .pin_rx = {.port = H_UART_PORT_RX, .pin = H_UART_PIN_RX}, + .pin_reset = {.port = H_GPIO_PORT_RESET, .pin = H_GPIO_PIN_RESET}, + .num_data_bits = H_UART_NUM_DATA_BITS, + .parity = H_UART_PARITY, + .stop_bits = H_UART_STOP_BITS, + .flow_ctrl = H_UART_FLOWCTRL, + .clk_src = H_UART_CLK_SRC, + .checksum_enable = H_UART_CHECKSUM, + .baud_rate = H_UART_BAUD_RATE, + .tx_queue_size = H_UART_TX_QUEUE_SIZE, + .rx_queue_size = H_UART_RX_QUEUE_SIZE, + }; +} +#endif \ No newline at end of file diff --git a/host/port/src/uart_wrapper.c b/host/port/esp/freertos/src/port_esp_hosted_host_uart.c similarity index 80% rename from host/port/src/uart_wrapper.c rename to host/port/esp/freertos/src/port_esp_hosted_host_uart.c index 24699e18..89ae143e 100644 --- a/host/port/src/uart_wrapper.c +++ b/host/port/esp/freertos/src/port_esp_hosted_host_uart.c @@ -1,26 +1,17 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2024 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "driver/uart.h" -#include "esp_hosted_config.h" -#include "os_wrapper.h" -#include "uart_wrapper.h" +#include "transport_drv.h" +#include "port_esp_hosted_host_os.h" +#include "port_esp_hosted_host_uart.h" #include "esp_log.h" static const char TAG[] = "uart_wrapper"; @@ -153,11 +144,11 @@ void * hosted_uart_init(void) ESP_ERROR_CHECK(uart_driver_install(H_UART_PORT, MAX_UART_BUFFER_SIZE, MAX_UART_BUFFER_SIZE, 0, NULL, 0)); ESP_ERROR_CHECK(uart_param_config(H_UART_PORT, &uart_config)); - ESP_ERROR_CHECK(uart_set_pin(H_UART_PORT, H_UART_TX_PIN, H_UART_RX_PIN, + ESP_ERROR_CHECK(uart_set_pin(H_UART_PORT, H_UART_PIN_TX, H_UART_PIN_RX, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE)); ESP_LOGI(TAG, "UART GPIOs: Tx: %"PRIu16 ", Rx: %"PRIu16 ", Baud Rate %i", - H_UART_TX_PIN, H_UART_RX_PIN, H_UART_BAUD_RATE); + H_UART_PIN_TX, H_UART_PIN_RX, H_UART_BAUD_RATE); ctx->uart_port = H_UART_PORT; @@ -181,7 +172,7 @@ esp_err_t hosted_uart_deinit(void *ctx) ESP_LOGE(TAG, "%s: Failed to flush uart Tx", __func__); uart_driver_delete(pctx->uart_port); - HOSTED_FREE(ctx); + g_h.funcs->_h_free(ctx); return ESP_OK; } diff --git a/host/port/include/esp_hosted_wifi_config.h b/host/port/include/esp_hosted_wifi_config.h deleted file mode 100644 index b1e75d9f..00000000 --- a/host/port/include/esp_hosted_wifi_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef __ESP_HOSTED_WIFI_CONFIG_H__ -#define __ESP_HOSTED_WIFI_CONFIG_H__ - -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) -// dual band API support available -#define H_WIFI_DUALBAND_SUPPORT 1 -#else -#define H_WIFI_DUALBAND_SUPPORT 0 -#endif - -#endif diff --git a/host/port/include/os_header.h b/host/port/include/os_header.h deleted file mode 100644 index 46105aad..00000000 --- a/host/port/include/os_header.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -/* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */ - -#ifndef __OS_HEADER_H -#define __OS_HEADER_H - -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/semphr.h" -#include "freertos/queue.h" -#include "freertos/event_groups.h" - -#ifndef DEFINE_LOG_TAG -#define DEFINE_LOG_TAG(sTr) static const char TAG[] = #sTr -#endif -#endif /*__OS_HEADER_H*/ diff --git a/host/port/src/esp_hosted_config.c b/host/port/src/esp_hosted_config.c deleted file mode 100644 index 9638848c..00000000 --- a/host/port/src/esp_hosted_config.c +++ /dev/null @@ -1,16 +0,0 @@ -/* -* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD -* -* SPDX-License-Identifier: Apache-2.0 -*/ - -#include "esp_hosted_config.h" -#include "esp_hosted_transport_config.h" - -esp_err_t esp_hosted_set_default_config(void) { - return esp_hosted_transport_set_default_config(); -} - -bool esp_hosted_is_config_valid(void) { - return esp_hosted_transport_is_config_valid(); -} diff --git a/host/utils/common.c b/host/utils/common.c deleted file mode 100644 index 601c0976..00000000 --- a/host/utils/common.c +++ /dev/null @@ -1,130 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** Includes **/ -#include "common.h" -#include "esp_log.h" -#include -#include - -#if 0 -DEFINE_LOG_TAG(utils); -#endif -/** Constants/Macros **/ - -/** Exported variables **/ - - -/** Function declaration **/ - -/** Exported Functions **/ -/** - * @brief debug buffer print - * @param buff - input buffer to print in hex - * rx_len - buff len - * human_str - helping string to describe about buffer - * @retval None - */ -#if DEBUG_HEX_STREAM_PRINT -char print_buff[MAX_SPI_BUFFER_SIZE*3]; -#endif - -uint16_t hton_short (uint16_t x) -{ -#if BYTE_ORDER == BIG_ENDIAN - return x; -#elif BYTE_ORDER == LITTLE_ENDIAN - uint16_t val = 0; - - val = (x &0x00FF)<<8; - val |= (x &0xFF00)>>8; - - return val; -#else -# error "not able to identify endianness" -#endif -} - -uint32_t hton_long (uint32_t x) -{ -#if BYTE_ORDER == BIG_ENDIAN - return x; -#elif BYTE_ORDER == LITTLE_ENDIAN - uint32_t val = (x&0xFF000000) >> 24; - - val |= (x&0x00FF0000) >> 8; - val |= (x&0x0000FF00) << 8; - val |= (x&0x000000FF) << 24; - - return val; -#else -# error "not able to identify endianness" -#endif -} - -/** - * @brief Calculate minimum - * @param x - number - * y - number - * @retval minimum - */ -int min(int x, int y) { - return (x < y) ? x : y; -} - -#if 0 -/** - * @brief get numbers from string - * @param val - return integer value, - * arg - input string - * @retval STM_OK on success, else STM_FAIL - */ -int get_num_from_string(int *val, char *arg) -{ - int base = 10; - char *endptr = NULL, *str = NULL; - - if (!arg || (arg[0]=='\0')) { - ESP_LOGE(TAG, "No number Identified \n"); - return STM_FAIL; - } - - if (!val) { - ESP_LOGE(TAG, "No memory allocated \n"); - return STM_FAIL; - } - - errno = 0; - str = arg; - *val = strtol(str, &endptr, base); - - if (endptr == str) { - ESP_LOGE(TAG, "No digits found \n"); - *val = 0; - return STM_FAIL; - } - - if ((errno == ERANGE) && ((*val == INT32_MAX) || (*val == INT32_MIN))) { - perror("strtol"); - *val = 0; - return STM_FAIL; - } - - return STM_OK; -} -#endif - -/** Local functions **/ diff --git a/host/utils/common.h b/host/utils/common.h deleted file mode 100644 index 30b0e6b0..00000000 --- a/host/utils/common.h +++ /dev/null @@ -1,125 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** prevent recursive inclusion **/ -#ifndef __COMMON_H -#define __COMMON_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** Includes **/ -#include "stdint.h" -#include "stdio.h" -#include "os_wrapper.h" -#include "esp_err.h" -#include "esp_hosted_transport.h" - - -/** Constants/Macros **/ -#define MAX_NETWORK_INTERFACES 2 -#define STA_INTERFACE "ESP_STATION" -#define SOFTAP_INTERFACE "ESP_SOFTAP" - -#define UNUSED_VAR(x) (void)(x); - -#define MAX_SPI_BUFFER_SIZE ESP_TRANSPORT_SPI_MAX_BUF_SIZE -#define MAX_SDIO_BUFFER_SIZE ESP_TRANSPORT_SDIO_MAX_BUF_SIZE -#define MAX_SPI_HD_BUFFER_SIZE ESP_TRANSPORT_SPI_HD_MAX_BUF_SIZE -#define MAX_UART_BUFFER_SIZE ESP_TRANSPORT_UART_MAX_BUF_SIZE - -#define MAX_SUPPORTED_SDIO_CLOCK_MHZ 40 - -#define IP_ADDR_LEN 4 -#define MAC_LEN 6 -#define MIN_MAC_STRING_LEN 17 - -#ifndef BIT -#define BIT(x) (1UL << (x)) -#endif - -#define FREQ_IN_MHZ(x) ((x)*1000000) - -#define MHZ_TO_HZ(x) (1000000*(x)) - -#define SUCCESS 0 -#define FAILURE -1 - -typedef enum stm_ret_s { - STM_OK = 0, - STM_FAIL = -1, - STM_FAIL_TIMEOUT = -2, - STM_FAIL_INVALID_ARG = -3, - STM_FAIL_NO_MEMORY = -4, - STM_FAIL_NOT_FOUND = -5, - STM_FAIL_NOT_FINISHED = -6, - STM_FAIL_ALIGNMENT = -7 -}stm_ret_t; - -typedef enum { - TRANSPORT_INACTIVE, - TRANSPORT_RX_ACTIVE, - TRANSPORT_TX_ACTIVE, -} transport_drv_events_e; - -/** Exported Structures **/ -/* interface header */ -typedef struct { - union { - void *priv_buffer_handle; - }; - uint8_t if_type; - uint8_t if_num; - uint8_t *payload; - uint8_t flag; - uint16_t payload_len; - uint16_t seq_num; - /* no need of memcpy at different layers */ - uint8_t payload_zcopy; - - void (*free_buf_handle)(void *buf_handle); -} interface_buffer_handle_t; - -/** Exported variables **/ - -/** Exported Functions **/ -uint16_t hton_short (uint16_t x); -uint32_t hton_long (uint32_t x); - -#define ntoh_long hton_long -#define ntoh_short hton_short - -typedef unsigned char u_char; -typedef unsigned long u_long; - -int min(int x, int y); -#if 0 -void hard_delay(int x); -int get_num_from_string(int *val, char *arg); -#endif - -#define H_FREE_PTR_WITH_FUNC(FreeFunc, FreePtr) do { \ - if (FreeFunc && FreePtr) { \ - FreeFunc(FreePtr); \ - FreePtr = NULL; \ - } \ -} while (0); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/host/utils/stats.c b/host/utils/stats.c index 88544042..c499d5cf 100644 --- a/host/utils/stats.c +++ b/host/utils/stats.c @@ -1,28 +1,17 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /** Includes **/ #include "stats.h" -#include "esp_hosted_config.h" #if TEST_RAW_TP -#include "os_wrapper.h" #include "transport_drv.h" #endif #include "esp_log.h" +#include "esp_hosted_transport_init.h" // use mempool and zero copy for Tx #include "mempool.h" @@ -30,11 +19,14 @@ #if ESP_PKT_STATS struct pkt_stats_t pkt_stats; void *pkt_stats_thread = NULL; -extern volatile uint8_t wifi_tx_throttling; +#endif + +#ifdef ESP_PKT_NUM_DEBUG +struct dbg_stats_t dbg_stats; #endif #if ESP_PKT_STATS || TEST_RAW_TP -DEFINE_LOG_TAG(stats); +static const char *TAG = "stats"; #endif /** Constants/Macros **/ @@ -91,7 +83,6 @@ void raw_tp_timer_func(void * arg) #endif int32_t div = 1024; - actual_bandwidth_tx = (test_raw_tx_len*8)/TEST_RAW_TP__TIMEOUT; actual_bandwidth_rx = (test_raw_rx_len*8)/TEST_RAW_TP__TIMEOUT; #if USE_FLOATING_POINT @@ -126,7 +117,7 @@ static void raw_tp_tx_task(void const* pvParameters) for (i=0; i<(TEST_RAW_TP__BUF_SIZE/4-1); i++, ptr++) *ptr = 0xBAADF00D; - ret = esp_hosted_tx(ESP_TEST_IF, 0, raw_tp_tx_buf, TEST_RAW_TP__BUF_SIZE, H_BUFF_ZEROCOPY, H_DEFLT_FREE_FUNC); + ret = esp_hosted_tx(ESP_TEST_IF, 0, raw_tp_tx_buf, TEST_RAW_TP__BUF_SIZE, H_BUFF_ZEROCOPY, raw_tp_tx_buf, H_DEFLT_FREE_FUNC, 0); #else raw_tp_tx_buf = mempool_alloc(buf_mp_g, MAX_TRANSPORT_BUFFER_SIZE, true); @@ -135,9 +126,9 @@ static void raw_tp_tx_task(void const* pvParameters) for (i=0; i<(TEST_RAW_TP__BUF_SIZE/4-1); i++, ptr++) *ptr = 0xBAADF00D; - ret = esp_hosted_tx(ESP_TEST_IF, 0, raw_tp_tx_buf, TEST_RAW_TP__BUF_SIZE, H_BUFF_ZEROCOPY, stats_mempool_free); + ret = esp_hosted_tx(ESP_TEST_IF, 0, raw_tp_tx_buf, TEST_RAW_TP__BUF_SIZE, H_BUFF_ZEROCOPY, raw_tp_tx_buf, stats_mempool_free, 0); #endif - if (ret != STM_OK) { + if (ret) { ESP_LOGE(TAG, "Failed to send to queue\n"); continue; } @@ -154,8 +145,8 @@ static void process_raw_tp_flags(uint8_t cap) test_raw_tp_cleanup(); if (test_raw_tp) { - hosted_timer_handler = g_h.funcs->_h_timer_start(TEST_RAW_TP__TIMEOUT, - RPC__TIMER_PERIODIC, raw_tp_timer_func, NULL); + hosted_timer_handler = g_h.funcs->_h_timer_start("raw_tp_timer", SEC_TO_MILLISEC(TEST_RAW_TP__TIMEOUT), + H_TIMER_TYPE_PERIODIC, raw_tp_timer_func, NULL); if (!hosted_timer_handler) { ESP_LOGE(TAG, "Failed to create timer\n\r"); return; @@ -208,10 +199,17 @@ struct mem_stats h_stats_g; #if ESP_PKT_STATS void stats_timer_func(void * arg) { - ESP_LOGI(TAG, "slave: sta_rx_in: %lu sta_rx_out: %lu sta_tx_in [pass: %lu drop: %lu] sta_tx_out: %lu ", + ESP_LOGI(TAG, "STA: s2h{in[%lu] out[%lu]} h2s{in(flowctrl_drop[%lu] in[%lu or %lu]) out(ok[%lu] drop[%lu])} flwctl{on[%lu] off[%lu]}", pkt_stats.sta_rx_in,pkt_stats.sta_rx_out, - pkt_stats.sta_tx_in_pass, pkt_stats.sta_tx_in_drop, pkt_stats.sta_tx_out); - ESP_LOGI(TAG, "wifi_tx_throttling %u", wifi_tx_throttling); + pkt_stats.sta_tx_flowctrl_drop, pkt_stats.sta_tx_in_pass, pkt_stats.sta_tx_trans_in, pkt_stats.sta_tx_out, pkt_stats.sta_tx_out_drop, + pkt_stats.sta_flow_ctrl_on, pkt_stats.sta_flow_ctrl_off); + ESP_LOGI(TAG, "internal: free %d l-free %d min-free %d, psram: free %d l-free %d min-free %d", + heap_caps_get_free_size(MALLOC_CAP_8BIT) - heap_caps_get_free_size(MALLOC_CAP_SPIRAM), + heap_caps_get_largest_free_block(MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL), + heap_caps_get_minimum_free_size(MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL), + heap_caps_get_free_size(MALLOC_CAP_SPIRAM), + heap_caps_get_largest_free_block(MALLOC_CAP_SPIRAM), + heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM)); } #endif @@ -220,8 +218,8 @@ void create_debugging_tasks(void) #if ESP_PKT_STATS if (ESP_PKT_STATS_REPORT_INTERVAL) { ESP_LOGI(TAG, "Start Pkt_stats reporting thread [timer: %u sec]", ESP_PKT_STATS_REPORT_INTERVAL); - pkt_stats_thread = g_h.funcs->_h_timer_start(ESP_PKT_STATS_REPORT_INTERVAL, - RPC__TIMER_PERIODIC, stats_timer_func, NULL); + pkt_stats_thread = g_h.funcs->_h_timer_start("pkt_stats_timer", SEC_TO_MILLISEC(ESP_PKT_STATS_REPORT_INTERVAL), + HOSTED_TIMER_PERIODIC, stats_timer_func, NULL); assert(pkt_stats_thread); } #endif diff --git a/host/utils/stats.h b/host/utils/stats.h index 24095d56..639e4310 100644 --- a/host/utils/stats.h +++ b/host/utils/stats.h @@ -1,29 +1,18 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef __STATS__H #define __STATS__H +#include "port_esp_hosted_host_config.h" + #ifdef __cplusplus extern "C" { #endif -#include "common.h" -#include "esp_hosted_config.h" - /* Stats CONFIG: * * 1. TEST_RAW_TP @@ -47,17 +36,7 @@ extern "C" { */ #if TEST_RAW_TP -#include "os_wrapper.h" -/* Raw throughput is supported only one direction - * at a time - * i.e. ESP to Host OR - * Host to ESP - */ -#if 0 -#define TEST_RAW_TP__ESP_TO_HOST 1 -#define TEST_RAW_TP__HOST_TO_ESP !TEST_RAW_TP__ESP_TO_HOST -#endif #define TEST_RAW_TP__TIMEOUT H_RAW_TP_REPORT_INTERVAL void update_test_raw_tp_rx_len(uint16_t len); @@ -116,20 +95,50 @@ struct mem_stats { }; extern struct mem_stats h_stats_g; -#endif +#endif /*H_MEM_STATS*/ + +#ifdef ESP_PKT_NUM_DEBUG +struct dbg_stats_t { + uint16_t tx_pkt_num; + uint16_t exp_rx_pkt_num; +}; + +extern struct dbg_stats_t dbg_stats; +#define UPDATE_HEADER_TX_PKT_NO(h) h->pkt_num = htole16(dbg_stats.tx_pkt_num++) +#define UPDATE_HEADER_RX_PKT_NO(h) \ + do { \ + uint16_t rcvd_pkt_num = le16toh(h->pkt_num); \ + if (dbg_stats.exp_rx_pkt_num != rcvd_pkt_num) { \ + ESP_LOGI(TAG, "exp_pkt_num[%u], rx_pkt_num[%u]", \ + dbg_stats.exp_rx_pkt_num, rcvd_pkt_num); \ + dbg_stats.exp_rx_pkt_num = rcvd_pkt_num; \ + } \ + dbg_stats.exp_rx_pkt_num++; \ + } while(0); + +#else /*ESP_PKT_NUM_DEBUG*/ + + #define UPDATE_HEADER_TX_PKT_NO(h) + #define UPDATE_HEADER_RX_PKT_NO(h) + +#endif /*ESP_PKT_NUM_DEBUG*/ #if ESP_PKT_STATS -#define ESP_PKT_STATS_REPORT_INTERVAL 10 struct pkt_stats_t { uint32_t sta_rx_in; uint32_t sta_rx_out; uint32_t sta_tx_in_pass; - uint32_t sta_tx_in_drop; + uint32_t sta_tx_trans_in; + uint32_t sta_tx_flowctrl_drop; uint32_t sta_tx_out; + uint32_t sta_tx_out_drop; + uint32_t sta_flow_ctrl_on; + uint32_t sta_flow_ctrl_off; }; extern struct pkt_stats_t pkt_stats; -#endif +#endif /*ESP_PKT_STATS*/ + #ifdef __cplusplus } #endif diff --git a/host/utils/util.c b/host/utils/util.c deleted file mode 100644 index e215047b..00000000 --- a/host/utils/util.c +++ /dev/null @@ -1,255 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** Includes **/ -#include "util.h" -#include "ctype.h" -#include "string.h" - -/** Constants/Macros **/ - -/** Exported variables **/ - -/** Function declaration **/ - -/** Exported Functions **/ -/* - * Check whether "cp" is a valid ascii representation - * of an Internet address and convert to a binary address. - * Returns 1 if the address is valid, 0 if not. - * This replaces inet_addr, the return value from which - * cannot distinguish between failure and a local broadcast address. - */ -int ipv4_addr_aton(const char *cp, uint32_t *ip_uint32) -{ - u_long val, base, n; - char c; - u_long parts[4], *pp = parts; - - for (;;) { - /* - * Collect number up to ``.''. - * Values are specified as for C: - * 0x=hex, 0=octal, other=decimal. - */ - val = 0; base = 10; - if (*cp == '0') { - if (*++cp == 'x' || *cp == 'X') - base = 16, cp++; - else - base = 8; - } - while ((c = *cp) != '\0') { - if (isascii(c) && isdigit(c)) { - val = (val * base) + (c - '0'); - cp++; - continue; - } - if (base == 16 && isascii(c) && isxdigit(c)) { - val = (val << 4) + - (c + 10 - (islower(c) ? 'a' : 'A')); - cp++; - continue; - } - break; - } - if (*cp == '.') { - /* - * Internet format: - * a.b.c.d - * a.b.c (with c treated as 16-bits) - * a.b (with b treated as 24 bits) - */ - if (pp >= parts + 3 || val > 0xff) - return (0); - *pp++ = val, cp++; - } else - break; - } - /* - * Check for trailing characters. - */ - if (*cp && (!isascii((uint8_t)*cp) || !isspace((uint8_t)*cp))) - return (0); - /* - * Concoct the address according to - * the number of parts specified. - */ - n = pp - parts + 1; - switch (n) { - - case 1: /* a -- 32 bits */ - break; - - case 2: /* a.b -- 8.24 bits */ - if (val > 0xffffff) - return (0); - val |= parts[0] << 24; - break; - - case 3: /* a.b.c -- 8.8.16 bits */ - if (val > 0xffff) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16); - break; - - case 4: /* a.b.c.d -- 8.8.8.8 bits */ - if (val > 0xff) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); - break; - } - if(ip_uint32) { - *ip_uint32 = hton_long(val); - } - return (1); -} - -/** - * @brief convert ip in int to string - * - * @param addr ip address in network order to convert - * @param buf target buffer where the string is stored - * @param buflen length of buf - * @return either pointer to buf which now holds the ASCII - * representation of addr or NULL if buf was too small - */ - -char * ipv4_addr_ntoa(uint32_t addr, char *buf, int buflen) -{ - char inv[3]; - char *rp; - uint8_t *ap; - uint8_t rem; - uint8_t n; - uint8_t i; - int len = 0; - uint32_t addr_nw = ntoh_long(addr); - - rp = buf; - ap = (uint8_t *)&addr_nw; - for (n = 0; n < 4; n++) { - i = 0; - do { - rem = *ap % (uint8_t)10; - *ap /= (uint8_t)10; - inv[i++] = (char)('0' + rem); - } while (*ap); - while (i--) { - if (len++ >= buflen) { - return NULL; - } - *rp++ = inv[i]; - } - if (len++ >= buflen) { - return NULL; - } - *rp++ = '.'; - ap++; - } - *--rp = 0; - return buf; -} - -/** - * @brief Convert mac string to byte stream - * @param out - output mac in bytes - * s - input mac string - * @retval STM_OK/STM_FAIL - */ -stm_ret_t convert_mac_to_bytes(uint8_t *out, const char *s) -{ - int mac[MAC_LEN] = {0}; - int num_bytes = 0; - - if (!s || (strlen(s) < MIN_MAC_STRING_LEN)) { - return STM_FAIL; - } - - num_bytes = sscanf(s, "%2x:%2x:%2x:%2x:%2x:%2x", - &mac[0],&mac[1], &mac[2], &mac[3], &mac[4], &mac[5]); - - if ((num_bytes < MAC_LEN) || - (mac[0] > 0xFF) || - (mac[1] > 0xFF) || - (mac[2] > 0xFF) || - (mac[3] > 0xFF) || - (mac[4] > 0xFF) || - (mac[5] > 0xFF)) { - return STM_FAIL; - } - - out[0] = mac[0]&0xff; - out[1] = mac[1]&0xff; - out[2] = mac[2]&0xff; - out[3] = mac[3]&0xff; - out[4] = mac[4]&0xff; - out[5] = mac[5]&0xff; - - return STM_OK; -} - -/** - * @brief compare two buff in bytes - * @param buff1 - in bytes - * buff2 - in bytes - * @retval 1 if same, else 0 - */ -uint8_t is_same_buff(void *buff1, void *buff2, uint16_t len) -{ - uint16_t idx; - uint8_t *b1 = (uint8_t*)buff1; - uint8_t *b2 = (uint8_t*)buff2; - - if ((b1 == NULL) && (b2==NULL)) { - if(len) { - return 0; - } - return 1; - } - - if(!b1 || !b2) { - return 0; - } - - /* Function assumes buff1 and buff2 are allocated for len */ - for (idx=0; idx < len; idx++) { - if (*b1 != *b2) { - return 0; - } - b1++; - b2++; - } - return 1; -} - -/** - * @brief Get ip in 32bit from dotted string notation - * @param ip_s - input ip address in string - * ip_x - output ip address in 32 bit - * @retval STM_OK/STM_FAIL - */ -stm_ret_t get_ipaddr_from_str(const char *ip_s, uint32_t *ip_x) -{ - uint32_t ip_nw = 0; - if (! ipv4_addr_aton(ip_s, &ip_nw)) - { - return STM_FAIL; - } - /* ipv4_addr_aton does conversion in network order. reverse */ - *ip_x = ntoh_long(ip_nw); - return STM_OK; -} diff --git a/host/utils/util.h b/host/utils/util.h deleted file mode 100644 index 5461d454..00000000 --- a/host/utils/util.h +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** prevent recursive inclusion **/ -#ifndef __UTIL_H -#define __UTIL_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** Includes **/ -#include "common.h" - -/** Constants/Macros **/ - -/** Exported Structures **/ - -/** Exported variables **/ - -/** Exported Functions **/ - -stm_ret_t get_ipaddr_from_str(const char *ip_s, uint32_t *ip_x); -int ipv4_addr_aton(const char *cp, uint32_t *ip_uint32); -char * ipv4_addr_ntoa(const uint32_t addr, char *buf, int buflen); -stm_ret_t convert_mac_to_bytes(uint8_t *out, const char *s); -uint8_t is_same_buff(void *buff1, void *buff2, uint16_t len); -stm_ret_t get_self_ip(int iface_type, uint32_t *self_ip); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/idf_component.yml b/idf_component.yml index 1076fe38..69a11628 100644 --- a/idf_component.yml +++ b/idf_component.yml @@ -1,4 +1,4 @@ -version: "1.3.2" +version: "2.6.1" description: ESP-Hosted-MCU provide drivers to act any ESP chipset as Wi-Fi or Bluetooth co-processor. url: https://github.com/espressif/esp-hosted-mcu examples: diff --git a/sdkconfig.ci.all_features_enabled b/sdkconfig.ci.all_features_enabled new file mode 100644 index 00000000..3fdfddc6 --- /dev/null +++ b/sdkconfig.ci.all_features_enabled @@ -0,0 +1,11 @@ +# ESP-Hosted All Features Enabled Configuration +# This configuration enables network split, power save, CLI, and SDIO with minimal overrides + +# Network Split Configuration (not default) +CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED=y + +# Host Power Save Configuration (default is y when supported) +CONFIG_ESP_HOSTED_HOST_POWER_SAVE_ENABLED=y + +# CLI Configuration (default is y) +CONFIG_ESP_HOSTED_CLI_ENABLED=y diff --git a/slave/CMakeLists.txt b/slave/CMakeLists.txt index 7ae51de1..95b9b488 100644 --- a/slave/CMakeLists.txt +++ b/slave/CMakeLists.txt @@ -2,33 +2,58 @@ # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) +# Add the wrap flag for esp_wifi_init +add_compile_options(-Wl,--wrap=esp_wifi_init) + +# Read version from header file before project() call +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/main/esp_hosted_coprocessor_fw_ver.h" HEADER_CONTENTS) +set(PROJECT_VERSION_REGEX "#define[ \t]+PROJECT_VERSION_MAJOR_1[ \t]+([0-9]+)[ \t\n]+#define[ \t]+PROJECT_VERSION_MINOR_1[ \t]+([0-9]+)[ \t\n]+#define[ \t]+PROJECT_VERSION_PATCH_1[ \t]+([0-9]+)") +string(REGEX MATCH "${PROJECT_VERSION_REGEX}" PROJECT_VERSION_MATCH "${HEADER_CONTENTS}") + +if(PROJECT_VERSION_MATCH) + set(PROJECT_VERSION_MAJOR_1 "${CMAKE_MATCH_1}") + set(PROJECT_VERSION_MINOR_1 "${CMAKE_MATCH_2}") + set(PROJECT_VERSION_PATCH_1 "${CMAKE_MATCH_3}") + # Set PROJECT_VER before project() call to override git versioning + set(PROJECT_VER "${PROJECT_VERSION_MAJOR_1}.${PROJECT_VERSION_MINOR_1}.${PROJECT_VERSION_PATCH_1}") + message(STATUS "Setting PROJECT_VER to: ${PROJECT_VER}") +endif() + include($ENV{IDF_PATH}/tools/cmake/project.cmake) list(APPEND EXCLUDE_COMPONENTS lwip esp_netif) -#set(COMPONENTS main nvs_flash protocomm esp_rom) -set(COMPONENTS esp_timer esptool_py bootloader main nvs_flash esp_rom esp_wifi protocomm driver) -#set(COMPONENTS main nvs_flash protocomm esp_gdbstub) # incase gdbsub needed + +set(COMPONENTS esp_timer esptool_py bootloader main nvs_flash esp_rom esp_wifi protocomm driver mqtt wpa_supplicant wifi_provisioning esp_driver_sdio) + +#list(APPEND COMPONENTS esp_gdbstub) # incase gdbstub needed project(network_adapter) idf_build_set_property(COMPILE_OPTIONS "-fdiagnostics-color=always" APPEND) -### add custom dependency for generated version header file -### reference: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/build-system.html#source-code-generation -if(EXISTS "${PROJECT_DIR}/main/coprocessor_fw_version.txt") - add_custom_command(OUTPUT "${PROJECT_DIR}/main/coprocessor_fw_version.h" - COMMAND ${CMAKE_COMMAND} -P "${PROJECT_DIR}/ExtractVersion.cmake" - DEPENDS "${PROJECT_DIR}/main/coprocessor_fw_version.txt" - VERBATIM) -elseif(EXISTS "${PROJECT_DIR}/../idf_component.yml") - add_custom_command(OUTPUT "${PROJECT_DIR}/main/coprocessor_fw_version.h" - COMMAND ${CMAKE_COMMAND} -P "${PROJECT_DIR}/ExtractVersion.cmake" - DEPENDS "${PROJECT_DIR}/../idf_component.yml" - VERBATIM) + +if(EXISTS "${PROJECT_DIR}/../common") + set(common_dir "${PROJECT_DIR}/../common") + message(STATUS "common: ${common_dir}") +elseif(EXISTS "${PROJECT_DIR}/main/common") + set(common_dir "${PROJECT_DIR}/main/common") + message(STATUS "common: ${common_dir}") else() - message(FATAL_ERROR "***** coprocessor_fw_version.txt and idf_component.yml NOT found.\nUnable to generate comprocessor fw version info to build") + message(FATAL_ERROR "Could not find 'common' directory in either '${PROJECT_DIR}/../common' or '${PROJECT_DIR}/main/common'") endif() -add_custom_target(version_header DEPENDS "${PROJECT_DIR}/main/coprocessor_fw_version.h") -add_dependencies(${PROJECT_NAME}.elf version_header) -### clean up generated file when project is cleaned -set_property(DIRECTORY "${PROJECT_DIR}" APPEND PROPERTY - ADDITIONAL_CLEAN_FILES "${PROJECT_DIR}/main/coprocessor_fw_version.h") +if(EXISTS "${common_dir}/esp_hosted_lwip_src_port_hook.h") +idf_component_get_property(lwip lwip COMPONENT_LIB) +if(TARGET ${lwip}) + # Use generator expressions to only apply to non-INTERFACE targets + get_target_property(lwip_type ${lwip} TYPE) + if(NOT lwip_type STREQUAL "INTERFACE_LIBRARY") + message(STATUS "********** Configuring LWIP for network split mode with custom hook **********") + target_include_directories(${lwip} PRIVATE "${common_dir}") + target_compile_definitions(${lwip} PRIVATE "-DESP_IDF_LWIP_HOOK_FILENAME=\"${common_dir}/esp_hosted_lwip_src_port_hook.h\"") + endif() +endif() +endif() + +### Display FW Version (already read before project() call) +message(*************************************************************************************) +message(" Building ESP-Hosted-MCU FW :: ${PROJECT_VER} ") +message(*************************************************************************************) diff --git a/slave/ExtractVersion.cmake b/slave/ExtractVersion.cmake deleted file mode 100644 index 6d77c044..00000000 --- a/slave/ExtractVersion.cmake +++ /dev/null @@ -1,43 +0,0 @@ -### if code is from Component Registry, generate from coprocessor_fw_version.txt -### if code is from git, generate from top level idf_component.yml - -if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/main/coprocessor_fw_version.txt") - file(READ "${CMAKE_CURRENT_LIST_DIR}/main/coprocessor_fw_version.txt" VERSION_CONTENTS) - set(VERSION_REGEX "^([0-9]+).([0-9]+).([0-9]+)") - string(REGEX MATCH "${VERSION_REGEX}" VERSION_MATCH "${VERSION_CONTENTS}") - if(VERSION_MATCH) - set(VERSION_GENERATOR "coprocessor_fw_version.txt") - else() - message(FATAL_ERROR "version info not found in coprocessor_fw_version.txt") - endif() -elseif(EXISTS "${CMAKE_CURRENT_LIST_DIR}/../idf_component.yml") - file(READ "${CMAKE_CURRENT_LIST_DIR}/../idf_component.yml" VERSION_CONTENTS) - set(VERSION_REGEX "^version: \"([0-9]+).([0-9]+).([0-9]+)\"") - string(REGEX MATCH "${VERSION_REGEX}" VERSION_MATCH "${VERSION_CONTENTS}") - if(VERSION_MATCH) - set(VERSION_GENERATOR "idf_component.yml") - else() - message(FATAL_ERROR "version info not found in idf_component.yml") - endif() -else() - message(FATAL_ERROR "idf_component.yml not found") -endif() - -# generate header file from the version info -file(WRITE "${CMAKE_CURRENT_LIST_DIR}/main/coprocessor_fw_version.h" - "/* this is a generated file - do not modify\n" - " * generated from ${VERSION_GENERATOR} */\n" - "#ifndef __COPROCESSOR_FW_VERSION_H__\n" - "#define __COPROCESSOR_FW_VERSION_H__\n" - "#define PROJECT_VERSION_MAJOR_1 ${CMAKE_MATCH_1}\n" - "#define PROJECT_VERSION_MINOR_1 ${CMAKE_MATCH_2}\n" - "#define PROJECT_VERSION_PATCH_1 ${CMAKE_MATCH_3}\n" - "#endif\n") - -set(PROJECT_VERSION_MAJOR_1 "${CMAKE_MATCH_1}") -set(PROJECT_VERSION_MINOR_1 "${CMAKE_MATCH_2}") -set(PROJECT_VERSION_PATCH_1 "${CMAKE_MATCH_3}") - -message(*************************************************************************************) -message(" Building ESP-Hosted-MCU FW :: ${PROJECT_VERSION_MAJOR_1}.${PROJECT_VERSION_MINOR_1}.${PROJECT_VERSION_PATCH_1} ") -message(*************************************************************************************) diff --git a/slave/README.md b/slave/README.md new file mode 100644 index 00000000..48c5f324 --- /dev/null +++ b/slave/README.md @@ -0,0 +1,133 @@ +# ESP-Hosted-MCU Slave example + +This document details the **ESP-Hosted MCU Slave Example**, demonstrating the slave firmware that provides Wi-Fi and Bluetooth connectivity to host MCUs via ESP32 series co-processors. + +## Overview + +The slave firmware enables host MCUs to utilize the Wi-Fi and Bluetooth capabilities of ESP32 series chips through **SDIO, SPI, or UART** interfaces. This minimal example focuses on basic connectivity; however, advanced features like Network Split and Host Power Save can be configured for optimized network traffic and power management. + +## Supported Co-processors and Transports + +The following table summarizes the supported co-processors and transport communication buses between the slave and host. This example specifically utilizes **SDIO** as the transport and **ESP32-C6** as the slave co-processor. + +| Transport Supported | SDIO | SPI Full-Duplex | SPI Half-Duplex | UART | +|---|:---:|:---:|:---:|:---:| +| **Co-Processors Supported** | | | | | +| ESP32 | ✓ | ✓ | × | ✓ | +| ESP32-C2 | × | ✓ | ✓ | ✓ | +| ESP32-C3 | × | ✓ | ✓ | ✓ | +| ESP32-C5 | ✓ | ✓ | ✓ | ✓ | +| ESP32-C6/C61 | ✓ | ✓ | ✓ | ✓ | +| ESP32-S2 | × | ✓ | ✓ | ✓ | +| ESP32-S3 | × | ✓ | ✓ | ✓ | + + +## Example Hardware Connections + +This example uses the SDIO interface. The default SDIO pin connections for the ESP32-C6 slave are as follows: + +### SDIO Interface (Default for ESP32-P4-Function-EV-Board) + +| Signal | GPIO | Notes | +|:-------|:-----|:------------| +| CLK | 19 | Clock | +| CMD | 18 | Command | +| D0 | 20 | Data 0 | +| D1 | 21 | Data 1 | +| D2 | 22 | Data 2 | +| D3 | 23 | Data 3 | +| Reset | EN | Reset input | + +For detailed SDIO hardware connection requirements, refer to the official documentation at [https://github.com/espressif/esp-hosted-mcu/blob/main/docs/sdio.md\#3-hardware-considerations](https://github.com/espressif/esp-hosted-mcu/blob/main/docs/sdio.md#3-hardware-considerations). The GPIO pins and transport can be configured as explained in later sections. + + +## Quick Start Guide + +### 1. Obtain the Slave Example + +Execute the following commands to retrieve the slave example: + +```bash +idf.py create-project-from-example "espressif/esp_hosted:slave" +cd slave +``` + +### 2. Set Up ESP-IDF + +It is presumed that ESP-IDF has already been set up. If not, please proceed with the setup using one of the following options: + +#### Option 1: Installer Way + + * **Windows** + + * Install and set up ESP-IDF on Windows as documented in the [Standard Setup of Toolchain for Windows](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html). + * Use the ESP-IDF [Powershell Command Prompt](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html#using-the-command-prompt) for subsequent commands. + + * **Linux or macOS** + + * For bash: + ```bash + bash docs/setup_esp_idf__latest_stable__linux_macos.sh + ``` + * For fish: + ```fish + fish docs/setup_esp_idf__latest_stable__linux_macos.fish + ``` + +#### Option 2: Manual Way + +Please follow the [ESP-IDF Get Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html) for manual installation. + +### 3. Set Target + +Set the target co-processor using the command below: + +```bash +idf.py set-target esp32c6 +``` + +> [!TIP] +> You can **customize** the target co-processor by replacing `esp32c6` with your desired ESP32 series chip. + +### 4. Customizing Configuration: Transport and Features + +This is optional step. By default, SDIO transport is pre-configured. + +You can access the configuration menu to choose desired configuration and features using: + +```bash +idf.py menuconfig +``` + +The default configuration tree looks like this: +``` +Example Configuration +└── Bus Config in between Host and Co-processor + └── Transport layer + └── Select transport: SDIO/SPI-Full-Duplex/SPI-Half-Duplex/UART + └── +``` + + +> [!TIP] +> You can optinally **customize** the transport layer (SDIO, SPI Full-Duplex, SPI Half-Duplex, or UART), their GPIOs in use and other optional features within this menu. + +### 5. Build and Flash + +Build and flash the firmware to your device using the commands below, replacing `` with your device's serial port: + +```bash +idf.py build +idf.py -p flash monitor +``` + +> [!TIP] +> You can **customize** the serial port (``) to match your specific hardware connection. + + +## References + +- [ESP-Hosted MCU Documentation](../../README.md) +- [ESP32-P4-Function-EV-Board Setup](../../docs/esp32_p4_function_ev_board.md) +- [Transport Layer Documentation](../../docs/) +- [Troubleshooting Guide](../../docs/troubleshooting.md) diff --git a/slave/main/CMakeLists.txt b/slave/main/CMakeLists.txt index b0d22bb3..147735a6 100644 --- a/slave/main/CMakeLists.txt +++ b/slave/main/CMakeLists.txt @@ -1,11 +1,32 @@ if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/common") - set(common_dir "${CMAKE_CURRENT_SOURCE_DIR}/common") + set(common_dir "${CMAKE_CURRENT_SOURCE_DIR}/common") else() - set(common_dir "../../common") + set(common_dir "../../common") endif() -set(COMPONENT_SRCS "slave_control.c" "${common_dir}/proto/esp_hosted_rpc.pb-c.c" "protocomm_pserial.c" "app_main.c" "slave_bt.c" "mempool.c" "stats.c" "mempool_ll.c") -set(COMPONENT_ADD_INCLUDEDIRS "." "${common_dir}" "${common_dir}/log" "${common_dir}/proto" "${common_dir}/rpc" "${common_dir}/transport") +set(COMPONENT_SRCS + "slave_control.c" + "${common_dir}/proto/esp_hosted_rpc.pb-c.c" + "${common_dir}/utils/esp_hosted_cli.c" + "protocomm_pserial.c" + "esp_hosted_coprocessor.c" + "slave_bt.c" + "mempool.c" + "stats.c" + "mempool_ll.c" + "host_power_save.c" + "lwip_filter.c" + "transport_gpio_pin_guard.c" +) + +set(COMPONENT_ADD_INCLUDEDIRS + "." + "${common_dir}" + "${common_dir}/log" + "${common_dir}/proto" + "${common_dir}/rpc" + "${common_dir}/transport" +) # Select BT UART code based on IDF Target if(CONFIG_IDF_TARGET_ESP32) @@ -26,8 +47,24 @@ else(CONFIG_ESP_UART_HOST_INTERFACE) list(APPEND COMPONENT_SRCS uart_slave_api.c) endif() +if(CONFIG_ESP_HOSTED_COPROCESSOR_EXAMPLE_MQTT) + list(APPEND COMPONENT_SRCS mqtt_example.c) +endif() + +if(CONFIG_ESP_HOSTED_COPROCESSOR_EXAMPLE_HTTP_CLIENT) + list(APPEND COMPONENT_SRCS http_req.c) +endif() + +# cli +list(APPEND COMPONENT_ADD_INCLUDEDIRS "${common_dir}/utils") +list(APPEND COMPONENT_SRCS "${common_dir}/utils/esp_hosted_cli.c") + + register_component() # Add directory of protocomm_priv.h to include paths idf_component_get_property(protocomm_dir protocomm COMPONENT_DIR) target_include_directories(${COMPONENT_LIB} PRIVATE "${protocomm_dir}/src/common") + +# Add linker options to wrap esp_wifi_init function +target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=esp_wifi_init") diff --git a/slave/main/Kconfig.projbuild b/slave/main/Kconfig.projbuild index e0a42add..383b8d67 100644 --- a/slave/main/Kconfig.projbuild +++ b/slave/main/Kconfig.projbuild @@ -1,615 +1,672 @@ menu "Example Configuration" - choice ESP_HOST_DEV_BOARD - bool "Configure GPIOs based on an ESP Development Board" - depends on IDF_TARGET_ESP32C6 - default ESP_HOST_DEV_BOARD_NONE - help - "Preconfigures GPIOs to use based on an ESP Development Board" - - config ESP_HOST_DEV_BOARD_NONE - bool "No specific development board" - - config ESP_HOST_DEV_BOARD_P4_FUNC_BOARD - bool "ESP32-P4-Function-EV-Board" - depends on IDF_TARGET_ESP32C6 - - endchoice - - choice ESP_HOST_INTERFACE - bool "Transport layer" - default ESP_SPI_HOST_INTERFACE if IDF_TARGET_ESP32 - default ESP_SPI_HOST_INTERFACE if IDF_TARGET_ESP32S2 - default ESP_SPI_HOST_INTERFACE if IDF_TARGET_ESP32S3 - default ESP_SPI_HOST_INTERFACE if IDF_TARGET_ESP32C2 - default ESP_SPI_HOST_INTERFACE if IDF_TARGET_ESP32C3 - default ESP_SDIO_HOST_INTERFACE if IDF_TARGET_ESP32C6 - default ESP_SPI_HOST_INTERFACE if IDF_TARGET_ESP32C5 - help - Bus interface to be used for communication with the host - - config ESP_SPI_HOST_INTERFACE - bool "SPI Full-duplex" - help - Enable/Disable SPI Full-duplex host interface - - config ESP_SDIO_HOST_INTERFACE - bool "SDIO" - depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32C6 - help - Enable/Disable SDIO host interface - - # SPI Half Duplex is not supported in ESP32 - config ESP_SPI_HD_HOST_INTERFACE - bool "SPI Half-duplex" - depends on !IDF_TARGET_ESP32 - help - Enable/Disable SPI Half-duplex host interface + config ESP_HOSTED_COPROCESSOR + bool + default y - config ESP_UART_HOST_INTERFACE - bool "UART" + menu "Bus Config in between Host and Co-processor" + choice ESP_HOST_DEV_BOARD + bool "Configure GPIOs based on an ESP Development Board" + default ESP_HOST_DEV_BOARD_NONE help - Enable/Disable UART host interface - endchoice + "Preconfigures GPIOs to use based on an ESP Development Board" - menu "SPI Full-duplex Configuration" - depends on ESP_SPI_HOST_INTERFACE + config ESP_HOST_DEV_BOARD_NONE + bool "No specific development board" - choice ESP_SPI_PRIV_MODE - bool "Slave SPI mode" - default ESP_SPI_PRIV_MODE_2 if IDF_TARGET_ESP32 - default ESP_SPI_PRIV_MODE_3 + config ESP_HOST_DEV_BOARD_P4_FUNC_BOARD + bool "ESP32-P4-Function-EV-Board" + depends on IDF_TARGET_ESP32C6 - config ESP_SPI_PRIV_MODE_0 - bool "Slave SPI mode 0" - - config ESP_SPI_PRIV_MODE_1 - bool "Slave SPI mode 1" - - config ESP_SPI_PRIV_MODE_2 - bool "Slave SPI mode 2" - - config ESP_SPI_PRIV_MODE_3 - bool "Slave SPI mode 3" + config C2_C5_MODULE_SUB_BOARD + bool "ESP32-P4 EV Sub-Board for C2 & C5" + depends on IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C5 endchoice - config ESP_SPI_MODE - int - default 0 if ESP_SPI_PRIV_MODE_0 - default 1 if ESP_SPI_PRIV_MODE_1 - default 2 if ESP_SPI_PRIV_MODE_2 - default 3 if ESP_SPI_PRIV_MODE_3 - default 3 - + choice ESP_HOST_INTERFACE + bool "Transport layer" + default ESP_SDIO_HOST_INTERFACE if SOC_SDIO_SLAVE_SUPPORTED + default ESP_SPI_HOST_INTERFACE + help + Bus interface to be used for communication with the host - choice SPI_CONTROLLER - bool "SPI controller to use" - default SPI_HSPI + config ESP_SPI_HOST_INTERFACE + bool "SPI Full-duplex" + help + Enable/Disable SPI Full-duplex host interface - config SPI_HSPI - bool "FSPI/HSPI" + config ESP_SDIO_HOST_INTERFACE + bool "SDIO" + depends on SOC_SDIO_SLAVE_SUPPORTED help - "HSPI/FSPI: SPI_controller_1" + Enable/Disable SDIO host interface - config SPI_VSPI - depends on IDF_TARGET_ESP32 - bool "VSPI" + config ESP_SPI_HD_HOST_INTERFACE + bool "SPI Half-duplex" + depends on SOC_SPI_SUPPORT_SLAVE_HD_VER2 help - "VSPI: SPI_controller_2" + Enable/Disable SPI Half-duplex host interface + config ESP_UART_HOST_INTERFACE + bool "UART" + help + Enable/Disable UART host interface endchoice - config ESP_SPI_CONTROLLER - int - default 2 if SPI_VSPI - default 1 + menu "SPI Full-duplex Configuration" + depends on ESP_SPI_HOST_INTERFACE + depends on C2_C5_MODULE_SUB_BOARD || !C2_C5_MODULE_SUB_BOARD - menu "Hosted SPI GPIOs" - config ESP_SPI_HSPI_GPIO_MOSI - depends on SPI_HSPI - int "Slave GPIO pin for Host MOSI" - default 20 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD - default 13 if IDF_TARGET_ESP32 - default 11 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 - default 7 - help - SPI controller Host MOSI + choice ESP_SPI_PRIV_MODE + bool "Slave SPI mode" + default ESP_SPI_PRIV_MODE_2 if IDF_TARGET_ESP32 + default ESP_SPI_PRIV_MODE_3 - config ESP_SPI_HSPI_GPIO_MISO - depends on SPI_HSPI - int "Slave GPIO pin for Host MISO" - default 21 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD - default 12 if IDF_TARGET_ESP32 - default 13 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 - default 2 - help - SPI controller Host MISO - - config ESP_SPI_HSPI_GPIO_CLK - depends on SPI_HSPI - int "Slave GPIO pin for Host CLK" - default 19 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD - default 14 if IDF_TARGET_ESP32 - default 12 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 - default 6 - help - SPI controller Host CLK - - config ESP_SPI_HSPI_GPIO_CS - depends on SPI_HSPI - int "Slave GPIO pin for Host CS" - default 18 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD - default 15 if IDF_TARGET_ESP32 - default 10 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 - default 10 - help - SPI controller Host CS + config ESP_SPI_PRIV_MODE_0 + bool "Slave SPI mode 0" - config ESP_SPI_VSPI_GPIO_MOSI - depends on SPI_VSPI - int "Slave GPIO pin for Host MOSI" - default 23 - help - SPI controller Host MOSI + config ESP_SPI_PRIV_MODE_1 + bool "Slave SPI mode 1" - config ESP_SPI_VSPI_GPIO_MISO - depends on SPI_VSPI - int "Slave GPIO pin for Host MISO" - default 19 - help - SPI controller Host MISO + config ESP_SPI_PRIV_MODE_2 + bool "Slave SPI mode 2" - config ESP_SPI_VSPI_GPIO_CLK - depends on SPI_VSPI - int "Slave GPIO pin for Host CLK" - default 18 - help - SPI controller Host CLK - - config ESP_SPI_VSPI_GPIO_CS - depends on SPI_VSPI - int "Slave GPIO pin for Host CS" - default 5 - help - SPI controller Host CS + config ESP_SPI_PRIV_MODE_3 + bool "Slave SPI mode 3" + endchoice - config ESP_SPI_GPIO_MOSI + config ESP_SPI_MODE int - default ESP_SPI_VSPI_GPIO_MOSI if SPI_VSPI - default ESP_SPI_HSPI_GPIO_MOSI + default 0 if ESP_SPI_PRIV_MODE_0 + default 1 if ESP_SPI_PRIV_MODE_1 + default 2 if ESP_SPI_PRIV_MODE_2 + default 3 if ESP_SPI_PRIV_MODE_3 + default 3 - config ESP_SPI_GPIO_MISO - int - default ESP_SPI_VSPI_GPIO_MISO if SPI_VSPI - default ESP_SPI_HSPI_GPIO_MISO - config ESP_SPI_GPIO_CLK - int - default ESP_SPI_VSPI_GPIO_CLK if SPI_VSPI - default ESP_SPI_HSPI_GPIO_CLK + choice SPI_CONTROLLER + bool "SPI controller to use" + default SPI_HSPI + + config SPI_HSPI + bool "FSPI/HSPI" + help + "HSPI/FSPI: SPI_controller_1" + + config SPI_VSPI + depends on IDF_TARGET_ESP32 + bool "VSPI" + help + "VSPI: SPI_controller_2" - config ESP_SPI_GPIO_CS + endchoice + + config ESP_SPI_CONTROLLER int - default ESP_SPI_VSPI_GPIO_CS if SPI_VSPI - default ESP_SPI_HSPI_GPIO_CS + default 2 if SPI_VSPI + default 1 + + menu "Hosted SPI GPIOs" + config ESP_SPI_HSPI_GPIO_MOSI + depends on SPI_HSPI + int "Slave GPIO pin for Host MOSI" + default 20 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD + default 13 if IDF_TARGET_ESP32 + default 11 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 + default 7 + help + SPI controller Host MOSI + + config ESP_SPI_HSPI_GPIO_MISO + depends on SPI_HSPI + int "Slave GPIO pin for Host MISO" + default 21 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD + default 12 if IDF_TARGET_ESP32 + default 13 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 + default 2 + help + SPI controller Host MISO + + config ESP_SPI_HSPI_GPIO_CLK + depends on SPI_HSPI + int "Slave GPIO pin for Host CLK" + default 19 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD + default 3 if IDF_TARGET_ESP32C5 + default 0 if IDF_TARGET_ESP32C2 && C2_C5_MODULE_SUB_BOARD + default 14 if IDF_TARGET_ESP32 + default 12 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 + default 6 + help + SPI controller Host CLK + + config ESP_SPI_HSPI_GPIO_CS + depends on SPI_HSPI + int "Slave GPIO pin for Host CS" + default 18 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD + default 15 if IDF_TARGET_ESP32 + default 10 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 + default 8 if IDF_TARGET_ESP32C61 + default 10 + help + SPI controller Host CS + + config ESP_SPI_VSPI_GPIO_MOSI + depends on SPI_VSPI + int "Slave GPIO pin for Host MOSI" + default 23 + help + SPI controller Host MOSI + + config ESP_SPI_VSPI_GPIO_MISO + depends on SPI_VSPI + int "Slave GPIO pin for Host MISO" + default 19 + help + SPI controller Host MISO + + config ESP_SPI_VSPI_GPIO_CLK + depends on SPI_VSPI + int "Slave GPIO pin for Host CLK" + default 18 + help + SPI controller Host CLK + + config ESP_SPI_VSPI_GPIO_CS + depends on SPI_VSPI + int "Slave GPIO pin for Host CS" + default 5 + help + SPI controller Host CS + + config ESP_SPI_GPIO_MOSI + int + default ESP_SPI_VSPI_GPIO_MOSI if SPI_VSPI + default ESP_SPI_HSPI_GPIO_MOSI + + config ESP_SPI_GPIO_MISO + int + default ESP_SPI_VSPI_GPIO_MISO if SPI_VSPI + default ESP_SPI_HSPI_GPIO_MISO + + config ESP_SPI_GPIO_CLK + int + default ESP_SPI_VSPI_GPIO_CLK if SPI_VSPI + default ESP_SPI_HSPI_GPIO_CLK + + config ESP_SPI_GPIO_CS + int + default ESP_SPI_VSPI_GPIO_CS if SPI_VSPI + default ESP_SPI_HSPI_GPIO_CS + + config ESP_SPI_GPIO_HANDSHAKE + int "Slave GPIO pin for handshake" + default 22 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD + default 4 if IDF_TARGET_ESP32C2 && C2_C5_MODULE_SUB_BOARD + default 3 if IDF_TARGET_ESP32C2 && !C2_C5_MODULE_SUB_BOARD + default 4 if IDF_TARGET_ESP32C5 && C2_C5_MODULE_SUB_BOARD + default 1 if IDF_TARGET_ESP32C5 && !C2_C5_MODULE_SUB_BOARD + default 3 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C6 + default 17 if IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32S2 + default 22 if IDF_TARGET_ESP32C61 + default 26 + help + Slave GPIO pin to use for handshake with other spi controller + + config ESP_SPI_GPIO_DATA_READY + int "Slave GPIO pin for data ready interrupt" + default 23 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD + default 1 if IDF_TARGET_ESP32C2 && C2_C5_MODULE_SUB_BOARD + default 4 if IDF_TARGET_ESP32C2 && !C2_C5_MODULE_SUB_BOARD + default 0 if IDF_TARGET_ESP32C5 && C2_C5_MODULE_SUB_BOARD + default 4 if IDF_TARGET_ESP32C5 && !C2_C5_MODULE_SUB_BOARD + default 23 if IDF_TARGET_ESP32C61 + default 4 + help + Slave GPIO pin for indicating host that SPI slave has data to be read by host + + config ESP_SPI_GPIO_RESET + int "Slave GPIO pin to reset itself" + default -1 + help + Host uses this pin to reset the slave ESP. To re-use ESP 'RST' or 'EN' GPIO, set value to -1 + endmenu + + config ESP_SPI_DEASSERT_HS_ON_CS + bool "Deassert Handshake when SPI CS is deasserted" + default y + help + Deassert Handshake and prepare a new SPI transaction only after + CS has been deasserted. This helps prevent data loss with MCUs + that delay deasserting CS after the end of a SPI transaction + by prematurely starting a new slave SPI transaction + since CS is detected by the slave as still asserted. + + config ESP_SPI_TX_Q_SIZE + int "ESP to Host SPI queue size" + default 10 if IDF_TARGET_ESP32 + default 6 if IDF_TARGET_ESP32C2 && BT_ENABLED + default 10 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C61 + default 10 if IDF_TARGET_ESP32C61 + default 20 + help + Very small tx queue will lower ESP -- SPI --> Host data rate + + config ESP_SPI_RX_Q_SIZE + int "Host to ESP SPI queue size" + default 10 if IDF_TARGET_ESP32 + default 6 if IDF_TARGET_ESP32C2 && BT_ENABLED + default 7 if IDF_TARGET_ESP32C2 + default 10 if IDF_TARGET_ESP32C61 + default 20 + help + Very small RX queue will lower ESP <-- SPI -- Host data rate - config ESP_SPI_GPIO_HANDSHAKE - int "Slave GPIO pin for handshake" - default 22 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD - default 3 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C6 - default 17 if IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32S2 - default 26 + config ESP_SPI_CHECKSUM + bool "SPI checksum ENABLE/DISABLE" + default y help - Slave GPIO pin to use for handshake with other spi controller + ENABLE/DISABLE software SPI checksum + endmenu - config ESP_SPI_GPIO_DATA_READY - int "Slave GPIO pin for data ready interrupt" - default 23 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD - default 13 if IDF_TARGET_ESP32C5 - default 4 + menu "SDIO Configuration" + depends on ESP_SDIO_HOST_INTERFACE + + config ESP_SDIO_STREAMING_MODE + bool "Enable SDIO Streaming Mode" + default y help - Slave GPIO pin for indicating host that SPI slave has data to be read by host + Enable Streaming Mode. Host to receive queued data from slave + as one stream instead of individual packets. This can improve + host SDIO read performance by doing one large read transaction + instead of many smaller read transactions. - config ESP_SPI_GPIO_RESET + config ESP_SDIO_GPIO_RESET int "Slave GPIO pin to reset itself" default -1 help Host uses this pin to reset the slave ESP. To re-use ESP 'RST' or 'EN' GPIO, set value to -1 - endmenu - config ESP_SPI_TX_Q_SIZE - int "ESP to Host SPI queue size" - default 10 if IDF_TARGET_ESP32 - default 6 if IDF_TARGET_ESP32C2 && BT_ENABLED - default 10 if IDF_TARGET_ESP32C2 - default 20 - help - Very small tx queue will lower ESP -- SPI --> Host data rate - - config ESP_SPI_RX_Q_SIZE - int "Host to ESP SPI queue size" - default 10 if IDF_TARGET_ESP32 - default 6 if IDF_TARGET_ESP32C2 && BT_ENABLED - default 7 if IDF_TARGET_ESP32C2 - default 20 - help - Very small RX queue will lower ESP <-- SPI -- Host data rate - - config ESP_SPI_CHECKSUM - bool "SPI checksum ENABLE/DISABLE" - default y - help - ENABLE/DISABLE software SPI checksum - endmenu + choice + prompt "SDIO Bus Speed" + default ESP_SDIO_HIGH_SPEED + help + Select the SDIO Slave Bus Speed. Actual speed in use depends on SDIO bus speed the SDIO Master can support - menu "SDIO Configuration" - depends on ESP_SDIO_HOST_INTERFACE + config ESP_SDIO_DEFAULT_SPEED + bool "Default Speed (20 MHz)" - config ESP_SDIO_STREAMING_MODE - bool "Enable SDIO Streaming Mode" - default y - help - Enable Streaming Mode. Host to receive queued data from slave - as one stream instead of individual packets. This can improve - host SDIO read performance by doing one large read transaction - instead of many smaller read transactions. - - config ESP_SDIO_GPIO_RESET - int "Slave GPIO pin to reset itself" - default -1 - help - Host uses this pin to reset the slave ESP. To re-use ESP 'RST' or 'EN' GPIO, set value to -1 - - choice - prompt "SDIO Bus Speed" - default ESP_SDIO_HIGH_SPEED - help - Select the SDIO Slave Bus Speed. Actual speed in use depends on SDIO bus speed the SDIO Master can support + config ESP_SDIO_HIGH_SPEED + bool "High Speed (40 MHz)" + endchoice - config ESP_SDIO_DEFAULT_SPEED - bool "Default Speed (20 MHz)" + # from /components/soc//include/soc/sdio_slave_pins.h + menu "Hosted SDIO GPIOs" + config ESP_SDIO_PIN_CMD + int "CMD GPIO number" + range 15 15 if IDF_TARGET_ESP32 + range 18 18 if IDF_TARGET_ESP32C6 + range 25 25 if IDF_TARGET_ESP32C61 + range 10 10 if IDF_TARGET_ESP32C5 + help + "Value cannot be configured. Displayed for reference." + + config ESP_SDIO_PIN_CLK + int "CLK GPIO number" + range 14 14 if IDF_TARGET_ESP32 + range 19 19 if IDF_TARGET_ESP32C6 + range 26 26 if IDF_TARGET_ESP32C61 + range 9 9 if IDF_TARGET_ESP32C5 + help + "Value cannot be configured. Displayed for reference." + + config ESP_SDIO_PIN_D0 + int "D0 GPIO number" + range 2 2 if IDF_TARGET_ESP32 + range 20 20 if IDF_TARGET_ESP32C6 + range 27 27 if IDF_TARGET_ESP32C61 + range 8 8 if IDF_TARGET_ESP32C5 + help + "Value cannot be configured. Displayed for reference." + + config ESP_SDIO_PIN_D1 + int "D1 GPIO number" + range 4 4 if IDF_TARGET_ESP32 + range 21 21 if IDF_TARGET_ESP32C6 + range 28 28 if IDF_TARGET_ESP32C61 + range 7 7 if IDF_TARGET_ESP32C5 + help + "Value cannot be configured. Displayed for reference." + + config ESP_SDIO_PIN_D2 + int "D2 GPIO number" + range 12 12 if IDF_TARGET_ESP32 + range 22 22 if IDF_TARGET_ESP32C6 + range 22 22 if IDF_TARGET_ESP32C61 + range 14 14 if IDF_TARGET_ESP32C5 + help + "Value cannot be configured. Displayed for reference." + + config ESP_SDIO_PIN_D3 + int "D3 GPIO number" + range 13 13 if IDF_TARGET_ESP32 + range 23 23 if IDF_TARGET_ESP32C6 + range 23 23 if IDF_TARGET_ESP32C61 + range 13 13 if IDF_TARGET_ESP32C5 + help + "Value cannot be configured. Displayed for reference." + endmenu + + choice + prompt "SDIO Slave Timing" + default ESP_SDIO_PSEND_PSAMPLE + help + Select the SDIO timing used by slave. Default value works with most + SDMMC controllers but if transfer errors are encountered, selecting a + different timing may help resolve the errors. + See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/sdio_slave.html#_CPPv419sdio_slave_timing_t + for more information - config ESP_SDIO_HIGH_SPEED - bool "High Speed (40 MHz)" - endchoice + config ESP_SDIO_PSEND_PSAMPLE + bool "Send at positive edge, sample at positive edge" + config ESP_SDIO_NSEND_PSAMPLE + bool "Send at negative edge, sample at positive edge" - menu "Hosted SDIO GPIOs" - config ESP_SDIO_PIN_CMD - int "CMD GPIO number" - range 15 15 if IDF_TARGET_ESP32 - range 18 18 if IDF_TARGET_ESP32C6 - help - "Value cannot be configured. Displayed for reference." + config ESP_SDIO_PSEND_NSAMPLE + bool "Send at positive edge, sample at negative edge" - config ESP_SDIO_PIN_CLK - int "CLK GPIO number" - range 14 14 if IDF_TARGET_ESP32 - range 19 19 if IDF_TARGET_ESP32C6 - help - "Value cannot be configured. Displayed for reference." + config ESP_SDIO_NSEND_NSAMPLE + bool "Send at negative edge, sample at negative edge" + endchoice - config ESP_SDIO_PIN_D0 - int "D0 GPIO number" - range 2 2 if IDF_TARGET_ESP32 - range 20 20 if IDF_TARGET_ESP32C6 + config ESP_SDIO_TX_Q_SIZE + int "SDIO TX queue size" + default 10 if IDF_TARGET_ESP32C61 + default 20 help - "Value cannot be configured. Displayed for reference." + Very small TX queue will lower ESP --> SDIO -- Host data rate - config ESP_SDIO_PIN_D1 - int "D1 GPIO number" - range 4 4 if IDF_TARGET_ESP32 - range 21 21 if IDF_TARGET_ESP32C6 + config ESP_SDIO_RX_Q_SIZE + int "SDIO RX queue size" + default 10 if IDF_TARGET_ESP32C61 + default 20 help - "Value cannot be configured. Displayed for reference." + Very small RX queue will lower ESP <-- SDIO -- Host data rate - config ESP_SDIO_PIN_D2 - int "D2 GPIO number" - range 12 12 if IDF_TARGET_ESP32 - range 22 22 if IDF_TARGET_ESP32C6 + config ESP_SDIO_CHECKSUM + bool "SDIO checksum ENABLE/DISABLE" + default n help - "Value cannot be configured. Displayed for reference." + ENABLE/DISABLE software SDIO checksum - config ESP_SDIO_PIN_D3 - int "D3 GPIO number" - range 13 13 if IDF_TARGET_ESP32 - range 23 23 if IDF_TARGET_ESP32C6 - help - "Value cannot be configured. Displayed for reference." endmenu - choice - prompt "SDIO Slave Timing" - default ESP_SDIO_PSEND_PSAMPLE - help - Select the SDIO timing used by slave. Default value works with most - SDMMC controllers but if transfer errors are encountered, selecting a - different timing may help resolve the errors. - See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/sdio_slave.html#_CPPv419sdio_slave_timing_t - for more information - - config ESP_SDIO_PSEND_PSAMPLE - bool "Send at positive edge, sample at positive edge" - - config ESP_SDIO_NSEND_PSAMPLE - bool "Send at negative edge, sample at positive edge" - - config ESP_SDIO_PSEND_NSAMPLE - bool "Send at positive edge, sample at negative edge" - - config ESP_SDIO_NSEND_NSAMPLE - bool "Send at negative edge, sample at negative edge" - endchoice - - config ESP_SDIO_RX_Q_SIZE - int "SDIO RX queue size" - default 20 - help - Very small RX queue will lower ESP <-- SDIO -- Host data rate + menu "SPI Half-duplex Configuration" + depends on ESP_SPI_HD_HOST_INTERFACE - config ESP_SDIO_CHECKSUM - bool "SDIO checksum ENABLE/DISABLE" - default n - help - ENABLE/DISABLE software SDIO checksum - - endmenu - - menu "SPI Half-duplex Configuration" - depends on ESP_SPI_HD_HOST_INTERFACE + choice ESP_SPI_HD_PRIV_MODE + bool "Slave SPI mode" + default ESP_SPI_HD_PRIV_MODE_3 - choice ESP_SPI_HD_PRIV_MODE - bool "Slave SPI mode" - default ESP_SPI_HD_PRIV_MODE_3 + config ESP_SPI_HD_PRIV_MODE_0 + bool "Slave SPI mode 0" - config ESP_SPI_HD_PRIV_MODE_0 - bool "Slave SPI mode 0" + config ESP_SPI_HD_PRIV_MODE_1 + bool "Slave SPI mode 1" - config ESP_SPI_HD_PRIV_MODE_1 - bool "Slave SPI mode 1" + config ESP_SPI_HD_PRIV_MODE_2 + bool "Slave SPI mode 2" - config ESP_SPI_HD_PRIV_MODE_2 - bool "Slave SPI mode 2" - - config ESP_SPI_HD_PRIV_MODE_3 - bool "Slave SPI mode 3" - endchoice - - config ESP_SPI_HD_MODE - int - default 0 if ESP_SPI_HD_PRIV_MODE_0 - default 1 if ESP_SPI_HD_PRIV_MODE_1 - default 2 if ESP_SPI_HD_PRIV_MODE_2 - default 3 if ESP_SPI_HD_PRIV_MODE_3 - help - SPI Mode to use. The same mode must be used on both host and slave. - - choice ESP_SPI_HD_PRIV_INTERFACE_NUM_DATA_LINES - bool "Num Data Lines to use" - default ESP_SPI_HD_PRIV_INTERFACE_4_DATA_LINES - help - Number of Data Lines to use in the SPI HD interface - - config ESP_SPI_HD_PRIV_INTERFACE_4_DATA_LINES - bool "4 data lines" + config ESP_SPI_HD_PRIV_MODE_3 + bool "Slave SPI mode 3" + endchoice - config ESP_SPI_HD_PRIV_INTERFACE_2_DATA_LINES - bool "2 data lines" - endchoice + config ESP_SPI_HD_MODE + int + default 0 if ESP_SPI_HD_PRIV_MODE_0 + default 1 if ESP_SPI_HD_PRIV_MODE_1 + default 2 if ESP_SPI_HD_PRIV_MODE_2 + default 3 if ESP_SPI_HD_PRIV_MODE_3 + help + SPI Mode to use. The same mode must be used on both host and slave. - config ESP_SPI_HD_INTERFACE_NUM_DATA_LINES - int - default 4 if ESP_SPI_HD_PRIV_INTERFACE_4_DATA_LINES - default 2 if ESP_SPI_HD_PRIV_INTERFACE_2_DATA_LINES + choice ESP_SPI_HD_PRIV_INTERFACE_NUM_DATA_LINES + bool "Num Data Lines to use" + default ESP_SPI_HD_PRIV_INTERFACE_4_DATA_LINES + help + Number of Data Lines to use in the SPI HD interface - menu "GPIOs" + config ESP_SPI_HD_PRIV_INTERFACE_4_DATA_LINES + bool "4 data lines" - config ESP_SPI_HD_GPIO_CS - int "Slave GPIO pin for Host CS" - default 18 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD - default 10 - help - SPI HD controller Host CS + config ESP_SPI_HD_PRIV_INTERFACE_2_DATA_LINES + bool "2 data lines" + endchoice - config ESP_SPI_HD_GPIO_CLK - int "Slave GPIO pin for Host CLK" - default 19 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD - default 6 + config ESP_SPI_HD_INTERFACE_NUM_DATA_LINES + int + default 4 if ESP_SPI_HD_PRIV_INTERFACE_4_DATA_LINES + default 2 if ESP_SPI_HD_PRIV_INTERFACE_2_DATA_LINES + + menu "GPIOs" + + config ESP_SPI_HD_GPIO_CS + int "Slave GPIO pin for Host CS" + default 18 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD + default 8 if IDF_TARGET_ESP32C61 + default 10 + help + SPI HD controller Host CS + + config ESP_SPI_HD_GPIO_CLK + int "Slave GPIO pin for Host CLK" + default 19 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD + default 3 if IDF_TARGET_ESP32C5 + default 0 if IDF_TARGET_ESP32C2 + default 6 + help + SPI HD controller Host CS + + config ESP_SPI_HD_GPIO_D0 + int "Slave GPIO pin for Host D0" + default 20 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD + default 7 + help + SPI HD controller Host D0 + + config ESP_SPI_HD_GPIO_D1 + int "Slave GPIO pin for Host D1" + default 21 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD + default 2 + help + SPI HD controller Host D1 + + config ESP_SPI_HD_GPIO_D2 + depends on ESP_SPI_HD_PRIV_INTERFACE_4_DATA_LINES + int "Slave GPIO pin for Host D2" + default 22 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD + default 4 if IDF_TARGET_ESP32C61 + default 5 + help + SPI HD controller Host D2 + + config ESP_SPI_HD_GPIO_D3 + depends on ESP_SPI_HD_PRIV_INTERFACE_4_DATA_LINES + int "Slave GPIO pin for Host D3" + default 23 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD + default 3 if IDF_TARGET_ESP32C61 + default 4 + help + SPI HD controller Host D3 + + config ESP_SPI_HD_GPIO_DATA_READY + int "Slave GPIO pin for Data Ready" + default 2 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD + default 0 if IDF_TARGET_ESP32C5 + default 1 if IDF_TARGET_ESP32C2 + default 23 if IDF_TARGET_ESP32C61 + default 11 + help + Slave GPIO pin for indicating host that SPI slave has data to be read by host + + choice ESP_SPI_HD_DATAREADY_GPIO_CONFIG + bool "DataReady GPIO Config" + default ESP_DR_ACTIVE_HIGH + help + Configure Data Ready to be active high (default) or active low + + config ESP_DR_ACTIVE_HIGH + bool "Active High" + config ESP_DR_ACTIVE_LOW + bool "Active Low" + endchoice + + config ESP_SPI_HD_GPIO_RESET + int "Slave GPIO pin to reset itself" + default -1 + help + Host uses this pin to reset the slave ESP. To re-use ESP 'RST' or 'EN' GPIO, set value to -1 + + endmenu + + config ESP_SPI_HD_Q_SIZE + int "Queue size" + default 12 if IDF_TARGET_ESP32C2 + default 10 if IDF_TARGET_ESP32C5 + default 10 if IDF_TARGET_ESP32C61 + default 20 help - SPI HD controller Host CS + Very small queue will lower SPI HD data rate - config ESP_SPI_HD_GPIO_D0 - int "Slave GPIO pin for Host D0" - default 20 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD - default 7 + config ESP_SPI_HD_CHECKSUM + bool "Checksum ENABLE/DISABLE" + default y help - SPI HD controller Host D0 + ENABLE/DISABLE SPI HD software checksum - config ESP_SPI_HD_GPIO_D1 - int "Slave GPIO pin for Host D1" - default 21 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD - default 2 - help - SPI HD controller Host D1 + endmenu - config ESP_SPI_HD_GPIO_D2 - depends on ESP_SPI_HD_PRIV_INTERFACE_4_DATA_LINES - int "Slave GPIO pin for Host D2" - default 22 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD - default 5 + menu "UART Configuration" + depends on ESP_UART_HOST_INTERFACE + + config ESP_UART_PORT + int "UART Port to Use" + default 1 + range 0 2 if IDF_TARGET_ESP32 + range 0 1 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C5 || IDF_TARGET_ESP32C6 + range 0 2 if IDF_TARGET_ESP32C61 + range 0 1 if IDF_TARGET_ESP32S2 + range 0 2 if IDF_TARGET_ESP32S3 help - SPI HD controller Host D2 + Select UART Port to Use. Do not select the UART Port used for console output (if enabled) - config ESP_SPI_HD_GPIO_D3 - depends on ESP_SPI_HD_PRIV_INTERFACE_4_DATA_LINES - int "Slave GPIO pin for Host D3" - default 23 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD - default 4 + config ESP_UART_PIN_TX + int "TX GPIO number" + default 13 if IDF_TARGET_ESP32 + default 5 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 + default 14 if IDF_TARGET_ESP32C5 + default 21 if IDF_TARGET_ESP32C6 + default 23 if IDF_TARGET_ESP32C61 + default 5 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 help - SPI HD controller Host D3 + GPIO used for UART TX - config ESP_SPI_HD_GPIO_DATA_READY - int "Slave GPIO pin for Data Ready" - default 2 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD + config ESP_UART_PIN_RX + int "RX GPIO number" + default 12 if IDF_TARGET_ESP32 + default 4 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 default 13 if IDF_TARGET_ESP32C5 - default 11 + default 20 if IDF_TARGET_ESP32C6 + default 22 if IDF_TARGET_ESP32C61 + default 4 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 help - Slave GPIO pin for indicating host that SPI slave has data to be read by host + GPIO used for UART RX - choice ESP_SPI_HD_DATAREADY_GPIO_CONFIG - bool "DataReady GPIO Config" - default ESP_DR_ACTIVE_HIGH + config ESP_UART_BAUDRATE + int "Baud Rate" + default 921600 + range 9600 3500000 help - Configure Data Ready to be active high (default) or active low + Baud Rate to Use. Make sure Hardware supports the rate. Standard rates are 9600, 19200, 38400, 57600, 115200, 460800, 921600 - config ESP_DR_ACTIVE_HIGH - bool "Active High" - config ESP_DR_ACTIVE_LOW - bool "Active Low" - endchoice - - config ESP_SPI_HD_GPIO_RESET - int "Slave GPIO pin to reset itself" - default -1 + config ESP_UART_NUM_DATA_BITS + int "Number of Data Bits" + default 8 + range 5 8 help - Host uses this pin to reset the slave ESP. To re-use ESP 'RST' or 'EN' GPIO, set value to -1 + Number of Data Bits to use - endmenu + choice ESP_UART_PRIV_PARITY + bool "Parity" - config ESP_SPI_HD_Q_SIZE - int "Queue size" - default 12 if IDF_TARGET_ESP32C2 - default 10 if IDF_TARGET_ESP32C5 - default 20 - help - Very small queue will lower SPI HD data rate - - config ESP_SPI_HD_CHECKSUM - bool "Checksum ENABLE/DISABLE" - default y - help - ENABLE/DISABLE SPI HD software checksum + config ESP_UART_PRIV_PARITY_NONE + bool "None" - endmenu - - menu "UART Configuration" - depends on ESP_UART_HOST_INTERFACE + config ESP_UART_PRIV_PARITY_EVEN + bool "Even" - config ESP_UART_PORT - int "UART Port to Use" - default 1 - range 0 2 if IDF_TARGET_ESP32 - range 0 1 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C5 || IDF_TARGET_ESP32C6 - range 0 2 if IDF_TARGET_ESP32C61 - range 0 1 if IDF_TARGET_ESP32S2 - range 0 2 if IDF_TARGET_ESP32S3 - help - Select UART Port to Use. Do not select the UART Port used for console output (if enabled) - - config ESP_UART_PIN_TX - int "TX GPIO number" - default 13 if IDF_TARGET_ESP32 - default 5 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 - default 14 if IDF_TARGET_ESP32C5 - default 21 if IDF_TARGET_ESP32C6 - default 5 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 - help - GPIO used for UART TX - - config ESP_UART_PIN_RX - int "RX GPIO number" - default 12 if IDF_TARGET_ESP32 - default 4 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 - default 13 if IDF_TARGET_ESP32C5 - default 20 if IDF_TARGET_ESP32C6 - default 4 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 - help - GPIO used for UART RX - - config ESP_UART_BAUDRATE - int "Baud Rate" - default 921600 - range 9600 3500000 - help - Baud Rate to Use. Make sure Hardware supports the rate. Standard rates are 9600, 19200, 38400, 57600, 115200, 460800, 921600 + config ESP_UART_PRIV_PARITY_ODD + bool "Odd" + endchoice - config ESP_UART_NUM_DATA_BITS - int "Number of Data Bits" - default 8 - range 5 8 - help - Number of Data Bits to use + config ESP_UART_PARITY + int + default 0 if ESP_UART_PRIV_PARITY_NONE + default 1 if ESP_UART_PRIV_PARITY_EVEN + default 2 if ESP_UART_PRIV_PARITY_ODD - choice ESP_UART_PRIV_PARITY - bool "Parity" + choice ESP_UART_PRIV_STOP_BITS + bool "Number of Stop Bits" - config ESP_UART_PRIV_PARITY_NONE - bool "None" + config ESP_UART_PRIV_STOP_BITS_1 + bool "1" - config ESP_UART_PRIV_PARITY_EVEN - bool "Even" + config ESP_UART_PRIV_STOP_BITS_1_5 + bool "1.5" - config ESP_UART_PRIV_PARITY_ODD - bool "Odd" - endchoice + config ESP_UART_PRIV_STOP_BITS_2 + bool "2" + endchoice - config ESP_UART_PARITY - int - default 0 if ESP_UART_PRIV_PARITY_NONE - default 1 if ESP_UART_PRIV_PARITY_EVEN - default 2 if ESP_UART_PRIV_PARITY_ODD + config ESP_UART_STOP_BITS + int + default 0 if ESP_UART_PRIV_STOP_BITS_1 + default 1 if ESP_UART_PRIV_STOP_BITS_1_5 + default 2 if ESP_UART_PRIV_STOP_BITS_2 - choice ESP_UART_PRIV_STOP_BITS - bool "Number of Stop Bits" + config ESP_UART_GPIO_RESET + int "Slave GPIO pin to reset itself" + default -1 + help + Host uses this pin to reset the slave ESP. To re-use ESP 'RST' or 'EN' GPIO, set value to -1 - config ESP_UART_PRIV_STOP_BITS_1 - bool "1" + config ESP_UART_TX_Q_SIZE + int "Tx Queue Size" + default 5 + help + UART rates are low, so large queue sizes are not required - config ESP_UART_PRIV_STOP_BITS_1_5 - bool "1.5" + config ESP_UART_RX_Q_SIZE + int "Rx Queue Size" + default 5 + help + UART rates are low, so large queue sizes are not required - config ESP_UART_PRIV_STOP_BITS_2 - bool "2" - endchoice + config ESP_UART_CHECKSUM + bool "UART checksum ENABLE/DISABLE" + default y + help + ENABLE/DISABLE software UART checksum + endmenu - config ESP_UART_STOP_BITS + config ESP_GPIO_SLAVE_RESET int - default 0 if ESP_UART_PRIV_STOP_BITS_1 - default 1 if ESP_UART_PRIV_STOP_BITS_1_5 - default 2 if ESP_UART_PRIV_STOP_BITS_2 - - config ESP_UART_GPIO_RESET - int "Slave GPIO pin to reset itself" - default -1 - help - Host uses this pin to reset the slave ESP. To re-use ESP 'RST' or 'EN' GPIO, set value to -1 - - config ESP_UART_TX_Q_SIZE - int "Tx Queue Size" - default 5 - help - UART rates are low, so large queue sizes are not required - - config ESP_UART_RX_Q_SIZE - int "Rx Queue Size" - default 5 - help - UART rates are low, so large queue sizes are not required - - config ESP_UART_CHECKSUM - bool "UART checksum ENABLE/DISABLE" - default y - help - ENABLE/DISABLE software UART checksum + default ESP_SPI_GPIO_RESET if ESP_SPI_HOST_INTERFACE + default ESP_SDIO_GPIO_RESET if ESP_SDIO_HOST_INTERFACE + default ESP_SPI_HD_GPIO_RESET if ESP_SPI_HD_HOST_INTERFACE + default ESP_UART_GPIO_RESET if ESP_UART_HOST_INTERFACE endmenu - config ESP_GPIO_SLAVE_RESET - int - default ESP_SPI_GPIO_RESET if ESP_SPI_HOST_INTERFACE - default ESP_SDIO_GPIO_RESET if ESP_SDIO_HOST_INTERFACE - default ESP_SPI_HD_GPIO_RESET if ESP_SPI_HD_HOST_INTERFACE - default ESP_UART_GPIO_RESET if ESP_UART_HOST_INTERFACE - # HCI UART menu for ESP32-C3/S3 menu "HCI UART Settings" depends on BT_CTRL_HCI_MODE_UART_H4 && (IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3) @@ -774,13 +831,13 @@ menu "Example Configuration" endmenu - config ESP_DEFAULT_TASK_STACK_SIZE + config ESP_HOSTED_DEFAULT_TASK_STACK_SIZE int "ESP-Hosted task stack size" default 4096 help Default task size of ESP-Hosted tasks - config ESP_DEFAULT_TASK_PRIO + config ESP_HOSTED_DEFAULT_TASK_PRIORITY int "ESP-Hosted task priority" default 22 help @@ -798,6 +855,12 @@ menu "Example Configuration" help Enable/disable sleeps while OTA operations + config ESP_WIFI_DPP_SUPPORT + bool "Enable Wi-Fi Easy Connect (DPP)" + default n + help + Enable Wi-Fi Easy Connect (DPP) support + menu "Hosted Debugging" config ESP_RAW_THROUGHPUT_TRANSPORT bool "RawTP: Transport level throughput debug test" @@ -816,10 +879,406 @@ menu "Example Configuration" int "RawTP: periodic duration to report stats accumulated" default 10 - config ESP_PKT_STATS - bool "Transport level packet stats" - default n + config ESP_PKT_STATS + bool "Transport level packet stats" + default n + help + On comparing with slave packet stats helps to understand any packet loss at hosted + + config ESP_PKT_STATS_INTERVAL_SEC + depends on ESP_PKT_STATS + int "Packet stats reporting interval (sec)" + default 30 + + config ESP_HOSTED_FUNCTION_PROFILING + bool "Enable function execution time profiling" + default n + help + Enable this option to measure and report function execution times. + This is useful for performance profiling and optimization. + + config ESP_HOSTED_FUNCTION_PROFILING_MAX_ENTRIES + int "Maximum number of functions to profile" + depends on ESP_HOSTED_FUNCTION_PROFILING + default 10 + range 1 50 + help + Maximum number of unique functions that can be profiled simultaneously. + Each entry consumes memory, so keep this value reasonable based on + available memory. + endmenu + + config ESP_HOSTED_NETWORK_SPLIT_ENABLED + bool "Enable Network Split: Shared IP address between host and slave" + depends on !IDF_TARGET_ESP32C2 && !IDF_TARGET_ESP32C3 + default n + help + Enables the LWIP stack on the slave to process its own set of ports, + alongside the host stack. Helps split network traffic and allows + background tasks on the slave, even when the host is in low-power mode. + + menu "Network Split Configuration" + depends on ESP_HOSTED_NETWORK_SPLIT_ENABLED + + choice + prompt "Destination LWIP for unfiltered packet" + default ESP_DEFAULT_LWIP_SLAVE + help + Packets having destination port within 'remote' port range are forwarded to host. Rest unfiltered packets, are to be sent to this LWIP. Please note: + (1) These settings are only for IP packets, yet. + (2) Extra filtering may be in effect to respond some packets locally by slave LWIP. + + config ESP_DEFAULT_LWIP_SLAVE + bool "Send packet to slave LWIP" + + config ESP_DEFAULT_LWIP_HOST + bool "Send packet to host LWIP" + + config ESP_DEFAULT_LWIP_BOTH + bool "Send packet to both LWIPs" + endchoice + + menu "Host Static Port Forwarding" + + config ESP_HOSTED_HOST_RESERVED_PORTS_CONFIGURED + bool "Extra port forwarding to host (static)" + default y + help + Enable static port forwarding to host for specific ports + + config ESP_HOSTED_HOST_RESERVED_TCP_SRC_PORTS + depends on ESP_HOSTED_HOST_RESERVED_PORTS_CONFIGURED + string "TCP source ports to forward to host (comma separated)" + default "22,8554" + help + Comma separated list of TCP source ports that will be allowed from host (Max 10) + + config ESP_HOSTED_HOST_RESERVED_TCP_DEST_PORTS + depends on ESP_HOSTED_HOST_RESERVED_PORTS_CONFIGURED + string "TCP destination ports to forward to host (comma separated)" + default "22,80,443,8080,8554" + help + Comma separated list of TCP destination ports that will be forwarded to host (Max 10) + + config ESP_HOSTED_HOST_RESERVED_UDP_SRC_PORTS + depends on ESP_HOSTED_HOST_RESERVED_PORTS_CONFIGURED + string "UDP source ports to allowed from host (comma separated)" + default "" + help + Comma separated list of UDP source ports that will be forwarded to host (Max 10) + + config ESP_HOSTED_HOST_RESERVED_UDP_DEST_PORTS + depends on ESP_HOSTED_HOST_RESERVED_PORTS_CONFIGURED + string "UDP destination ports to forward to host (comma separated)" + default "53,123" + help + Comma separated list of UDP destination ports that will be forwarded to host (Max 10) + endmenu + + menu "Slave side (local) LWIP port range" + config LWIP_TCP_LOCAL_PORT_RANGE_START + int "Slave TCP start port" + default 61440 + help + Slave side TCP start port. Host defaults to 49152 + Slave range: 61440-65535 + Host range: 49152-61439 + + config LWIP_TCP_LOCAL_PORT_RANGE_END + int "Slave TCP end port" + default 65535 + help + Slave side TCP end port. Host defaults to 61439 + Slave range: 61440-65535 + Host range: 49152-61439 + + config LWIP_UDP_LOCAL_PORT_RANGE_START + int "Slave UDP start port" + default 61440 + help + Slave side UDP start port. Host defaults to 49152 + Slave range: 61440-65535 + Host range: 49152-61439 + + config LWIP_UDP_LOCAL_PORT_RANGE_END + int "Slave UDP end port" + default 65535 + help + Slave side UDP end port. Host defaults to 61439 + Slave range: 61440-65535 + Host range: 49152-61439 + endmenu + + menu "Host side (remote) LWIP port range" + config LWIP_TCP_REMOTE_PORT_RANGE_START + int "Host TCP start port" + default 49152 + help + Host side TCP start port. Slave defaults to 61440 + Slave range: 61440-65535 + Host range: 49152-61439 + + config LWIP_TCP_REMOTE_PORT_RANGE_END + int "Host TCP end port" + default 61439 + help + Host side TCP end port. Slave defaults to 65535 + Slave range: 61440-65535 + Host range: 49152-61439 + + config LWIP_UDP_REMOTE_PORT_RANGE_START + int "Host UDP start port" + default 49152 + help + Host side UDP start port. Slave defaults to 61440 + Slave range: 61440-65535 + Host range: 49152-61439 + + config LWIP_UDP_REMOTE_PORT_RANGE_END + int "Host UDP end port" + default 61439 + help + Host side UDP end port. Slave defaults to 65535 + Slave range: 61440-65535 + Host range: 49152-61439 + endmenu + + endmenu + + config ESP_HOSTED_HOST_POWER_SAVE_ENABLED + bool "Allow host to power save" + default n + help + Allow host to enter power save mode. + Host will notify slave before entering and exiting the power save + + menu "Host power save config" + depends on ESP_HOSTED_HOST_POWER_SAVE_ENABLED + + config ESP_HOSTED_HOST_DEEP_SLEEP_ALLOWED + depends on ESP_HOSTED_HOST_POWER_SAVE_ENABLED + bool "Allow host to enter deep sleep. Slave will wakeup host using GPIO when needed" + default y if ESP_HOSTED_HOST_POWER_SAVE_ENABLED + select ESP_HOSTED_CLI_ENABLED + help + Allow host to enter deep sleep mode. Host will notify slave before entering deep sleep. + + menu "Host deep sleep - wakeup config" + depends on ESP_HOSTED_HOST_DEEP_SLEEP_ALLOWED + config ESP_HOSTED_HOST_WAKEUP_GPIO + int "Slave out: Host wakeup GPIO" + default 2 if IDF_TARGET_ESP32C6 && !ESP_SPI_HD_HOST_INTERFACE + default 9 if IDF_TARGET_ESP32C6 && ESP_SPI_HD_HOST_INTERFACE + default 1 if IDF_TARGET_ESP32C3 + default 25 if IDF_TARGET_ESP32C5 + default 6 if IDF_TARGET_ESP32C2 && C2_C5_MODULE_SUB_BOARD + default -1 + + choice ESP_HOSTED_HOST_WAKEUP_GPIO_LEVEL + prompt "Host Wakeup GPIO Level" + default ESP_HOSTED_HOST_WAKEUP_GPIO_LEVEL_HIGH + + config ESP_HOSTED_HOST_WAKEUP_GPIO_LEVEL_HIGH + bool "High" + config ESP_HOSTED_HOST_WAKEUP_GPIO_LEVEL_LOW + bool "Low" + endchoice + + config ESP_HOSTED_HOST_WAKEUP_GPIO_LEVEL + int + default 1 if ESP_HOSTED_HOST_WAKEUP_GPIO_LEVEL_HIGH + default 0 if ESP_HOSTED_HOST_WAKEUP_GPIO_LEVEL_LOW help - On comparing with slave packet stats helps to understand any packet loss at hosted + GPIO level to use for host wakeup from sleep. + Set to 0 to use low level, set to 1 to use high level. + endmenu + + config ESP_HOSTED_UNLOAD_BUS_DRIVER_DURING_HOST_SLEEP + depends on ESP_HOSTED_HOST_POWER_SAVE_ENABLED + bool "Unload low level BUS driver during host deep sleep" + default n + + config PRINT_HOST_WAKEUP_PACKET_FULL_PKT + bool "Print the full wakeup packet" + default n + + endmenu + + + config ESP_HOSTED_CLI_ENABLED + bool "Enable CLI Shell" + default y if ESP_HOSTED_HOST_DEEP_SLEEP_ALLOWED + default n if !ESP_HOSTED_HOST_DEEP_SLEEP_ALLOWED + help + Enable CLI shell for debugging and control purposes. + + config ESP_HOSTED_CLI_NEW_INSTANCE + depends on ESP_HOSTED_CLI_ENABLED + bool "Create new instance & do not re-use existing session if any" + default y + + config ESP_HOSTED_USE_EXAMPLE_WIFI_PRE_PROVISION_CONFIG + bool "Wi-Fi default config (pre-provisioning)" + default n + help + Enable this option to use a predefined Wi-Fi configuration for examples. + This can be useful for testing and development purposes where a known + Wi-Fi setup is required. + + config ESP_HOSTED_ENABLE_GPIO_RPC + bool "Enable GPIO control on SLAVE (host can control slave GPIOs)" + default n + help + Enable RPC methods that allow the HOST MCU to configure and control + GPIOs on the SLAVE. Leave disabled unless you really need it. + Access to GPIOs used by the transport (SPI/SDIO/SPI-HD/UART) are always blocked. + + menu "Wi-Fi default config (pre-provisioning)" + depends on ESP_HOSTED_USE_EXAMPLE_WIFI_PRE_PROVISION_CONFIG + + config ESP_WIFI_SSID + string "WiFi SSID" + default "myssid" + help + SSID (network name) for the example to connect to. + + config ESP_WIFI_PASSWORD + string "WiFi Password" + default "mypassword" + help + WiFi password (WPA or WPA2) for the example to use. + + choice ESP_WIFI_SAE_MODE + prompt "WPA3 SAE mode selection" + default ESP_WPA3_SAE_PWE_BOTH + help + Select mode for SAE as Hunt and Peck, H2E or both. + config ESP_WPA3_SAE_PWE_HUNT_AND_PECK + bool "HUNT AND PECK" + config ESP_WPA3_SAE_PWE_HASH_TO_ELEMENT + bool "H2E" + config ESP_WPA3_SAE_PWE_BOTH + bool "BOTH" + endchoice + + config ESP_WIFI_PW_ID + string "PASSWORD IDENTIFIER" + depends on ESP_WPA3_SAE_PWE_HASH_TO_ELEMENT|| ESP_WPA3_SAE_PWE_BOTH + default "" + help + password identifier for SAE H2E + + config ESP_MAXIMUM_RETRY + int "Maximum retry" + default 5 + help + Set the Maximum retry to avoid station reconnecting to the AP unlimited when the AP is really inexistent. + + choice ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD + prompt "WiFi Scan auth mode threshold" + default ESP_WIFI_AUTH_WPA2_PSK + help + The weakest authmode to accept in the scan mode. + This value defaults to ESP_WIFI_AUTH_WPA2_PSK incase password is present and ESP_WIFI_AUTH_OPEN is used. + Please select ESP_WIFI_AUTH_WEP/ESP_WIFI_AUTH_WPA_PSK incase AP is operating in WEP/WPA mode. + + config ESP_WIFI_AUTH_OPEN + bool "OPEN" + config ESP_WIFI_AUTH_WEP + bool "WEP" + config ESP_WIFI_AUTH_WPA_PSK + bool "WPA PSK" + config ESP_WIFI_AUTH_WPA2_PSK + bool "WPA2 PSK" + config ESP_WIFI_AUTH_WPA_WPA2_PSK + bool "WPA/WPA2 PSK" + config ESP_WIFI_AUTH_WPA3_PSK + bool "WPA3 PSK" + config ESP_WIFI_AUTH_WPA2_WPA3_PSK + bool "WPA2/WPA3 PSK" + config ESP_WIFI_AUTH_WAPI_PSK + bool "WAPI PSK" + + endchoice + + choice WIFI_CMD_DEFAULT_COUNTRY + prompt "Set default country during initialize wifi" + default WIFI_CMD_DEFAULT_COUNTRY_CN + help + Set default wifi country during initialize wifi + + config WIFI_CMD_DEFAULT_COUNTRY_NONE + bool + prompt "Do not set country code" + + config WIFI_CMD_DEFAULT_COUNTRY_CN + bool + prompt "Set country code to CN (1-13)" + endchoice + endmenu + + config ESP_HOSTED_EXTRA_EXAMPLES + depends on ESP_HOSTED_NETWORK_SPLIT_ENABLED + bool "Additional higher layer examples to run" + default n + help + Extra set of optional examples to run at slave + + menu "Select Examples to run" + depends on ESP_HOSTED_EXTRA_EXAMPLES + + config ESP_HOSTED_COPROCESSOR_EXAMPLE_MQTT + bool "MQTT client example" + default y + + menu "MQTT client config" + depends on ESP_HOSTED_COPROCESSOR_EXAMPLE_MQTT + choice BROKER_CHOICE + prompt "MQTT Broker" + default BROKER_HIVEMQ + + config BROKER_ECLIPSEPROJECTS + bool "mqtt.eclipseprojects.io" + config BROKER_HIVEMQ + bool "broker.hivemq.com" + endchoice + + config BROKER_URL + string + default "mqtt://mqtt.eclipseprojects.io" if BROKER_ECLIPSEPROJECTS + default "mqtt://broker.hivemq.com" if BROKER_HIVEMQ + help + URL of the broker to connect to + + config BROKER_URL_FROM_STDIN + bool + default y if BROKER_URL = "FROM_STDIN" + + endmenu + + config ESP_HOSTED_COPROCESSOR_EXAMPLE_HTTP_CLIENT + bool "HTTP client example" + default y + + menu "HTTP client config" + depends on ESP_HOSTED_COPROCESSOR_EXAMPLE_HTTP_CLIENT + + config HTTP_WEBSERVER + string "HTTP webserver to send req" + default "example.com" + + config HTTP_WEBSERVER_PORT + string "HTTP webserver port" + default "80" + + config HTTP_WEBSERVER_PATH + string "HTTP webserver path" + default "/" + + config HTTP_REQ_DELAY + int "Delay after every http request (seconds)" + default 10 + + endmenu endmenu endmenu diff --git a/slave/main/app_main.c b/slave/main/esp_hosted_coprocessor.c similarity index 52% rename from slave/main/app_main.c rename to slave/main/esp_hosted_coprocessor.c index 106f954c..61dd0132 100644 --- a/slave/main/app_main.c +++ b/slave/main/esp_hosted_coprocessor.c @@ -20,14 +20,15 @@ #include "esp_private/wifi.h" #include "interface.h" #include "esp_wpa.h" -#include "app_main.h" +#include "esp_hosted_coprocessor.h" #include "driver/gpio.h" #include "freertos/task.h" #include "freertos/queue.h" -#if CONFIG_BT_ENABLED +#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_SOC_BT_SUPPORTED) #include "esp_bt.h" #endif + #include "endian.h" #include @@ -39,31 +40,29 @@ #include "esp_timer.h" #include "mempool.h" -#include "coprocessor_fw_version.h" +#include "esp_hosted_coprocessor_fw_ver.h" +#include "esp_hosted_cli.h" +#include "host_power_save.h" -static const char *TAG = "fg_mcu_slave"; +#if CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED + #include "esp_hosted_rpc.pb-c.h" + volatile uint8_t station_got_ip = 0; + #define H_SLAVE_LWIP_DHCP_AT_SLAVE 1 +#endif +#include "lwip_filter.h" -//#define BYPASS_TX_PRIORITY_Q 1 -#ifdef CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS -#define STATS_TICKS pdMS_TO_TICKS(1000*2) -#define ARRAY_SIZE_OFFSET 5 -#endif +static const char *TAG = "co-pro-main"; -#define UNKNOWN_RPC_MSG_ID 0 +#define BYPASS_TX_PRIORITY_Q 1 -#if CONFIG_ESP_SPI_HOST_INTERFACE - #ifdef CONFIG_IDF_TARGET_ESP32S2 - #define TO_HOST_QUEUE_SIZE 5 - #else - #define TO_HOST_QUEUE_SIZE 20 - #endif -#else - #define TO_HOST_QUEUE_SIZE 20 -#endif +#define UNKNOWN_RPC_MSG_ID 0 + +#define TO_HOST_QUEUE_SIZE 10 #define ETH_DATA_LEN 1500 -#define MAX_WIFI_STA_TX_RETRY 6 +#define MAX_WIFI_STA_TX_RETRY 2 + volatile uint8_t datapath = 0; volatile uint8_t station_connected = 0; @@ -79,14 +78,16 @@ static QueueHandle_t meta_to_host_queue = NULL; static QueueHandle_t to_host_queue[MAX_PRIORITY_QUEUES] = {NULL}; #endif +esp_netif_t *slave_sta_netif = NULL; static protocomm_t *pc_pserial; +SemaphoreHandle_t host_reset_sem; static struct rx_data { uint8_t valid; uint16_t cur_seq_no; int len; - uint8_t data[4096]; + uint8_t data[8192]; } r; uint8_t ap_mac[BSSID_BYTES_SIZE] = {0}; @@ -95,11 +96,11 @@ uint8_t ap_mac[BSSID_BYTES_SIZE] = {0}; #error "Hosted UART Interface cannot be used with Bluetooth HCI over UART" #endif -static void print_firmware_version() +static void print_firmware_version(void) { ESP_LOGI(TAG, "*********************************************************************"); ESP_LOGI(TAG, " ESP-Hosted-MCU Slave FW version :: %d.%d.%d ", - PROJECT_VERSION_MAJOR_1, PROJECT_VERSION_MINOR_1, PROJECT_VERSION_PATCH_1); + (int)PROJECT_VERSION_MAJOR_1, (int)PROJECT_VERSION_MINOR_1, (int)PROJECT_VERSION_PATCH_1); #if CONFIG_ESP_SPI_HOST_INTERFACE #if BLUETOOTH_UART ESP_LOGI(TAG, " Transport used :: SPI + UART "); @@ -141,7 +142,9 @@ static uint8_t get_capabilities(void) cap |= ESP_CHECKSUM_ENABLED; #endif +#ifdef CONFIG_BT_ENABLED cap |= get_bluetooth_capabilities(); +#endif ESP_LOGI(TAG, "capabilities: 0x%x", cap); return cap; @@ -181,6 +184,32 @@ static uint32_t get_capabilities_ext(void) return ext_cap; } +static inline esp_err_t populate_buff_handle(interface_buffer_handle_t *buf_handle, + uint8_t if_type, + uint8_t *buf, + uint16_t len, + void (*free_buf_func)(void *data), + void *free_buf_handle, + uint8_t flag, + uint8_t if_num, + uint16_t seq_num) +{ + buf_handle->if_type = if_type; + buf_handle->payload = buf; + buf_handle->payload_len = len; + buf_handle->priv_buffer_handle = free_buf_handle; + buf_handle->free_buf_handle = free_buf_func; + buf_handle->flag = flag; + buf_handle->if_num = if_num; + buf_handle->seq_num = seq_num; + + return ESP_OK; +} + +#define populate_wifi_buffer_handle(Buf_hdL, TypE, BuF, LeN) \ + populate_buff_handle(Buf_hdL, TypE, BuF, LeN, esp_wifi_internal_free_rx_buffer, eb, 0, 0, 0); + + esp_err_t wlan_ap_rx_callback(void *buffer, uint16_t len, void *eb) { interface_buffer_handle_t buf_handle = {0}; @@ -191,7 +220,7 @@ esp_err_t wlan_ap_rx_callback(void *buffer, uint16_t len, void *eb) } return ESP_OK; } - ESP_HEXLOGV("AP_Get", buffer, len); + ESP_HEXLOGV("AP_Get", buffer, len, 32); #if 0 /* Only enable this is you want to avoid multi and bradcast @@ -206,12 +235,7 @@ esp_err_t wlan_ap_rx_callback(void *buffer, uint16_t len, void *eb) } #endif - buf_handle.if_type = ESP_AP_IF; - buf_handle.if_num = 0; - buf_handle.payload_len = len; - buf_handle.payload = buffer; - buf_handle.wlan_buf_handle = eb; - buf_handle.free_buf_handle = esp_wifi_internal_free_rx_buffer; + populate_wifi_buffer_handle(&buf_handle, ESP_AP_IF, buffer, len); if (send_to_host_queue(&buf_handle, PRIO_Q_OTHERS)) goto DONE; @@ -223,42 +247,129 @@ esp_err_t wlan_ap_rx_callback(void *buffer, uint16_t len, void *eb) return ESP_OK; } +/* This function would check the incoming packet from AP + * to send it to local lwip or host lwip depending upon the + * destination port used in the packet + */ esp_err_t wlan_sta_rx_callback(void *buffer, uint16_t len, void *eb) { interface_buffer_handle_t buf_handle = {0}; - if (!buffer || !eb || !datapath) { + if (!buffer || !eb) { if (eb) { esp_wifi_internal_free_rx_buffer(eb); } return ESP_OK; } - ESP_HEXLOGV("STA_Get", buffer, len); - buf_handle.if_type = ESP_STA_IF; - buf_handle.if_num = 0; - buf_handle.payload_len = len; - buf_handle.payload = buffer; - buf_handle.wlan_buf_handle = eb; - buf_handle.free_buf_handle = esp_wifi_internal_free_rx_buffer; + ESP_HEXLOGV("STA_Get", buffer, len, 32); #if ESP_PKT_STATS - pkt_stats.sta_sh_in++; + pkt_stats.sta_lwip_in++; #endif - if (send_to_host_queue(&buf_handle, PRIO_Q_OTHERS)) - goto DONE; +#ifdef CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED + hosted_l2_bridge bridge_to_use = HOST_LWIP_BRIDGE; + + /* Filtering based on destination port */ + bridge_to_use = filter_and_route_packet(buffer, len); + + + switch (bridge_to_use) { + case HOST_LWIP_BRIDGE: + /* Send to Host */ + if (!datapath) { + /* Drop packet */ + if (eb) { + esp_wifi_internal_free_rx_buffer(eb); + } + return ESP_OK; + } + ESP_LOGV(TAG, "host packet"); + populate_wifi_buffer_handle(&buf_handle, ESP_STA_IF, buffer, len); + + if (unlikely(send_to_host_queue(&buf_handle, PRIO_Q_OTHERS))) + goto DONE; + + #if ESP_PKT_STATS + pkt_stats.sta_sh_in++; + pkt_stats.sta_host_lwip_out++; + #endif + break; + + case SLAVE_LWIP_BRIDGE: + /* Send to local LWIP */ + ESP_LOGV(TAG, "slave packet"); + esp_netif_receive(slave_sta_netif, buffer, len, eb); + #if ESP_PKT_STATS + pkt_stats.sta_slave_lwip_out++; + #endif + break; + case BOTH_LWIP_BRIDGE: + ESP_LOGV(TAG, "slave & host packet"); + void * copy_buff = malloc(len); + assert(copy_buff); + memcpy(copy_buff, buffer, len); + + /* slave LWIP */ + esp_netif_receive(slave_sta_netif, buffer, len, eb); + //netif would free eb after processing + + ESP_LOGV(TAG, "slave & host packet"); + + /* Host LWIP, free up wifi buffers */ + populate_buff_handle(&buf_handle, ESP_STA_IF, copy_buff, len, free, copy_buff, 0, 0, 0); + if (unlikely(send_to_host_queue(&buf_handle, PRIO_Q_OTHERS))) { + /* Free copy_buff since we couldn't queue it */ + free(copy_buff); + return ESP_OK; + } + + #if ESP_PKT_STATS + pkt_stats.sta_sh_in++; + pkt_stats.sta_both_lwip_out++; + #endif + break; + + default: + ESP_LOGV(TAG, "Packet filtering failed, drop packet"); + goto DONE; + } +#else + if (!datapath) { + /* Drop packet */ + if (eb) { + esp_wifi_internal_free_rx_buffer(eb); + } + return ESP_OK; + } + + /* default as co-processor mode */ + populate_wifi_buffer_handle(&buf_handle, ESP_STA_IF, buffer, len); + + if (unlikely(send_to_host_queue(&buf_handle, PRIO_Q_OTHERS))) + goto DONE; + + #if ESP_PKT_STATS + pkt_stats.sta_sh_in++; + pkt_stats.sta_host_lwip_out++; + #endif +#endif return ESP_OK; DONE: - esp_wifi_internal_free_rx_buffer(eb); + if (eb) { + esp_wifi_internal_free_rx_buffer(eb); + } return ESP_OK; } -void process_tx_pkt(interface_buffer_handle_t *buf_handle) +static void process_tx_pkt(interface_buffer_handle_t *buf_handle) { + int host_awake = 1; + /* Check if data path is not yet open */ if (!datapath) { /* Post processing */ @@ -267,12 +378,29 @@ void process_tx_pkt(interface_buffer_handle_t *buf_handle) buf_handle->priv_buffer_handle = NULL; } ESP_LOGD(TAG, "Data path stopped"); - usleep(100*1000); + vTaskDelay(pdMS_TO_TICKS(100)); return; } if (if_context && if_context->if_ops && if_context->if_ops->write) { - if_context->if_ops->write(if_handle, buf_handle); + + if (is_host_power_saving() && is_host_wakeup_needed(buf_handle)) { + uint16_t wakeup_pkt_display_len = 32; + ESP_LOGI(TAG, "Host sleeping, trigger host wake-up"); + #ifdef CONFIG_PRINT_HOST_WAKEUP_PACKET_FULL_PKT + wakeup_pkt_display_len = buf_handle->payload_len>1600?1600:buf_handle->payload_len; + #endif + ESP_HEXLOGW("Wakeup_pkt", buf_handle->payload+H_ESP_PAYLOAD_HEADER_OFFSET, + buf_handle->payload_len, wakeup_pkt_display_len); + host_awake = wakeup_host(portMAX_DELAY); + buf_handle->flag |= FLAG_WAKEUP_PKT; + } + + if (host_awake) + if_context->if_ops->write(if_handle, buf_handle); + else + ESP_LOGI(TAG, "Host wakeup failed, drop packet"); } + /* Post processing */ if (buf_handle->free_buf_handle && buf_handle->priv_buffer_handle) { buf_handle->free_buf_handle(buf_handle->priv_buffer_handle); @@ -282,7 +410,7 @@ void process_tx_pkt(interface_buffer_handle_t *buf_handle) #if !BYPASS_TX_PRIORITY_Q /* Send data to host */ -void send_task(void* pvParameters) +static void send_task(void* pvParameters) { uint8_t queue_type = 0; interface_buffer_handle_t buf_handle = {0}; @@ -290,7 +418,7 @@ void send_task(void* pvParameters) while (1) { if (!datapath) { - usleep(100*1000); + vTaskDelay(pdMS_TO_TICKS(100)); continue; } @@ -301,7 +429,33 @@ void send_task(void* pvParameters) } #endif -void parse_protobuf_req(void) +static void host_reset_task(void* pvParameters) +{ + uint8_t capa = 0; + uint32_t ext_capa = 0; + + ESP_LOGI(TAG, "host reset handler task started"); + + while (1) { + + if (host_reset_sem) { + xSemaphoreTake(host_reset_sem, portMAX_DELAY); + } else { + vTaskDelay(pdMS_TO_TICKS(100)); + continue; + } + + capa = get_capabilities(); + ext_capa = get_capabilities_ext(); + + /* send capabilities to host */ + ESP_LOGI(TAG,"host reconfig event"); + generate_startup_event(capa, ext_capa); + //send_event_to_host(RPC_ID__Event_ESPInit); + } +} + +static void parse_protobuf_req(void) { protocomm_pserial_data_ready(pc_pserial, r.data, r.len, UNKNOWN_RPC_MSG_ID); @@ -323,7 +477,7 @@ void send_event_data_to_host(int event_id, void *data, int size) protocomm_pserial_data_ready(pc_pserial, data, size, event_id); } -void process_serial_rx_pkt(uint8_t *buf) +static void process_serial_rx_pkt(uint8_t *buf) { struct esp_payload_header *header = NULL; uint16_t payload_len = 0; @@ -335,7 +489,7 @@ void process_serial_rx_pkt(uint8_t *buf) payload = buf + le16toh(header->offset); rem_buff_size = sizeof(r.data) - r.len; - ESP_HEXLOGV("serial_rx", payload, payload_len); + ESP_HEXLOGV("serial_rx", payload, payload_len, 32); while (r.valid) { @@ -352,6 +506,7 @@ void process_serial_rx_pkt(uint8_t *buf) if (header->seq_num != r.cur_seq_no) { /* Sequence number mismatch */ r.valid = 1; + ESP_LOGV(TAG, "Final Frag: r.valid=1"); parse_protobuf_req(); return; } @@ -362,6 +517,7 @@ void process_serial_rx_pkt(uint8_t *buf) if (!(header->flags & MORE_FRAGMENT)) { /* Received complete buffer */ r.valid = 1; + ESP_LOGV(TAG, "no frag case: r.valid=1"); parse_protobuf_req(); } } @@ -430,19 +586,19 @@ static int host_to_slave_reconfig(uint8_t *evt_buf, uint16_t len) } else if (*pos == SLV_CONFIG_THROTTLE_HIGH_THRESHOLD) { slv_cfg_g.throttle_high_threshold = *(pos + 2); - ESP_LOGI(TAG, "ESP<-Host high data throttle threshold [%u%%]", + ESP_LOGI(TAG, "ESP<-Host wifi flow ctl start thres [%u%%]", slv_cfg_g.throttle_high_threshold); /* Warn if FreeRTOS tick is small */ if ((slv_cfg_g.throttle_low_threshold > 0) && (CONFIG_FREERTOS_HZ < 1000)) { - ESP_LOGW(TAG, "FreeRTOS tick[%d]<1000. Enabling throttling with lower FrerRTOS tick may result in lower peak data throughput", (int) CONFIG_FREERTOS_HZ); + ESP_LOGW(TAG, "FreeRTOS tick[%d]<1000. Enabling flow control with lower FrerRTOS tick may result in lower peak data throughput", (int) CONFIG_FREERTOS_HZ); } } else if (*pos == SLV_CONFIG_THROTTLE_LOW_THRESHOLD) { slv_cfg_g.throttle_low_threshold = *(pos + 2); - ESP_LOGI(TAG, "ESP<-Host low data throttle threshold [%u%%]", + ESP_LOGI(TAG, "ESP<-Host wifi flow ctl clear thres [%u%%]", slv_cfg_g.throttle_low_threshold); } else { @@ -454,7 +610,10 @@ static int host_to_slave_reconfig(uint8_t *evt_buf, uint16_t len) pos += (tag_len+2); len_left -= (tag_len+2); } - +#if CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED + /* Host should be in position to get DHCP/DNS info */ + //send_dhcp_dns_info_to_host(1, 0); +#endif return ESP_OK; } @@ -471,7 +630,7 @@ static void process_priv_pkt(uint8_t *payload, uint16_t payload_len) if (event->event_type == ESP_PRIV_EVENT_INIT) { ESP_LOGI(TAG, "Slave init_config received from host"); - ESP_HEXLOGD("init_config", event->event_data, event->event_len); + ESP_HEXLOGD("init_config", event->event_data, event->event_len, 32); ret = host_to_slave_reconfig(event->event_data, event->event_len); if (ret) { @@ -482,7 +641,7 @@ static void process_priv_pkt(uint8_t *payload, uint16_t payload_len) } } -void process_rx_pkt(interface_buffer_handle_t *buf_handle) +static void process_rx_pkt(interface_buffer_handle_t *buf_handle) { struct esp_payload_header *header = NULL; uint8_t *payload = NULL; @@ -494,40 +653,34 @@ void process_rx_pkt(interface_buffer_handle_t *buf_handle) payload = buf_handle->payload + le16toh(header->offset); payload_len = le16toh(header->len); - ESP_HEXLOGD("rx_new", buf_handle->payload, min(32,buf_handle->payload_len)); + ESP_HEXLOGD("bus_RX", buf_handle->payload, buf_handle->payload_len, 32); + if (buf_handle->if_type == ESP_STA_IF && station_connected) { /* Forward data to wlan driver */ do { - ret = esp_wifi_internal_tx(ESP_IF_WIFI_STA, payload, payload_len); - - /* Delay only if throttling is enabled */ - if (ret && - slv_cfg_g.throttle_high_threshold && - (retry_wifi_tx<(MAX_WIFI_STA_TX_RETRY/2))) { - vTaskDelay(2); + ret = esp_wifi_internal_tx(WIFI_IF_STA, payload, payload_len); + if (ret) { + vTaskDelay(pdMS_TO_TICKS(1)); } retry_wifi_tx--; } while (ret && retry_wifi_tx); - ESP_HEXLOGV("STA_Put", payload, payload_len); - if (ESP_OK == ret) { -#if ESP_PKT_STATS - pkt_stats.hs_bus_sta_out++; -#endif - } else { + ESP_HEXLOGV("STA_Put", payload, payload_len, 32); #if ESP_PKT_STATS + if (ret) pkt_stats.hs_bus_sta_fail++; + else + pkt_stats.hs_bus_sta_out++; #endif - } } else if (buf_handle->if_type == ESP_AP_IF && softap_started) { /* Forward data to wlan driver */ - esp_wifi_internal_tx(ESP_IF_WIFI_AP, payload, payload_len); - ESP_HEXLOGV("AP_Put", payload, payload_len); + esp_wifi_internal_tx(WIFI_IF_AP, payload, payload_len); + ESP_HEXLOGV("AP_Put", payload, payload_len, 32); } else if (buf_handle->if_type == ESP_SERIAL_IF) { #if ESP_PKT_STATS - pkt_stats.serial_rx++; + pkt_stats.serial_rx++; #endif process_serial_rx_pkt(buf_handle->payload); } else if (buf_handle->if_type == ESP_PRIV_IF) { @@ -549,18 +702,18 @@ void process_rx_pkt(interface_buffer_handle_t *buf_handle) buf_handle->free_buf_handle(buf_handle->priv_buffer_handle); buf_handle->priv_buffer_handle = NULL; } + } /* Get data from host */ -void recv_task(void* pvParameters) +static void recv_task(void* pvParameters) { interface_buffer_handle_t buf_handle = {0}; for (;;) { - if (!datapath) { - /* Datapath is not enabled by host yet*/ - usleep(100*1000); + if (is_host_power_saving() || !datapath) { + vTaskDelay(pdMS_TO_TICKS(100)); continue; } @@ -568,7 +721,7 @@ void recv_task(void* pvParameters) if (if_context && if_context->if_ops && if_context->if_ops->read) { int len = if_context->if_ops->read(if_handle, &buf_handle); if (len <= 0) { - usleep(10*1000); + vTaskDelay(pdMS_TO_TICKS(1)); continue; } } @@ -602,6 +755,7 @@ int send_to_host_queue(interface_buffer_handle_t *buf_handle, uint8_t queue_type ESP_LOGE(TAG, "Failed to send buffer into queue[%u]\n",queue_type); return ESP_FAIL; } + if (queue_type == PRIO_Q_SERIAL) ret = xQueueSendToFront(meta_to_host_queue, &queue_type, portMAX_DELAY); else @@ -653,7 +807,7 @@ static esp_err_t serial_write_data(uint8_t* data, ssize_t len) return ESP_FAIL; } - ESP_HEXLOGV("serial_tx_create", data, frag_len); + ESP_HEXLOGV("serial_tx_create", data, frag_len, 32); left_len -= frag_len; pos += frag_len; @@ -662,6 +816,21 @@ static esp_err_t serial_write_data(uint8_t* data, ssize_t len) return ESP_OK; } +// This new function will run in a temporary, separate task. +static void power_save_alert_task(void *pvParameters) +{ + uint32_t event = (uint32_t)pvParameters; + host_power_save_alert(event); + /* The task deletes itself after running. */ + if (event == ESP_POWER_SAVE_OFF) { + sleep(2); + if (host_reset_sem) { + xSemaphoreGive(host_reset_sem); + } + } + vTaskDelete(NULL); +} + int event_handler(uint8_t val) { switch(val) { @@ -670,6 +839,11 @@ int event_handler(uint8_t val) if_handle->state = ACTIVE; datapath = 1; ESP_EARLY_LOGI(TAG, "Start Data Path"); + if (host_reset_sem) { + xSemaphoreGive(host_reset_sem); + } else { + ESP_EARLY_LOGI(TAG, "Failed to give host_reset_sem"); + } } else { ESP_EARLY_LOGI(TAG, "Failed to Start Data Path"); } @@ -679,123 +853,32 @@ int event_handler(uint8_t val) datapath = 0; if (if_handle) { ESP_EARLY_LOGI(TAG, "Stop Data Path"); - if_handle->state = DEACTIVE; + if (if_handle->state > DEACTIVE) { + if_handle->state = DEACTIVE; + } } else { ESP_EARLY_LOGI(TAG, "Failed to Stop Data Path"); } break; - } - return 0; -} -#ifdef CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS -/* These functions are only for debugging purpose - * Please do not enable in production environments - */ -static esp_err_t print_real_time_stats(TickType_t xTicksToWait) -{ - TaskStatus_t *start_array = NULL, *end_array = NULL; - UBaseType_t start_array_size, end_array_size; - uint32_t start_run_time, end_run_time; - esp_err_t ret; - - /* Allocate array to store current task states */ - start_array_size = uxTaskGetNumberOfTasks() + ARRAY_SIZE_OFFSET; - start_array = malloc(sizeof(TaskStatus_t) * start_array_size); - if (start_array == NULL) { - ret = ESP_ERR_NO_MEM; - goto exit; - } - /* Get current task states */ - start_array_size = uxTaskGetSystemState(start_array, - start_array_size, &start_run_time); - if (start_array_size == 0) { - ret = ESP_ERR_INVALID_SIZE; - goto exit; - } - - vTaskDelay(xTicksToWait); - - /* Allocate array to store tasks states post delay */ - end_array_size = uxTaskGetNumberOfTasks() + ARRAY_SIZE_OFFSET; - end_array = malloc(sizeof(TaskStatus_t) * end_array_size); - if (end_array == NULL) { - ret = ESP_ERR_NO_MEM; - goto exit; - } - /* Get post delay task states */ - end_array_size = uxTaskGetSystemState(end_array, end_array_size, &end_run_time); - if (end_array_size == 0) { - ret = ESP_ERR_INVALID_SIZE; - goto exit; - } - - /* Calculate total_elapsed_time in units of run time stats clock period */ - uint32_t total_elapsed_time = (end_run_time - start_run_time); - if (total_elapsed_time == 0) { - ret = ESP_ERR_INVALID_STATE; - goto exit; - } - - ESP_LOGI(TAG,"| Task | Run Time | Percentage"); - /* Match each task in start_array to those in the end_array */ - for (int i = 0; i < start_array_size; i++) { - int k = -1; - for (int j = 0; j < end_array_size; j++) { - if (start_array[i].xHandle == end_array[j].xHandle) { - k = j; - /* Mark that task have been matched by overwriting their handles */ - start_array[i].xHandle = NULL; - end_array[j].xHandle = NULL; - break; - } - } - /* Check if matching task found */ - if (k >= 0) { - uint32_t task_elapsed_time = end_array[k].ulRunTimeCounter - - start_array[i].ulRunTimeCounter; - uint32_t percentage_time = (task_elapsed_time * 100UL) / - (total_elapsed_time * portNUM_PROCESSORS); - ESP_LOGI(TAG,"| %s | %d | %d%%", start_array[i].pcTaskName, - task_elapsed_time, percentage_time); - } - } - - /* Print unmatched tasks */ - for (int i = 0; i < start_array_size; i++) { - if (start_array[i].xHandle != NULL) { - ESP_LOGI(TAG,"| %s | Deleted", start_array[i].pcTaskName); - } - } - for (int i = 0; i < end_array_size; i++) { - if (end_array[i].xHandle != NULL) { - ESP_LOGI(TAG,"| %s | Created", end_array[i].pcTaskName); - } - } - ret = ESP_OK; - -exit: /* Common return path */ - if (start_array) - free(start_array); - if (end_array) - free(end_array); - return ret; -} + case ESP_POWER_SAVE_ON: + xTaskCreate(power_save_alert_task, "ps_alert_task", 3072, (void *)ESP_POWER_SAVE_ON, tskIDLE_PRIORITY + 5, NULL); + break; -void task_runtime_stats_task(void* pvParameters) -{ - while (1) { - ESP_LOGI(TAG,"\n\nGetting real time stats over %d ticks", STATS_TICKS); - if (print_real_time_stats(STATS_TICKS) == ESP_OK) { - ESP_LOGI(TAG,"Real time stats obtained"); - } else { - ESP_LOGI(TAG,"Error getting real time stats"); - } - vTaskDelay(pdMS_TO_TICKS(1000*2)); + case ESP_POWER_SAVE_OFF: + //if (if_handle && if_handle->state >= DEACTIVE) { + datapath = 1; + if_handle->state = ACTIVE; + /*} else { + ESP_EARLY_LOGI(TAG, "Failed to set state to ACTIVE"); + }*/ + xTaskCreate(power_save_alert_task, "ps_alert_task", 3072, (void *)ESP_POWER_SAVE_OFF, tskIDLE_PRIORITY + 5, NULL); + break; } + return 0; } -#endif +#if defined(CONFIG_ESP_GPIO_SLAVE_RESET) && (CONFIG_ESP_GPIO_SLAVE_RESET != -1) static void IRAM_ATTR gpio_resetpin_isr_handler(void* arg) { @@ -841,105 +924,324 @@ static void register_reset_pin(uint32_t gpio_num) gpio_isr_handler_add(gpio_num, gpio_resetpin_isr_handler, NULL); } } - -void app_main() +#endif +#ifdef CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED +void create_slave_sta_netif(uint8_t dhcp_at_slave) { - esp_err_t ret; - uint8_t capa = 0; - uint32_t ext_capa = 0; - uint8_t prio_q_idx = 0; + /* Create "almost" default station, but with un-flagged DHCP client */ + esp_netif_inherent_config_t netif_cfg; + memcpy(&netif_cfg, ESP_NETIF_BASE_DEFAULT_WIFI_STA, sizeof(netif_cfg)); + + if (!dhcp_at_slave) + netif_cfg.flags &= ~ESP_NETIF_DHCP_CLIENT; + + esp_netif_config_t cfg_sta = { + .base = &netif_cfg, + .stack = ESP_NETIF_NETSTACK_DEFAULT_WIFI_STA, + }; + esp_netif_t *netif_sta = esp_netif_new(&cfg_sta); + assert(netif_sta); + + ESP_ERROR_CHECK(esp_netif_attach_wifi_station(netif_sta)); + ESP_ERROR_CHECK(esp_wifi_set_default_wifi_sta_handlers()); + + if (!dhcp_at_slave) { + ESP_ERROR_CHECK(esp_netif_dhcpc_stop(netif_sta)); + ESP_LOGI(TAG, "No DHCP at slave"); + } else { + ESP_LOGI(TAG, "DHCP at slave"); + /* TODO: Is below line needed? */ + //ESP_ERROR_CHECK(esp_netif_dhcpc_start(netif_sta)); + } - print_firmware_version(); - register_reset_pin(CONFIG_ESP_GPIO_SLAVE_RESET); + slave_sta_netif = netif_sta; +} +#endif - capa = get_capabilities(); - ext_capa = get_capabilities_ext(); +#ifdef CONFIG_ESP_HOSTED_USE_EXAMPLE_WIFI_PRE_PROVISION_CONFIG +#define EXAMPLE_ESP_WIFI_SSID CONFIG_ESP_WIFI_SSID +#define EXAMPLE_ESP_WIFI_PASS CONFIG_ESP_WIFI_PASSWORD +#define EXAMPLE_ESP_MAXIMUM_RETRY CONFIG_ESP_MAXIMUM_RETRY + +#if CONFIG_ESP_WPA3_SAE_PWE_HUNT_AND_PECK + #define ESP_WIFI_SAE_MODE WPA3_SAE_PWE_HUNT_AND_PECK + #define EXAMPLE_H2E_IDENTIFIER "" +#elif CONFIG_ESP_WPA3_SAE_PWE_HASH_TO_ELEMENT + #define ESP_WIFI_SAE_MODE WPA3_SAE_PWE_HASH_TO_ELEMENT + #define EXAMPLE_H2E_IDENTIFIER CONFIG_ESP_WIFI_PW_ID +#elif CONFIG_ESP_WPA3_SAE_PWE_BOTH + #define ESP_WIFI_SAE_MODE WPA3_SAE_PWE_BOTH + #define EXAMPLE_H2E_IDENTIFIER CONFIG_ESP_WIFI_PW_ID +#endif - /* Initialize NVS */ - ret = nvs_flash_init(); +#if CONFIG_ESP_WIFI_AUTH_OPEN + #define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_OPEN +#elif CONFIG_ESP_WIFI_AUTH_WEP + #define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WEP +#elif CONFIG_ESP_WIFI_AUTH_WPA_PSK + #define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA_PSK +#elif CONFIG_ESP_WIFI_AUTH_WPA2_PSK + #define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA2_PSK +#elif CONFIG_ESP_WIFI_AUTH_WPA_WPA2_PSK + #define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA_WPA2_PSK +#elif CONFIG_ESP_WIFI_AUTH_WPA3_PSK + #define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA3_PSK +#elif CONFIG_ESP_WIFI_AUTH_WPA2_WPA3_PSK + #define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA2_WPA3_PSK +#elif CONFIG_ESP_WIFI_AUTH_WAPI_PSK + #define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WAPI_PSK +#endif - if (ret == ESP_ERR_NVS_NO_FREE_PAGES || - ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { - ESP_ERROR_CHECK(nvs_flash_erase()); - ret = nvs_flash_init(); + +static int fallback_to_sdkconfig_wifi_config(void) +{ + wifi_config_t wifi_config = { + .sta = { + .ssid = EXAMPLE_ESP_WIFI_SSID, + .password = EXAMPLE_ESP_WIFI_PASS, + /* Authmode threshold resets to WPA2 as default if password matches WPA2 standards (password len => 8). + * If you want to connect the device to deprecated WEP/WPA networks, Please set the threshold value + * to WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK and set the password with length and format matching to + * WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK standards. + */ + .threshold.authmode = ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD, + .sae_pwe_h2e = ESP_WIFI_SAE_MODE, + .sae_h2e_identifier = EXAMPLE_H2E_IDENTIFIER, + }, + }; + + ESP_ERROR_CHECK(esp_hosted_set_sta_config(WIFI_IF_STA, &wifi_config) ); + + return ESP_OK; +} +#endif + +#ifdef CONFIG_ESP_HOSTED_USE_EXAMPLE_WIFI_PRE_PROVISION_CONFIG +static bool wifi_is_provisioned(void) +{ + wifi_config_t wifi_cfg = {0}; + + if (esp_wifi_get_config(WIFI_IF_STA, &wifi_cfg) != ESP_OK) { + ESP_LOGI(TAG, "Wifi get config failed"); + return false; } - ESP_ERROR_CHECK( ret ); - initialise_bluetooth(); + ESP_LOGI(TAG, "SSID: %s", wifi_cfg.sta.ssid); - pc_pserial = protocomm_new(); - if (pc_pserial == NULL) { - ESP_LOGE(TAG,"Failed to allocate memory for new instance of protocomm "); - return; + if (strlen((const char *) wifi_cfg.sta.ssid)) { + ESP_LOGI(TAG, "Wifi provisioned"); + return true; } + ESP_LOGI(TAG, "Wifi not provisioned, Fallback to example config"); - /* Endpoint for control command responses */ - if (protocomm_add_endpoint(pc_pserial, RPC_EP_NAME_RSP, - data_transfer_handler, NULL) != ESP_OK) { - ESP_LOGE(TAG, "Failed to add enpoint"); - return; + return false; +} +#endif + +#if defined(CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED) || defined(CONFIG_ESP_HOSTED_USE_EXAMPLE_WIFI_PRE_PROVISION_CONFIG) +static int connect_sta(void) +{ + wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); + + ESP_ERROR_CHECK(esp_wifi_init(&cfg)); + ESP_ERROR_CHECK(esp_wifi_set_storage(WIFI_STORAGE_FLASH)); + esp_hosted_register_wifi_event_handlers(); + + ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) ); + +#ifdef CONFIG_ESP_HOSTED_USE_EXAMPLE_WIFI_PRE_PROVISION_CONFIG +#if CONFIG_WIFI_CMD_DEFAULT_COUNTRY_CN + /* Only set country once during first initialize wifi */ + static bool country_code_has_set = false; + if (country_code_has_set == false) { + wifi_country_t country = { + .cc = "CN", + .schan = 1, + .nchan = 13, + .policy = 0 + }; + esp_wifi_set_country(&country); + country_code_has_set = true; } +#endif - /* Endpoint for control notifications for events subscribed by user */ - if (protocomm_add_endpoint(pc_pserial, RPC_EP_NAME_EVT, - rpc_evt_handler, NULL) != ESP_OK) { - ESP_LOGE(TAG, "Failed to add enpoint"); - return; + if (! wifi_is_provisioned()) { + fallback_to_sdkconfig_wifi_config(); } +#endif - protocomm_pserial_start(pc_pserial, serial_write_data, serial_read_data); + ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_NONE)); - if_context = interface_insert_driver(event_handler); + ESP_ERROR_CHECK(esp_wifi_start() ); -#if CONFIG_ESP_SPI_HOST_INTERFACE - datapath = 1; +#ifdef CONFIG_ESP_HOSTED_USE_EXAMPLE_WIFI_PRE_PROVISION_CONFIG +#if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS + #if CONFIG_ESP_WIFI_ENABLE_WIFI_RX_MU_STATS + esp_wifi_enable_rx_statistics(true, true); + #else + esp_wifi_enable_rx_statistics(true, false); + #endif +#endif + +#if CONFIG_ESP_WIFI_ENABLE_WIFI_TX_STATS + esp_wifi_enable_tx_statistics(ESP_WIFI_ACI_BE, true); +#endif #endif + return ESP_OK; +} +#endif + + + +static void host_wakeup_callback(void) +{ +#if H_HOST_PS_ALLOWED + /* Interrupt context */ +#endif +} + +esp_err_t esp_hosted_coprocessor_init(void) +{ + static bool esp_hosted_rcp_init_done = false; + if (esp_hosted_rcp_init_done) { + return ESP_OK; + } + esp_hosted_rcp_init_done = true; + + assert(host_reset_sem = xSemaphoreCreateBinary()); + xSemaphoreTake(host_reset_sem, 0); + + print_firmware_version(); + + if_context = interface_insert_driver(event_handler); if (!if_context || !if_context->if_ops) { ESP_LOGE(TAG, "Failed to insert driver\n"); - return; + return ESP_FAIL; } if_handle = if_context->if_ops->init(); - if (!if_handle) { ESP_LOGE(TAG, "Failed to initialize driver\n"); - return; + return ESP_FAIL; } + assert(xTaskCreate(recv_task , "recv_task" , + CONFIG_ESP_HOSTED_DEFAULT_TASK_STACK_SIZE, NULL , + CONFIG_ESP_HOSTED_DEFAULT_TASK_PRIORITY, NULL) == pdTRUE); +#if CONFIG_ESP_SPI_HOST_INTERFACE + datapath = 1; + if (host_reset_sem) + xSemaphoreGive(host_reset_sem); +#endif + +#if CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED + ESP_ERROR_CHECK(esp_netif_init()); +#endif + ESP_ERROR_CHECK(esp_event_loop_create_default()); + +#if defined(CONFIG_ESP_GPIO_SLAVE_RESET) && (CONFIG_ESP_GPIO_SLAVE_RESET != -1) + register_reset_pin(CONFIG_ESP_GPIO_SLAVE_RESET); +#endif + +#if defined(CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED) && defined(CONFIG_ESP_HOSTED_HOST_RESERVED_PORTS_CONFIGURED) + ESP_LOGI(TAG, "Configuring host static port forwarding rules from slave kconfig"); + configure_host_static_port_forwarding_rules(CONFIG_ESP_HOSTED_HOST_RESERVED_TCP_SRC_PORTS, + CONFIG_ESP_HOSTED_HOST_RESERVED_TCP_DEST_PORTS, + CONFIG_ESP_HOSTED_HOST_RESERVED_UDP_SRC_PORTS, + CONFIG_ESP_HOSTED_HOST_RESERVED_UDP_DEST_PORTS); +#endif + + pc_pserial = protocomm_new(); + if (pc_pserial == NULL) { + ESP_LOGE(TAG,"Failed to allocate memory for new instance of protocomm "); + return ESP_FAIL; + } + + /* Endpoint for control command responses */ + if (protocomm_add_endpoint(pc_pserial, RPC_EP_NAME_RSP, + data_transfer_handler, NULL) != ESP_OK) { + ESP_LOGE(TAG, "Failed to add enpoint"); + return ESP_FAIL; + } + + /* Endpoint for control notifications for events subscribed by user */ + if (protocomm_add_endpoint(pc_pserial, RPC_EP_NAME_EVT, + rpc_evt_handler, NULL) != ESP_OK) { + ESP_LOGE(TAG, "Failed to add enpoint"); + return ESP_FAIL; + } + + protocomm_pserial_start(pc_pserial, serial_write_data, serial_read_data); - assert(xTaskCreate(recv_task , "recv_task" , - CONFIG_ESP_DEFAULT_TASK_STACK_SIZE, NULL , - CONFIG_ESP_DEFAULT_TASK_PRIO, NULL) == pdTRUE); #if !BYPASS_TX_PRIORITY_Q meta_to_host_queue = xQueueCreate(TO_HOST_QUEUE_SIZE*3, sizeof(uint8_t)); assert(meta_to_host_queue); - for (prio_q_idx=0; prio_q_idx +#include "esp_timer.h" +#include "interface.h" +static char *TAG = "host_ps"; + +#if H_HOST_PS_ALLOWED + + uint8_t power_save_on; + + #if H_HOST_PS_DEEP_SLEEP_ALLOWED + SemaphoreHandle_t wakeup_sem; + + #define GPIO_HOST_WAKEUP (H_HOST_WAKE_UP_GPIO) + + /* Assuming wakup gpio neg 'level' interrupt */ + #define set_host_wakeup_gpio() gpio_set_level(GPIO_HOST_WAKEUP, 1) + #define reset_host_wakeup_gpio() gpio_set_level(GPIO_HOST_WAKEUP, 0) + #endif + static void (*host_wakeup_cb)(void); +#endif + +extern interface_context_t *if_context; +extern interface_handle_t *if_handle; + +int is_host_wakeup_needed(interface_buffer_handle_t *buf_handle) +{ + int wakup_needed = 0; + char reason[100] = ""; +#if H_HOST_PS_ALLOWED + uint8_t *buf_start; + + buf_start = buf_handle->payload; + + +#if CONFIG_ESP_SPI_HD_HOST_INTERFACE || CONFIG_ESP_UART_HOST_INTERFACE || CONFIG_ESP_SPI_HOST_INTERFACE + /* Flow control packet cannot miss */ + if (buf_handle->wifi_flow_ctrl_en) { + strlcpy(reason, "flow_ctl_pkt", sizeof(reason)); + wakup_needed = 1; + goto end; + } +#endif + + if (!buf_start) { + /* Do not wake up */ + strlcpy(reason, "NULL_TxBuff", sizeof(reason)); + wakup_needed = 0; + goto end; + } + + /* Wake up for serial msg */ + switch (buf_handle->if_type) { + + case ESP_SERIAL_IF: + strlcpy(reason, "serial tx msg", sizeof(reason)); + wakup_needed = 1; + goto end; + break; + + case ESP_HCI_IF: + strlcpy(reason, "bt tx msg", sizeof(reason)); + wakup_needed = 1; + goto end; + break; + + case ESP_PRIV_IF: + strlcpy(reason, "priv tx msg", sizeof(reason)); + wakup_needed = 1; + goto end; + break; + + case ESP_TEST_IF: + strlcpy(reason, "test tx msg", sizeof(reason)); + wakup_needed = 1; + goto end; + break; + + case ESP_STA_IF: + + /* TODO: parse packet if lwip split not configured. + * Decide if packets need to reach to host or not + **/ + strlcpy(reason, "sta tx msg", sizeof(reason)); + wakup_needed = 1; + goto end; + break; + + case ESP_AP_IF: + strlcpy(reason, "ap tx msg", sizeof(reason)); + wakup_needed = 1; + goto end; + break; + } + +end: +#else + strlcpy(reason, "host_ps_disabled", sizeof(reason)); + wakup_needed = 0; +#endif + + if (wakup_needed) { + ESP_LOGI(TAG, "Wakeup needed, reason %s", reason); + } else { + ESP_LOGI(TAG, "Wakeup not needed"); + } + return wakup_needed; +} + + +int host_power_save_init(void (*fn_host_wakeup_cb)(void)) +{ +#if H_HOST_PS_ALLOWED + +#if H_HOST_PS_DEEP_SLEEP_ALLOWED + assert(GPIO_HOST_WAKEUP != -1); + /* Configuration for the OOB line */ + gpio_config_t io_conf={ + .intr_type=GPIO_INTR_DISABLE, + .mode=GPIO_MODE_OUTPUT, + .pin_bit_mask=(1ULL< timeout_ms) { + /* timeout */ + ESP_LOGI(TAG, "%s:%u timeout Curr:%llu start:%llu timeout:%lu", + __func__,__LINE__, GET_CURR_TIME_IN_MS(), start_time, timeout_ms); + break; + } + + } while (1); + + /* Clean up timer if it's still active */ + if (timer) { + esp_timer_stop(timer); + esp_timer_delete(timer); + } + + return wakeup_success; + +#else + return 1; +#endif +} + +int wakeup_host(uint32_t timeout_ms) +{ + +#if H_HOST_PS_ALLOWED + int wakeup_success = 0; + + if(!is_host_power_saving()) { + return 1; + } + + if (!if_handle || !if_context) { + ESP_LOGE(TAG, "Failed to wakeup, if_handle or if_context is NULL"); + return 0; + } + + ESP_LOGI(TAG, "if_handle->state: %u", if_handle->state); + if (if_handle->state < DEACTIVE) { + ESP_LOGI(TAG, "%s:%u Re-Initializing driver\n", __func__, __LINE__); + + /* host wakeup mandated in sdio init */ + wakeup_success = 1; + if_handle = if_context->if_ops->init(); + if (!if_handle) { + ESP_LOGE(TAG, "%s:%u Failed to initialize driver\n", __func__, __LINE__); + return ESP_FAIL; + } + } + + if (power_save_on) { + wakeup_success = wakeup_host_mandate(timeout_ms); + ESP_LOGI(TAG, "host %s woke up", is_host_power_saving() ? "not" : ""); + } + + return wakeup_success; +#else + return 1; +#endif +} + +int host_power_save_alert(uint32_t ps_evt) +{ + +#if H_HOST_PS_ALLOWED + /* Running in interrupt context - Keep it short and simple */ + BaseType_t do_yeild = pdFALSE; + + if (ESP_POWER_SAVE_ON == ps_evt) { + ESP_EARLY_LOGI(TAG, "Host Sleep"); + #if H_HOST_PS_DEEP_SLEEP_ALLOWED + if (wakeup_sem) { + /* Host sleeping */ + xSemaphoreTakeFromISR(wakeup_sem, &do_yeild); + } + #endif + power_save_on = 1; + + if (!if_handle || !if_context || if_handle->state < DEACTIVE) { + ESP_EARLY_LOGE(TAG, "%s:%u Failed to bring down transport", __func__, __LINE__); + } + + if (if_handle->state >= DEACTIVE) { + if (!if_context->if_ops || !if_context->if_ops->deinit) { + ESP_EARLY_LOGI(TAG, "%s:%u if_context->if_ops->deinit not available", __func__, __LINE__); + } else { + ESP_EARLY_LOGI(TAG, "%s:%u Deinitializing driver", __func__, __LINE__); + if_context->if_ops->deinit(if_handle); + /* if_handle->state would be changed to DEINIT */ + } + } + } else if ((ESP_POWER_SAVE_OFF == ps_evt) || (ESP_OPEN_DATA_PATH == ps_evt)) { + ESP_EARLY_LOGI(TAG, "Host Awake, transport state: %u", if_handle->state); + + power_save_on = 0; + if (host_wakeup_cb) { + host_wakeup_cb(); + } + #if H_HOST_PS_DEEP_SLEEP_ALLOWED + if (wakeup_sem) { + xSemaphoreGiveFromISR(wakeup_sem, &do_yeild); + } + #endif + } else { + ESP_EARLY_LOGI(TAG, "Ignore event[%u]", ps_evt); + } + + if (do_yeild == pdTRUE) { + portYIELD_FROM_ISR(); + } +#endif + return 0; +} + diff --git a/slave/main/host_power_save.h b/slave/main/host_power_save.h new file mode 100644 index 00000000..7701eadb --- /dev/null +++ b/slave/main/host_power_save.h @@ -0,0 +1,56 @@ +/* + * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __HOST_POWER_SAVE_H__ +#define __HOST_POWER_SAVE_H__ + +#include +#include "sdkconfig.h" +#include "interface.h" + +#if defined(CONFIG_ESP_HOSTED_HOST_POWER_SAVE_ENABLED) + #define H_HOST_PS_ALLOWED 1 + extern uint8_t power_save_on; +#else + #define H_HOST_PS_ALLOWED 0 +#endif + +#if H_HOST_PS_ALLOWED && defined(CONFIG_ESP_HOSTED_HOST_DEEP_SLEEP_ALLOWED) + #define H_HOST_PS_DEEP_SLEEP_ALLOWED 1 +#else + #define H_HOST_PS_DEEP_SLEEP_ALLOWED 0 +#endif + +#if H_HOST_PS_DEEP_SLEEP_ALLOWED && CONFIG_ESP_HOSTED_HOST_WAKEUP_GPIO == -1 + #error "CONFIG_HOST_WAKEUP_GPIO is not configured. Either disable host power save or configure the host wakeup GPIO pin" +#else + #define H_HOST_WAKE_UP_GPIO CONFIG_ESP_HOSTED_HOST_WAKEUP_GPIO +#endif + +#if defined(CONFIG_ESP_HOSTED_UNLOAD_BUS_DRIVER_DURING_HOST_SLEEP) + #define H_PS_UNLOAD_BUS_WHILE_PS 1 +#else + #define H_PS_UNLOAD_BUS_WHILE_PS 0 +#endif + + +int host_power_save_init(void (*host_wakeup_callback)(void)); +int host_power_save_deinit(void); +int is_host_wakeup_needed(interface_buffer_handle_t *buf_handle); +int wakeup_host_mandate(uint32_t timeout_ms); +int wakeup_host(uint32_t timeout_ms); +int host_power_save_alert(uint32_t ps_evt); +static inline int is_host_power_saving(void) +{ +#if H_HOST_PS_ALLOWED + return power_save_on; +#else + return 0; +#endif +} + + +#endif diff --git a/slave/main/http_req.c b/slave/main/http_req.c new file mode 100644 index 00000000..707a3436 --- /dev/null +++ b/slave/main/http_req.c @@ -0,0 +1,129 @@ +/* HTTP GET Example using plain POSIX sockets + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ +#include +#include "sdkconfig.h" + +#ifdef CONFIG_ESP_HOSTED_COPROCESSOR_EXAMPLE_HTTP_CLIENT +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "esp_system.h" +#include "esp_log.h" + +#include "lwip/err.h" +#include "lwip/sockets.h" +#include "lwip/sys.h" +#include "lwip/netdb.h" +#include "lwip/dns.h" + +extern volatile uint8_t station_connected; +/* Constants that aren't configurable in menuconfig */ +#define WEB_SERVER CONFIG_HTTP_WEBSERVER +#define WEB_PORT CONFIG_HTTP_WEBSERVER_PORT +#define WEB_PATH CONFIG_HTTP_WEBSERVER_PATH + +static const char *TAG = "http_req"; + +static const char *REQUEST = "GET " WEB_PATH " HTTP/1.0\r\n" + "Host: "WEB_SERVER":"WEB_PORT"\r\n" + "User-Agent: esp-idf/1.0 esp32\r\n" + "\r\n"; + +static void http_get_task(void *pvParameters) +{ + const struct addrinfo hints = { + .ai_family = AF_INET, + .ai_socktype = SOCK_STREAM, + }; + struct addrinfo *res; + struct in_addr *addr; + int s, r; + char recv_buf[64]; + + while(1) { + int err = getaddrinfo(WEB_SERVER, WEB_PORT, &hints, &res); + + if(err != 0 || res == NULL) { + ESP_LOGE(TAG, "DNS lookup failed err=%d res=%p", err, res); + vTaskDelay(1000 / portTICK_PERIOD_MS); + continue; + } + + /* Code to print the resolved IP. + +Note: inet_ntoa is non-reentrant, look at ipaddr_ntoa_r for "real" code */ + addr = &((struct sockaddr_in *)res->ai_addr)->sin_addr; + ESP_LOGV(TAG, "DNS lookup succeeded. IP=%s", inet_ntoa(*addr)); + + s = socket(res->ai_family, res->ai_socktype, 0); + if(s < 0) { + ESP_LOGE(TAG, "... Failed to allocate socket."); + freeaddrinfo(res); + vTaskDelay(1000 / portTICK_PERIOD_MS); + continue; + } + ESP_LOGV(TAG, "... allocated socket"); + + if(connect(s, res->ai_addr, res->ai_addrlen) != 0) { + ESP_LOGE(TAG, "... socket connect failed errno=%d", errno); + close(s); + freeaddrinfo(res); + vTaskDelay(4000 / portTICK_PERIOD_MS); + continue; + } + + ESP_LOGV(TAG, "... connected"); + freeaddrinfo(res); + + if (write(s, REQUEST, strlen(REQUEST)) < 0) { + ESP_LOGE(TAG, "... socket send failed"); + close(s); + vTaskDelay(4000 / portTICK_PERIOD_MS); + continue; + } + ESP_LOGV(TAG, "... socket send success"); + + struct timeval receiving_timeout; + receiving_timeout.tv_sec = 5; + receiving_timeout.tv_usec = 0; + if (setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &receiving_timeout, + sizeof(receiving_timeout)) < 0) { + ESP_LOGE(TAG, "... failed to set socket receiving timeout"); + close(s); + vTaskDelay(4000 / portTICK_PERIOD_MS); + continue; + } + ESP_LOGV(TAG, "... set socket receiving timeout success"); + + /* Read HTTP response */ + do { + bzero(recv_buf, sizeof(recv_buf)); + r = read(s, recv_buf, sizeof(recv_buf)-1); +#if 0 + for(int i = 0; i < r; i++) { + putchar(recv_buf[i]); + } +#endif + } while(r > 0); + + if (r) + ESP_LOGE(TAG, "HTTP req: return=%d errno=%d.", r, errno); + else + ESP_LOGI(TAG, "HTTP req fetched successful"); + + close(s); + + vTaskDelay(CONFIG_HTTP_REQ_DELAY * 1000 / portTICK_PERIOD_MS); + } +} + +void slave_http_req_example(void) +{ + xTaskCreate(&http_get_task, "http_get_task", 4096, NULL, 5, NULL); +} +#endif diff --git a/slave/main/idf_component.yml b/slave/main/idf_component.yml new file mode 100644 index 00000000..37b22088 --- /dev/null +++ b/slave/main/idf_component.yml @@ -0,0 +1,21 @@ +dependencies: + cmd_system: + path: ${IDF_PATH}/examples/system/console/advanced/components/cmd_system + espressif/iperf-cmd: + matches: + - if: "idf_version >=6.0" + version: "~0.1.3" + - if: "idf_version <6.0" + version: "~0.1.1" + esp-qa/wifi-cmd: + matches: + - if: "idf_version >=6.0" + version: "~0.2.0" + - if: "idf_version >=5.5,<6.0" + version: "~0.2.2" + - if: "idf_version >=5.4,<5.5" + version: "~0.1.8" + - if: "idf_version >=5.3,<5.4" + version: "~0.1.0" + esp-qa/ping-cmd: + version: "~1.0.0" diff --git a/slave/main/interface.h b/slave/main/interface.h index dc1d4cef..fbc79175 100644 --- a/slave/main/interface.h +++ b/slave/main/interface.h @@ -22,7 +22,7 @@ #ifdef CONFIG_ESP_SDIO_HOST_INTERFACE -#if defined(CONFIG_IDF_TARGET_ESP32)||defined(CONFIG_IDF_TARGET_ESP32C6) +#if CONFIG_SOC_SDIO_SLAVE_SUPPORTED #include "driver/sdio_slave.h" #else #error "SDIO is not supported for this chipset" @@ -52,9 +52,8 @@ typedef enum { typedef enum { DEINIT, - INIT, - ACTIVE, DEACTIVE, + ACTIVE, } INTERFACE_STATE; typedef struct { @@ -74,7 +73,7 @@ typedef struct { uint8_t flag; uint16_t payload_len; uint16_t seq_num; -#if CONFIG_ESP_SPI_HD_HOST_INTERFACE || CONFIG_ESP_UART_HOST_INTERFACE +#if CONFIG_ESP_SPI_HD_HOST_INTERFACE || CONFIG_ESP_UART_HOST_INTERFACE || CONFIG_ESP_SPI_HOST_INTERFACE uint8_t wifi_flow_ctrl_en; #endif @@ -126,9 +125,10 @@ typedef struct { } slave_state_t; interface_context_t * interface_insert_driver(int (*callback)(uint8_t val)); -int interface_remove_driver(); +int interface_remove_driver(void); void generate_startup_event(uint8_t cap, uint32_t ext_cap); int send_to_host_queue(interface_buffer_handle_t *buf_handle, uint8_t queue_type); +void send_dhcp_dns_info_to_host(uint8_t network_up, uint8_t send_wifi_connected); #ifndef min #define min(a, b) ((a) < (b) ? (a) : (b)) diff --git a/slave/main/lwip_filter.c b/slave/main/lwip_filter.c new file mode 100644 index 00000000..50cc5a61 --- /dev/null +++ b/slave/main/lwip_filter.c @@ -0,0 +1,527 @@ +/* + * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* LWIP packet filtering implementation */ + +#include +#include +#include + +#include "esp_log.h" +#include "esp_timer.h" +#include "host_power_save.h" +#include "lwip_filter.h" + +#if defined(CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED) && defined(CONFIG_LWIP_ENABLE) +#include "lwip/opt.h" +#include "lwip/err.h" +#include "lwip/sys.h" +#include "lwip/etharp.h" +#include "lwip/prot/iana.h" +#include "lwip/prot/ip.h" +#include "lwip/prot/tcp.h" +#include "lwip/prot/udp.h" +#include "lwip/prot/icmp.h" +#include "lwip/tcp.h" +#include "lwip/udp.h" +#include "lwip/priv/tcp_priv.h" + + + +static const char *TAG = "lwip_filter"; + +#define MQTT_PORT 1883 +#define WAKEUP_HOST_STRING "wakeup-host" +#define DEFAULT_IPERF_PORT 5001 + +/* Use LWIP's port range macros instead of redefining */ +/* #define IS_REMOTE_TCP_PORT(port) ((port) != MQTT_PORT) */ +/* #define IS_REMOTE_UDP_PORT(port) (1) */ + +/* TODO: This should be done using the filter functions */ +#define DHCP_LWIP_BRIDGE BOTH_LWIP_BRIDGE + +#if defined(CONFIG_ESP_DEFAULT_LWIP_SLAVE) + #define DEFAULT_LWIP_TO_SEND SLAVE_LWIP_BRIDGE +#elif defined(CONFIG_ESP_DEFAULT_LWIP_HOST) + #define DEFAULT_LWIP_TO_SEND HOST_LWIP_BRIDGE +#elif defined(CONFIG_ESP_DEFAULT_LWIP_BOTH) + #define DEFAULT_LWIP_TO_SEND BOTH_LWIP_BRIDGE +#else + #error "Select one of the LWIP to forward" +#endif + +/* Cache for TCP port checks */ +static struct { + uint64_t last_check_time; + int last_result; + uint16_t last_port; +} tcp_cache = {0}; + +/* Cache for UDP port checks */ +static struct { + uint64_t last_check_time; + int last_result; + uint16_t last_port; +} udp_cache = {0}; + +#define MAX_ALLOWED_TCP_SRC_PORTS 10 +#define MAX_ALLOWED_UDP_SRC_PORTS 10 +#define MAX_ALLOWED_TCP_DST_PORTS 10 +#define MAX_ALLOWED_UDP_DST_PORTS 10 + +/* In the file-scope variables section */ +static uint16_t allowed_tcp_src_ports[MAX_ALLOWED_TCP_SRC_PORTS] = {0}; +static uint16_t allowed_udp_src_ports[MAX_ALLOWED_UDP_SRC_PORTS] = {0}; +static uint16_t allowed_tcp_dst_ports[MAX_ALLOWED_TCP_DST_PORTS] = {0}; +static uint16_t allowed_udp_dst_ports[MAX_ALLOWED_UDP_DST_PORTS] = {0}; +static int allowed_tcp_src_ports_count = 0; +static int allowed_udp_src_ports_count = 0; +static int allowed_tcp_dst_ports_count = 0; +static int allowed_udp_dst_ports_count = 0; + +/* Parse a comma-separated list of ports into an array */ +static int init_allowed_ports(const char *ports_str, int *ports_count, uint16_t *ports_array, int max_ports, const char *port_type) { + /* Only initialize once */ + static bool tcp_src_initialized = false; + static bool tcp_dst_initialized = false; + static bool udp_src_initialized = false; + static bool udp_dst_initialized = false; + + /* Check if already initialized for this port type */ + if ((strcmp(port_type, "tcp_src") == 0 && tcp_src_initialized) || + (strcmp(port_type, "tcp_dst") == 0 && tcp_dst_initialized) || + (strcmp(port_type, "udp_src") == 0 && udp_src_initialized) || + (strcmp(port_type, "udp_dst") == 0 && udp_dst_initialized)) { + return 0; + } + + /* Reset counter */ + *ports_count = 0; + + /* If no ports string provided, return */ + if (!ports_str || !ports_str[0]) { + ESP_LOGI(TAG, "No %s ports configured", port_type); + return 0; + } + + char port_buf[6]; /* Max 5 digits for a port + null terminator */ + int port_buf_idx = 0; + + for (int i = 0; ports_str[i] != '\0' && *ports_count < max_ports; i++) { + if (isdigit((unsigned char)ports_str[i])) { /* Fix: cast to unsigned char */ + port_buf[port_buf_idx++] = ports_str[i]; + if (port_buf_idx >= sizeof(port_buf) - 1) { + port_buf_idx = sizeof(port_buf) - 2; /* Prevent overflow */ + } + } else if (ports_str[i] == ',') { + if (port_buf_idx > 0) { + port_buf[port_buf_idx] = '\0'; + ports_array[(*ports_count)++] = atoi(port_buf); + port_buf_idx = 0; + } + } + } + + /* Process the last port if there's no trailing comma */ + if (port_buf_idx > 0) { + port_buf[port_buf_idx] = '\0'; + ports_array[(*ports_count)++] = atoi(port_buf); + } + + /* Log the results */ + ESP_LOGI(TAG, "Initialized %d allowed %s ports:", *ports_count, port_type); + for (int i = 0; i < *ports_count; i++) { + ESP_LOGI(TAG, " - Port %d", ports_array[i]); + } + + /* Mark as initialized */ + if (strcmp(port_type, "tcp_src") == 0) { + tcp_src_initialized = true; + } else if (strcmp(port_type, "tcp_dst") == 0) { + tcp_dst_initialized = true; + } else if (strcmp(port_type, "udp_src") == 0) { + udp_src_initialized = true; + } else if (strcmp(port_type, "udp_dst") == 0) { + udp_dst_initialized = true; + } + + return 0; +} + + +static int init_allowed_tcp_ports(const char *ports_str_src, const char *ports_str_dst) { + int ret1 = 0, ret2 = 0; + + if (ports_str_src && strlen(ports_str_src) > 0) { + ESP_LOGI(TAG, "Host reserved TCP src ports: %s", ports_str_src); + ret1 = init_allowed_ports(ports_str_src, &allowed_tcp_src_ports_count, + allowed_tcp_src_ports, MAX_ALLOWED_TCP_SRC_PORTS, "tcp_src"); + } + + if (ports_str_dst && strlen(ports_str_dst) > 0) { + ESP_LOGI(TAG, "Host reserved TCP dst ports: %s", ports_str_dst); + ret2 = init_allowed_ports(ports_str_dst, &allowed_tcp_dst_ports_count, + allowed_tcp_dst_ports, MAX_ALLOWED_TCP_DST_PORTS, "tcp_dst"); + } + + if (ret1) { + ESP_LOGE(TAG, "Failed to initialize allowed TCP src ports"); + return ret1; + } + if (ret2) { + ESP_LOGE(TAG, "Failed to initialize allowed TCP dst ports"); + return ret2; + } + return 0; +} + +static int init_allowed_udp_ports(const char *ports_str_src, const char *ports_str_dst) { + int ret1=0, ret2=0; + if (ports_str_src && strlen(ports_str_src) > 0) { + ESP_LOGI(TAG, "host reserved udp src ports: %s", ports_str_src); + ret1 = init_allowed_ports(ports_str_src, &allowed_udp_src_ports_count, allowed_udp_src_ports, MAX_ALLOWED_UDP_SRC_PORTS, "udp_src"); + } + if (ports_str_dst && strlen(ports_str_dst) > 0) { + ESP_LOGI(TAG, "host reserved udp dst ports: %s", ports_str_dst); + ret2 = init_allowed_ports(ports_str_dst, &allowed_udp_dst_ports_count, allowed_udp_dst_ports, MAX_ALLOWED_UDP_DST_PORTS, "udp_dst"); + } + + if (ret1) { + ESP_LOGE(TAG, "Failed to initialize allowed udp src ports"); + return ret1; + } + if (ret2) { + ESP_LOGE(TAG, "Failed to initialize allowed udp dst ports"); + return ret2; + } + return 0; +} + +static int punch_hole_for_host_ports_from_config(const char *ports_str_tcp_src, + const char *ports_str_tcp_dst, + const char *ports_str_udp_src, + const char *ports_str_udp_dst) { + int ret1 = 0, ret2 = 0; + + ESP_LOGI(TAG, "Host reserved TCP src ports: %s", + ports_str_tcp_src && strlen(ports_str_tcp_src) > 0 ? ports_str_tcp_src : "none"); + ESP_LOGI(TAG, "Host reserved TCP dst ports: %s", + ports_str_tcp_dst && strlen(ports_str_tcp_dst) > 0 ? ports_str_tcp_dst : "none"); + ret1 = init_allowed_tcp_ports(ports_str_tcp_src, ports_str_tcp_dst); + + ESP_LOGI(TAG, "Host reserved UDP src ports: %s", + ports_str_udp_src && strlen(ports_str_udp_src) > 0 ? ports_str_udp_src : "none"); + ESP_LOGI(TAG, "Host reserved UDP dst ports: %s", + ports_str_udp_dst && strlen(ports_str_udp_dst) > 0 ? ports_str_udp_dst : "none"); + ret2 = init_allowed_udp_ports(ports_str_udp_src, ports_str_udp_dst); + + if (ret1) { + ESP_LOGE(TAG, "Failed to initialize allowed TCP ports"); + return ret1; + } + if (ret2) { + ESP_LOGE(TAG, "Failed to initialize allowed UDP ports"); + return ret2; + } + return 0; +} + +/* Port filtering functions */ +static inline bool is_tcp_src_port_allowed(uint16_t port) { + for (int i = 0; i < allowed_tcp_src_ports_count; i++) { + if (port == allowed_tcp_src_ports[i]) { + return true; + } + } + return false; +} + +static inline bool is_tcp_dst_port_allowed(uint16_t port) { + for (int i = 0; i < allowed_tcp_dst_ports_count; i++) { + if (port == allowed_tcp_dst_ports[i]) { + return true; + } + } + return false; +} + +static inline bool is_udp_src_port_allowed(uint16_t port) { + for (int i = 0; i < allowed_udp_src_ports_count; i++) { + if (port == allowed_udp_src_ports[i]) { + return true; + } + } + return false; +} + +static inline bool is_udp_dst_port_allowed(uint16_t port) { + for (int i = 0; i < allowed_udp_dst_ports_count; i++) { + if (port == allowed_udp_dst_ports[i]) { + return true; + } + } + return false; +} + +static bool host_mqtt_wakeup_triggered(const void *payload, uint16_t payload_length) +{ + /* Check if payload contains "wakeup-host" string */ + if (payload_length >= strlen(WAKEUP_HOST_STRING) && + memcmp(payload, WAKEUP_HOST_STRING, strlen(WAKEUP_HOST_STRING)) == 0) { + return true; + } + return false; +} + +static int is_local_tcp_port_open(uint16_t port) +{ + uint64_t current_time = esp_timer_get_time() >> 10; /* Approx ms */ + + /* Return cached result if within 1 sec window */ + if (tcp_cache.last_port == port && + (current_time - tcp_cache.last_check_time) < 1000) { + tcp_cache.last_check_time = current_time; + return tcp_cache.last_result; + } + + /* Use LWIP protection for thread safety */ + SYS_ARCH_DECL_PROTECT(old_level); + SYS_ARCH_PROTECT(old_level); + + int found = 0; + struct tcp_pcb *pcb; + for(pcb = tcp_listen_pcbs.pcbs; pcb != NULL; pcb = pcb->next) { + if (pcb->local_port == port) { + found = 1; + break; + } + } + + SYS_ARCH_UNPROTECT(old_level); + + /* Cache the result */ + tcp_cache.last_check_time = current_time; + tcp_cache.last_result = found; + tcp_cache.last_port = port; + + ESP_LOGI(TAG, "is_local_tcp_port (%u) open: %d", port, found); + return found; +} + +static int is_local_udp_port_open(uint16_t port) +{ + uint64_t current_time = esp_timer_get_time() >> 10; /* Approx ms */ + + /* Return cached result if within 1 sec window */ + if (udp_cache.last_port == port && + (current_time - udp_cache.last_check_time) < 1000) { + udp_cache.last_check_time = current_time; + return udp_cache.last_result; + } + + /* Use LWIP protection for thread safety */ + SYS_ARCH_DECL_PROTECT(old_level); + SYS_ARCH_PROTECT(old_level); + + int found = 0; + struct udp_pcb *pcb; + for(pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) { + if (pcb->local_port == port) { + found = 1; + break; + } + } + + SYS_ARCH_UNPROTECT(old_level); + + /* Cache the result */ + udp_cache.last_check_time = current_time; + udp_cache.last_result = found; + udp_cache.last_port = port; + + ESP_LOGI(TAG, "is_local_udp_port (%u) open: %d", port, found); + return found; +} + +hosted_l2_bridge filter_and_route_packet(void *frame_data, uint16_t frame_length) +{ + hosted_l2_bridge result = DEFAULT_LWIP_TO_SEND; + + struct eth_hdr *ethhdr = (struct eth_hdr *)frame_data; + struct ip_hdr *iphdr; + u8_t proto; + u16_t dst_port = 0; + u16_t src_port = 0; + + /* Check if the frame is a MAC broadcast */ + if (ethhdr->dest.addr[0] & 0x01) { + result = SLAVE_LWIP_BRIDGE; + return result; + } + + /* Check if the frame contains an IP packet */ + if (lwip_ntohs(ethhdr->type) == ETHTYPE_IP) { + ESP_LOGV(TAG, "new ip packet"); + + /* Get the IP header */ + iphdr = (struct ip_hdr *)((u8_t *)frame_data + SIZEOF_ETH_HDR); + /* Get the protocol from the IP header */ + proto = IPH_PROTO(iphdr); + + if (proto == IP_PROTO_TCP) { + struct tcp_hdr *tcphdr = (struct tcp_hdr *)((u8_t *)iphdr + IPH_HL(iphdr) * 4); + dst_port = lwip_ntohs(tcphdr->dest); + src_port = lwip_ntohs(tcphdr->src); + + ESP_LOGV(TAG, "dst_port: %u, src_port: %u", dst_port, src_port); + + /* Check for allowed ports (SSH, RTSP, etc.) */ + if (is_tcp_src_port_allowed(src_port) || is_tcp_dst_port_allowed(dst_port)) { + ESP_LOGV(TAG, "Priority tcp port traffic detected, forwarding to host"); + result = HOST_LWIP_BRIDGE; + return result; + } + + /* Check for iperf port */ + if (dst_port == DEFAULT_IPERF_PORT) { + ESP_LOGV(TAG, "iperf pkt %u", DEFAULT_IPERF_PORT); + if (is_local_tcp_port_open(dst_port)) { + result = SLAVE_LWIP_BRIDGE; + return result; + } else if (!is_host_power_saving()) { + result = HOST_LWIP_BRIDGE; + return result; + } + } + + if (IS_REMOTE_TCP_PORT(dst_port)) { + if (is_host_power_saving()) { + /* filter host destined mqtt packet says 'wake-up-host' */ + if (src_port == MQTT_PORT) { + #define TCP_HDR_LEN(tcphdr) ((TCPH_FLAGS(tcphdr) >> 12) * 4) + + u16_t tcp_hdr_len = TCP_HDR_LEN(tcphdr); + u16_t mqtt_payload_length = lwip_ntohs(tcphdr->wnd); + u8_t *mqtt_payload = (u8_t *)tcphdr + tcp_hdr_len; + + if (host_mqtt_wakeup_triggered(mqtt_payload, mqtt_payload_length)) { + ESP_LOGV(TAG, "Wakeup host: MQTT wakeup pkt"); + result = HOST_LWIP_BRIDGE; + return result; + } else { + /* drop any other host destined mqtt packet */ + result = INVALID_BRIDGE; + ESP_LOGW(TAG, "mqtt pkt DROPPED dst %u src %u => lwip %u", dst_port, src_port, result); + return result; + } + } else { + ESP_LOGV(TAG, "Wakeup host: TCP pkt"); + result = INVALID_BRIDGE; + ESP_LOGW(TAG, "host pkt dropped in power save (dst %u src %u)", dst_port, src_port); + return result; + } + } else { + /* As host is not sleeping, send packets freely */ + result = HOST_LWIP_BRIDGE; + return result; + } + } else if (IS_LOCAL_TCP_PORT(dst_port)) { + result = SLAVE_LWIP_BRIDGE; + return result; + } + + } else if (proto == IP_PROTO_UDP) { + ESP_LOGV(TAG, "new udp packet"); + struct udp_hdr *udphdr = (struct udp_hdr *)((u8_t *)iphdr + IPH_HL(iphdr) * 4); + dst_port = lwip_ntohs(udphdr->dest); + src_port = lwip_ntohs(udphdr->src); + + ESP_LOGV(TAG, "UDP dst_port: %u, src_port: %u", dst_port, src_port); + + /* Check for allowed ports */ + if (is_udp_src_port_allowed(src_port) || is_udp_dst_port_allowed(dst_port)) { + ESP_LOGV(TAG, "Priority udp port traffic detected, forwarding to host"); + result = HOST_LWIP_BRIDGE; + return result; + } + + /* Check for iperf UDP port */ + if (dst_port == DEFAULT_IPERF_PORT) { + ESP_LOGV(TAG, "Detected iperf UDP packet on port %u", DEFAULT_IPERF_PORT); + if (is_local_udp_port_open(dst_port)) { + result = SLAVE_LWIP_BRIDGE; + return result; + } else if (!is_host_power_saving()) { + result = HOST_LWIP_BRIDGE; + return result; + } + } + + if (dst_port == LWIP_IANA_PORT_DHCP_CLIENT) { + result = DHCP_LWIP_BRIDGE; + return result; + } + + if (IS_REMOTE_UDP_PORT(dst_port)) { + if (is_host_power_saving()) { + ESP_LOGW(TAG, "host pkt dropped in power save (dst %u src %u)", dst_port, src_port); + result = INVALID_BRIDGE; + return result; + } else { + result = HOST_LWIP_BRIDGE; + return result; + } + } else if (IS_LOCAL_UDP_PORT(dst_port)) { + result = SLAVE_LWIP_BRIDGE; + return result; + } + + } else if (proto == IP_PROTO_ICMP) { + ESP_LOGV(TAG, "new icmp packet"); + struct icmp_echo_hdr *icmphdr = (struct icmp_echo_hdr *)((u8_t *)iphdr + IPH_HL(iphdr) * 4); + if (icmphdr->type == ICMP_ECHO) { + /* ping request */ + result = SLAVE_LWIP_BRIDGE; + return result; + } else if (icmphdr->type == ICMP_ER) { + if (is_host_power_saving()) { + result = SLAVE_LWIP_BRIDGE; + return result; + } else { + /* ping response */ + ESP_HEXLOGV("icmp_er", frame_data, frame_length, 64); + result = BOTH_LWIP_BRIDGE; + return result; + } + } + } + + } else if (lwip_ntohs(ethhdr->type) == ETHTYPE_ARP) { + ESP_LOGV(TAG, "new arp packet"); + struct etharp_hdr *arphdr = (struct etharp_hdr *)((u8_t *)frame_data + SIZEOF_ETH_HDR); + + if (arphdr->opcode == lwip_htons(ARP_REQUEST)) { + result = SLAVE_LWIP_BRIDGE; + return result; + } else { + if (is_host_power_saving()) { + result = SLAVE_LWIP_BRIDGE; + return result; + } else { + ESP_HEXLOGV("arp_reply", frame_data, frame_length, 64); + result = BOTH_LWIP_BRIDGE; + return result; + } + } + } + + return result; +} + +int configure_host_static_port_forwarding_rules(const char *ports_str_tcp_src, const char *ports_str_tcp_dst, const char *ports_str_udp_src, const char *ports_str_udp_dst) { + return punch_hole_for_host_ports_from_config(ports_str_tcp_src, ports_str_tcp_dst, ports_str_udp_src, ports_str_udp_dst); +} +#endif diff --git a/slave/main/lwip_filter.h b/slave/main/lwip_filter.h new file mode 100644 index 00000000..7d7fc075 --- /dev/null +++ b/slave/main/lwip_filter.h @@ -0,0 +1,29 @@ +/* + * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef __LWIP_FILTER_H__ +#define __LWIP_FILTER_H__ + +#include +#include +#include + +typedef enum { + SLAVE_LWIP_BRIDGE, + HOST_LWIP_BRIDGE, + BOTH_LWIP_BRIDGE, + INVALID_BRIDGE, +} hosted_l2_bridge; + +#if defined(CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED) && defined(CONFIG_LWIP_ENABLE) +#include "esp_hosted_lwip_src_port_hook.h" + +hosted_l2_bridge filter_and_route_packet(void *frame_data, uint16_t frame_length); + +int configure_host_static_port_forwarding_rules(const char *ports_str_tcp_src, const char *ports_str_tcp_dst, + const char *ports_str_udp_src, const char *ports_str_udp_dst); +#endif + +#endif diff --git a/slave/main/mempool.c b/slave/main/mempool.c index 5ed61662..5e38bfd8 100644 --- a/slave/main/mempool.c +++ b/slave/main/mempool.c @@ -16,6 +16,7 @@ #include "mempool.h" #include "esp_log.h" +#include "sdkconfig.h" const char *TAG = "HS_MP"; @@ -33,7 +34,7 @@ struct hosted_mempool * hosted_mempool_create(void *pre_allocated_mem, if (!pre_allocated_mem) { /* no pre-allocated mem, allocate new */ - heap = (uint8_t *)CALLOC(1, MEMPOOL_ALIGNED(OS_MEMPOOL_BYTES( + heap = (uint8_t *)MEM_ALLOC(MEMPOOL_ALIGNED(OS_MEMPOOL_BYTES( num_blocks,block_size))); if (!heap) { ESP_LOGE(TAG, "mempool create failed, no mem\n"); @@ -101,6 +102,7 @@ void hosted_mempool_destroy(struct hosted_mempool *mempool) ESP_LOGI(MEM_TAG, "Destroy mempool %p num_blk[%lu] blk_size:[%lu]", mempool->pool, mempool->num_blocks, mempool->block_size); #endif + os_mempool_unregister(mempool->pool); FREE(mempool->pool); if (!mempool->static_heap) @@ -116,8 +118,10 @@ void * hosted_mempool_alloc(struct hosted_mempool *mempool, void *mem = NULL; #ifdef CONFIG_ESP_CACHE_MALLOC - if (!mempool) + if (!mempool) { + ESP_LOGE(TAG, "mempool %p is NULL", mempool); return NULL; + } #if MYNEWT_VAL(OS_MEMPOOL_CHECK) assert(mempool->heap); @@ -137,16 +141,22 @@ void * hosted_mempool_alloc(struct hosted_mempool *mempool, if (mem && need_memset) memset(mem, 0, nbytes); + if (!mem) { + ESP_LOGE(TAG, "mempool %p alloc failed nbytes[%u]", mempool, nbytes); + } return mem; } int hosted_mempool_free(struct hosted_mempool *mempool, void *mem) { - if (!mem) + if (!mem) { return 0; + } #ifdef CONFIG_ESP_CACHE_MALLOC - if (!mempool) + if (!mempool) { + ESP_LOGE(TAG, "%s: mempool %p is NULL", __func__, mempool); return MEMPOOL_FAIL; + } #if MYNEWT_VAL(OS_MEMPOOL_CHECK) assert(mempool->heap); diff --git a/slave/main/mempool_ll.c b/slave/main/mempool_ll.c index fbb15ff9..d60286b7 100644 --- a/slave/main/mempool_ll.c +++ b/slave/main/mempool_ll.c @@ -191,6 +191,12 @@ os_mempool_ext_clear(struct os_mempool_ext *mpe) return os_mempool_clear(&mpe->mpe_mp); } +void +os_mempool_unregister(struct os_mempool *mp) +{ + STAILQ_REMOVE(&g_os_hosted_mempool_list, mp, os_mempool, mp_list); +} + bool os_mempool_is_sane(const struct os_mempool *mp) { diff --git a/slave/main/mempool_ll.h b/slave/main/mempool_ll.h index 739923f2..8fbf08bd 100644 --- a/slave/main/mempool_ll.h +++ b/slave/main/mempool_ll.h @@ -268,16 +268,25 @@ os_error_t os_mempool_ext_init(struct os_mempool_ext *mpe, uint16_t blocks, uint32_t block_size, void *membuf, const char *name); /** - * Clears a memory pool. + * Clear a memory pool. * - * @param mp The mempool to clear. + * @param mp The mempool to clear. * - * @return os_error_t + * @return 0 on success, error code on failure. */ os_error_t os_mempool_clear(struct os_mempool *mp); /** - * Clears an extended memory pool. + * Unregister a memory pool. + * + * @param mp The mempool to unregister. + * + * @return 0 on success, error code on failure. + */ +void os_mempool_unregister(struct os_mempool *mp); + +/** + * Clear an extended memory pool. * * @param mpe The extended memory pool to clear. * diff --git a/slave/main/mqtt_example.c b/slave/main/mqtt_example.c new file mode 100644 index 00000000..accb4420 --- /dev/null +++ b/slave/main/mqtt_example.c @@ -0,0 +1,279 @@ +/* + * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* MQTT (over TCP) Example + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +#include +#include +#include +#include +#include "sdkconfig.h" + +#ifdef CONFIG_ESP_HOSTED_COPROCESSOR_EXAMPLE_MQTT + +#include "esp_wifi.h" +#include "esp_system.h" +#include "nvs_flash.h" +#include "esp_event.h" +#include "esp_netif.h" +//#include "protocol_examples_common.h" + +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "freertos/semphr.h" +#include "freertos/queue.h" + + +#include "esp_log.h" +#include "mqtt_client.h" +#include "host_power_save.h" + +#include "lwip/sockets.h" +#include "lwip/dns.h" +#include "lwip/netdb.h" + +static const char *TAG = "mqtt_example"; +static esp_mqtt_client_handle_t client; +static uint8_t client_started; + +#define WAKEUP_HOST_STRING "wakeup-host" + +static void log_error_if_nonzero(const char *message, int error_code) +{ + if (error_code != 0) { + ESP_LOGE(TAG, "Last error %s: 0x%x", message, error_code); + } +} + +static bool host_mqtt_wakeup_triggered(const void *payload, uint16_t payload_length) +{ + /* Check if payload contains "wakeup-host" string */ + if (payload_length >= strlen(WAKEUP_HOST_STRING) && + memcmp(payload, WAKEUP_HOST_STRING, strlen(WAKEUP_HOST_STRING)) == 0) { + return true; + } + return false; +} + +/* + * @brief Event handler registered to receive MQTT events + * + * This function is called by the MQTT client event loop. + * + * @param handler_args user data registered to the event. + * @param base Event base for the handler(always MQTT Base in this example). + * @param event_id The id for the received event. + * @param event_data The data for the event, esp_mqtt_event_handle_t. + */ +static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data) +{ + ESP_LOGD(TAG, "Event dispatched from event loop base=%s, event_id=%" PRIi32 "", base, event_id); + esp_mqtt_event_handle_t event = event_data; + esp_mqtt_client_handle_t client = event->client; + int msg_id; + switch ((esp_mqtt_event_id_t)event_id) { + case MQTT_EVENT_CONNECTED: + ESP_LOGI(TAG, "MQTT_EVENT_CONNECTED"); + msg_id = esp_mqtt_client_publish(client, "/topic/qos1", "data_3", 0, 1, 0); + ESP_LOGI(TAG, "sent publish successful, msg_id=%d", msg_id); + + msg_id = esp_mqtt_client_subscribe(client, "/topic/qos0", 0); + ESP_LOGI(TAG, "sent subscribe successful, msg_id=%d", msg_id); + + msg_id = esp_mqtt_client_subscribe(client, "/topic/qos1", 1); + ESP_LOGI(TAG, "sent subscribe successful, msg_id=%d", msg_id); + + msg_id = esp_mqtt_client_unsubscribe(client, "/topic/qos1"); + ESP_LOGI(TAG, "sent unsubscribe successful, msg_id=%d", msg_id); + break; + case MQTT_EVENT_DISCONNECTED: + ESP_LOGI(TAG, "MQTT_EVENT_DISCONNECTED"); + break; + + case MQTT_EVENT_SUBSCRIBED: + ESP_LOGI(TAG, "MQTT_EVENT_SUBSCRIBED, msg_id=%d", event->msg_id); + msg_id = esp_mqtt_client_publish(client, "/topic/qos0", "data", 0, 0, 0); + ESP_LOGI(TAG, "sent publish successful, msg_id=%d", msg_id); + break; + case MQTT_EVENT_UNSUBSCRIBED: + ESP_LOGI(TAG, "MQTT_EVENT_UNSUBSCRIBED, msg_id=%d", event->msg_id); + break; + case MQTT_EVENT_PUBLISHED: + ESP_LOGI(TAG, "MQTT_EVENT_PUBLISHED, msg_id=%d", event->msg_id); + break; + case MQTT_EVENT_DATA: + ESP_LOGI(TAG, "MQTT_EVENT_DATA"); + printf("TOPIC=%.*s\r\n", event->topic_len, event->topic); + printf("DATA=%.*s\r\n", event->data_len, event->data); + + if (host_mqtt_wakeup_triggered(event->data, event->data_len)) { + wakeup_host(portMAX_DELAY); + } + break; + case MQTT_EVENT_ERROR: + ESP_LOGI(TAG, "MQTT_EVENT_ERROR"); + if (event->error_handle->error_type == MQTT_ERROR_TYPE_TCP_TRANSPORT) { + log_error_if_nonzero("reported from esp-tls", event->error_handle->esp_tls_last_esp_err); + log_error_if_nonzero("reported from tls stack", event->error_handle->esp_tls_stack_err); + log_error_if_nonzero("captured as transport's socket errno", event->error_handle->esp_transport_sock_errno); + ESP_LOGI(TAG, "Last errno string (%s)", strerror(event->error_handle->esp_transport_sock_errno)); + + } + break; + default: + ESP_LOGI(TAG, "Other event id:%d", event->event_id); + break; + } +} + +#if 0 +static int check_ip_reachability(const char *ip, int port) +{ + int sock; + struct sockaddr_in server; + + // Create socket + sock = socket(AF_INET, SOCK_STREAM, 0); + if (sock == -1) { + printf("Could not create socket\n"); + return ESP_FAIL; + } + + // Configure the server address + server.sin_addr.s_addr = inet_addr(ip); + server.sin_family = AF_INET; + server.sin_port = htons(port); + + // Set a timeout for the connection attempt + struct timeval timeout; + timeout.tv_sec = 5; // 5 seconds timeout + timeout.tv_usec = 0; + setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char*)&timeout, sizeof(timeout)); + + // Try to connect to the server + if (connect(sock, (struct sockaddr *)&server, sizeof(server)) < 0) { + printf("Connection to %s on port %d failed\n", ip, port); + close(sock); + return ESP_FAIL; + } + + printf("Successfully connected to %s on port %d\n", ip, port); + close(sock); + return ESP_OK; +} +#endif + +static esp_mqtt_client_handle_t example_mqtt_init_internal(void) +{ + esp_mqtt_client_config_t mqtt_cfg = { + .broker.address.uri = CONFIG_BROKER_URL, + }; +#if CONFIG_BROKER_URL_FROM_STDIN + char line[128]; + + if (strcmp(mqtt_cfg.broker.address.uri, "FROM_STDIN") == 0) { + int count = 0; + printf("Please enter url of mqtt broker\n"); + while (count < 128) { + int c = fgetc(stdin); + if (c == '\n') { + line[count] = '\0'; + break; + } else if (c > 0 && c < 127) { + line[count] = c; + ++count; + } + vTaskDelay(10 / portTICK_PERIOD_MS); + } + mqtt_cfg.broker.address.uri = line; + printf("Broker url: %s\n", line); + } else { + ESP_LOGE(TAG, "Configuration mismatch: wrong broker url"); + abort(); + } +#endif /* CONFIG_BROKER_URL_FROM_STDIN */ + + client = esp_mqtt_client_init(&mqtt_cfg); + /* The last argument may be used to pass data to the event handler, in this example mqtt_event_handler */ + esp_mqtt_client_register_event(client, ESP_EVENT_ANY_ID, mqtt_event_handler, NULL); + + return client; +} + +esp_err_t example_mqtt_init(void) +{ +#if 0 + esp_err_t err; + err = check_ip_reachability("8.8.8.8", 53); + if (err) { + ESP_LOGI(TAG, "Failed to start the mqtt"); + return NULL; + } +#endif + + ESP_LOGI(TAG, "[APP] Startup.."); + ESP_LOGI(TAG, "[APP] Free memory: %" PRIu32 " bytes", esp_get_free_heap_size()); + ESP_LOGI(TAG, "[APP] IDF version: %s", esp_get_idf_version()); + + esp_log_level_set("*", ESP_LOG_INFO); + esp_log_level_set("mqtt_client", ESP_LOG_VERBOSE); + esp_log_level_set("mqtt_example", ESP_LOG_VERBOSE); + esp_log_level_set("transport_base", ESP_LOG_VERBOSE); + esp_log_level_set("esp-tls", ESP_LOG_VERBOSE); + esp_log_level_set("transport", ESP_LOG_VERBOSE); + esp_log_level_set("outbox", ESP_LOG_VERBOSE); + + example_mqtt_init_internal(); + + if (client) + return ESP_OK; + else + return ESP_FAIL; +} + +esp_err_t example_mqtt_resume(void) +{ + if (!client) { + example_mqtt_init(); + } + + if (client && !client_started) { + client_started = 1; + ESP_LOGV(TAG, "mqtt client started"); + return esp_mqtt_client_start(client); + } + ESP_LOGV(TAG, "%s : client[%p] client_started[%u]", + __func__, client, client_started); + + return ESP_OK; +} + +esp_err_t example_mqtt_pause(void) +{ + if (client && client_started) { + client_started = 0; + ESP_LOGV(TAG, "mqtt client stopped"); + return esp_mqtt_client_stop(client); +#if 0 + if (ESP_OK == esp_mqtt_client_destroy(client)) { + client = NULL; + } +#endif + } + ESP_LOGV(TAG, "%s : client[%p] client_started[%u]", + __func__, client, client_started); + + return ESP_OK; +} + + +#endif diff --git a/slave/main/mqtt_example.h b/slave/main/mqtt_example.h new file mode 100644 index 00000000..354afb39 --- /dev/null +++ b/slave/main/mqtt_example.h @@ -0,0 +1,23 @@ +/* + * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/* MQTT (over TCP) Example + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ +#ifndef __MQTT_EXAMPLE_H__ +#define __MQTT_EXAMPLE_H__ + +#ifdef CONFIG_ESP_HOSTED_COPROCESSOR_EXAMPLE_MQTT +esp_err_t example_mqtt_init(void); +esp_err_t example_mqtt_resume(void); +esp_err_t example_mqtt_pause(void); +#endif +#endif + diff --git a/slave/main/protocomm_pserial.c b/slave/main/protocomm_pserial.c index 63f3227c..c7eb00b6 100644 --- a/slave/main/protocomm_pserial.c +++ b/slave/main/protocomm_pserial.c @@ -25,6 +25,7 @@ #include #include "protocomm_pserial.h" #include "esp_hosted_transport.h" +#include "esp_hosted_log.h" static const char TAG[] = "protocomm_pserial"; @@ -92,7 +93,7 @@ static esp_err_t compose_tlv(char *epname, uint8_t **out, size_t *outlen) ep_len + SIZE_OF_TYPE + SIZE_OF_LENGTH + *outlen; uint8_t *buf = (uint8_t *)calloc(1, buf_len); if (buf == NULL) { - ESP_LOGE(TAG,"%s Failed to allocate memory", __func__); + ESP_LOGE(TAG,"%s Mem Alloc Failed [%d]bytes", __func__, (int)buf_len); return ESP_FAIL; } buf[len] = PROTO_PSER_TLV_T_EPNAME; @@ -283,6 +284,7 @@ static void pserial_task(void *params) if ((arg.msg_id > RPC_ID__Event_Base) && (arg.msg_id < RPC_ID__Event_Max)) { /* Events */ + ESP_HEXLOGV("pserial_evt_rx", arg.data, arg.len, 32); ret = rpc_evt_handler(pc, arg.data, arg.len, arg.msg_id); if (ret) ESP_LOGI(TAG, "protobuf rpc event handling failed %d\n", ret); @@ -290,7 +292,7 @@ static void pserial_task(void *params) /* Request */ len = pserial_cfg->recv(arg.data, arg.len); if (len) { - /*ESP_LOG_BUFFER_HEXDUMP("serial_rx", arg.data, len<16?len:16, ESP_LOG_INFO);*/ + ESP_HEXLOGV("pserial_req_rx", arg.data, arg.len, 32); ret = rpc_req_handler(pc, arg.data, len); if (ret) ESP_LOGI(TAG, "protocom rpc req handling failed %d\n", ret); @@ -326,8 +328,11 @@ esp_err_t protocomm_pserial_start(protocomm_t *pc, pc->priv = pserial_cfg; - xTaskCreate(pserial_task, "pserial_task", 1024*5, - (void *) pc, CONFIG_ESP_DEFAULT_TASK_PRIO, NULL); +#define ESP_HOSTED_PROTOBUF_TASK_STACK_SIZE (CONFIG_ESP_HOSTED_DEFAULT_TASK_STACK_SIZE+1024) + + xTaskCreate(pserial_task, "pserial_task", + ESP_HOSTED_PROTOBUF_TASK_STACK_SIZE, + (void *) pc, CONFIG_ESP_HOSTED_DEFAULT_TASK_PRIORITY, NULL); return ESP_OK; } diff --git a/slave/main/sdio_slave_api.c b/slave/main/sdio_slave_api.c index 3207d915..cb243c54 100644 --- a/slave/main/sdio_slave_api.c +++ b/slave/main/sdio_slave_api.c @@ -1,17 +1,8 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -30,21 +21,23 @@ #include "esp_hosted_header.h" #include "esp_hosted_transport.h" #include "esp_hosted_transport_init.h" +#include "host_power_save.h" +#include "esp_hosted_coprocessor_fw_ver.h" //#define SIMPLIFIED_SDIO_SLAVE 1 -#define SDIO_SLAVE_QUEUE_SIZE 20 -#define BUFFER_SIZE MAX_TRANSPORT_BUF_SIZE -#define BUFFER_NUM 20 -static uint8_t sdio_slave_rx_buffer[BUFFER_NUM][BUFFER_SIZE]; +#define SDIO_DRIVER_TX_QUEUE_SIZE CONFIG_ESP_SDIO_TX_Q_SIZE +#define SDIO_RX_BUFFER_SIZE MAX_TRANSPORT_BUF_SIZE +#define SDIO_NUM_RX_BUFFERS CONFIG_ESP_SDIO_RX_Q_SIZE +static uint8_t sdio_slave_rx_buffer[SDIO_NUM_RX_BUFFERS][SDIO_RX_BUFFER_SIZE]; -#define SDIO_MEMPOOL_NUM_BLOCKS 40 +/* TODO: Need to cross check once in priority queue properly handled */ +#define SDIO_MEMPOOL_NUM_BLOCKS 40 static struct hosted_mempool * buf_mp_tx_g; interface_context_t context; interface_handle_t if_handle_g; -static const char TAG[] = "SDIO_SLAVE"; - -#define SDIO_RX_QUEUE_SIZE CONFIG_ESP_SDIO_RX_Q_SIZE +static const char *TAG = "SDIO_SLAVE"; +static uint8_t hosted_constructs_created = 0; #if !SIMPLIFIED_SDIO_SLAVE static SemaphoreHandle_t sdio_rx_sem; @@ -93,7 +86,7 @@ if_ops_t if_ops = { static inline void sdio_mempool_create(void) { - buf_mp_tx_g = hosted_mempool_create(NULL, 0, SDIO_MEMPOOL_NUM_BLOCKS, BUFFER_SIZE); + buf_mp_tx_g = hosted_mempool_create(NULL, 0, SDIO_MEMPOOL_NUM_BLOCKS, SDIO_RX_BUFFER_SIZE); #ifdef CONFIG_ESP_CACHE_MALLOC assert(buf_mp_tx_g); #endif @@ -107,7 +100,7 @@ static inline void sdio_mempool_destroy(void) static inline void *sdio_buffer_tx_alloc(size_t nbytes, uint need_memset) { /* TODO: When Mempool is not needed, SDIO should use - * exact bytes for allocation instead of BUFFER_SIZE + * exact bytes for allocation instead of SDIO_RX_BUFFER_SIZE * To reduce strain on system memory */ return hosted_mempool_alloc(buf_mp_tx_g, nbytes, need_memset); } @@ -131,14 +124,15 @@ static void start_rx_data_throttling_if_needed(void) queue_load = uxQueueMessagesWaiting(sdio_rx_queue[PRIO_Q_OTHERS]); -#if ESP_PKT_STATS - pkt_stats.slave_wifi_rx_msg_loaded = queue_load; -#endif - load_percent = (queue_load*100/SDIO_RX_QUEUE_SIZE); + load_percent = (queue_load*100/SDIO_NUM_RX_BUFFERS); if (load_percent > slv_cfg_g.throttle_high_threshold) { slv_state_g.current_throttling = 1; ESP_LOGV(TAG, "start data throttling at host"); +#if ESP_PKT_STATS + pkt_stats.sta_flowctrl_on++; +#endif + sdio_slave_send_host_int(HOST_INT_START_THROTTLE); } } @@ -152,14 +146,14 @@ static void stop_rx_data_throttling_if_needed(void) if (slv_state_g.current_throttling) { queue_load = uxQueueMessagesWaiting(sdio_rx_queue[PRIO_Q_OTHERS]); -#if ESP_PKT_STATS - pkt_stats.slave_wifi_rx_msg_loaded = queue_load; -#endif - load_percent = (queue_load*100/SDIO_RX_QUEUE_SIZE); + load_percent = (queue_load*100/SDIO_NUM_RX_BUFFERS); if (load_percent < slv_cfg_g.throttle_low_threshold) { slv_state_g.current_throttling = 0; ESP_LOGV(TAG, "stop data throttling at host"); +#if ESP_PKT_STATS + pkt_stats.sta_flowctrl_off++; +#endif sdio_slave_send_host_int(HOST_INT_STOP_THROTTLE); } } @@ -187,13 +181,31 @@ int interface_remove_driver() IRAM_ATTR static void event_cb(uint8_t val) { if (val == ESP_RESET) { + /* Force power save off state when host resets */ + host_power_save_alert(ESP_POWER_SAVE_OFF); sdio_reset(&if_handle_g); return; } + if (val == ESP_OPEN_DATA_PATH) { + /* Also force power save off on data path open */ + host_power_save_alert(ESP_POWER_SAVE_OFF); + sdio_reset(&if_handle_g); + } + + if (val == ESP_POWER_SAVE_OFF) { + //sdio_reset(&if_handle_g); + host_power_save_alert(ESP_POWER_SAVE_OFF); + sdio_reset(&if_handle_g); + } + if (context.event_handler) { context.event_handler(val); } + + if (val == ESP_POWER_SAVE_ON) { + sdio_reset(&if_handle_g); + } } void generate_startup_event(uint8_t cap, uint32_t ext_cap) @@ -219,6 +231,7 @@ void generate_startup_event(uint8_t cap, uint32_t ext_cap) header->if_num = 0; header->offset = htole16(sizeof(struct esp_payload_header)); header->priv_pkt_type = ESP_PACKET_TYPE_EVENT; + UPDATE_HEADER_TX_PKT_NO(header); /* Populate event data */ event = (struct esp_priv_event *) (buf_handle.payload + sizeof(struct esp_payload_header)); @@ -244,9 +257,33 @@ void generate_startup_event(uint8_t cap, uint32_t ext_cap) *pos = LENGTH_1_BYTE; pos++;len++; *pos = raw_tp_cap; pos++;len++; + *pos = ESP_PRIV_TX_Q_SIZE; pos++;len++; + *pos = LENGTH_1_BYTE; pos++;len++; + *pos = SDIO_DRIVER_TX_QUEUE_SIZE; pos++;len++; + *pos = ESP_PRIV_RX_Q_SIZE; pos++;len++; *pos = LENGTH_1_BYTE; pos++;len++; - *pos = SDIO_RX_QUEUE_SIZE; pos++;len++; + +#if !SIMPLIFIED_SDIO_SLAVE + *pos = SDIO_NUM_RX_BUFFERS; pos++;len++; +#else + *pos = 0; pos++;len++; +#endif + + // convert fw version into a uint32_t + uint32_t fw_version = ESP_HOSTED_VERSION_VAL(PROJECT_VERSION_MAJOR_1, + PROJECT_VERSION_MINOR_1, + PROJECT_VERSION_PATCH_1); + + // send fw version as a little-endian uint32_t + *pos = ESP_PRIV_FIRMWARE_VERSION; pos++;len++; + *pos = LENGTH_4_BYTE; pos++;len++; + // send fw_version as a little endian 32bit value + *pos = (fw_version & 0xff); pos++;len++; + *pos = (fw_version >> 8) & 0xff; pos++;len++; + *pos = (fw_version >> 16) & 0xff; pos++;len++; + *pos = (fw_version >> 24) & 0xff; pos++;len++; + /* TLVs end */ event->event_len = len; @@ -260,7 +297,7 @@ void generate_startup_event(uint8_t cap, uint32_t ext_cap) header->checksum = htole16(compute_checksum(buf_handle.payload, buf_handle.payload_len)); #endif - ESP_HEXLOGD("sdio_tx_init", buf_handle.payload, buf_handle.payload_len); + ESP_HEXLOGV("bus_tx_init", buf_handle.payload, buf_handle.payload_len, 32); #if !SIMPLIFIED_SDIO_SLAVE xSemaphoreTake(sdio_send_queue_sem, portMAX_DELAY); @@ -282,14 +319,16 @@ void generate_startup_event(uint8_t cap, uint32_t ext_cap) static void sdio_read_done(void *handle) { + ESP_LOGV(TAG, "sdio_read_done, reloading buf"); sdio_slave_recv_load_buf((sdio_slave_buf_handle_t) handle); } static interface_handle_t * sdio_init(void) { -#if !SIMPLIFIED_SDIO_SLAVE - uint16_t prio_q_idx = 0; -#endif + if (if_handle_g.state >= DEACTIVE) { + return &if_handle_g; + } + esp_err_t ret = ESP_OK; sdio_slave_buf_handle_t handle = {0}; sdio_slave_config_t config = { @@ -298,8 +337,8 @@ static interface_handle_t * sdio_init(void) #else .sending_mode = SDIO_SLAVE_SEND_PACKET, #endif - .send_queue_size = SDIO_SLAVE_QUEUE_SIZE, - .recv_buffer_size = BUFFER_SIZE, + .send_queue_size = SDIO_DRIVER_TX_QUEUE_SIZE, + .recv_buffer_size = SDIO_RX_BUFFER_SIZE, .event_cb = event_cb, /* Note: For small devkits there may be no pullups on the board. @@ -316,30 +355,30 @@ static interface_handle_t * sdio_init(void) #else #error Invalid SDIO bus speed selection #endif - .timing = SDIO_SLAVE_TIMING, + .timing = SDIO_SLAVE_TIMING, }; -#if CONFIG_ESP_SDIO_STREAMING_MODE +#if !SIMPLIFIED_SDIO_SLAVE + #if CONFIG_ESP_SDIO_STREAMING_MODE ESP_LOGI(TAG, "%s: sending mode: SDIO_SLAVE_SEND_STREAM", __func__); -#else + #else ESP_LOGI(TAG, "%s: sending mode: SDIO_SLAVE_SEND_PACKET", __func__); + #endif #endif -#if defined(CONFIG_IDF_TARGET_ESP32C6) - ESP_LOGI(TAG, "%s: ESP32-C6 SDIO RxQ[%d] timing[%u]\n", __func__, SDIO_RX_QUEUE_SIZE, config.timing); -#else - ESP_LOGI(TAG, "%s: ESP32 SDIO RxQ[%d] timing[%u]\n", __func__, SDIO_RX_QUEUE_SIZE, config.timing); -#endif + ESP_LOGI(TAG, "%s: ESP32 SDIO DriverTxQ[%d] timing[%u]\n", __func__, SDIO_DRIVER_TX_QUEUE_SIZE, config.timing); #if !SIMPLIFIED_SDIO_SLAVE - sdio_send_queue_sem = xSemaphoreCreateCounting(SDIO_SLAVE_QUEUE_SIZE, SDIO_SLAVE_QUEUE_SIZE); - assert(sdio_send_queue_sem); + if (hosted_constructs_created == 0) { + sdio_send_queue_sem = xSemaphoreCreateCounting(SDIO_DRIVER_TX_QUEUE_SIZE, SDIO_DRIVER_TX_QUEUE_SIZE); + assert(sdio_send_queue_sem); - sdio_rx_sem = xSemaphoreCreateCounting(SDIO_RX_QUEUE_SIZE*3, 0); - assert(sdio_rx_sem != NULL); + sdio_rx_sem = xSemaphoreCreateCounting(SDIO_NUM_RX_BUFFERS* MAX_PRIORITY_QUEUES, 0); + assert(sdio_rx_sem != NULL); - for (prio_q_idx=0; prio_q_idxif_type = buf_handle->if_type; + header->if_num = buf_handle->if_num; + header->len = htole16(buf_handle->payload_len); + header->offset = htole16(offset); + header->seq_num = htole16(buf_handle->seq_num); + header->flags = buf_handle->flag; + //header->throttle_cmd = buf_handle->flow_ctl_en; + UPDATE_HEADER_TX_PKT_NO(header); + +#if CONFIG_ESP_SDIO_CHECKSUM + header->checksum = htole16(compute_checksum(sendbuf, + offset+buf_handle->payload_len)); +#endif + + return header; +} + +static inline esp_err_t copy_tx_payload(uint8_t *sendbuf, uint8_t* payload, uint16_t len) +{ + memcpy(sendbuf + sizeof(struct esp_payload_header), payload, len); + return ESP_OK; +} + static int32_t sdio_write(interface_handle_t *handle, interface_buffer_handle_t *buf_handle) { - esp_err_t ret = ESP_OK; int32_t total_len = 0; uint8_t* sendbuf = NULL; uint16_t offset = sizeof(struct esp_payload_header); - struct esp_payload_header *header = NULL; + int ret = 0; if (!handle || !buf_handle) { ESP_LOGE(TAG , "Invalid arguments"); return ESP_FAIL; } - if (handle->state != ACTIVE) { + if (handle->state < ACTIVE) { + ESP_LOGI(TAG, "Driver state not active, drop"); return ESP_FAIL; } - if (!buf_handle->payload_len || !buf_handle->payload) { - ESP_LOGE(TAG , "Invalid arguments, len:%d", buf_handle->payload_len); + if (is_host_power_saving()) { + ESP_LOGI(TAG, "Host sleeping, drop"); + return ESP_FAIL; + } + + if (!buf_handle->payload_len && !buf_handle->payload && !buf_handle->flag) { + ESP_LOGW(TAG , "Invalid arguments, len:%d, payload:%p, flag:%d, drop", buf_handle->payload_len, buf_handle->payload, buf_handle->flag); return ESP_FAIL; } @@ -440,39 +530,29 @@ static int32_t sdio_write(interface_handle_t *handle, interface_buffer_handle_t sendbuf = sdio_buffer_tx_alloc(total_len, MEMSET_REQUIRED); if (sendbuf == NULL) { - ESP_LOGE(TAG , "send buffer[%"PRIu32"] malloc fail", total_len); + ESP_LOGE(TAG, "send buffer[%"PRIu32"] malloc fail", total_len); return ESP_FAIL; } - header = (struct esp_payload_header *) sendbuf; - - memset (header, 0, sizeof(struct esp_payload_header)); - - /* Initialize header */ - header->if_type = buf_handle->if_type; - header->if_num = buf_handle->if_num; - header->len = htole16(buf_handle->payload_len); - header->offset = htole16(offset); - header->seq_num = htole16(buf_handle->seq_num); - header->flags = buf_handle->flag; - - memcpy(sendbuf + offset, buf_handle->payload, buf_handle->payload_len); + copy_tx_payload(sendbuf, buf_handle->payload, buf_handle->payload_len); + update_tx_header(sendbuf, buf_handle); -#if CONFIG_ESP_SDIO_CHECKSUM - header->checksum = htole16(compute_checksum(sendbuf, - offset+buf_handle->payload_len)); -#endif - - ESP_HEXLOGD("sdio_tx", sendbuf, min(32,total_len)); + ESP_HEXLOGV("bus_tx", sendbuf, total_len, 32); #if !SIMPLIFIED_SDIO_SLAVE - xSemaphoreTake(sdio_send_queue_sem, portMAX_DELAY); + if (xSemaphoreTake(sdio_send_queue_sem, portMAX_DELAY) != pdTRUE) { + sdio_buffer_tx_free(sendbuf); + return ESP_FAIL; + } ret = sdio_slave_send_queue(sendbuf, total_len, sendbuf, portMAX_DELAY); #else ret = sdio_slave_transmit(sendbuf, total_len); #endif if (ret != ESP_OK) { ESP_LOGE(TAG , "sdio slave transmit error, ret : 0x%x\r\n", ret); +#if !SIMPLIFIED_SDIO_SLAVE + xSemaphoreGive(sdio_send_queue_sem); +#endif sdio_buffer_tx_free(sendbuf); return ESP_FAIL; } @@ -482,30 +562,32 @@ static int32_t sdio_write(interface_handle_t *handle, interface_buffer_handle_t #endif #if ESP_PKT_STATS - if (header->if_type == ESP_STA_IF) + if (buf_handle->if_type == ESP_STA_IF) pkt_stats.sta_sh_out++; - else if (header->if_type == ESP_SERIAL_IF) + else if (buf_handle->if_type == ESP_SERIAL_IF) pkt_stats.serial_tx_total++; #endif + return buf_handle->payload_len; } #if !SIMPLIFIED_SDIO_SLAVE static int sdio_read(interface_handle_t *if_handle, interface_buffer_handle_t *buf_handle) { - if (!if_handle || (if_handle->state != ACTIVE) || !buf_handle) { + if (!if_handle || (if_handle->state < DEACTIVE) || !buf_handle) { ESP_LOGE(TAG, "%s: Invalid state/args", __func__); return ESP_FAIL; } + xSemaphoreTake(sdio_rx_sem, portMAX_DELAY); if (pdFALSE == xQueueReceive(sdio_rx_queue[PRIO_Q_SERIAL], buf_handle, 0)) if (pdFALSE == xQueueReceive(sdio_rx_queue[PRIO_Q_BT], buf_handle, 0)) if (pdFALSE == xQueueReceive(sdio_rx_queue[PRIO_Q_OTHERS], buf_handle, 0)) { ESP_LOGE(TAG, "%s No element in rx queue", __func__); - return ESP_FAIL; - } + return ESP_FAIL; + } stop_rx_data_throttling_if_needed(); @@ -516,25 +598,53 @@ static void sdio_rx_task(void* pvParameters) { esp_err_t ret = ESP_OK; struct esp_payload_header *header = NULL; -#if CONFIG_ESP_SDIO_CHECKSUM + #if CONFIG_ESP_SDIO_CHECKSUM uint16_t rx_checksum = 0, checksum = 0; -#endif + #endif uint16_t len = 0, offset = 0; size_t sdio_read_len = 0; interface_buffer_handle_t buf_handle = {0}; + uint8_t flags = 0; + uint32_t recv_timeout = portMAX_DELAY; for(;;) { + /* Check if SDIO is deinitialized */ + if (if_handle_g.state < DEACTIVE) { + ESP_LOGV(TAG, "SDIO is deinitialized, cannot read"); + vTaskDelay(pdMS_TO_TICKS(100)); + continue; + } + +#if H_PS_UNLOAD_BUS_WHILE_PS + recv_timeout = pdMS_TO_TICKS(10); +#endif ret = sdio_slave_recv(&(buf_handle.sdio_buf_handle), &(buf_handle.payload), - &(sdio_read_len), portMAX_DELAY); + &(sdio_read_len), recv_timeout); if (ret) { - ESP_LOGE(TAG, "sdio_slave_recv returned failure"); + /* Not an error if timed out, just return and let caller try again */ + if (ret == ESP_ERR_TIMEOUT) { + continue; + } + ESP_LOGE(TAG, "sdio_slave_recv failed. ret [0x%x]", ret); continue; } buf_handle.payload_len = sdio_read_len & 0xFFFF; header = (struct esp_payload_header *) buf_handle.payload; + UPDATE_HEADER_RX_PKT_NO(header); + + flags = header->flags; + if (flags & FLAG_POWER_SAVE_STARTED) { + if (context.event_handler) { + context.event_handler(ESP_POWER_SAVE_ON); + } + } else if (flags & FLAG_POWER_SAVE_STOPPED) { + if (context.event_handler) { + context.event_handler(ESP_POWER_SAVE_OFF); + } + } len = le16toh(header->len); if (!len) { @@ -552,7 +662,7 @@ static void sdio_rx_task(void* pvParameters) continue; } -#if CONFIG_ESP_SDIO_CHECKSUM + #if CONFIG_ESP_SDIO_CHECKSUM rx_checksum = le16toh(header->checksum); header->checksum = 0; @@ -563,18 +673,19 @@ static void sdio_rx_task(void* pvParameters) sdio_read_done(buf_handle.sdio_buf_handle); continue; } -#endif + #endif buf_handle.if_type = header->if_type; buf_handle.if_num = header->if_num; buf_handle.free_buf_handle = sdio_read_done; + #if ESP_PKT_STATS + if (header->if_type == ESP_STA_IF) + pkt_stats.hs_bus_sta_in++; + #endif start_rx_data_throttling_if_needed(); -#if ESP_PKT_STATS - if (header->if_type == ESP_STA_IF) - pkt_stats.hs_bus_sta_in++; -#endif + if (header->if_type == ESP_SERIAL_IF) { xQueueSend(sdio_rx_queue[PRIO_Q_SERIAL], &buf_handle, portMAX_DELAY); } else if (header->if_type == ESP_HCI_IF) { @@ -591,24 +702,32 @@ static int sdio_read(interface_handle_t *if_handle, interface_buffer_handle_t *b { esp_err_t ret = ESP_OK; struct esp_payload_header *header = NULL; -#if CONFIG_ESP_SDIO_CHECKSUM + #if CONFIG_ESP_SDIO_CHECKSUM uint16_t rx_checksum = 0, checksum = 0; -#endif + #endif uint16_t len = 0; size_t sdio_read_len = 0; - + uint32_t recv_timeout = portMAX_DELAY; if (!if_handle || !buf_handle) { ESP_LOGE(TAG, "Invalid arguments to sdio_read"); return ESP_FAIL; } - if (if_handle->state != ACTIVE) + if (if_handle->state < DEACTIVE) return ESP_FAIL; +#if H_PS_UNLOAD_BUS_WHILE_PS + recv_timeout = pdMS_TO_TICKS(10); +#endif + /* Use a timeout instead of indefinite blocking to allow processing reset events */ ret = sdio_slave_recv(&(buf_handle->sdio_buf_handle), &(buf_handle->payload), - &(sdio_read_len), portMAX_DELAY); + &(sdio_read_len), recv_timeout); if (ret) { + /* Not an error if timed out, just return and let caller try again */ + if (ret == ESP_ERR_TIMEOUT) { + return 0; + } ESP_LOGD(TAG, "sdio_slave_recv returned failure"); return ESP_FAIL; } @@ -616,10 +735,22 @@ static int sdio_read(interface_handle_t *if_handle, interface_buffer_handle_t *b buf_handle->payload_len = sdio_read_len & 0xFFFF; header = (struct esp_payload_header *) buf_handle->payload; + UPDATE_HEADER_RX_PKT_NO(header); + +#if 0 + if (header->flags & FLAG_POWER_SAVE_STARTED) { + ESP_LOGI(TAG, "Host informed starting to power sleep"); + event_cb(ESP_POWER_SAVE_ON); + } + if (header->flags & FLAG_POWER_SAVE_STOPPED) { + ESP_LOGI(TAG, "Host informed that it waken up"); + event_cb(ESP_OPEN_DATA_PATH); + } +#endif len = le16toh(header->len) + le16toh(header->offset); -#if CONFIG_ESP_SDIO_CHECKSUM + #if CONFIG_ESP_SDIO_CHECKSUM rx_checksum = le16toh(header->checksum); header->checksum = 0; @@ -630,11 +761,12 @@ static int sdio_read(interface_handle_t *if_handle, interface_buffer_handle_t *b sdio_read_done(buf_handle->sdio_buf_handle); return ESP_FAIL; } -#endif -#if ESP_PKT_STATS + #endif + + #if ESP_PKT_STATS if (header->if_type == ESP_STA_IF) pkt_stats.hs_bus_sta_in++; -#endif + #endif buf_handle->if_type = header->if_type; buf_handle->if_num = header->if_num; @@ -643,15 +775,18 @@ static int sdio_read(interface_handle_t *if_handle, interface_buffer_handle_t *b } #endif /* !SIMPLIFIED_SDIO_SLAVE */ -static esp_err_t sdio_reset(interface_handle_t *handle) +static void sdio_reset_task(void *pvParameters) { + interface_handle_t *handle = (interface_handle_t *)pvParameters; esp_err_t ret = ESP_OK; sdio_slave_stop(); ret = sdio_slave_reset(); - if (ret != ESP_OK) - return ret; + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to reset SDIO slave: %d", ret); + goto exit; + } /* ESP-Hosted uses bit6 and bit 7 internal use, rest bits free */ sdio_slave_set_host_intena(SDIO_SLAVE_HOSTINT_SEND_NEW_PACKET | @@ -665,32 +800,107 @@ static esp_err_t sdio_reset(interface_handle_t *handle) SDIO_SLAVE_HOSTINT_BIT7); ret = sdio_slave_start(); - if (ret != ESP_OK) - return ret; + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to start SDIO slave: %d", ret); + goto exit; + } + +exit: + handle->state = ACTIVE; + vTaskDelete(NULL); +} + +static esp_err_t sdio_reset(interface_handle_t *handle) +{ + if (handle->state >= DEACTIVE) { + handle->state = DEACTIVE; + return ESP_OK; + } + + /* Create a task to handle SDIO reset */ + xTaskCreate(sdio_reset_task, "sdio_reset", + CONFIG_ESP_HOSTED_DEFAULT_TASK_STACK_SIZE, handle, + CONFIG_ESP_HOSTED_DEFAULT_TASK_PRIORITY, NULL); + + return ESP_OK; +} + +#if H_PS_UNLOAD_BUS_WHILE_PS +static void sdio_deinit_task(void *pvParameters) +{ + esp_err_t ret = ESP_OK; + + ESP_LOGI(TAG, "Deinitializing SDIO interface"); + + /* First stop SDIO to prevent new operations */ + sdio_slave_stop(); + + /* Give some time for ongoing operations to complete */ + vTaskDelay(pdMS_TO_TICKS(20)); + + /* Clear all pending interrupts */ + sdio_slave_clear_host_int(SDIO_SLAVE_HOSTINT_SEND_NEW_PACKET | + SDIO_SLAVE_HOSTINT_BIT0 | + SDIO_SLAVE_HOSTINT_BIT1 | + SDIO_SLAVE_HOSTINT_BIT2 | + SDIO_SLAVE_HOSTINT_BIT3 | + SDIO_SLAVE_HOSTINT_BIT4 | + SDIO_SLAVE_HOSTINT_BIT5 | + SDIO_SLAVE_HOSTINT_BIT6 | + SDIO_SLAVE_HOSTINT_BIT7); - while (1) { - sdio_slave_buf_handle_t handle = NULL; + /* Disable all interrupts */ + sdio_slave_set_host_intena(0); - /* Return buffers to driver */ - ret = sdio_slave_send_get_finished(&handle, 0); - if (ret != ESP_OK) + /* Reset the SDIO slave peripheral */ + sdio_slave_reset(); + + /* Now try to clean up buffers with timeout */ + int retry = 3; + while (retry--) { + sdio_slave_buf_handle_t buf_handle = NULL; + ret = sdio_slave_send_get_finished(&buf_handle, 10); // 10ms timeout + if (ret == ESP_ERR_TIMEOUT) { + ESP_LOGW(TAG, "Buffer cleanup timed out, retrying..."); + continue; + } + if (ret != ESP_OK || !buf_handle) { break; + } + #if !SIMPLIFIED_SDIO_SLAVE - xSemaphoreGive(sdio_send_queue_sem); + if (sdio_send_queue_sem) { + xSemaphoreGive(sdio_send_queue_sem); + } #endif - if (handle) { - ret = sdio_slave_recv_load_buf(handle); + if (buf_handle) { + ret = sdio_slave_recv_unregister_buf(buf_handle); ESP_ERROR_CHECK_WITHOUT_ABORT(ret); } } - return ESP_OK; + /* Final deinit */ + sdio_slave_deinit(); + if_handle_g.state = DEINIT; + + ESP_LOGI(TAG, "SDIO interface deinitialized"); + vTaskDelete(NULL); } +#endif static void sdio_deinit(interface_handle_t *handle) { - sdio_mempool_destroy(); - sdio_slave_stop(); - sdio_slave_reset(); +#if H_PS_UNLOAD_BUS_WHILE_PS + if (if_handle_g.state == DEINIT) { + ESP_LOGW(TAG, "SDIO already deinitialized"); + return; + } + if_handle_g.state = DEINIT; + + /* Create a task to handle SDIO deinitialization */ + xTaskCreate(sdio_deinit_task, "sdio_deinit", + CONFIG_ESP_HOSTED_DEFAULT_TASK_STACK_SIZE, handle, + CONFIG_ESP_HOSTED_DEFAULT_TASK_PRIORITY, NULL); +#endif } diff --git a/slave/main/sdio_slave_api.h b/slave/main/sdio_slave_api.h index 43760931..0e09408b 100644 --- a/slave/main/sdio_slave_api.h +++ b/slave/main/sdio_slave_api.h @@ -17,7 +17,7 @@ #ifndef __SDIO_SLAVE_API_H #define __SDIO_SLAVE_API_H -#if defined CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_SOC_SDIO_SLAVE_SUPPORTED #else #error "SDIO is not supported for this target. Please use SPI" #endif diff --git a/slave/main/slave_bt.c b/slave/main/slave_bt.c index 9896b669..8fdf055d 100644 --- a/slave/main/slave_bt.c +++ b/slave/main/slave_bt.c @@ -1,18 +1,8 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -71,7 +61,7 @@ static int host_rcv_pkt(uint8_t *data, uint16_t len) buf_handle.wlan_buf_handle = buf; buf_handle.free_buf_handle = free; - ESP_HEXLOGV("bt_tx new", data, len); + ESP_HEXLOGV("bt_tx new", data, len, 32); if (send_to_host_queue(&buf_handle, PRIO_Q_BT)) { free(buf); @@ -90,7 +80,7 @@ void process_hci_rx_pkt(uint8_t *payload, uint16_t payload_len) { /* VHCI needs one extra byte at the start of payload */ /* that is accomodated in esp_payload_header */ - ESP_HEXLOGV("bt_rx", payload, payload_len); + ESP_HEXLOGV("bt_rx", payload, payload_len, 32); payload--; payload_len++; @@ -120,8 +110,8 @@ void process_hci_rx_pkt(uint8_t *payload, uint16_t payload_len) #if BLUETOOTH_HCI #if SOC_ESP_NIMBLE_CONTROLLER -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 0) -#include "nimble/ble_hci_trans.h" +#if ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(5, 3, 0) +#include "ble_hci_trans.h" typedef enum { DATA_TYPE_COMMAND = 1, @@ -138,24 +128,24 @@ typedef enum { void esp_vhci_host_send_packet(uint8_t *data, uint16_t len) { - if (*(data) == DATA_TYPE_COMMAND) { - struct ble_hci_cmd *cmd = NULL; - cmd = (struct ble_hci_cmd *) ble_hci_trans_buf_alloc(BLE_HCI_TRANS_BUF_CMD); - if (!cmd) { - ESP_LOGE(TAG, "Failed to allocate memory for HCI transport buffer"); - return; - } + if (*(data) == DATA_TYPE_COMMAND) { + struct ble_hci_cmd *cmd = NULL; + cmd = (struct ble_hci_cmd *) ble_hci_trans_buf_alloc(BLE_HCI_TRANS_BUF_CMD); + if (!cmd) { + ESP_LOGE(TAG, "Failed to allocate memory for HCI transport buffer"); + return; + } - memcpy((uint8_t *)cmd, data + 1, len - 1); - ble_hci_trans_hs_cmd_tx((uint8_t *)cmd); - } + memcpy((uint8_t *)cmd, data + 1, len - 1); + ble_hci_trans_hs_cmd_tx((uint8_t *)cmd); + } - if (*(data) == DATA_TYPE_ACL) { - struct os_mbuf *om = os_msys_get_pkthdr(len, ACL_DATA_MBUF_LEADINGSPACE); - assert(om); - os_mbuf_append(om, &data[1], len - 1); - ble_hci_trans_hs_acl_tx(om); - } + if (*(data) == DATA_TYPE_ACL) { + struct os_mbuf *om = os_msys_get_pkthdr(len, ACL_DATA_MBUF_LEADINGSPACE); + assert(om); + os_mbuf_append(om, &data[1], len - 1); + ble_hci_trans_hs_acl_tx(om); + } } @@ -190,14 +180,16 @@ ble_hs_rx_data(struct os_mbuf *om, void *arg) os_mbuf_free_chain(om); return 0; } -#endif // ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 0) +#endif // ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(5, 3, 0) #endif #endif #endif -esp_err_t initialise_bluetooth(void) +esp_err_t init_bluetooth(void) { + esp_err_t ret = ESP_FAIL; + #if CONFIG_BT_ENABLED uint8_t mac[BSSID_BYTES_SIZE] = {0}; esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); @@ -210,30 +202,13 @@ esp_err_t initialise_bluetooth(void) slave_bt_init_uart(&bt_cfg); #endif - ESP_ERROR_CHECK( esp_bt_controller_init(&bt_cfg) ); -#if BLUETOOTH_BLE - ESP_ERROR_CHECK( esp_bt_controller_enable(ESP_BT_MODE_BLE) ); -#elif BLUETOOTH_BT - ESP_ERROR_CHECK( esp_bt_controller_enable(ESP_BT_MODE_CLASSIC_BT) ); -#elif BLUETOOTH_BT_BLE - ESP_ERROR_CHECK( esp_bt_controller_enable(ESP_BT_MODE_BTDM) ); -#endif - -#if BLUETOOTH_HCI - esp_err_t ret = ESP_OK; - -#if SOC_ESP_NIMBLE_CONTROLLER && (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 0)) - ble_hci_trans_cfg_hs((ble_hci_trans_rx_cmd_fn *)ble_hs_hci_rx_evt,NULL, - (ble_hci_trans_rx_acl_fn *)ble_hs_rx_data,NULL); -#else - ret = esp_vhci_host_register_callback(&vhci_host_cb); -#endif - + ret = esp_bt_controller_init(&bt_cfg); if (ret != ESP_OK) { - ESP_LOGE(TAG, "Failed to register VHCI callback"); + ESP_LOGE(TAG, "esp_bt_controller_init() FAILED"); return ret; } +#if BLUETOOTH_HCI vhci_send_sem = xSemaphoreCreateBinary(); if (vhci_send_sem == NULL) { ESP_LOGE(TAG, "Failed to create VHCI send sem"); @@ -244,11 +219,13 @@ esp_err_t initialise_bluetooth(void) #endif #endif - return ESP_OK; + return ret; } -void deinitialize_bluetooth(void) +esp_err_t deinit_bluetooth(bool mem_release) { + esp_err_t result = ESP_FAIL; + #ifdef CONFIG_BT_ENABLED #if BLUETOOTH_HCI if (vhci_send_sem) { @@ -258,9 +235,84 @@ void deinitialize_bluetooth(void) vSemaphoreDelete(vhci_send_sem); vhci_send_sem = NULL; } - esp_bt_controller_disable(); - esp_bt_controller_deinit(); #endif + result = esp_bt_controller_deinit(); + if (result != ESP_OK) { + ESP_LOGE(TAG, "esp_bt_controller_deinit FAILED"); + return result; + } + + if (mem_release) { + result = ESP_OK; +#if BLUETOOTH_BLE + result = esp_bt_controller_mem_release(ESP_BT_MODE_BLE); +#elif BLUETOOTH_BT + result = esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT); +#elif BLUETOOTH_BT_BLE + result = esp_bt_controller_mem_release(ESP_BT_MODE_BTDM); +#endif + if (result != ESP_OK) { + ESP_LOGE(TAG, "esp_bt_controller_mem_release FAILED"); + return result; + } + } +#endif + return result; +} + +esp_err_t enable_bluetooth(void) +{ + esp_err_t ret = ESP_FAIL; + +#ifdef CONFIG_BT_ENABLED +#if BLUETOOTH_BLE + ret = esp_bt_controller_enable(ESP_BT_MODE_BLE); +#elif BLUETOOTH_BT + ret = esp_bt_controller_enable(ESP_BT_MODE_CLASSIC_BT); +#elif BLUETOOTH_BT_BLE + ret = esp_bt_controller_enable(ESP_BT_MODE_BTDM); +#endif + if (ret != ESP_OK) { + ESP_LOGE(TAG, "esp_bt_controller_enable FAILED (or not called)"); + return ret; + } + +#if BLUETOOTH_HCI +#if SOC_ESP_NIMBLE_CONTROLLER && (ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(5, 3, 0)) + ble_hci_trans_cfg_hs((ble_hci_trans_rx_cmd_fn *)ble_hs_hci_rx_evt,NULL, + (ble_hci_trans_rx_acl_fn *)ble_hs_rx_data,NULL); +#else + ret = esp_vhci_host_register_callback(&vhci_host_cb); + + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to register VHCI callback"); + return ret; + } +#endif +#endif // BLUETOOTH_HCI +#endif // CONFIG_BT_ENABLED + + return ret; +} + +esp_err_t disable_bluetooth(void) +{ +#ifdef CONFIG_BT_ENABLED +#if BLUETOOTH_HCI +// unregister callback functions +#if SOC_ESP_NIMBLE_CONTROLLER && (ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(5, 3, 0)) + ble_hci_trans_cfg_hs(NULL, NULL, + NULL, NULL); +#else + esp_vhci_host_callback_t null_cb = { + NULL, NULL }; + esp_vhci_host_register_callback(&null_cb); +#endif +#endif + + return esp_bt_controller_disable(); +#else + return ESP_FAIL; #endif } diff --git a/slave/main/slave_bt.h b/slave/main/slave_bt.h index 620c93ae..c9617958 100644 --- a/slave/main/slave_bt.h +++ b/slave/main/slave_bt.h @@ -19,6 +19,7 @@ #include "esp_err.h" #include "esp_idf_version.h" +#include #ifdef CONFIG_BT_ENABLED @@ -160,8 +161,11 @@ #endif #endif /* CONFIG_BT_ENABLED */ -void deinitialize_bluetooth(void); -esp_err_t initialise_bluetooth(void); +esp_err_t init_bluetooth(void); +esp_err_t enable_bluetooth(void); +esp_err_t disable_bluetooth(void); +esp_err_t deinit_bluetooth(bool mem_release); + uint8_t get_bluetooth_capabilities(void); uint32_t get_bluetooth_ext_capabilities(void); diff --git a/slave/main/slave_control.c b/slave/main/slave_control.c index 22020178..e7f0a308 100644 --- a/slave/main/slave_control.c +++ b/slave/main/slave_control.c @@ -1,19 +1,11 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include + #include "freertos/FreeRTOS.h" #include "freertos/event_groups.h" #include "esp_log.h" @@ -21,202 +13,88 @@ #include "slave_control.h" #include "esp_hosted_rpc.pb-c.h" #include "esp_ota_ops.h" +#include "esp_mac.h" #include "esp_hosted_rpc.h" #include "esp_hosted_transport.h" #include "esp_hosted_bitmasks.h" +#include "slave_wifi_config.h" +#include "esp_hosted_log.h" +#include "slave_bt.h" +#include "esp_hosted_coprocessor_fw_ver.h" + +#if CONFIG_ESP_HOSTED_ENABLE_GPIO_RPC +#include "driver/gpio.h" +#include "transport_gpio_pin_guard.h" +#endif + +#if H_DPP_SUPPORT +#include "esp_dpp.h" +#endif + +#if CONFIG_SOC_WIFI_HE_SUPPORT +#include "esp_wifi_he.h" +#endif +#if H_WIFI_ENTERPRISE_SUPPORT +#include "esp_eap_client.h" +#endif +/* Slave-side: Always support reserved field decoding for maximum compatibility + * The host may or may not have CONFIG_ESP_HOSTED_DECODE_WIFI_RESERVED_FIELD enabled + */ +#define H_DECODE_WIFI_RESERVED_FIELD 1 -#include "coprocessor_fw_version.h" +#ifdef CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED +#include "esp_check.h" +#include "lwip/inet.h" +#include "host_power_save.h" +#include "mqtt_example.h" +#endif #define MAC_STR_LEN 17 #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" #define SUCCESS 0 #define FAILURE -1 -#define SSID_LENGTH 32 -#define PASSWORD_LENGTH 64 #define MIN_TX_POWER 8 #define MAX_TX_POWER 84 -/* Bits for wifi connect event */ -#define WIFI_CONNECTED_BIT BIT0 -#define WIFI_FAIL_BIT BIT1 -#define WIFI_NO_AP_FOUND_BIT BIT2 -#define WIFI_WRONG_PASSWORD_BIT BIT3 -#define WIFI_HOST_REQUEST_BIT BIT4 +#define IFACE_MAC_SIZE 8 // 6 for MAC-48, 8 for EIU-64, 2 for EFUSE_EXT #define MAX_STA_CONNECT_ATTEMPTS 3 #define TIMEOUT_IN_MIN (60*TIMEOUT_IN_SEC) #define TIMEOUT_IN_HOUR (60*TIMEOUT_IN_MIN) -#define TIMEOUT (2*TIMEOUT_IN_MIN) -#define RESTART_TIMEOUT (5*TIMEOUT_IN_SEC) +#define RESTART_TIMEOUT (2*TIMEOUT_IN_SEC) #define MIN_HEARTBEAT_INTERVAL (10) #define MAX_HEARTBEAT_INTERVAL (60*60) -#define mem_free(x) \ - { \ - if (x) { \ - free(x); \ - x = NULL; \ - } \ - } - - -#define NTFY_TEMPLATE(NtFy_MsgId, NtFy_TyPe, NtFy_StRuCt, InIt_FuN) \ - NtFy_TyPe *ntfy_payload = NULL; \ - ntfy_payload = (NtFy_TyPe*)calloc(1,sizeof(NtFy_TyPe)); \ - if (!ntfy_payload) { \ - ESP_LOGE(TAG,"Failed to allocate memory"); \ - return ESP_ERR_NO_MEM; \ - } \ - InIt_FuN(ntfy_payload); \ - ntfy->payload_case = NtFy_MsgId; \ - ntfy->NtFy_StRuCt = ntfy_payload; \ - ntfy_payload->resp = SUCCESS; -#define RPC_TEMPLATE(RspTyPe, RspStRuCt, ReqType, ReqStruct, InIt_FuN) \ - RspTyPe *resp_payload = NULL; \ - ReqType *req_payload = NULL; \ - if (!req || !resp || !req->ReqStruct) { \ - ESP_LOGE(TAG, "Invalid parameters"); \ - return ESP_FAIL; \ - } \ - req_payload = req->ReqStruct; \ - resp_payload = (RspTyPe *)calloc(1, sizeof(RspTyPe)); \ - if (!resp_payload) { \ - ESP_LOGE(TAG, "Failed to alloc mem for resp.%s\n",#RspStRuCt); \ - return ESP_ERR_NO_MEM; \ - } \ - resp->RspStRuCt = resp_payload; \ - InIt_FuN(resp_payload); \ - resp_payload->resp = SUCCESS; \ - - -/* Simple is same above just, we dod not need req_payload unused warning */ -#define RPC_TEMPLATE_SIMPLE(RspTyPe, RspStRuCt, ReqType, ReqStruct, InIt_FuN) \ - RspTyPe *resp_payload = NULL; \ - if (!req || !resp) { \ - ESP_LOGE(TAG, "Invalid parameters"); \ - return ESP_FAIL; \ - } \ - resp_payload = (RspTyPe *)calloc(1, sizeof(RspTyPe)); \ - if (!resp_payload) { \ - ESP_LOGE(TAG, "Failed to alloc mem for resp.%s\n",#RspStRuCt); \ - return ESP_ERR_NO_MEM; \ - } \ - resp->RspStRuCt = resp_payload; \ - InIt_FuN(resp_payload); \ - resp_payload->resp = SUCCESS; \ - -#define RPC_RESP_ASSIGN_FIELD(PaRaM) \ - resp_payload->PaRaM = PaRaM - -#define RPC_RET_FAIL_IF(ConDiTiOn) do { \ - int rEt = (ConDiTiOn); \ - if (rEt) { \ - resp_payload->resp = rEt; \ - ESP_LOGE(TAG, "%s:%u failed [%s] = [%d]", __func__,__LINE__,#ConDiTiOn, rEt); \ - return ESP_OK; \ - } \ -} while(0); - - -#define RPC_ALLOC_ELEMENT(TyPe,MsG_StRuCt,InIt_FuN) { \ - TyPe *NeW_AllocN = (TyPe *)calloc(1, sizeof(TyPe)); \ - if (!NeW_AllocN) { \ - ESP_LOGI(TAG,"Failed to allocate memory for req.%s\n",#MsG_StRuCt); \ - resp_payload->resp = RPC_ERR_MEMORY_FAILURE; \ - goto err; \ - } \ - MsG_StRuCt = NeW_AllocN; \ - InIt_FuN(MsG_StRuCt); \ -} - -#define NTFY_ALLOC_ELEMENT(TyPe,MsG_StRuCt,InIt_FuN) { \ - TyPe *NeW_AllocN = (TyPe *)calloc(1, sizeof(TyPe)); \ - if (!NeW_AllocN) { \ - ESP_LOGI(TAG,"Failed to allocate memory for req.%s\n",#MsG_StRuCt); \ - ntfy_payload->resp = RPC_ERR_MEMORY_FAILURE; \ - goto err; \ - } \ - MsG_StRuCt = NeW_AllocN; \ - InIt_FuN(MsG_StRuCt); \ -} - -#define NTFY_COPY_BYTES(dest, src, num) \ - do { \ - if (num) { \ - dest.data = (uint8_t *)calloc(1, num); \ - if (!dest.data) { \ - ESP_LOGE(TAG, "%s:%u Failed to duplicate bytes\n",__func__,__LINE__); \ - ntfy_payload->resp = FAILURE; \ - return ESP_OK; \ - } \ - memcpy(dest.data, src, num); \ - dest.len = num; \ - } \ - } while(0) - -#define RPC_REQ_COPY_BYTES(dest, src, num_bytes) \ - if (src.len && src.data) \ - memcpy((char*)dest, src.data, min(min(sizeof(dest), num_bytes), src.len)); - -#define RPC_REQ_COPY_STR RPC_REQ_COPY_BYTES - - -#define RPC_RESP_COPY_STR(dest, src, max_len) \ - if (src) { \ - dest.data = (uint8_t*)strndup((char*)src, max_len); \ - if (!dest.data) { \ - ESP_LOGE(TAG, "%s:%u Failed to duplicate bytes\n",__func__,__LINE__); \ - resp_payload->resp = FAILURE; \ - return ESP_OK; \ - } \ - dest.len = min(max_len,strlen((char*)src)+1); \ - } -#define RPC_RESP_COPY_BYTES_SRC_UNCHECKED(dest, src, num) \ - do { \ - if (num) { \ - dest.data = (uint8_t *)calloc(1, num); \ - if (!dest.data) { \ - ESP_LOGE(TAG, "%s:%u Failed to duplicate bytes\n",__func__,__LINE__); \ - resp_payload->resp = FAILURE; \ - return ESP_OK; \ - } \ - memcpy(dest.data, src, num); \ - dest.len = num; \ - } \ - } while(0) - -#define RPC_RESP_COPY_BYTES(dest, src, num) \ - if (src) { \ - RPC_RESP_COPY_BYTES_SRC_UNCHECKED(dest, src, num); \ - } +static wifi_config_t new_wifi_config = {0}; +static bool new_config_recvd = false; +static wifi_event_sta_connected_t lkg_sta_connected_event = {0}; -#define RPC_COPY_STR(dest, src, max_len) \ - if (src) { \ - dest.data = (uint8_t*)strndup((char*)src, max_len); \ - if (!dest.data) { \ - ESP_LOGE(TAG, "%s:%u Failed to duplicate bytes\n",__func__,__LINE__); \ - return FAILURE; \ - } \ - dest.len = min(max_len,strlen((char*)src)+1); \ - } +enum { + OTA_NOT_STARTED, + OTA_IN_PROGRESS, + OTA_FAILED, + OTA_COMPLETED, + OTA_ACTIVATED, +}; -#define RPC_COPY_BYTES(dest, src, num) \ - do { \ - if (num) { \ - dest.data = (uint8_t *)calloc(1, num); \ - if (!dest.data) { \ - ESP_LOGE(TAG, "%s:%u Failed to duplicate bytes\n",__func__,__LINE__); \ - return FAILURE; \ - } \ - memcpy(dest.data, src, num); \ - dest.len = num; \ - } \ - } while(0) +uint8_t ota_status = OTA_NOT_STARTED; + +#if H_WIFI_ENTERPRISE_SUPPORT +#define CLEAR_CERT(ptr, len) \ + do { \ + if (ptr) { \ + memset(ptr, 0, len); \ + free(ptr); \ + ptr = NULL; \ + } \ + len = 0; \ + } while (0) +#endif typedef struct esp_rpc_cmd { int req_num; @@ -225,12 +103,29 @@ typedef struct esp_rpc_cmd { } esp_rpc_req_t; -static const char* TAG = "slave_ctrl"; +static const char* TAG = "slave_rpc"; static TimerHandle_t handle_heartbeat_task; static uint32_t hb_num; /* FreeRTOS event group to signal when we are connected*/ static esp_event_handler_instance_t instance_any_id; +#ifdef CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED +static esp_event_handler_instance_t instance_ip; +extern volatile uint8_t station_got_ip; +static rpc_dhcp_dns_status_t s2h_dhcp_dns = {0}; + +#endif + +#if H_WIFI_ENTERPRISE_SUPPORT +unsigned char *g_ca_cert = NULL; +int g_ca_cert_len = 0; +unsigned char *g_client_cert = NULL; +int g_client_cert_len = 0; +unsigned char *g_private_key = NULL; +int g_private_key_len = 0; +unsigned char *g_private_key_password = NULL; +int g_private_key_passwd_len = 0; +#endif static esp_ota_handle_t handle; const esp_partition_t* update_partition = NULL; @@ -241,14 +136,148 @@ extern esp_err_t wlan_ap_rx_callback(void *buffer, uint16_t len, void *eb); extern volatile uint8_t station_connected; extern volatile uint8_t softap_started; +static volatile bool station_connecting = false; +static volatile bool wifi_initialized = false; + +static void send_wifi_event_data_to_host(int event, void *event_data, int event_size) +{ + send_event_data_to_host(event, event_data, event_size); +} + +#ifdef CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED +/* DHCP/DNS event handling */ +void send_dhcp_dns_info_to_host(uint8_t network_up, uint8_t send_wifi_connected) +{ + rpc_dhcp_dns_status_t s2h_dhcp_dns_DOWN = {0}; + rpc_dhcp_dns_status_t *evnt_to_send = &s2h_dhcp_dns_DOWN; + + if (network_up && s2h_dhcp_dns.dhcp_up && s2h_dhcp_dns.net_link_up && s2h_dhcp_dns.dns_up) { + evnt_to_send = &s2h_dhcp_dns; + } + send_event_data_to_host(RPC_ID__Event_DhcpDnsStatus, + evnt_to_send, sizeof(rpc_dhcp_dns_status_t)); + + vTaskDelay(pdMS_TO_TICKS(10)); + if (send_wifi_connected && station_connected) { + send_wifi_event_data_to_host(RPC_ID__Event_StaConnected, + &lkg_sta_connected_event, sizeof(wifi_event_sta_connected_t)); + } + + ESP_EARLY_LOGI(TAG, "Send DHCP-DNS status to Host: IP: %s, NM: %s, GW: %s, DNS IP: %s, Type: %"PRId32, + (char *)evnt_to_send->dhcp_ip, + (char *)evnt_to_send->dhcp_nm, + (char *)evnt_to_send->dhcp_gw, + (char *)evnt_to_send->dns_ip, + evnt_to_send->dns_type); +} + +/* Get DNS information */ +esp_err_t get_slave_dns(wifi_interface_t iface, esp_netif_dns_info_t *dns) +{ + esp_netif_t *netif = NULL; + + if (!dns) { + return ESP_ERR_INVALID_ARG; + } + + if (iface == WIFI_IF_STA) { + netif = esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"); + } else if (iface == WIFI_IF_AP) { + netif = esp_netif_get_handle_from_ifkey("WIFI_AP_DEF"); + } + + if (!netif) { + return ESP_FAIL; + } + + return esp_netif_get_dns_info(netif, ESP_NETIF_DNS_MAIN, dns); +} + +/* Set DNS information */ +esp_err_t set_slave_dns(wifi_interface_t iface, char *ip, uint8_t type) +{ + esp_netif_t *netif = NULL; + esp_netif_dns_info_t dns = {0}; + + if (!ip) { + return ESP_ERR_INVALID_ARG; + } + + if (iface == WIFI_IF_STA) { + netif = esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"); + } else if (iface == WIFI_IF_AP) { + netif = esp_netif_get_handle_from_ifkey("WIFI_AP_DEF"); + } + + if (!netif) { + return ESP_FAIL; + } + + /* Convert IP string to IP address */ + if (esp_netif_str_to_ip4(ip, &dns.ip.u_addr.ip4) != ESP_OK) { + return ESP_FAIL; + } + + dns.ip.type = type; + return esp_netif_set_dns_info(netif, ESP_NETIF_DNS_MAIN, &dns); +} + +/* Get static IP information */ +esp_err_t get_slave_static_ip(wifi_interface_t iface, esp_netif_ip_info_t *ip_info, uint8_t *netlink_up) +{ + esp_netif_t *netif = NULL; + + if (!ip_info || !netlink_up) { + return ESP_ERR_INVALID_ARG; + } + + if (iface == WIFI_IF_STA) { + netif = esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"); + } else if (iface == WIFI_IF_AP) { + netif = esp_netif_get_handle_from_ifkey("WIFI_AP_DEF"); + } + + if (!netif) { + return ESP_FAIL; + } + + /* Get network interface status */ + *netlink_up = esp_netif_is_netif_up(netif); + + /* Get IP info only if interface is up */ + if (*netlink_up) { + return esp_netif_get_ip_info(netif, ip_info); + } + + /* Clear IP info if interface is down */ + memset(ip_info, 0, sizeof(esp_netif_ip_info_t)); + return ESP_OK; +} +#endif /* CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED */ + /* OTA end timer callback */ void vTimerCallback( TimerHandle_t xTimer ) { xTimerDelete(xTimer, 0); + esp_unregister_shutdown_handler((shutdown_handler_t)esp_wifi_stop); esp_restart(); } +#if H_WIFI_ENTERPRISE_SUPPORT +static void free_all_g_eap_cert_and_key(void) +{ + CLEAR_CERT(g_client_cert, g_client_cert_len); + CLEAR_CERT(g_private_key, g_private_key_len); + CLEAR_CERT(g_private_key_password, g_private_key_passwd_len); +} + +static void free_g_ca_cert(void) +{ + CLEAR_CERT(g_ca_cert, g_ca_cert_len); +} +#endif + /* Function returns mac address of station/softap */ static esp_err_t req_wifi_get_mac(Rpc *req, Rpc *resp, void *priv_data) @@ -291,14 +320,11 @@ static esp_err_t req_wifi_get_mode(Rpc *req, static esp_err_t req_wifi_set_mode(Rpc *req, Rpc *resp, void *priv_data) { - wifi_mode_t num = 0; - RPC_TEMPLATE(RpcRespSetMode, resp_set_wifi_mode, RpcReqSetMode, req_set_wifi_mode, rpc__resp__set_mode__init); - num = req_payload->mode; - RPC_RET_FAIL_IF(esp_wifi_set_mode(num)); + RPC_RET_FAIL_IF(esp_wifi_set_mode(req_payload->mode)); return ESP_OK; } @@ -306,24 +332,20 @@ static esp_err_t req_wifi_set_mode(Rpc *req, /* Function sets MAC address for station/softap */ static esp_err_t req_wifi_set_mac(Rpc *req, Rpc *resp, void *priv_data) -{ - uint8_t * mac = NULL; +{ RPC_TEMPLATE(RpcRespSetMacAddress, resp_set_mac_address, RpcReqSetMacAddress, req_set_mac_address, rpc__resp__set_mac_address__init); if (!req_payload->mac.data || (req_payload->mac.len != BSSID_BYTES_SIZE)) { - ESP_LOGE(TAG, "Invalid MAC address data or len: %d", req->req_set_mac_address->mac.len); + ESP_LOGE(TAG, "Invalid MAC address data or len: %d", req_payload->mac.len); resp_payload->resp = ESP_ERR_INVALID_ARG; - goto err; + return ESP_OK; } - mac = req_payload->mac.data; - ESP_LOGD(TAG, "mac: " MACSTR, MAC2STR(mac)); + RPC_RET_FAIL_IF(esp_wifi_set_mac(req_payload->mode, req_payload->mac.data)); - RPC_RET_FAIL_IF(esp_wifi_set_mac(req_payload->mode, mac)); -err: return ESP_OK; } @@ -334,7 +356,9 @@ static esp_err_t req_wifi_set_ps(Rpc *req, RPC_TEMPLATE(RpcRespSetPs, resp_wifi_set_ps, RpcReqSetPs, req_wifi_set_ps, rpc__resp__set_ps__init); + RPC_RET_FAIL_IF(esp_wifi_set_ps(req_payload->type)); + return ESP_OK; } @@ -390,6 +414,7 @@ static esp_err_t req_ota_begin_handler (Rpc *req, ESP_LOGE(TAG, "OTA begin failed[%d]", ret); goto err; } + ota_status = OTA_IN_PROGRESS; ota_msg = 1; @@ -444,7 +469,6 @@ static esp_err_t req_ota_end_handler (Rpc *req, { esp_err_t ret = ESP_OK; RpcRespOTAEnd *resp_payload = NULL; - TimerHandle_t xTimer = NULL; if (!req || !resp) { ESP_LOGE(TAG, "Invalid parameters"); @@ -467,16 +491,72 @@ static esp_err_t req_ota_end_handler (Rpc *req, } else { ESP_LOGE(TAG, "OTA update failed in end (%s)!", esp_err_to_name(ret)); } + ota_status = OTA_FAILED; goto err; } + ESP_LOGI(TAG, "**** OTA updated successful, ready for activation ****"); + ota_status = OTA_COMPLETED; + resp_payload->resp = SUCCESS; + return ESP_OK; +err: + resp_payload->resp = ret; + return ESP_OK; +} + +/* Function OTA activate */ +static esp_err_t req_ota_activate_handler (Rpc *req, + Rpc *resp, void *priv_data) +{ + esp_err_t ret = ESP_OK; + RpcRespOTAActivate *resp_payload = NULL; + TimerHandle_t xTimer = NULL; + + if (!req || !resp) { + ESP_LOGE(TAG, "Invalid parameters"); + return ESP_FAIL; + } + + resp_payload = (RpcRespOTAActivate *)calloc(1,sizeof(RpcRespOTAActivate)); + if (!resp_payload) { + ESP_LOGE(TAG,"Failed to allocate memory"); + return ESP_ERR_NO_MEM; + } + rpc__resp__otaactivate__init(resp_payload); + resp->payload_case = RPC__PAYLOAD_RESP_OTA_ACTIVATE; + resp->resp_ota_activate = resp_payload; + + ret = ESP_OK; + switch (ota_status) { + case OTA_COMPLETED: + break; + case OTA_IN_PROGRESS: + ESP_LOGW(TAG, "OTA in progress"); + goto err; + break; + case OTA_NOT_STARTED: + ESP_LOGW(TAG, "OTA not started"); + goto err; + break; + case OTA_FAILED: + ESP_LOGW(TAG, "OTA failed"); + goto err; + break; + default: + ESP_LOGW(TAG, "OTA status unknown"); + goto err; + break; + } + /* set OTA partition for next boot */ ret = esp_ota_set_boot_partition(update_partition); if (ret != ESP_OK) { ESP_LOGE(TAG, "esp_ota_set_boot_partition failed (%s)!", esp_err_to_name(ret)); goto err; } - xTimer = xTimerCreate("Timer", RESTART_TIMEOUT , pdFALSE, 0, vTimerCallback); + ota_status = OTA_ACTIVATED; + /* Create timer to reboot system and activate OTA */ + xTimer = xTimerCreate("OTAActivateTimer", RESTART_TIMEOUT , pdFALSE, 0, vTimerCallback); if (xTimer == NULL) { ESP_LOGE(TAG, "Failed to create timer to restart system"); ret = -1; @@ -488,7 +568,7 @@ static esp_err_t req_ota_end_handler (Rpc *req, ret = -2; goto err; } - ESP_LOGE(TAG, "**** OTA updated successful, ESP32 will reboot in 5 sec ****"); + ESP_LOGE(TAG, "**** OTA activation initiated, ESP32 will reboot in 2 sec ****"); resp_payload->resp = SUCCESS; return ESP_OK; err: @@ -681,7 +761,92 @@ static esp_err_t req_config_heartbeat(Rpc *req, } -static void event_handler(void* arg, esp_event_base_t event_base, + +#if CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED +static void event_handler_ip(void* arg, esp_event_base_t event_base, + int32_t event_id, void* event_data) +{ + char ip_s[16] = {0}; + char nm_s[16] = {0}; + char gw_s[16] = {0}; + char dns_ip_s[16] = {0}; + + if (event_base == IP_EVENT) { + switch (event_id) { + + case IP_EVENT_STA_GOT_IP: { + ESP_LOGI(TAG, "Got IP"); + ip_event_got_ip_t* event = event_data; + esp_netif_t *netif = event->esp_netif; + esp_netif_dns_info_t dns = {0}; + + //memcpy(&lkg_sta_got_ip_event, event_data, sizeof(ip_event_got_ip_t)); + ESP_ERROR_CHECK(esp_wifi_internal_set_sta_ip()); + ESP_ERROR_CHECK(esp_netif_get_dns_info(netif, ESP_NETIF_DNS_MAIN, &dns)); + + esp_ip4addr_ntoa(&event->ip_info.ip, ip_s, sizeof(ip_s)); + esp_ip4addr_ntoa(&event->ip_info.netmask, nm_s, sizeof(nm_s)); + esp_ip4addr_ntoa(&event->ip_info.gw, gw_s, sizeof(gw_s)); + esp_ip4addr_ntoa(&dns.ip.u_addr.ip4, dns_ip_s, sizeof(dns_ip_s)); + + ESP_LOGI(TAG, "Slave sta dhcp {IP[%s] NM[%s] GW[%s]} dns{type[%u] ip[%s]}", + ip_s, nm_s, gw_s, dns.ip.type, dns_ip_s); + + s2h_dhcp_dns.net_link_up = 1; + s2h_dhcp_dns.dhcp_up = 1; + s2h_dhcp_dns.dns_up = 1; + strlcpy((char*)s2h_dhcp_dns.dhcp_ip, ip_s, sizeof(s2h_dhcp_dns.dhcp_ip)); + strlcpy((char*)s2h_dhcp_dns.dhcp_nm, nm_s, sizeof(s2h_dhcp_dns.dhcp_nm)); + strlcpy((char*)s2h_dhcp_dns.dhcp_gw, gw_s, sizeof(s2h_dhcp_dns.dhcp_gw)); + strlcpy((char*)s2h_dhcp_dns.dns_ip, dns_ip_s, sizeof(s2h_dhcp_dns.dns_ip)); + s2h_dhcp_dns.dns_type = ESP_NETIF_DNS_MAIN; + + + //send_dhcp_dns_info_to_host(1, 0); + station_got_ip = 1; +#ifdef CONFIG_ESP_HOSTED_COPROCESSOR_EXAMPLE_MQTT + example_mqtt_resume(); +#endif + break; + } case IP_EVENT_STA_LOST_IP: { +#ifdef CONFIG_ESP_HOSTED_COPROCESSOR_EXAMPLE_MQTT + example_mqtt_pause(); +#endif + ESP_LOGI(TAG, "Lost IP address"); + station_got_ip = 0; + memset(&s2h_dhcp_dns, 0, sizeof(s2h_dhcp_dns)); + //send_dhcp_dns_info_to_host(0, 0); + break; + } + + } + } +} + + +extern esp_netif_t *slave_sta_netif; + +static esp_err_t set_slave_static_ip(wifi_interface_t iface, char *ip, char *nm, char *gw) +{ + + esp_netif_ip_info_t ip_info = {0}; + + ESP_RETURN_ON_FALSE(iface == WIFI_IF_STA, ESP_FAIL, TAG, "only sta iface supported yet"); + + ip_info.ip.addr = ipaddr_addr(ip); + ip_info.netmask.addr = ipaddr_addr(nm); + ip_info.gw.addr = ipaddr_addr(gw); + + ESP_LOGI(TAG, "Set static IP addr ip:%s nm:%s gw:%s", ip, nm, gw); + ESP_ERROR_CHECK(esp_netif_set_ip_info(slave_sta_netif, &ip_info)); + esp_wifi_internal_reg_rxcb(WIFI_IF_STA, (wifi_rxcb_t) wlan_sta_rx_callback); + + return ESP_OK; +} +#endif + +#include "esp_wifi_netif.h" +static void event_handler_wifi(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { if (event_base == WIFI_EVENT) { @@ -705,35 +870,474 @@ static void event_handler(void* arg, esp_event_base_t event_base, event_data, sizeof(wifi_event_sta_scan_done_t)); } else if (event_id == WIFI_EVENT_STA_CONNECTED) { ESP_LOGI(TAG, "Sta mode connected"); + if (new_config_recvd) { + ESP_LOGI(TAG, "New wifi config still unapplied, applying it"); + /* Still not applied new config, so apply it */ + int ret = esp_wifi_set_config(WIFI_IF_STA, &new_wifi_config); + if (ret) { + ESP_LOGE(TAG, "Error[0x%x] while setting the wifi config", ret); + } else { + new_config_recvd = 0; + } + esp_wifi_disconnect(); + return; + } + station_connecting = false; send_event_data_to_host(RPC_ID__Event_StaConnected, event_data, sizeof(wifi_event_sta_connected_t)); - esp_wifi_internal_reg_rxcb(ESP_IF_WIFI_STA, (wifi_rxcb_t) wlan_sta_rx_callback); + memcpy(&lkg_sta_connected_event, event_data, sizeof(wifi_event_sta_connected_t)); + esp_wifi_internal_reg_rxcb(WIFI_IF_STA, (wifi_rxcb_t) wlan_sta_rx_callback); station_connected = true; } else if (event_id == WIFI_EVENT_STA_DISCONNECTED) { station_connected = false; - esp_wifi_internal_reg_rxcb(ESP_IF_WIFI_STA, NULL); + if (new_config_recvd) { + ESP_LOGI(TAG, "New wifi config still unapplied, applying it"); + /* Still not applied new config, so apply it */ + int ret = esp_wifi_set_config(WIFI_IF_STA, &new_wifi_config); + if (ret) { + ESP_LOGE(TAG, "Error[0x%x] while setting the wifi config", ret); + } else { + new_config_recvd = 0; + } + } + esp_wifi_internal_reg_rxcb(WIFI_IF_STA, NULL); ESP_LOGI(TAG, "Sta mode disconnect"); + station_connecting = false; send_event_data_to_host(RPC_ID__Event_StaDisconnected, event_data, sizeof(wifi_event_sta_disconnected_t)); +#if CONFIG_SOC_WIFI_HE_SUPPORT + } else if (event_id == WIFI_EVENT_ITWT_SETUP) { + ESP_LOGI(TAG, "Itwt Setup"); + send_event_data_to_host(RPC_ID__Event_StaItwtSetup, + event_data, sizeof(wifi_event_sta_itwt_setup_t)); + } else if (event_id == WIFI_EVENT_ITWT_TEARDOWN) { + ESP_LOGI(TAG, "Itwt Teardown"); + send_event_data_to_host(RPC_ID__Event_StaItwtTeardown, + event_data, sizeof(wifi_event_sta_itwt_teardown_t)); + } else if (event_id == WIFI_EVENT_ITWT_SUSPEND) { + ESP_LOGI(TAG, "Itwt Suspend"); + send_event_data_to_host(RPC_ID__Event_StaItwtSuspend, + event_data, sizeof(wifi_event_sta_itwt_suspend_t)); + } else if (event_id == WIFI_EVENT_ITWT_PROBE) { + ESP_LOGI(TAG, "Itwt Probe"); + send_event_data_to_host(RPC_ID__Event_StaItwtProbe, + event_data, sizeof(wifi_event_sta_itwt_probe_t)); +#endif +#if H_WIFI_DPP_SUPPORT + } else if (event_id == WIFI_EVENT_DPP_URI_READY) { + ESP_LOGW(TAG, "DPP URI Ready"); + wifi_event_dpp_uri_ready_t *uri = (wifi_event_dpp_uri_ready_t *)event_data; + int uri_len = uri->uri_data_len; + // include the length of the uri when sending event + send_event_data_to_host(RPC_ID__Event_WifiDppUriReady, + event_data, sizeof(wifi_event_dpp_uri_ready_t) + uri_len); + } else if (event_id == WIFI_EVENT_DPP_CFG_RECVD) { + ESP_LOGI(TAG, "DPP CFG Ready"); + send_event_data_to_host(RPC_ID__Event_WifiDppCfgRecvd, + event_data, sizeof(wifi_event_dpp_config_received_t)); + } else if (event_id == WIFI_EVENT_DPP_FAILED) { + ESP_LOGI(TAG, "DPP Failed"); + send_event_data_to_host(RPC_ID__Event_WifiDppFail, + event_data, sizeof(wifi_event_dpp_failed_t)); +#endif } else { + // ensure start events are only sent once during a state change if (event_id == WIFI_EVENT_AP_START) { - ESP_LOGI(TAG,"softap started"); - esp_wifi_internal_reg_rxcb(ESP_IF_WIFI_AP, (wifi_rxcb_t) wlan_ap_rx_callback); - softap_started = 1; + if (!softap_started) { + ESP_LOGI(TAG,"softap started"); + esp_wifi_internal_reg_rxcb(WIFI_IF_AP, (wifi_rxcb_t) wlan_ap_rx_callback); + softap_started = 1; + send_event_data_to_host(RPC_ID__Event_WifiEventNoArgs, + &event_id, sizeof(event_id)); + } } else if (event_id == WIFI_EVENT_AP_STOP) { - ESP_LOGI(TAG,"softap stopped"); - esp_wifi_internal_reg_rxcb(ESP_IF_WIFI_AP, NULL); - softap_started = 0; + if (softap_started) { + ESP_LOGI(TAG,"softap stopped"); + esp_wifi_internal_reg_rxcb(WIFI_IF_AP, NULL); + softap_started = 0; + send_event_data_to_host(RPC_ID__Event_WifiEventNoArgs, + &event_id, sizeof(event_id)); + } + } else if (event_id == WIFI_EVENT_STA_START) { + if (!station_connecting) { + ESP_LOGI(TAG, "sta started"); + station_connecting = true; + esp_wifi_connect(); + send_event_data_to_host(RPC_ID__Event_WifiEventNoArgs, + &event_id, sizeof(event_id)); + } + } else if (event_id == WIFI_EVENT_STA_STOP) { + ESP_LOGI(TAG, "sta stopped"); + station_connecting = false; + send_event_data_to_host(RPC_ID__Event_WifiEventNoArgs, + &event_id, sizeof(event_id)); + } else { + send_event_data_to_host(RPC_ID__Event_WifiEventNoArgs, + &event_id, sizeof(event_id)); } + } + } +} - send_event_data_to_host(RPC_ID__Event_WifiEventNoArgs, - &event_id, sizeof(event_id)); +// macros to format output +#define PRINT_HEADER() ESP_LOGI(TAG, " Wifi Init Param | Default | Host | Actual"); +#define PRINT_FOOTER() ESP_LOGI(TAG, " End Wifi Init Param |"); + +// need several ESP_LOGx formats due to different sizes of variables to be printed +// int (PRI16), int32_t (PRI32), bool (PRI16) +#define PRINT_USE_HOST_VALUE(param_str, default, host, final) \ + ESP_LOGD(TAG, "%20s | %7"PRIu16" | %7"PRIi32" | %7"PRIi16, param_str, default, host, final); +#define PRINT_USE_DEFAULT_VALUE(param_str, default, host, final) \ + ESP_LOGW(TAG, "%20s | %7"PRIu16" | %7"PRIi32" | %7"PRIi16, param_str, default, host, final); + +#define PRINT_USE_HOST_VALUE_BOOL(param_str, default, host, final) \ + ESP_LOGD(TAG, "%20s | %7"PRIu16" | %7"PRIi16" | %7"PRIi16, param_str, default, host, final); +#define PRINT_USE_DEFAULT_VALUE_BOOL(param_str, default, host, final) \ + ESP_LOGI(TAG, "%20s | %7"PRIu16" | %7"PRIi16" | %7"PRIi16, param_str, default, host, final); + +#define PRINT_HEX64_USE_HOST_VALUE(param_str, default, host, final) \ + ESP_LOGD(TAG, "%20s | 0x%5"PRIx16" | 0x%5"PRIx64" | 0x%5"PRIx64, param_str, default, host, final); +#define PRINT_HEX64_USE_DEFAULT_VALUE(param_str, default, host, final) \ + ESP_LOGW(TAG, "%20s | %7"PRIx16" | %7"PRIx64" | %7"PRIx64, param_str, default, host, final); + +// macros to copy host or default value +#define USE_HOST_VALUE(PARAM_STR, DEFAULT, PARAM) \ + do { \ + dst_config->PARAM = src_config->PARAM; \ + PRINT_USE_HOST_VALUE(PARAM_STR, \ + DEFAULT, \ + src_config->PARAM, \ + dst_config->PARAM); \ + } while(0); + +#define USE_HOST_VALUE_BOOL(PARAM_STR, DEFAULT, PARAM) \ + do { \ + dst_config->PARAM = src_config->PARAM; \ + PRINT_USE_HOST_VALUE_BOOL(PARAM_STR, \ + DEFAULT, \ + src_config->PARAM, \ + dst_config->PARAM); \ + } while(0); + +#define USE_DEFAULT_VALUE(PARAM_STR, DEFAULT, PARAM) \ + do { \ + dst_config->PARAM = DEFAULT; \ + PRINT_USE_DEFAULT_VALUE(PARAM_STR, \ + DEFAULT, \ + src_config->PARAM, \ + dst_config->PARAM); \ + } while(0); + +#define USE_DEFAULT_VALUE_BOOL(PARAM_STR, DEFAULT, PARAM) \ + do { \ + dst_config->PARAM = DEFAULT; \ + PRINT_USE_DEFAULT_VALUE_BOOL(PARAM_STR, \ + DEFAULT, \ + src_config->PARAM, \ + dst_config->PARAM); \ + } while(0); + +/** Returns the merged wifi init config + * Compares the src config from the host with our Wi-Fi defaults + * and adjust dst_config as necessary. + * + * Also displays the changed configs. + */ +static wifi_init_config_t * get_merged_init_config(wifi_init_config_t *dst_config, WifiInitConfig *src_config) +{ + /* always use value from host, except for + * - cache_tx_buf_num + * - feature_caps + */ + PRINT_HEADER(); + USE_HOST_VALUE("static_rx_buf", CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM, static_rx_buf_num); + USE_HOST_VALUE("dynamic_rx_buf", CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM, dynamic_rx_buf_num); + USE_HOST_VALUE("tx_buf_type", CONFIG_ESP_WIFI_TX_BUFFER_TYPE, tx_buf_type); + USE_HOST_VALUE("static_tx_buf", WIFI_STATIC_TX_BUFFER_NUM, static_tx_buf_num); + USE_HOST_VALUE("dynamic_tx_buf", WIFI_DYNAMIC_TX_BUFFER_NUM, dynamic_tx_buf_num); + USE_HOST_VALUE("rx_mgmt_buf_type", CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF, rx_mgmt_buf_type); + USE_HOST_VALUE("rx_mgmt_buf", WIFI_RX_MGMT_BUF_NUM_DEF, rx_mgmt_buf_num); + + if (WIFI_ENABLE_CACHE_TX_BUFFER) { + // use setting from host + USE_HOST_VALUE("cache_tx_buf", WIFI_CACHE_TX_BUFFER_NUM, cache_tx_buf_num); + dst_config->feature_caps = src_config->feature_caps; + PRINT_HEX64_USE_HOST_VALUE("feature_caps", WIFI_FEATURE_CAPS, + src_config->feature_caps, + dst_config->feature_caps); + } else { + if (WIFI_FEATURE_CAPS != src_config->feature_caps) { + // don't use host setting, which may have enabled CACHE_TX_BUFFER + USE_DEFAULT_VALUE("cache_tx_buf", WIFI_CACHE_TX_BUFFER_NUM, cache_tx_buf_num); + dst_config->feature_caps = WIFI_FEATURE_CAPS; + PRINT_HEX64_USE_DEFAULT_VALUE("feature_caps", WIFI_FEATURE_CAPS, + src_config->feature_caps, + dst_config->feature_caps); + } else { + USE_HOST_VALUE("cache_tx_buf", WIFI_CACHE_TX_BUFFER_NUM, cache_tx_buf_num); + dst_config->feature_caps = src_config->feature_caps; + PRINT_HEX64_USE_HOST_VALUE("feature_caps", WIFI_FEATURE_CAPS, + src_config->feature_caps, + dst_config->feature_caps); + } + } + + USE_HOST_VALUE("csi_enable", WIFI_CSI_ENABLED, csi_enable); + USE_HOST_VALUE("ampdu_rx_enable", WIFI_AMPDU_RX_ENABLED, ampdu_rx_enable); + USE_HOST_VALUE("ampdu_tx_enable", WIFI_AMPDU_TX_ENABLED, ampdu_tx_enable); + USE_HOST_VALUE("amsdu_tx_enable", WIFI_AMSDU_TX_ENABLED, amsdu_tx_enable); + USE_HOST_VALUE("nvs_enable", WIFI_NVS_ENABLED, nvs_enable); + USE_HOST_VALUE("nano_enable", WIFI_NANO_FORMAT_ENABLED, nano_enable); + USE_HOST_VALUE("rx_ba_win", WIFI_DEFAULT_RX_BA_WIN, rx_ba_win); + USE_HOST_VALUE("wifi_task_core", WIFI_TASK_CORE_ID, wifi_task_core_id); + USE_HOST_VALUE("beacon_max_len", WIFI_SOFTAP_BEACON_MAX_LEN, beacon_max_len); + USE_HOST_VALUE("mgmt_sbuf_num", WIFI_MGMT_SBUF_NUM, mgmt_sbuf_num); + USE_HOST_VALUE_BOOL("sta_disconnected_pm", WIFI_STA_DISCONNECTED_PM_ENABLED, sta_disconnected_pm); + USE_HOST_VALUE("espnow_max_encrypt",CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM, espnow_max_encrypt_num); + USE_HOST_VALUE("tx_hetb_queue", WIFI_TX_HETB_QUEUE_NUM, tx_hetb_queue_num); + USE_HOST_VALUE("dump_hesigb_enable", WIFI_DUMP_HESIGB_ENABLED, dump_hesigb_enable); + PRINT_FOOTER(); + + dst_config->magic = src_config->magic; + + return dst_config; +} + +esp_err_t esp_hosted_register_wifi_event_handlers(void) +{ + int ret1; + + esp_event_handler_instance_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, &instance_any_id); + + ret1 = esp_event_handler_instance_register(WIFI_EVENT, + ESP_EVENT_ANY_ID, + &event_handler_wifi, + NULL, + &instance_any_id); + + if (ret1) { + ESP_LOGW(TAG, "Failed to register WiFi events"); + } +#ifdef CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED + int ret2, ret3; + + esp_event_handler_instance_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, &instance_any_id); + ret2 = esp_event_handler_instance_register(IP_EVENT, + IP_EVENT_STA_GOT_IP, + &event_handler_ip, + NULL, + &instance_ip); + esp_event_handler_instance_unregister(IP_EVENT, IP_EVENT_STA_LOST_IP, &instance_any_id); + ret3 = esp_event_handler_instance_register(IP_EVENT, + IP_EVENT_STA_LOST_IP, + &event_handler_ip, + NULL, + &instance_ip); + + if (ret2 || ret3) { + ESP_LOGW(TAG, "Failed to register IP events"); + } +#endif + return ESP_OK; +} + +/* Cached WiFi init configuration for comparison when reinitializing */ +static wifi_init_config_t cached_wifi_init_config = {0}; +static bool has_cached_config = false; + +/* External declaration of the real esp_wifi_init function */ +extern esp_err_t __real_esp_wifi_init(const wifi_init_config_t *config); + +/** + * @brief Compare only the relevant wifi init config fields that we care about + * + * This function compares only the specific fields that are set in req_wifi_init() + * to determine if we need to reinitialize WiFi + */ +static bool wifi_init_config_changed(const wifi_init_config_t *new_cfg, const wifi_init_config_t *cached_cfg) +{ + if (!new_cfg || !cached_cfg) { + ESP_LOGI(TAG, "WiFi init config comparison: One of the configs is NULL"); + return true; + } + + /* Compare only the fields that are explicitly set in req_wifi_init */ + bool changed = false; + + if (new_cfg->static_rx_buf_num != cached_cfg->static_rx_buf_num) { + ESP_LOGI(TAG, "WiFi init config: static_rx_buf_num changed: %lu -> %lu", + (unsigned long)cached_cfg->static_rx_buf_num, (unsigned long)new_cfg->static_rx_buf_num); + changed = true; + } + + if (new_cfg->dynamic_rx_buf_num != cached_cfg->dynamic_rx_buf_num) { + ESP_LOGI(TAG, "WiFi init config: dynamic_rx_buf_num changed: %lu -> %lu", + (unsigned long)cached_cfg->dynamic_rx_buf_num, (unsigned long)new_cfg->dynamic_rx_buf_num); + changed = true; + } + + if (new_cfg->tx_buf_type != cached_cfg->tx_buf_type) { + ESP_LOGI(TAG, "WiFi init config: tx_buf_type changed: %lu -> %lu", + (unsigned long)cached_cfg->tx_buf_type, (unsigned long)new_cfg->tx_buf_type); + changed = true; + } + + if (new_cfg->static_tx_buf_num != cached_cfg->static_tx_buf_num) { + ESP_LOGI(TAG, "WiFi init config: static_tx_buf_num changed: %lu -> %lu", + (unsigned long)cached_cfg->static_tx_buf_num, (unsigned long)new_cfg->static_tx_buf_num); + changed = true; + } + + if (new_cfg->dynamic_tx_buf_num != cached_cfg->dynamic_tx_buf_num) { + ESP_LOGI(TAG, "WiFi init config: dynamic_tx_buf_num changed: %lu -> %lu", + (unsigned long)cached_cfg->dynamic_tx_buf_num, (unsigned long)new_cfg->dynamic_tx_buf_num); + changed = true; + } + + if (new_cfg->cache_tx_buf_num != cached_cfg->cache_tx_buf_num) { + ESP_LOGI(TAG, "WiFi init config: cache_tx_buf_num changed: %lu -> %lu", + (unsigned long)cached_cfg->cache_tx_buf_num, (unsigned long)new_cfg->cache_tx_buf_num); + changed = true; + } + + if (new_cfg->csi_enable != cached_cfg->csi_enable) { + ESP_LOGI(TAG, "WiFi init config: csi_enable changed: %lu -> %lu", + (unsigned long)cached_cfg->csi_enable, (unsigned long)new_cfg->csi_enable); + changed = true; + } + + if (new_cfg->ampdu_rx_enable != cached_cfg->ampdu_rx_enable) { + ESP_LOGI(TAG, "WiFi init config: ampdu_rx_enable changed: %lu -> %lu", + (unsigned long)cached_cfg->ampdu_rx_enable, (unsigned long)new_cfg->ampdu_rx_enable); + changed = true; + } + + if (new_cfg->ampdu_tx_enable != cached_cfg->ampdu_tx_enable) { + ESP_LOGI(TAG, "WiFi init config: ampdu_tx_enable changed: %lu -> %lu", + (unsigned long)cached_cfg->ampdu_tx_enable, (unsigned long)new_cfg->ampdu_tx_enable); + changed = true; + } + + if (new_cfg->amsdu_tx_enable != cached_cfg->amsdu_tx_enable) { + ESP_LOGI(TAG, "WiFi init config: amsdu_tx_enable changed: %lu -> %lu", + (unsigned long)cached_cfg->amsdu_tx_enable, (unsigned long)new_cfg->amsdu_tx_enable); + changed = true; + } + + if (new_cfg->nvs_enable != cached_cfg->nvs_enable) { + ESP_LOGI(TAG, "WiFi init config: nvs_enable changed: %lu -> %lu", + (unsigned long)cached_cfg->nvs_enable, (unsigned long)new_cfg->nvs_enable); + changed = true; + } + + if (new_cfg->nano_enable != cached_cfg->nano_enable) { + ESP_LOGI(TAG, "WiFi init config: nano_enable changed: %lu -> %lu", + (unsigned long)cached_cfg->nano_enable, (unsigned long)new_cfg->nano_enable); + changed = true; + } + + if (new_cfg->rx_ba_win != cached_cfg->rx_ba_win) { + ESP_LOGI(TAG, "WiFi init config: rx_ba_win changed: %lu -> %lu", + (unsigned long)cached_cfg->rx_ba_win, (unsigned long)new_cfg->rx_ba_win); + changed = true; + } + + if (new_cfg->wifi_task_core_id != cached_cfg->wifi_task_core_id) { + ESP_LOGI(TAG, "WiFi init config: wifi_task_core_id changed: %lu -> %lu", + (unsigned long)cached_cfg->wifi_task_core_id, (unsigned long)new_cfg->wifi_task_core_id); + changed = true; + } + + if (new_cfg->beacon_max_len != cached_cfg->beacon_max_len) { + ESP_LOGI(TAG, "WiFi init config: beacon_max_len changed: %lu -> %lu", + (unsigned long)cached_cfg->beacon_max_len, (unsigned long)new_cfg->beacon_max_len); + changed = true; + } + + if (new_cfg->mgmt_sbuf_num != cached_cfg->mgmt_sbuf_num) { + ESP_LOGI(TAG, "WiFi init config: mgmt_sbuf_num changed: %lu -> %lu", + (unsigned long)cached_cfg->mgmt_sbuf_num, (unsigned long)new_cfg->mgmt_sbuf_num); + changed = true; + } + + if (new_cfg->feature_caps != cached_cfg->feature_caps) { + ESP_LOGI(TAG, "WiFi init config: feature_caps changed: %lu -> %lu", + (unsigned long)cached_cfg->feature_caps, (unsigned long)new_cfg->feature_caps); + changed = true; + } + + if (new_cfg->sta_disconnected_pm != cached_cfg->sta_disconnected_pm) { + ESP_LOGI(TAG, "WiFi init config: sta_disconnected_pm changed: %lu -> %lu", + (unsigned long)cached_cfg->sta_disconnected_pm, (unsigned long)new_cfg->sta_disconnected_pm); + changed = true; + } + + if (new_cfg->espnow_max_encrypt_num != cached_cfg->espnow_max_encrypt_num) { + ESP_LOGI(TAG, "WiFi init config: espnow_max_encrypt_num changed: %lu -> %lu", + (unsigned long)cached_cfg->espnow_max_encrypt_num, (unsigned long)new_cfg->espnow_max_encrypt_num); + changed = true; + } + + if (new_cfg->magic != cached_cfg->magic) { + ESP_LOGI(TAG, "WiFi init config: magic changed: %lu -> %lu", + (unsigned long)cached_cfg->magic, (unsigned long)new_cfg->magic); + changed = true; + } + + return changed; +} + +/** + * @brief Wrapper function for esp_wifi_init that caches config and handles reinitialization + * + * This function intercepts calls to esp_wifi_init, caches the configuration, + * and compares with previous config. If config has changed and WiFi is already + * initialized, it will stop, deinit, and reinitialize with the new parameters. + */ +esp_err_t __wrap_esp_wifi_init(const wifi_init_config_t *config) +{ + esp_err_t ret; + bool should_reinit = false; + ESP_LOGI(TAG, "=== __wrap_esp_wifi_init called ==="); + + if (wifi_initialized) { + /* Compare with cached config */ + if (has_cached_config && wifi_init_config_changed(config, &cached_wifi_init_config)) { + ESP_LOGI(TAG, "WiFi init config changed, reinitializing"); + esp_wifi_stop(); + esp_wifi_deinit(); + wifi_initialized = false; + should_reinit = true; + } else { + ESP_LOGW(TAG, "WiFi already initialized with same parameters"); + return ESP_OK; } + } else { + ESP_LOGI(TAG, "First-time WiFi initialization"); + } + + /* Cache the config for future comparisons */ + if (config) { + memcpy(&cached_wifi_init_config, config, sizeof(wifi_init_config_t)); + has_cached_config = true; } + + /* Call the real init function */ + ESP_LOGI(TAG, "Calling __real_esp_wifi_init..."); + ret = __real_esp_wifi_init(config); + ESP_LOGI(TAG, "__real_esp_wifi_init returned: %d", ret); + + if (ret == ESP_OK && !should_reinit) { + wifi_initialized = true; + } + + return ret; } static esp_err_t req_wifi_init(Rpc *req, Rpc *resp, void *priv_data) { + int ret = 0; + wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); RPC_TEMPLATE(RpcRespWifiInit, resp_wifi_init, @@ -741,11 +1345,22 @@ static esp_err_t req_wifi_init(Rpc *req, Rpc *resp, void *priv_data) rpc__resp__wifi_init__init); RPC_RET_FAIL_IF(!req_payload->cfg); + cfg.static_rx_buf_num = req_payload->cfg->static_rx_buf_num ; cfg.dynamic_rx_buf_num = req_payload->cfg->dynamic_rx_buf_num ; cfg.tx_buf_type = req_payload->cfg->tx_buf_type ; cfg.static_tx_buf_num = req_payload->cfg->static_tx_buf_num ; cfg.dynamic_tx_buf_num = req_payload->cfg->dynamic_tx_buf_num ; + +#if CONFIG_IDF_TARGET_ESP32C2 + /* Hardcode: No static tx buffers for c2 due to low memory issues */ + if (!cfg.tx_buf_type) { + cfg.tx_buf_type = 1; + + if (!cfg.dynamic_tx_buf_num) + cfg.dynamic_tx_buf_num = 16; + } +#endif cfg.cache_tx_buf_num = req_payload->cfg->cache_tx_buf_num ; cfg.csi_enable = req_payload->cfg->csi_enable ; cfg.ampdu_rx_enable = req_payload->cfg->ampdu_rx_enable ; @@ -762,15 +1377,19 @@ static esp_err_t req_wifi_init(Rpc *req, Rpc *resp, void *priv_data) cfg.espnow_max_encrypt_num = req_payload->cfg->espnow_max_encrypt_num ; cfg.magic = req_payload->cfg->magic ; - RPC_RET_FAIL_IF(esp_wifi_init(&cfg)); + ESP_LOGV(TAG, "Wifi-config: static_rx_buf_num[%lu] dynamic_rx_buf_num[%lu] tx_buf_type[%lu]", (unsigned long)cfg.static_rx_buf_num, (unsigned long)cfg.dynamic_rx_buf_num, (unsigned long)cfg.tx_buf_type); + ESP_LOGV(TAG, "Wifi-config: static_tx_buf_num[%lu] dynamic_tx_buf_num[%lu] cache_tx_buf_num[%lu]", (unsigned long)cfg.static_tx_buf_num, (unsigned long)cfg.dynamic_tx_buf_num, (unsigned long)cfg.cache_tx_buf_num); + ESP_LOGV(TAG, "Wifi-config: csi_enable[%lu] ampdu_rx_enable[%lu] ampdu_tx_enable[%lu] amsdu_tx_enable[%lu]", (unsigned long)cfg.csi_enable, (unsigned long)cfg.ampdu_rx_enable, (unsigned long)cfg.ampdu_tx_enable, (unsigned long)cfg.amsdu_tx_enable); + ESP_LOGV(TAG, "Wifi-config: nvs_enable[%lu] nano_enable[%lu] rx_ba_win[%lu] wifi_task_core_id[%lu]", (unsigned long)cfg.nvs_enable, (unsigned long)cfg.nano_enable, (unsigned long)cfg.rx_ba_win, (unsigned long)cfg.wifi_task_core_id); + ESP_LOGV(TAG, "Wifi-config: beacon_max_len[%lu] mgmt_sbuf_num[%lu] feature_caps[%lu] sta_disconnected_pm[%lu]", (unsigned long)cfg.beacon_max_len, (unsigned long)cfg.mgmt_sbuf_num, (unsigned long)cfg.feature_caps, (unsigned long)cfg.sta_disconnected_pm); + ESP_LOGV(TAG, "Wifi-config: espnow_max_encrypt_num[%lu] magic[%lu]", (unsigned long)cfg.espnow_max_encrypt_num, (unsigned long)cfg.magic); - ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, - ESP_EVENT_ANY_ID, - &event_handler, - NULL, - &instance_any_id)); + /* Use our wrapper directly instead of esp_hosted_wifi_init */ + RPC_RET_FAIL_IF(esp_wifi_init(get_merged_init_config(&cfg, req_payload->cfg))); - return ESP_OK; + esp_hosted_register_wifi_event_handlers(); + + return ret; } static esp_err_t req_wifi_deinit(Rpc *req, Rpc *resp, void *priv_data) @@ -779,6 +1398,10 @@ static esp_err_t req_wifi_deinit(Rpc *req, Rpc *resp, void *priv_data) RpcReqWifiDeinit, req_wifi_deinit, rpc__resp__wifi_deinit__init); +#if H_WIFI_ENTERPRISE_SUPPORT + free_g_ca_cert(); + free_all_g_eap_cert_and_key(); +#endif RPC_RET_FAIL_IF(esp_wifi_deinit()); return ESP_OK; @@ -792,6 +1415,31 @@ static esp_err_t req_wifi_start(Rpc *req, Rpc *resp, void *priv_data) rpc__resp__wifi_start__init); RPC_RET_FAIL_IF(esp_wifi_start()); + + /** + * check the current wifi mode and send the STA/AP start event(s) + * to handle the case where the host wakes up from deep sleep. + * In this case, the wifi was already started on the co-processor + * and does not generate the required start events + */ + wifi_mode_t mode; + int event_id; + esp_err_t res = esp_wifi_get_mode(&mode); + if (res == ESP_OK) { + if ((mode == WIFI_MODE_STA) || (mode == WIFI_MODE_APSTA)) { + ESP_LOGI(TAG, "send WIFI_EVENT_STA_START"); + event_id = WIFI_EVENT_STA_START; + send_wifi_event_data_to_host(RPC_ID__Event_WifiEventNoArgs, + &event_id, sizeof(event_id)); + } + if ((mode == WIFI_MODE_AP) || (mode == WIFI_MODE_APSTA)) { + ESP_LOGI(TAG, "send WIFI_EVENT_AP_START"); + event_id = WIFI_EVENT_AP_START; + send_wifi_event_data_to_host(RPC_ID__Event_WifiEventNoArgs, + &event_id, sizeof(event_id)); + } + } + return ESP_OK; } @@ -802,20 +1450,57 @@ static esp_err_t req_wifi_stop(Rpc *req, Rpc *resp, void *priv_data) rpc__resp__wifi_stop__init); RPC_RET_FAIL_IF(esp_wifi_stop()); - return ESP_OK; } static esp_err_t req_wifi_connect(Rpc *req, Rpc *resp, void *priv_data) { + int ret = ESP_OK; + wifi_config_t wifi_cfg = {0}; + RPC_TEMPLATE_SIMPLE(RpcRespWifiConnect, resp_wifi_connect, RpcReqWifiConnect, req_wifi_connect, rpc__resp__wifi_connect__init); - ESP_LOGI(TAG, "************ connect ****************"); - RPC_RET_FAIL_IF(esp_wifi_connect()); + // Check if WiFi config has valid SSID before attempting connection + if (esp_wifi_get_config(WIFI_IF_STA, &wifi_cfg) != ESP_OK) { + ESP_LOGE(TAG, "Failed to get WiFi config"); + resp_payload->resp = ESP_ERR_WIFI_NOT_INIT; + return ESP_OK; + } - return ESP_OK; + if (strlen((char*)wifi_cfg.sta.ssid) == 0) { + ESP_LOGE(TAG, "No SSID configured, cannot connect"); + resp_payload->resp = ESP_ERR_WIFI_SSID; + return ESP_OK; + } + + ESP_LOGI(TAG, "Attempting to connect to SSID: %s", wifi_cfg.sta.ssid); + + if (new_config_recvd || !station_connected) { + ESP_LOGI(TAG, "************ connect ****************"); + //station_connecting = true; + ret = esp_wifi_connect(); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to connect to WiFi: %d", ret); + station_connecting = false; + } + } else { + ESP_LOGI(TAG, "connect recvd, ack with connected event"); + + +#if CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED + //send_dhcp_dns_info_to_host(1, 0); +#endif + + send_wifi_event_data_to_host(RPC_ID__Event_StaConnected, + &lkg_sta_connected_event, sizeof(wifi_event_sta_connected_t)); + } + + if (ret != ESP_ERR_WIFI_CONN) + resp_payload->resp = ret; + + return ESP_OK; } static esp_err_t req_wifi_disconnect(Rpc *req, Rpc *resp, void *priv_data) @@ -829,6 +1514,98 @@ static esp_err_t req_wifi_disconnect(Rpc *req, Rpc *resp, void *priv_data) return ESP_OK; } +static bool wifi_is_provisioned(wifi_config_t *wifi_cfg) +{ + if (!wifi_cfg) { + ESP_LOGI(TAG, "NULL wifi cfg passed, ignore"); + return false; + } + + if (esp_wifi_get_config(WIFI_IF_STA, wifi_cfg) != ESP_OK) { + ESP_LOGI(TAG, "Wifi get config failed"); + return false; + } + + ESP_LOGI(TAG, "SSID: %s", wifi_cfg->sta.ssid); + + if (strlen((const char *) wifi_cfg->sta.ssid)) { + ESP_LOGI(TAG, "Wifi provisioned"); + return true; + } + ESP_LOGI(TAG, "Wifi not provisioned, Fallback to example config"); + + return false; +} + +/* Function to compare two WiFi configurations */ +static bool is_wifi_config_equal(const wifi_config_t *cfg1, const wifi_config_t *cfg2) +{ + if (!cfg1 || !cfg2) { + return false; + } + /* Compare SSID */ + if (strcmp((char *)cfg1->sta.ssid, (char *)cfg2->sta.ssid) != 0) { + ESP_LOGD(TAG, "SSID different: '%s' vs '%s'", cfg1->sta.ssid, cfg2->sta.ssid); + return false; + } + + /* Compare password */ + if (strcmp((char *)cfg1->sta.password, (char *)cfg2->sta.password) != 0) { + ESP_LOGD(TAG, "Password different"); + return false; + } + + /* Compare BSSID if set */ + if (cfg1->sta.bssid_set && cfg2->sta.bssid_set) { + if (memcmp(cfg1->sta.bssid, cfg2->sta.bssid, BSSID_BYTES_SIZE) != 0) { + ESP_LOGD(TAG, "BSSID different"); + return false; + } + } else if (cfg1->sta.bssid_set != cfg2->sta.bssid_set) { + ESP_LOGD(TAG, "BSSID set status different: %d vs %d", + cfg1->sta.bssid_set, cfg2->sta.bssid_set); + return false; + } + + /* Compare channel if set */ + if (cfg1->sta.channel != 0 && cfg2->sta.channel != 0) { + if (cfg1->sta.channel != cfg2->sta.channel) { + ESP_LOGD(TAG, "Channel different: %d vs %d", + cfg1->sta.channel, cfg2->sta.channel); + return false; + } + } + + return true; +} + + +/* Function to handle WiFi configuration */ +esp_err_t esp_hosted_set_sta_config(wifi_interface_t iface, wifi_config_t *cfg) +{ + wifi_config_t current_config = {0}; + if (!wifi_is_provisioned(¤t_config)) { + if (esp_wifi_set_config(WIFI_IF_STA, cfg) != ESP_OK) { + ESP_LOGW(TAG, "not provisioned and failed to set wifi config"); + } else { + ESP_LOGI(TAG, "Provisioned new Wi-Fi config"); + new_config_recvd = true; + station_connecting = false; + } + } + + if (!is_wifi_config_equal(cfg, ¤t_config)) { + new_config_recvd = true; + station_connecting = false; + ESP_LOGI(TAG, "Setting new WiFi config SSID: %s", cfg->sta.ssid); + memcpy(&new_wifi_config, cfg, sizeof(wifi_config_t)); + } else { + ESP_LOGI(TAG, "WiFi config unchanged, keeping current connection"); + new_config_recvd = false; + } + + return ESP_OK; +} static esp_err_t req_wifi_set_config(Rpc *req, Rpc *resp, void *priv_data) { @@ -842,7 +1619,9 @@ static esp_err_t req_wifi_set_config(Rpc *req, Rpc *resp, void *priv_data) (req_payload->iface != WIFI_IF_AP)); RPC_RET_FAIL_IF(!req_payload->cfg); + if (req_payload->iface == WIFI_IF_STA) { + wifi_sta_config_t * p_a_sta = &(cfg.sta); WifiStaConfig * p_c_sta = req_payload->cfg->sta; RPC_RET_FAIL_IF(!req_payload->cfg->sta); @@ -851,7 +1630,7 @@ static esp_err_t req_wifi_set_config(Rpc *req, Rpc *resp, void *priv_data) ESP_LOGI(TAG, "STA set config: SSID:%s", p_a_sta->ssid); RPC_REQ_COPY_STR(p_a_sta->password, p_c_sta->password, PASSWORD_LENGTH); if (strlen((char*)p_a_sta->password)) - ESP_LOGD(TAG, "STA: password:%s", p_a_sta->password); + ESP_LOGD(TAG, "STA: password:xxxxxxxx"); p_a_sta->scan_method = p_c_sta->scan_method; p_a_sta->bssid_set = p_c_sta->bssid_set; @@ -861,35 +1640,62 @@ static esp_err_t req_wifi_set_config(Rpc *req, Rpc *resp, void *priv_data) p_a_sta->channel = p_c_sta->channel; p_a_sta->listen_interval = p_c_sta->listen_interval; p_a_sta->sort_method = p_c_sta->sort_method; - p_a_sta->threshold.rssi = p_c_sta->threshold->rssi; - p_a_sta->threshold.authmode = p_c_sta->threshold->authmode; + if (p_c_sta->threshold) { + p_a_sta->threshold.rssi = p_c_sta->threshold->rssi; + p_a_sta->threshold.authmode = p_c_sta->threshold->authmode; +#if H_PRESENT_IN_ESP_IDF_5_4_0 + p_a_sta->threshold.rssi_5g_adjustment = p_c_sta->threshold->rssi_5g_adjustment; +#endif + } //p_a_sta->ssid_hidden = p_c_sta->ssid_hidden; //p_a_sta->max_connections = p_c_sta->max_connections; - p_a_sta->pmf_cfg.capable = p_c_sta->pmf_cfg->capable; - p_a_sta->pmf_cfg.required = p_c_sta->pmf_cfg->required; - - p_a_sta->rm_enabled = H_GET_BIT(STA_RM_ENABLED_BIT, p_c_sta->bitmask); - p_a_sta->btm_enabled = H_GET_BIT(STA_BTM_ENABLED_BIT, p_c_sta->bitmask); - p_a_sta->mbo_enabled = H_GET_BIT(STA_MBO_ENABLED_BIT, p_c_sta->bitmask); - p_a_sta->ft_enabled = H_GET_BIT(STA_FT_ENABLED_BIT, p_c_sta->bitmask); - p_a_sta->owe_enabled = H_GET_BIT(STA_OWE_ENABLED_BIT, p_c_sta->bitmask); - p_a_sta->transition_disable = H_GET_BIT(STA_TRASITION_DISABLED_BIT, p_c_sta->bitmask); - p_a_sta->reserved = WIFI_CONFIG_STA_GET_RESERVED_VAL(p_c_sta->bitmask); + if (p_c_sta->pmf_cfg) { + p_a_sta->pmf_cfg.capable = p_c_sta->pmf_cfg->capable; + p_a_sta->pmf_cfg.required = p_c_sta->pmf_cfg->required; + } + p_a_sta->rm_enabled = H_GET_BIT(WIFI_STA_CONFIG_1_rm_enabled, p_c_sta->bitmask); + p_a_sta->btm_enabled = H_GET_BIT(WIFI_STA_CONFIG_1_btm_enabled, p_c_sta->bitmask); + p_a_sta->mbo_enabled = H_GET_BIT(WIFI_STA_CONFIG_1_mbo_enabled, p_c_sta->bitmask); + p_a_sta->ft_enabled = H_GET_BIT(WIFI_STA_CONFIG_1_ft_enabled, p_c_sta->bitmask); + p_a_sta->owe_enabled = H_GET_BIT(WIFI_STA_CONFIG_1_owe_enabled, p_c_sta->bitmask); + p_a_sta->transition_disable = H_GET_BIT(WIFI_STA_CONFIG_1_transition_disable, p_c_sta->bitmask); +#if H_DECODE_WIFI_RESERVED_FIELD +#if H_WIFI_NEW_RESERVED_FIELD_NAMES + p_a_sta->reserved1 = WIFI_STA_CONFIG_1_GET_RESERVED_VAL(p_c_sta->bitmask); +#else + p_a_sta->reserved = WIFI_STA_CONFIG_1_GET_RESERVED_VAL(p_c_sta->bitmask); +#endif +#endif p_a_sta->sae_pwe_h2e = p_c_sta->sae_pwe_h2e; + p_a_sta->sae_pk_mode = p_c_sta->sae_pk_mode; p_a_sta->failure_retry_cnt = p_c_sta->failure_retry_cnt; - p_a_sta->he_dcm_set = H_GET_BIT(WIFI_HE_STA_CONFIG_he_dcm_set_BIT, p_c_sta->he_bitmask); - // WIFI_HE_STA_CONFIG_he_dcm_max_constellation_tx is two bits wide - p_a_sta->he_dcm_max_constellation_tx = (p_c_sta->he_bitmask >> WIFI_HE_STA_CONFIG_he_dcm_max_constellation_tx_BITS) & 0x03; - // WIFI_HE_STA_CONFIG_he_dcm_max_constellation_rx is two bits wide - p_a_sta->he_dcm_max_constellation_rx = (p_c_sta->he_bitmask >> WIFI_HE_STA_CONFIG_he_dcm_max_constellation_rx_BITS) & 0x03; - p_a_sta->he_mcs9_enabled = H_GET_BIT(WIFI_HE_STA_CONFIG_he_mcs9_enabled_BIT, p_c_sta->he_bitmask); - p_a_sta->he_su_beamformee_disabled = H_GET_BIT(WIFI_HE_STA_CONFIG_he_su_beamformee_disabled_BIT, p_c_sta->he_bitmask); - p_a_sta->he_trig_su_bmforming_feedback_disabled = H_GET_BIT(WIFI_HE_STA_CONFIG_he_trig_su_bmforming_feedback_disabled_BIT, p_c_sta->bitmask); - p_a_sta->he_trig_mu_bmforming_partial_feedback_disabled = H_GET_BIT(WIFI_HE_STA_CONFIG_he_trig_mu_bmforming_partial_feedback_disabled_BIT, p_c_sta->bitmask); - p_a_sta->he_trig_cqi_feedback_disabled = H_GET_BIT(WIFI_HE_STA_CONFIG_he_trig_cqi_feedback_disabled_BIT, p_c_sta->bitmask); - p_a_sta->he_reserved = WIFI_HE_STA_GET_RESERVED_VAL(p_c_sta->bitmask); + p_a_sta->he_dcm_set = H_GET_BIT(WIFI_STA_CONFIG_2_he_dcm_set_BIT, p_c_sta->he_bitmask); + /* WIFI_STA_CONFIG_2_he_dcm_max_constellation_tx is two bits wide */ + p_a_sta->he_dcm_max_constellation_tx = (p_c_sta->he_bitmask >> WIFI_STA_CONFIG_2_he_dcm_max_constellation_tx_BITS) & 0x03; + /* WIFI_STA_CONFIG_2_he_dcm_max_constellation_rx is two bits wide */ + p_a_sta->he_dcm_max_constellation_rx = (p_c_sta->he_bitmask >> WIFI_STA_CONFIG_2_he_dcm_max_constellation_rx_BITS) & 0x03; + + p_a_sta->he_mcs9_enabled = H_GET_BIT(WIFI_STA_CONFIG_2_he_mcs9_enabled_BIT, p_c_sta->he_bitmask); + p_a_sta->he_su_beamformee_disabled = H_GET_BIT(WIFI_STA_CONFIG_2_he_su_beamformee_disabled_BIT, p_c_sta->he_bitmask); + p_a_sta->he_trig_su_bmforming_feedback_disabled = H_GET_BIT(WIFI_STA_CONFIG_2_he_trig_su_bmforming_feedback_disabled_BIT, p_c_sta->he_bitmask); + p_a_sta->he_trig_mu_bmforming_partial_feedback_disabled = H_GET_BIT(WIFI_STA_CONFIG_2_he_trig_mu_bmforming_partial_feedback_disabled_BIT, p_c_sta->he_bitmask); + p_a_sta->he_trig_cqi_feedback_disabled = H_GET_BIT(WIFI_STA_CONFIG_2_he_trig_cqi_feedback_disabled_BIT, p_c_sta->he_bitmask); + +#if H_PRESENT_IN_ESP_IDF_5_5_0 + p_a_sta->vht_su_beamformee_disabled = H_GET_BIT(WIFI_STA_CONFIG_2_vht_su_beamformee_disabled, p_c_sta->he_bitmask); + p_a_sta->vht_mu_beamformee_disabled = H_GET_BIT(WIFI_STA_CONFIG_2_vht_mu_beamformee_disabled, p_c_sta->he_bitmask); + p_a_sta->vht_mcs8_enabled = H_GET_BIT(WIFI_STA_CONFIG_2_vht_mcs8_enabled, p_c_sta->he_bitmask); +#endif + +#if H_DECODE_WIFI_RESERVED_FIELD +#if H_WIFI_NEW_RESERVED_FIELD_NAMES + p_a_sta->reserved2 = WIFI_STA_CONFIG_2_GET_RESERVED_VAL(p_c_sta->he_bitmask); +#else + p_a_sta->he_reserved = WIFI_STA_CONFIG_2_GET_RESERVED_VAL(p_c_sta->he_bitmask); +#endif +#endif /* Avoid using fast scan, which leads to faster SSID selection, * but faces data throughput issues when same SSID broadcasted by weaker AP @@ -898,6 +1704,7 @@ static esp_err_t req_wifi_set_config(Rpc *req, Rpc *resp, void *priv_data) p_a_sta->sort_method = WIFI_CONNECT_AP_BY_SIGNAL; RPC_REQ_COPY_STR(p_a_sta->sae_h2e_identifier, p_c_sta->sae_h2e_identifier, SAE_H2E_IDENTIFIER_LEN); + RPC_RET_FAIL_IF(esp_hosted_set_sta_config(req_payload->iface, &cfg)); } else if (req_payload->iface == WIFI_IF_AP) { wifi_ap_config_t * p_a_ap = &(cfg.ap); WifiApConfig * p_c_ap = req_payload->cfg->ap; @@ -911,15 +1718,199 @@ static esp_err_t req_wifi_set_config(Rpc *req, Rpc *resp, void *priv_data) p_a_ap->ssid_hidden = p_c_ap->ssid_hidden; p_a_ap->max_connection = p_c_ap->max_connection; p_a_ap->beacon_interval = p_c_ap->beacon_interval; + p_a_ap->csa_count = p_c_ap->csa_count; + p_a_ap->dtim_period = p_c_ap->dtim_period; p_a_ap->pairwise_cipher = p_c_ap->pairwise_cipher; p_a_ap->ftm_responder = p_c_ap->ftm_responder; - p_a_ap->pmf_cfg.capable = p_c_ap->pmf_cfg->capable; - p_a_ap->pmf_cfg.required = p_c_ap->pmf_cfg->required; + if (p_c_ap->pmf_cfg) { + p_a_ap->pmf_cfg.capable = p_c_ap->pmf_cfg->capable; + p_a_ap->pmf_cfg.required = p_c_ap->pmf_cfg->required; + } p_a_ap->sae_pwe_h2e = p_c_ap->sae_pwe_h2e; +#if H_GOT_AP_CONFIG_PARAM_TRANSITION_DISABLE + p_a_ap->transition_disable = p_c_ap->transition_disable; +#endif +#if H_PRESENT_IN_ESP_IDF_5_5_0 + p_a_ap->sae_ext = p_c_ap->sae_ext; + if (p_c_ap->bss_max_idle_cfg) { + p_a_ap->bss_max_idle_cfg.period = p_c_ap->bss_max_idle_cfg->period; + p_a_ap->bss_max_idle_cfg.protected_keep_alive = p_c_ap->bss_max_idle_cfg->protected_keep_alive; + } + p_a_ap->gtk_rekey_interval = p_c_ap->gtk_rekey_interval; +#endif + + RPC_RET_FAIL_IF(esp_wifi_set_config(req_payload->iface, &cfg)); + } + + return ESP_OK; +} + +typedef enum { + PAYLOAD_TYPE_RPC_RESP_WIFI_GET_CONFIG, + PAYLOAD_TYPE_RPC_EVENT_SUPP_DPP_GET_CONFIG, +#if H_WIFI_DPP_SUPPORT + PAYLOAD_TYPE_RPC_EVENT_WIFI_DPP_GET_CONFIG, +#endif +} rpc_payload_type_t; + +/* + * Copies the station config from ESP-IDF struct to RPC response/event. This is used in: + * - req_wifi_get_config + * - rpc_evt_supp + * - wifi_dpp_cfg_recvd + * + * `type` determines the type of payload the station config is copied to + */ +static esp_err_t copy_wifi_sta_cfg_to_rpc_struct(void *payload, rpc_payload_type_t type, + wifi_sta_config_t *sta_cfg) +{ + wifi_sta_config_t * p_a_sta = sta_cfg; + WifiStaConfig * p_c_sta = NULL; + + if (!payload) { + ESP_LOGE(TAG, "%s called with NULL payload", __func__); + return ESP_FAIL; + } + + /** macros used to do allocation and copying depend on + ** resp_payload or ntfy_payload being defined and used, so do + ** them all here + **/ + switch (type) { + case PAYLOAD_TYPE_RPC_RESP_WIFI_GET_CONFIG: { + RpcRespWifiGetConfig *resp_payload = (RpcRespWifiGetConfig *)payload; + RPC_ALLOC_ELEMENT(WifiStaConfig, resp_payload->cfg->sta, wifi_sta_config__init); + p_c_sta = resp_payload->cfg->sta; + RPC_RESP_COPY_STR(p_c_sta->ssid, p_a_sta->ssid, SSID_LENGTH); + RPC_RESP_COPY_STR(p_c_sta->password, p_a_sta->password, PASSWORD_LENGTH); + RPC_RESP_COPY_BYTES(p_c_sta->bssid, p_a_sta->bssid, BSSID_BYTES_SIZE); + RPC_ALLOC_ELEMENT(WifiScanThreshold, p_c_sta->threshold, wifi_scan_threshold__init); + RPC_ALLOC_ELEMENT(WifiPmfConfig, p_c_sta->pmf_cfg, wifi_pmf_config__init); + break; + } + case PAYLOAD_TYPE_RPC_EVENT_SUPP_DPP_GET_CONFIG: { + RpcEventSuppDppCfgRecvd *ntfy_payload = (RpcEventSuppDppCfgRecvd *)payload; + NTFY_ALLOC_ELEMENT(WifiStaConfig, ntfy_payload->cfg->sta, wifi_sta_config__init); + p_c_sta = ntfy_payload->cfg->sta; + NTFY_COPY_STR(p_c_sta->ssid, p_a_sta->ssid, SSID_LENGTH); + NTFY_COPY_STR(p_c_sta->password, p_a_sta->password, PASSWORD_LENGTH); + NTFY_COPY_BYTES(p_c_sta->bssid, p_a_sta->bssid, BSSID_BYTES_SIZE); + NTFY_ALLOC_ELEMENT(WifiScanThreshold, p_c_sta->threshold, wifi_scan_threshold__init); + NTFY_ALLOC_ELEMENT(WifiPmfConfig, p_c_sta->pmf_cfg, wifi_pmf_config__init); + break; + } +#if H_WIFI_DPP_SUPPORT + case PAYLOAD_TYPE_RPC_EVENT_WIFI_DPP_GET_CONFIG: { + RpcEventWifiDppCfgRecvd *ntfy_payload = (RpcEventWifiDppCfgRecvd *)payload; + NTFY_ALLOC_ELEMENT(WifiStaConfig, ntfy_payload->cfg->sta, wifi_sta_config__init); + p_c_sta = ntfy_payload->cfg->sta; + NTFY_COPY_STR(p_c_sta->ssid, p_a_sta->ssid, SSID_LENGTH); + NTFY_COPY_STR(p_c_sta->password, p_a_sta->password, PASSWORD_LENGTH); + NTFY_COPY_BYTES(p_c_sta->bssid, p_a_sta->bssid, BSSID_BYTES_SIZE); + NTFY_ALLOC_ELEMENT(WifiScanThreshold, p_c_sta->threshold, wifi_scan_threshold__init); + NTFY_ALLOC_ELEMENT(WifiPmfConfig, p_c_sta->pmf_cfg, wifi_pmf_config__init); + break; + } +#endif + } + + if (!p_c_sta) { + ESP_LOGE(TAG, "%s: p_c_sta still NULL", __func__); + return ESP_FAIL; } - RPC_RET_FAIL_IF(esp_wifi_set_config(req_payload->iface, &cfg)); + // generic copying of data done here using only p_c_sta + p_c_sta->scan_method = p_a_sta->scan_method; + p_c_sta->bssid_set = p_a_sta->bssid_set; + p_c_sta->channel = p_a_sta->channel; + p_c_sta->listen_interval = p_a_sta->listen_interval; + p_c_sta->sort_method = p_a_sta->sort_method; + p_c_sta->threshold->rssi = p_a_sta->threshold.rssi; + p_c_sta->threshold->authmode = p_a_sta->threshold.authmode; +#if H_PRESENT_IN_ESP_IDF_5_4_0 + p_c_sta->threshold->rssi_5g_adjustment = p_a_sta->threshold.rssi_5g_adjustment; +#endif + p_c_sta->pmf_cfg->capable = p_a_sta->pmf_cfg.capable; + p_c_sta->pmf_cfg->required = p_a_sta->pmf_cfg.required; + + if (p_a_sta->rm_enabled) + H_SET_BIT(WIFI_STA_CONFIG_1_rm_enabled, p_c_sta->bitmask); + + if (p_a_sta->btm_enabled) + H_SET_BIT(WIFI_STA_CONFIG_1_btm_enabled, p_c_sta->bitmask); + + if (p_a_sta->mbo_enabled) + H_SET_BIT(WIFI_STA_CONFIG_1_mbo_enabled, p_c_sta->bitmask); + + if (p_a_sta->ft_enabled) + H_SET_BIT(WIFI_STA_CONFIG_1_ft_enabled, p_c_sta->bitmask); + + if (p_a_sta->owe_enabled) + H_SET_BIT(WIFI_STA_CONFIG_1_owe_enabled, p_c_sta->bitmask); + + if (p_a_sta->transition_disable) + H_SET_BIT(WIFI_STA_CONFIG_1_transition_disable, p_c_sta->bitmask); + +#if H_DECODE_WIFI_RESERVED_FIELD +#if H_WIFI_NEW_RESERVED_FIELD_NAMES + WIFI_STA_CONFIG_1_SET_RESERVED_VAL(p_a_sta->reserved1, p_c_sta->bitmask); +#else + WIFI_STA_CONFIG_1_SET_RESERVED_VAL(p_a_sta->reserved, p_c_sta->bitmask); +#endif +#endif + + p_c_sta->sae_pwe_h2e = p_a_sta->sae_pwe_h2e; + p_c_sta->sae_pk_mode = p_a_sta->sae_pk_mode; + p_c_sta->failure_retry_cnt = p_a_sta->failure_retry_cnt; + + /* HE field handling */ + if (p_a_sta->he_dcm_set) + H_SET_BIT(WIFI_STA_CONFIG_2_he_dcm_set_BIT, p_c_sta->he_bitmask); + + /* WIFI_STA_CONFIG_2_he_dcm_max_constellation_tx is two bits wide */ + if (p_a_sta->he_dcm_max_constellation_tx & 0x03) { + p_c_sta->he_bitmask |= (p_a_sta->he_dcm_max_constellation_tx & 0x03) << WIFI_STA_CONFIG_2_he_dcm_max_constellation_tx_BITS; + } + /* WIFI_STA_CONFIG_2_he_dcm_max_constellation_rx is two bits wide */ + if (p_a_sta->he_dcm_max_constellation_rx & 0x03) { + p_c_sta->he_bitmask |= (p_a_sta->he_dcm_max_constellation_rx & 0x03) << WIFI_STA_CONFIG_2_he_dcm_max_constellation_rx_BITS; + } + if (p_a_sta->he_mcs9_enabled) + H_SET_BIT(WIFI_STA_CONFIG_2_he_mcs9_enabled_BIT, p_c_sta->he_bitmask); + + if (p_a_sta->he_su_beamformee_disabled) + H_SET_BIT(WIFI_STA_CONFIG_2_he_su_beamformee_disabled_BIT, p_c_sta->he_bitmask); + + if (p_a_sta->he_trig_su_bmforming_feedback_disabled) + H_SET_BIT(WIFI_STA_CONFIG_2_he_trig_su_bmforming_feedback_disabled_BIT, p_c_sta->he_bitmask); + + if (p_a_sta->he_trig_mu_bmforming_partial_feedback_disabled) + H_SET_BIT(WIFI_STA_CONFIG_2_he_trig_mu_bmforming_partial_feedback_disabled_BIT, p_c_sta->he_bitmask); + + if (p_a_sta->he_trig_cqi_feedback_disabled) + H_SET_BIT(WIFI_STA_CONFIG_2_he_trig_cqi_feedback_disabled_BIT, p_c_sta->he_bitmask); + +#if H_PRESENT_IN_ESP_IDF_5_5_0 + if (p_a_sta->vht_su_beamformee_disabled) + H_SET_BIT(WIFI_STA_CONFIG_2_vht_su_beamformee_disabled, p_c_sta->he_bitmask); + + if (p_a_sta->vht_mu_beamformee_disabled) + H_SET_BIT(WIFI_STA_CONFIG_2_vht_mu_beamformee_disabled, p_c_sta->he_bitmask); + + if (p_a_sta->vht_mcs8_enabled) + H_SET_BIT(WIFI_STA_CONFIG_2_vht_mcs8_enabled, p_c_sta->he_bitmask); +#endif + +#if H_DECODE_WIFI_RESERVED_FIELD +#if H_WIFI_NEW_RESERVED_FIELD_NAMES + WIFI_STA_CONFIG_2_SET_RESERVED_VAL(p_a_sta->reserved2, p_c_sta->he_bitmask); +#else + WIFI_STA_CONFIG_2_SET_RESERVED_VAL(p_a_sta->he_reserved, p_c_sta->he_bitmask); +#endif +#endif + +err: return ESP_OK; } @@ -941,53 +1932,13 @@ static esp_err_t req_wifi_get_config(Rpc *req, Rpc *resp, void *priv_data) switch (iface) { case WIFI_IF_STA: { - wifi_sta_config_t * p_a_sta = &(cfg.sta); resp_payload->cfg->u_case = WIFI_CONFIG__U_STA; - - RPC_ALLOC_ELEMENT(WifiStaConfig, resp_payload->cfg->sta, wifi_sta_config__init); - - WifiStaConfig * p_c_sta = resp_payload->cfg->sta; - RPC_RESP_COPY_STR(p_c_sta->ssid, p_a_sta->ssid, SSID_LENGTH); - RPC_RESP_COPY_STR(p_c_sta->password, p_a_sta->password, PASSWORD_LENGTH); - p_c_sta->scan_method = p_a_sta->scan_method; - p_c_sta->bssid_set = p_a_sta->bssid_set; - - //TODO: Expected to break python for bssid - if (p_c_sta->bssid_set) - RPC_RESP_COPY_BYTES(p_c_sta->bssid, p_a_sta->bssid, BSSID_BYTES_SIZE); - - p_c_sta->channel = p_a_sta->channel; - p_c_sta->listen_interval = p_a_sta->listen_interval; - p_c_sta->sort_method = p_a_sta->sort_method; - RPC_ALLOC_ELEMENT(WifiScanThreshold, p_c_sta->threshold, wifi_scan_threshold__init); - p_c_sta->threshold->rssi = p_a_sta->threshold.rssi; - p_c_sta->threshold->authmode = p_a_sta->threshold.authmode; - RPC_ALLOC_ELEMENT(WifiPmfConfig, p_c_sta->pmf_cfg, wifi_pmf_config__init); - p_c_sta->pmf_cfg->capable = p_a_sta->pmf_cfg.capable; - p_c_sta->pmf_cfg->required = p_a_sta->pmf_cfg.required; - - if (p_a_sta->rm_enabled) - H_SET_BIT(STA_RM_ENABLED_BIT, p_c_sta->bitmask); - - if (p_a_sta->btm_enabled) - H_SET_BIT(STA_BTM_ENABLED_BIT, p_c_sta->bitmask); - - if (p_a_sta->mbo_enabled) - H_SET_BIT(STA_MBO_ENABLED_BIT, p_c_sta->bitmask); - - if (p_a_sta->ft_enabled) - H_SET_BIT(STA_FT_ENABLED_BIT, p_c_sta->bitmask); - - if (p_a_sta->owe_enabled) - H_SET_BIT(STA_OWE_ENABLED_BIT, p_c_sta->bitmask); - - if (p_a_sta->transition_disable) - H_SET_BIT(STA_TRASITION_DISABLED_BIT, p_c_sta->bitmask); - - WIFI_CONFIG_STA_SET_RESERVED_VAL(p_a_sta->reserved, p_c_sta->bitmask); - - p_c_sta->sae_pwe_h2e = p_a_sta->sae_pwe_h2e; - p_c_sta->failure_retry_cnt = p_a_sta->failure_retry_cnt; + esp_err_t res = copy_wifi_sta_cfg_to_rpc_struct(resp_payload, + PAYLOAD_TYPE_RPC_RESP_WIFI_GET_CONFIG, &cfg.sta); + if (res != ESP_OK) { + ESP_LOGE(TAG, "RPC_RESP: copy_wifi_sta_cfg_to_rpc_struct() FAILED"); + return res; + } break; } case WIFI_IF_AP: { @@ -998,19 +1949,31 @@ static esp_err_t req_wifi_get_config(Rpc *req, Rpc *resp, void *priv_data) WifiApConfig * p_c_ap = resp_payload->cfg->ap; RPC_RESP_COPY_STR(p_c_ap->password, p_a_ap->password, PASSWORD_LENGTH); p_c_ap->ssid_len = p_a_ap->ssid_len; + if (p_c_ap->ssid_len) + RPC_RESP_COPY_STR(p_c_ap->ssid, p_a_ap->ssid, SSID_LENGTH); p_c_ap->channel = p_a_ap->channel; p_c_ap->authmode = p_a_ap->authmode; p_c_ap->ssid_hidden = p_a_ap->ssid_hidden; p_c_ap->max_connection = p_a_ap->max_connection; p_c_ap->beacon_interval = p_a_ap->beacon_interval; + p_c_ap->csa_count = p_a_ap->csa_count; + p_c_ap->dtim_period = p_a_ap->dtim_period; p_c_ap->pairwise_cipher = p_a_ap->pairwise_cipher; p_c_ap->ftm_responder = p_a_ap->ftm_responder; RPC_ALLOC_ELEMENT(WifiPmfConfig, p_c_ap->pmf_cfg, wifi_pmf_config__init); p_c_ap->pmf_cfg->capable = p_a_ap->pmf_cfg.capable; p_c_ap->pmf_cfg->required = p_a_ap->pmf_cfg.required; - if (p_c_ap->ssid_len) - RPC_RESP_COPY_STR(p_c_ap->ssid, p_a_ap->ssid, SSID_LENGTH); p_c_ap->sae_pwe_h2e = p_a_ap->sae_pwe_h2e; +#if H_GOT_AP_CONFIG_PARAM_TRANSITION_DISABLE + p_c_ap->transition_disable = p_a_ap->transition_disable; +#endif +#if H_PRESENT_IN_ESP_IDF_5_5_0 + p_c_ap->sae_ext = p_a_ap->sae_ext; + RPC_ALLOC_ELEMENT(WifiBssMaxIdleConfig, p_c_ap->bss_max_idle_cfg, wifi_bss_max_idle_config__init); + p_c_ap->bss_max_idle_cfg->period = p_a_ap->bss_max_idle_cfg.period; + p_c_ap->bss_max_idle_cfg->protected_keep_alive = p_a_ap->bss_max_idle_cfg.protected_keep_alive; + p_c_ap->gtk_rekey_interval = p_a_ap->gtk_rekey_interval; +#endif break; } default: @@ -1058,6 +2021,11 @@ static esp_err_t req_wifi_scan_start(Rpc *req, Rpc *resp, void *priv_data) p_a_st->active.max = p_c_st->active->max ; p_a->home_chan_dwell_time = p_c->home_chan_dwell_time; + + if (p_c->channel_bitmap) { + p_a->channel_bitmap.ghz_2_channels = p_c->channel_bitmap->ghz_2_channels; + p_a->channel_bitmap.ghz_5_channels = p_c->channel_bitmap->ghz_5_channels; + } } RPC_RET_FAIL_IF(esp_wifi_scan_start(p_a, req_payload->block)); @@ -1070,11 +2038,12 @@ static esp_err_t req_wifi_scan_start(Rpc *req, Rpc *resp, void *priv_data) static esp_err_t req_wifi_set_protocol(Rpc *req, Rpc *resp, void *priv_data) { RPC_TEMPLATE(RpcRespWifiSetProtocol, resp_wifi_set_protocol, - RpcReqWifiSetProtocol, req_wifi_set_protocol, - rpc__resp__wifi_set_protocol__init); + RpcReqWifiSetProtocol, req_wifi_set_protocol, + rpc__resp__wifi_set_protocol__init); RPC_RET_FAIL_IF(esp_wifi_set_protocol(req_payload->ifx, req_payload->protocol_bitmap)); + return ESP_OK; } @@ -1288,6 +2257,7 @@ static esp_err_t req_wifi_scan_get_ap_records(Rpc *req, Rpc *resp, void *priv_da resp_payload->ap_records = (WifiApRecord**)calloc(number, sizeof(WifiApRecord *)); if (!resp_payload->ap_records) { ESP_LOGE(TAG,"resp: malloc failed for resp_payload->ap_records"); + resp_payload->resp = RPC_ERR_MEMORY_FAILURE; goto err; } @@ -1384,7 +2354,10 @@ static esp_err_t req_wifi_set_storage(Rpc *req, Rpc *resp, void *priv_data) RpcReqWifiSetStorage, req_wifi_set_storage, rpc__resp__wifi_set_storage__init); + ESP_LOGI(TAG, "Setting wifi storage: %lu", req_payload->storage); + RPC_RET_FAIL_IF(esp_wifi_set_storage(req_payload->storage)); + return ESP_OK; } @@ -1395,6 +2368,7 @@ static esp_err_t req_wifi_set_bandwidth(Rpc *req, Rpc *resp, void *priv_data) rpc__resp__wifi_set_bandwidth__init); RPC_RET_FAIL_IF(esp_wifi_set_bandwidth(req_payload->ifx, req_payload->bw)); + return ESP_OK; } @@ -1418,6 +2392,7 @@ static esp_err_t req_wifi_set_channel(Rpc *req, Rpc *resp, void *priv_data) rpc__resp__wifi_set_channel__init); RPC_RET_FAIL_IF(esp_wifi_set_channel(req_payload->primary, req_payload->second)); + return ESP_OK; } @@ -1622,9 +2597,9 @@ static esp_err_t req_wifi_sta_get_negotiated_phymode(Rpc *req, Rpc *resp, void * return ESP_OK; } +#if H_PRESENT_IN_ESP_IDF_5_4_0 static esp_err_t req_wifi_set_protocols(Rpc *req, Rpc *resp, void *priv_data) { -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) RPC_TEMPLATE(RpcRespWifiSetProtocols, resp_wifi_set_protocols, RpcReqWifiSetProtocols, req_wifi_set_protocols, rpc__resp__wifi_set_protocols__init); @@ -1644,14 +2619,10 @@ static esp_err_t req_wifi_set_protocols(Rpc *req, Rpc *resp, void *priv_data) RPC_RET_FAIL_IF(esp_wifi_set_protocols(ifx, &protocols)); return ESP_OK; -#else - return ESP_FAIL; -#endif } static esp_err_t req_wifi_get_protocols(Rpc *req, Rpc *resp, void *priv_data) { -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) RPC_TEMPLATE(RpcRespWifiGetProtocols, resp_wifi_get_protocols, RpcReqWifiGetProtocols, req_wifi_get_protocols, rpc__resp__wifi_get_protocols__init); @@ -1671,15 +2642,10 @@ static esp_err_t req_wifi_get_protocols(Rpc *req, Rpc *resp, void *priv_data) ESP_LOGI(TAG, "get protocols: ghz_2g %d, ghz_5g %d", protocols.ghz_2g, protocols.ghz_5g); err: return ESP_OK; -#else - return ESP_FAIL; -#endif - } static esp_err_t req_wifi_set_bandwidths(Rpc *req, Rpc *resp, void *priv_data) { -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) RPC_TEMPLATE(RpcRespWifiSetBandwidths, resp_wifi_set_bandwidths, RpcReqWifiSetBandwidths, req_wifi_set_bandwidths, rpc__resp__wifi_set_bandwidths__init); @@ -1700,14 +2666,10 @@ static esp_err_t req_wifi_set_bandwidths(Rpc *req, Rpc *resp, void *priv_data) RPC_RET_FAIL_IF(esp_wifi_set_bandwidths(ifx, &bw)); return ESP_OK; -#else - return ESP_FAIL; -#endif } static esp_err_t req_wifi_get_bandwidths(Rpc *req, Rpc *resp, void *priv_data) { -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) RPC_TEMPLATE(RpcRespWifiGetBandwidths, resp_wifi_get_bandwidths, RpcReqWifiGetBandwidths, req_wifi_get_bandwidths, rpc__resp__wifi_get_bandwidths__init); @@ -1728,14 +2690,10 @@ static esp_err_t req_wifi_get_bandwidths(Rpc *req, Rpc *resp, void *priv_data) ESP_LOGI(TAG, "get bandwidths: ghz_2g %d, ghz_5g %d", bw.ghz_2g, bw.ghz_5g); err: return ESP_OK; -#else - return ESP_FAIL; -#endif } static esp_err_t req_wifi_set_band(Rpc *req, Rpc *resp, void *priv_data) { -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) RPC_TEMPLATE(RpcRespWifiSetBand, resp_wifi_set_band, RpcReqWifiSetBand, req_wifi_set_band, rpc__resp__wifi_set_band__init); @@ -1743,19 +2701,13 @@ static esp_err_t req_wifi_set_band(Rpc *req, Rpc *resp, void *priv_data) wifi_band_t band; band = req_payload->band; - ESP_LOGW(TAG, "set band: %d", band); - RPC_RET_FAIL_IF(esp_wifi_set_band(band)); return ESP_OK; -#else - return ESP_FAIL; -#endif } static esp_err_t req_wifi_get_band(Rpc *req, Rpc *resp, void *priv_data) { -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) RPC_TEMPLATE_SIMPLE(RpcRespWifiGetBand, resp_wifi_get_band, RpcReqWifiGetBand, req_wifi_get_band, rpc__resp__wifi_get_band__init); @@ -1768,14 +2720,10 @@ static esp_err_t req_wifi_get_band(Rpc *req, Rpc *resp, void *priv_data) ESP_LOGW(TAG, "get band: %d", band); return ESP_OK; -#else - return ESP_FAIL; -#endif } static esp_err_t req_wifi_set_band_mode(Rpc *req, Rpc *resp, void *priv_data) { -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) RPC_TEMPLATE(RpcRespWifiSetBandMode, resp_wifi_set_bandmode, RpcReqWifiSetBandMode, req_wifi_set_bandmode, rpc__resp__wifi_set_band_mode__init); @@ -1783,19 +2731,15 @@ static esp_err_t req_wifi_set_band_mode(Rpc *req, Rpc *resp, void *priv_data) wifi_band_mode_t band_mode; band_mode = req_payload->bandmode; - ESP_LOGW(TAG, "set band_mode: %d", band_mode); + ESP_LOGW(TAG, "set band mode: %d", band_mode); RPC_RET_FAIL_IF(esp_wifi_set_band_mode(band_mode)); return ESP_OK; -#else - return ESP_FAIL; -#endif } static esp_err_t req_wifi_get_band_mode(Rpc *req, Rpc *resp, void *priv_data) { -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) RPC_TEMPLATE_SIMPLE(RpcRespWifiGetBandMode, resp_wifi_get_bandmode, RpcReqWifiGetBandMode, req_wifi_get_bandmode, rpc__resp__wifi_get_band_mode__init); @@ -1808,75 +2752,1060 @@ static esp_err_t req_wifi_get_band_mode(Rpc *req, Rpc *resp, void *priv_data) ESP_LOGW(TAG, "get band_mode: %d", band_mode); return ESP_OK; +} +#endif // H_PRESENT_IN_ESP_IDF_5_4_0 + +/* Get DHCP/DNS status handler */ +static esp_err_t req_get_dhcp_dns_status(Rpc *req, Rpc *resp, void *priv_data) +{ +#ifdef CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED + RPC_TEMPLATE(RpcRespGetDhcpDnsStatus, resp_get_dhcp_dns, + RpcReqGetDhcpDnsStatus, req_get_dhcp_dns, + rpc__resp__get_dhcp_dns_status__init); #else - return ESP_FAIL; + RPC_TEMPLATE_SIMPLE(RpcRespGetDhcpDnsStatus, resp_get_dhcp_dns, + RpcReqGetDhcpDnsStatus, req_get_dhcp_dns, + rpc__resp__get_dhcp_dns_status__init); +#endif + +#ifdef CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED + int ret1, ret2; + esp_netif_ip_info_t ip_info = {0}; + esp_netif_dns_info_t dns = {0}; + uint8_t netlink_up = 0; + + ret1 = get_slave_static_ip(req_payload->iface, &ip_info, &netlink_up); + ret2 = get_slave_dns(req_payload->iface, &dns); + + if (ret1 || ret2) { + ESP_LOGE(TAG, "Failed to get DHCP/DNS status"); + resp_payload->resp = ESP_FAIL; + resp_payload->dhcp_up = 0; + resp_payload->dns_up = 0; + resp_payload->net_link_up = 0; + return ESP_OK; + } + ESP_LOGI(TAG, "static_ip_ret: %d dns_ret: %d", ret1, ret2); + + resp_payload->net_link_up = netlink_up; + resp_payload->dhcp_up = netlink_up; + resp_payload->dns_up = netlink_up; + resp_payload->dns_type = dns.ip.type; + + char sta_ip[64] = {0}; + char sta_nm[64] = {0}; + char sta_gw[64] = {0}; + char sta_dns_ip[64] = {0}; + + if (esp_ip4addr_ntoa(&ip_info.ip, sta_ip, sizeof(sta_ip))) { + strlcpy((char *)resp_payload->dhcp_ip.data, sta_ip, sizeof(resp_payload->dhcp_ip.data)); + resp_payload->dhcp_ip.len = strlen(sta_ip); + } + if (esp_ip4addr_ntoa(&ip_info.netmask, sta_nm, sizeof(sta_nm))) { + strlcpy((char *)resp_payload->dhcp_nm.data, sta_nm, sizeof(resp_payload->dhcp_nm.data)); + resp_payload->dhcp_nm.len = strlen(sta_nm); + } + if (esp_ip4addr_ntoa(&ip_info.gw, sta_gw, sizeof(sta_gw))) { + strlcpy((char *)resp_payload->dhcp_gw.data, sta_gw, sizeof(resp_payload->dhcp_gw.data)); + resp_payload->dhcp_gw.len = strlen(sta_gw); + } + if (esp_ip4addr_ntoa(&dns.ip.u_addr.ip4, sta_dns_ip, sizeof(sta_dns_ip))) { + strlcpy((char *)resp_payload->dns_ip.data, sta_dns_ip, sizeof(resp_payload->dns_ip.data)); + resp_payload->dns_ip.len = strlen(sta_dns_ip); + } + + ESP_LOGI(TAG, "Fetched IP: %s, NM: %s, GW: %s, DNS IP: %s, Type: %"PRId32, + resp_payload->dhcp_ip.data, + resp_payload->dhcp_nm.data, + resp_payload->dhcp_gw.data, + resp_payload->dns_ip.data, + resp_payload->dns_type); + + resp_payload->resp = ESP_OK; +#else + resp_payload->resp = ESP_FAIL; #endif + return ESP_OK; } -static esp_err_t req_get_coprocessor_fw_version(Rpc *req, Rpc *resp, void *priv_data) +static esp_err_t req_set_dhcp_dns_status(Rpc *req, Rpc *resp, void *priv_data) { - RPC_TEMPLATE_SIMPLE(RpcRespGetCoprocessorFwVersion, resp_get_coprocessor_fwversion, - RpcReqGetCoprocessorFwVersion, req_get_coprocessor_fwversion, - rpc__resp__get_coprocessor_fw_version__init); - resp_payload->major1 = PROJECT_VERSION_MAJOR_1; - resp_payload->minor1 = PROJECT_VERSION_MINOR_1; - resp_payload->patch1 = PROJECT_VERSION_PATCH_1; - resp_payload->resp = ESP_OK; +#ifdef CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED + RPC_TEMPLATE(RpcRespSetDhcpDnsStatus, resp_set_dhcp_dns, + RpcReqSetDhcpDnsStatus, req_set_dhcp_dns, + rpc__resp__set_dhcp_dns_status__init); +#else + RPC_TEMPLATE_SIMPLE(RpcRespSetDhcpDnsStatus, resp_set_dhcp_dns, + RpcReqSetDhcpDnsStatus, req_set_dhcp_dns, + rpc__resp__set_dhcp_dns_status__init); +#endif + +#ifdef CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED + + uint8_t iface = req_payload->iface; + uint8_t net_link_up = req_payload->net_link_up; + uint8_t dhcp_up = req_payload->dhcp_up; + uint8_t dns_up = req_payload->dns_up; + uint8_t dns_type = req_payload->dns_type; + + char dhcp_ip[64] = {0}; + char dhcp_nm[64] = {0}; + char dhcp_gw[64] = {0}; + char dns_ip[64] = {0}; + + ESP_LOGI(TAG, "iface: %u link_up:%u dhcp_up:%u dns_up:%u dns_type:%u", + iface, net_link_up, dhcp_up, dns_up, dns_type); + + if (req_payload->dhcp_ip.len) + ESP_LOGI(TAG, "dhcp ip: %s" , req_payload->dhcp_ip.data); + if (req_payload->dhcp_nm.len) + ESP_LOGI(TAG, "dhcp nm: %s" , req_payload->dhcp_nm.data); + if (req_payload->dhcp_gw.len) + ESP_LOGI(TAG, "dhcp gw: %s" , req_payload->dhcp_gw.data); + if (req_payload->dns_ip.len) + ESP_LOGI(TAG, "dns ip: %s" , req_payload->dns_ip.data); + + RPC_REQ_COPY_BYTES(dhcp_ip, req_payload->dhcp_ip, sizeof(dhcp_ip)); + RPC_REQ_COPY_BYTES(dhcp_nm, req_payload->dhcp_nm, sizeof(dhcp_nm)); + RPC_REQ_COPY_BYTES(dhcp_gw, req_payload->dhcp_gw, sizeof(dhcp_gw)); + RPC_REQ_COPY_BYTES(dns_ip, req_payload->dns_ip, sizeof(dns_ip)); + + if (dhcp_up) + set_slave_static_ip(iface, dhcp_ip, dhcp_nm, dhcp_gw); + + if (dns_up) + set_slave_dns(iface, dns_ip, dns_type); +#else + + resp_payload->resp = ESP_FAIL; + +#endif return ESP_OK; } -#if 0 -static esp_err_t req_wifi_(Rpc *req, Rpc *resp, void *priv_data) +static esp_err_t req_wifi_set_inactive_time(Rpc *req, Rpc *resp, void *priv_data) { - RPC_TEMPLATE(RpcRespWifi, resp_wifi_, - RpcReqWifi, req_wifi_, - rpc__resp__wifi___init); + RPC_TEMPLATE(RpcRespWifiSetInactiveTime, resp_wifi_set_inactive_time, + RpcReqWifiSetInactiveTime, req_wifi_set_inactive_time, + rpc__resp__wifi_set_inactive_time__init); + + wifi_interface_t ifx = req_payload->ifx; + uint16_t sec = req_payload->sec; - RPC_RET_FAIL_IF(esp_wifi_(&cfg)); + RPC_RET_FAIL_IF(esp_wifi_set_inactive_time(ifx, sec)); return ESP_OK; } -#endif -static esp_rpc_req_t req_table[] = { - { - .req_num = RPC_ID__Req_GetMACAddress , - .command_handler = req_wifi_get_mac - }, - { - .req_num = RPC_ID__Req_GetWifiMode, - .command_handler = req_wifi_get_mode - }, - { - .req_num = RPC_ID__Req_SetWifiMode, - .command_handler = req_wifi_set_mode - }, - { - .req_num = RPC_ID__Req_SetMacAddress, - .command_handler = req_wifi_set_mac - }, - { - .req_num = RPC_ID__Req_WifiSetPs, - .command_handler = req_wifi_set_ps - }, - { - .req_num = RPC_ID__Req_WifiGetPs, - .command_handler = req_wifi_get_ps - }, - { - .req_num = RPC_ID__Req_OTABegin, - .command_handler = req_ota_begin_handler - }, - { - .req_num = RPC_ID__Req_OTAWrite, - .command_handler = req_ota_write_handler - }, - { - .req_num = RPC_ID__Req_OTAEnd, - .command_handler = req_ota_end_handler - }, +static esp_err_t req_wifi_get_inactive_time(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespWifiGetInactiveTime, resp_wifi_get_inactive_time, + RpcReqWifiGetInactiveTime, req_wifi_get_inactive_time, + rpc__resp__wifi_get_inactive_time__init); + + wifi_interface_t ifx = req_payload->ifx; + uint16_t sec; + + RPC_RET_FAIL_IF(esp_wifi_get_inactive_time(ifx, &sec)); + + resp_payload->sec = sec; + + return ESP_OK; +} + +#if H_WIFI_ENTERPRISE_SUPPORT +static esp_err_t req_wifi_sta_enterprise_enable(Rpc *req, + Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE_SIMPLE(RpcRespWifiStaEnterpriseEnable, resp_wifi_sta_enterprise_enable, + RpcReqWifiStaEnterpriseEnable, req_wifi_sta_enterprise_enable, + rpc__resp__wifi_sta_enterprise_enable__init); + + RPC_RET_FAIL_IF(esp_wifi_sta_enterprise_enable()); + + return ESP_OK; +} + +static esp_err_t req_wifi_sta_enterprise_disable(Rpc *req, + Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE_SIMPLE(RpcRespWifiStaEnterpriseDisable, resp_wifi_sta_enterprise_disable, + RpcReqWifiStaEnterpriseDisable, req_wifi_sta_enterprise_disable, + rpc__resp__wifi_sta_enterprise_disable__init); + + free_g_ca_cert(); + free_all_g_eap_cert_and_key(); + RPC_RET_FAIL_IF(esp_wifi_sta_enterprise_disable()); + + return ESP_OK; +} + +static esp_err_t req_eap_set_identity(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespEapSetIdentity, resp_eap_set_identity, + RpcReqEapSetIdentity, req_eap_set_identity, + rpc__resp__eap_set_identity__init); + + RPC_RET_FAIL_IF(!req_payload->identity.data || req_payload->len <= 0); + const unsigned char *identity = req_payload->identity.data; + int len = req_payload->len; + + RPC_RET_FAIL_IF(esp_eap_client_set_identity(identity, len)); + return ESP_OK; +} + +static esp_err_t req_eap_clear_identity(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE_SIMPLE(RpcRespEapClearIdentity, resp_eap_clear_identity, + RpcReqEapClearIdentity, req_eap_clear_identity, + rpc__resp__eap_clear_identity__init); + + esp_eap_client_clear_identity(); + + return ESP_OK; +} + +static esp_err_t req_eap_set_username(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespEapSetUsername, resp_eap_set_username, + RpcReqEapSetUsername, req_eap_set_username, + rpc__resp__eap_set_username__init); + + RPC_RET_FAIL_IF(!req_payload->username.data || req_payload->len <= 0); + const unsigned char *username = req_payload->username.data; + int len = req_payload->len; + + RPC_RET_FAIL_IF(esp_eap_client_set_username(username, len)); + + return ESP_OK; +} + +static esp_err_t req_eap_clear_username(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE_SIMPLE(RpcRespEapClearUsername, resp_eap_clear_username, + RpcReqEapClearUsername, req_eap_clear_username, + rpc__resp__eap_clear_username__init); + + esp_eap_client_clear_username(); + + return ESP_OK; +} + +static esp_err_t req_eap_set_password(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespEapSetPassword, resp_eap_set_password, + RpcReqEapSetPassword, req_eap_set_password, + rpc__resp__eap_set_password__init); + + RPC_RET_FAIL_IF(!req_payload->password.data || req_payload->len <= 0); + const unsigned char *password = req_payload->password.data; + int len = req_payload->len; + + RPC_RET_FAIL_IF(esp_eap_client_set_password(password, len)); + + return ESP_OK; +} + +static esp_err_t req_eap_clear_password(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE_SIMPLE(RpcRespEapClearPassword, resp_eap_clear_password, + RpcReqEapClearPassword, req_eap_clear_password, + rpc__resp__eap_clear_password__init); + + esp_eap_client_clear_password(); + + return ESP_OK; +} + +static esp_err_t req_eap_set_new_password(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespEapSetNewPassword, resp_eap_set_new_password, + RpcReqEapSetNewPassword, req_eap_set_new_password, + rpc__resp__eap_set_new_password__init); + + RPC_RET_FAIL_IF(!req_payload->new_password.data || req_payload->len <= 0); + + RPC_RET_FAIL_IF(esp_eap_client_set_password(req_payload->new_password.data, req_payload->len)); + + return ESP_OK; +} + +static esp_err_t req_eap_clear_new_password(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE_SIMPLE(RpcRespEapClearNewPassword, resp_eap_clear_new_password, + RpcReqEapClearNewPassword, req_eap_clear_new_password, + rpc__resp__eap_clear_new_password__init); + + esp_eap_client_clear_new_password(); + + return ESP_OK; +} + +static esp_err_t req_eap_set_ca_cert(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespEapSetCaCert, resp_eap_set_ca_cert, + RpcReqEapSetCaCert, req_eap_set_ca_cert, + rpc__resp__eap_set_ca_cert__init); + + RPC_RET_FAIL_IF(!req_payload->ca_cert.data || req_payload->ca_cert_len <= 0); + free_g_ca_cert(); + g_ca_cert_len = req_payload->ca_cert_len; + if (g_ca_cert_len) { + g_ca_cert = (unsigned char *)malloc(g_ca_cert_len); + if (g_ca_cert == NULL) { + return ESP_ERR_NO_MEM; + } + memcpy(g_ca_cert, req_payload->ca_cert.data, g_ca_cert_len); + } + + RPC_RET_FAIL_IF(esp_eap_client_set_ca_cert(g_ca_cert, g_ca_cert_len)); + + return ESP_OK; +} + +static esp_err_t req_eap_clear_ca_cert(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE_SIMPLE(RpcRespEapClearCaCert, resp_eap_clear_ca_cert, + RpcReqEapClearCaCert, req_eap_clear_ca_cert, + rpc__resp__eap_clear_ca_cert__init); + + free_g_ca_cert(); + esp_eap_client_clear_ca_cert(); + + return ESP_OK; +} + +static esp_err_t req_eap_set_certificate_and_key(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespEapSetCertificateAndKey, resp_eap_set_certificate_and_key, + RpcReqEapSetCertificateAndKey, req_eap_set_certificate_and_key, + rpc__resp__eap_set_certificate_and_key__init); + + RPC_RET_FAIL_IF((req_payload->client_cert.data && req_payload->client_cert_len <= 0) || + (req_payload->client_cert_len > 0 && !req_payload->client_cert.data)); + RPC_RET_FAIL_IF((req_payload->private_key.data && req_payload->private_key_len <= 0) || + (req_payload->private_key_len > 0 && !req_payload->private_key.data)); + RPC_RET_FAIL_IF((req_payload->private_key_password.data && req_payload->private_key_passwd_len <= 0) || + (req_payload->private_key_passwd_len > 0 && !req_payload->private_key_password.data)); + + free_all_g_eap_cert_and_key(); + g_client_cert_len = req_payload->client_cert_len; + if (g_client_cert_len) { + g_client_cert = (unsigned char *)malloc(g_client_cert_len); + if (g_client_cert == NULL) { + return ESP_ERR_NO_MEM; + } + memcpy(g_client_cert, req_payload->client_cert.data, g_client_cert_len); + } + + g_private_key_len = req_payload->private_key_len; + if (g_private_key_len) { + g_private_key = (unsigned char *)malloc(g_private_key_len); + if (g_private_key == NULL) { + free_all_g_eap_cert_and_key(); + return ESP_ERR_NO_MEM; + } + memcpy(g_private_key, req_payload->private_key.data, g_private_key_len); + } + + g_private_key_passwd_len = req_payload->private_key_passwd_len; + if (g_private_key_passwd_len) { + g_private_key_password = (unsigned char *)malloc(g_private_key_passwd_len); + if (g_private_key_password == NULL) { + free_all_g_eap_cert_and_key(); + return ESP_ERR_NO_MEM; + } + memcpy(g_private_key_password, req_payload->private_key_password.data, g_private_key_passwd_len); + } + + RPC_RET_FAIL_IF(esp_eap_client_set_certificate_and_key(g_client_cert, g_client_cert_len, + g_private_key, g_private_key_len, + g_private_key_password, g_private_key_passwd_len)); + + return ESP_OK; +} + +static esp_err_t req_eap_clear_certificate_and_key(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE_SIMPLE(RpcRespEapClearCertificateAndKey, resp_eap_clear_certificate_and_key, + RpcReqEapClearCertificateAndKey, req_eap_clear_certificate_and_key, + rpc__resp__eap_clear_certificate_and_key__init); + + free_all_g_eap_cert_and_key(); + esp_eap_client_clear_certificate_and_key(); + + return ESP_OK; +} + +static esp_err_t req_eap_set_disable_time_check(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespEapSetDisableTimeCheck, resp_eap_set_disable_time_check, + RpcReqEapSetDisableTimeCheck, req_eap_set_disable_time_check, + rpc__resp__eap_set_disable_time_check__init); + + RPC_RET_FAIL_IF(esp_eap_client_set_disable_time_check(req_payload->disable)); + + return ESP_OK; +} + +static esp_err_t req_eap_get_disable_time_check(Rpc *req, Rpc *resp, void *priv_data) +{ + bool disable = false; + + RPC_TEMPLATE_SIMPLE(RpcRespEapGetDisableTimeCheck, resp_eap_get_disable_time_check, + RpcReqEapGetDisableTimeCheck, req_eap_get_disable_time_check, + rpc__resp__eap_get_disable_time_check__init); + + RPC_RET_FAIL_IF(esp_eap_client_get_disable_time_check(&disable)); + + resp_payload->disable = disable; + + return ESP_OK; +} + +static esp_err_t req_eap_set_ttls_phase2_method(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespEapSetTtlsPhase2Method, resp_eap_set_ttls_phase2_method, + RpcReqEapSetTtlsPhase2Method, req_eap_set_ttls_phase2_method, + rpc__resp__eap_set_ttls_phase2_method__init); + + RPC_RET_FAIL_IF(esp_eap_client_set_ttls_phase2_method(req_payload->type)); + + return ESP_OK; +} + +static esp_err_t req_eap_set_suiteb_certification(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespEapSetSuiteb192bitCertification, resp_eap_set_suiteb_certification, + RpcReqEapSetSuiteb192bitCertification, req_eap_set_suiteb_certification, + rpc__resp__eap_set_suiteb192bit_certification__init); + + RPC_RET_FAIL_IF(esp_eap_client_set_suiteb_192bit_certification(req_payload->enable)); + + return ESP_OK; +} + +static esp_err_t req_eap_set_pac_file(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespEapSetPacFile, resp_eap_set_pac_file, + RpcReqEapSetPacFile, req_eap_set_pac_file, + rpc__resp__eap_set_pac_file__init); + + RPC_RET_FAIL_IF(!req_payload->pac_file.data || req_payload->pac_file_len <= 0); + const unsigned char *pac_file = req_payload->pac_file.data; + int pac_file_len = req_payload->pac_file_len; + + RPC_RET_FAIL_IF(esp_eap_client_set_pac_file(pac_file, pac_file_len)); + + return ESP_OK; +} + +static esp_err_t req_eap_set_fast_params(Rpc *req, Rpc *resp, void *priv_data) +{ + esp_eap_fast_config fast_config = {0}; + + RPC_TEMPLATE(RpcRespEapSetFastParams, resp_eap_set_fast_params, + RpcReqEapSetFastParams, req_eap_set_fast_params, + rpc__resp__eap_set_fast_params__init); + + fast_config.fast_provisioning = req_payload->eap_fast_config->fast_provisioning; + fast_config.fast_max_pac_list_len = req_payload->eap_fast_config->fast_max_pac_list_len; + fast_config.fast_pac_format_binary = req_payload->eap_fast_config->fast_pac_format_binary; + + RPC_RET_FAIL_IF(esp_eap_client_set_fast_params(fast_config)); + + return ESP_OK; +} + +static esp_err_t req_eap_use_default_cert_bundle(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespEapUseDefaultCertBundle, resp_eap_use_default_cert_bundle, + RpcReqEapUseDefaultCertBundle, req_eap_use_default_cert_bundle, + rpc__resp__eap_use_default_cert_bundle__init); + + RPC_RET_FAIL_IF(esp_eap_client_use_default_cert_bundle(req_payload->use_default_bundle)); + + return ESP_OK; +} + +#if H_GOT_EAP_OKC_SUPPORT +static esp_err_t req_wifi_set_okc_support(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespWifiSetOkcSupport, resp_wifi_set_okc_support, + RpcReqWifiSetOkcSupport, req_wifi_set_okc_support, + rpc__resp__wifi_set_okc_support__init); + + esp_wifi_set_okc_support(req_payload->enable); + return ESP_OK; +} +#endif + +#if H_GOT_EAP_SET_DOMAIN_NAME +static esp_err_t req_eap_set_domain_name(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespEapSetDomainName, resp_eap_set_domain_name, + RpcReqEapSetDomainName, req_eap_set_domain_name, + rpc__resp__eap_set_domain_name__init); + + const char *domain_name = (const char *)req_payload->domain_name.data; + RPC_RET_FAIL_IF(!req_payload->domain_name.data); + + RPC_RET_FAIL_IF(esp_eap_client_set_domain_name(domain_name)); + return ESP_OK; +} +#endif + +#if H_GOT_SET_EAP_METHODS_API +static esp_err_t req_eap_set_eap_methods(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespEapSetEapMethods, resp_eap_set_eap_methods, + RpcReqEapSetEapMethods, req_eap_set_eap_methods, + rpc__resp__eap_set_eap_methods__init); + + RPC_RET_FAIL_IF(esp_eap_client_set_eap_methods(req_payload->methods)); + + return ESP_OK; +} +#endif +#endif // H_WIFI_ENTERPRISE_SUPPORT + +static esp_err_t req_get_coprocessor_fw_version(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE_SIMPLE(RpcRespGetCoprocessorFwVersion, resp_get_coprocessor_fwversion, + RpcReqGetCoprocessorFwVersion, req_get_coprocessor_fwversion, + rpc__resp__get_coprocessor_fw_version__init); + + resp_payload->major1 = PROJECT_VERSION_MAJOR_1; + resp_payload->minor1 = PROJECT_VERSION_MINOR_1; + resp_payload->patch1 = PROJECT_VERSION_PATCH_1; + resp_payload->resp = ESP_OK; + + return ESP_OK; +} + +static esp_err_t req_iface_mac_addr_len_get(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespIfaceMacAddrLenGet, resp_iface_mac_addr_len_get, + RpcReqIfaceMacAddrLenGet, req_iface_mac_addr_len_get, + rpc__resp__iface_mac_addr_len_get__init); + + size_t len = esp_mac_addr_len_get(req_payload->type); + + resp_payload->type = req_payload->type; + resp_payload->len = len; + + return ESP_OK; +} + +static esp_err_t req_iface_mac_addr_set_get(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespIfaceMacAddrSetGet, resp_iface_mac_addr_set_get, + RpcReqIfaceMacAddrSetGet, req_iface_mac_addr_set_get, + rpc__resp__iface_mac_addr_set_get__init); + + // copy the incoming request to the outgoing response + resp_payload->set = req_payload->set; + resp_payload->type = req_payload->type; + + // get the expected len based on the type + size_t len = esp_mac_addr_len_get(req_payload->type); + + if (req_payload->set) { + // set the interface mac address + if (req_payload->mac.len) { + if (req_payload->mac.len == len) { + RPC_RET_FAIL_IF(esp_iface_mac_addr_set(req_payload->mac.data, req_payload->type)); + // copy the mac address that was set in the response + RPC_RESP_COPY_BYTES_SRC_UNCHECKED(resp_payload->mac, req_payload->mac.data, len); + } else { + ESP_LOGE(TAG, "expected mac length %" PRIu16 ", but got %" PRIu16, len, req_payload->mac.len); + resp_payload->resp = ESP_ERR_INVALID_ARG; + } + } else { + // no mac data provided + ESP_LOGE(TAG, "error: set iface mac address without mac data"); + resp_payload->resp = ESP_ERR_INVALID_ARG; + } + } else { + // get the interface mac address + uint8_t iface_mac[IFACE_MAC_SIZE] = {0}; + RPC_RET_FAIL_IF(esp_read_mac(iface_mac, req_payload->type)); + + RPC_RESP_COPY_BYTES_SRC_UNCHECKED(resp_payload->mac, iface_mac, len); + } + + return ESP_OK; +} + +static esp_err_t req_feature_control(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespFeatureControl, resp_feature_control, + RpcReqFeatureControl, req_feature_control, + rpc__resp__feature_control__init); + + // copy the incoming request to the outgoing response + resp_payload->feature = req_payload->feature; + resp_payload->command = req_payload->command; + resp_payload->option = req_payload->option; + + if (req_payload->feature == RPC_FEATURE__Feature_Bluetooth) { + // decode the requested Bluetooth control + switch (req_payload->command) { + case RPC_FEATURE_COMMAND__Feature_Command_BT_Init: + RPC_RET_FAIL_IF(init_bluetooth()); + break; + case RPC_FEATURE_COMMAND__Feature_Command_BT_Deinit: + bool mem_release = false; + if (req_payload->option == RPC_FEATURE_OPTION__Feature_Option_BT_Deinit_Release_Memory) { + mem_release = true; + } + RPC_RET_FAIL_IF(deinit_bluetooth(mem_release)); + break; + case RPC_FEATURE_COMMAND__Feature_Command_BT_Enable: + RPC_RET_FAIL_IF(enable_bluetooth()); + break; + case RPC_FEATURE_COMMAND__Feature_Command_BT_Disable: + RPC_RET_FAIL_IF(disable_bluetooth()); + break; + default: + // invalid Bluetooth control feature + ESP_LOGE(TAG, "error: invalid Bluetooth Feature Control"); + resp_payload->resp = ESP_ERR_INVALID_ARG; + break; + } + } else { + // invalid feature + ESP_LOGE(TAG, "error: invalid Feature Control"); + resp_payload->resp = ESP_ERR_INVALID_ARG; + } + return ESP_OK; +} + +#if CONFIG_SOC_WIFI_HE_SUPPORT +#if H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 +static esp_err_t req_wifi_sta_twt_config(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespWifiStaTwtConfig, resp_wifi_sta_twt_config, + RpcReqWifiStaTwtConfig, req_wifi_sta_twt_config, + rpc__resp__wifi_sta_twt_config__init); + + wifi_twt_config_t wifi_twt_config; + wifi_twt_config.post_wakeup_event = req_payload->config->post_wakeup_event; +#if H_GOT_TWT_ENABLE_KEEP_ALIVE + wifi_twt_config.twt_enable_keep_alive = req_payload->config->twt_enable_keep_alive; +#endif + + RPC_RET_FAIL_IF(esp_wifi_sta_twt_config(&wifi_twt_config)); + + return ESP_OK; +} +#endif + +static esp_err_t req_wifi_sta_itwt_setup(Rpc *req, Rpc *resp, void *priv_data) +{ +#if H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 + wifi_itwt_setup_config_t cfg = {0}; +#else + wifi_twt_setup_config_t cfg = {0}; +#endif + + RPC_TEMPLATE(RpcRespWifiStaItwtSetup, resp_wifi_sta_itwt_setup, + RpcReqWifiStaItwtSetup, req_wifi_sta_itwt_setup, + rpc__resp__wifi_sta_itwt_setup__init); + +#if H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 + wifi_itwt_setup_config_t * p_a_cfg = &cfg; +#else + wifi_twt_setup_config_t * p_a_cfg = &cfg; +#endif + WifiItwtSetupConfig *p_c_cfg = req_payload->setup_config; + + p_a_cfg->setup_cmd = p_c_cfg->setup_cmd; + p_a_cfg->trigger = H_GET_BIT(WIFI_ITWT_CONFIG_1_trigger_BIT, p_c_cfg->bitmask_1); + p_a_cfg->flow_type = H_GET_BIT(WIFI_ITWT_CONFIG_1_flow_type_BIT, p_c_cfg->bitmask_1); + /* WIFI_ITWT_CONFIG_1_flow_id_BIT is three bits wide */ + p_a_cfg->flow_id = (p_c_cfg->bitmask_1 >> WIFI_ITWT_CONFIG_1_flow_id_BIT) & 0x07; + /* WIFI_ITWT_CONFIG_1_wake_invl_expn_BIT is five bits wide */ + p_a_cfg->wake_invl_expn = (p_c_cfg->bitmask_1 >> WIFI_ITWT_CONFIG_1_wake_invl_expn_BIT) & 0x1F; + p_a_cfg->wake_duration_unit = H_GET_BIT(WIFI_ITWT_CONFIG_1_wake_duration_unit_BIT, p_c_cfg->bitmask_1); +#if H_DECODE_WIFI_RESERVED_FIELD + p_a_cfg->reserved = WIFI_ITWT_CONFIG_1_GET_RESERVED_VAL(p_c_cfg->bitmask_1); +#endif + p_a_cfg->min_wake_dura = p_c_cfg->min_wake_dura; + p_a_cfg->wake_invl_mant = p_c_cfg->wake_invl_mant; + p_a_cfg->twt_id = p_c_cfg->twt_id; + p_a_cfg->timeout_time_ms = p_c_cfg->timeout_time_ms; + + RPC_RET_FAIL_IF(esp_wifi_sta_itwt_setup(&cfg)); + + return ESP_OK; +} + +static esp_err_t req_wifi_sta_itwt_teardown(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespWifiStaItwtTeardown, resp_wifi_sta_itwt_teardown, + RpcReqWifiStaItwtTeardown, req_wifi_sta_itwt_teardown, + rpc__resp__wifi_sta_itwt_teardown__init); + + int flow_id = req_payload->flow_id; + + RPC_RET_FAIL_IF(esp_wifi_sta_itwt_teardown(flow_id)); + + return ESP_OK; +} + +static esp_err_t req_wifi_sta_itwt_suspend(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespWifiStaItwtSuspend, resp_wifi_sta_itwt_suspend, + RpcReqWifiStaItwtSuspend, req_wifi_sta_itwt_suspend, + rpc__resp__wifi_sta_itwt_suspend__init); + + int flow_id = req_payload->flow_id; + int suspend_time_ms = req_payload->suspend_time_ms; + + RPC_RET_FAIL_IF(esp_wifi_sta_itwt_suspend(flow_id, suspend_time_ms)); + + return ESP_OK; +} + +static esp_err_t req_wifi_sta_itwt_get_flow_id_status(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE_SIMPLE(RpcRespWifiStaItwtGetFlowIdStatus, resp_wifi_sta_itwt_get_flow_id_status, + RpcReqWifiStaItwtGetFlowIdStatus, req_wifi_sta_itwt_get_flow_id_status, + rpc__resp__wifi_sta_itwt_get_flow_id_status__init); + + int flow_id_bitmap; + + RPC_RET_FAIL_IF(esp_wifi_sta_itwt_get_flow_id_status(&flow_id_bitmap)); + + resp_payload->flow_id_bitmap = flow_id_bitmap; + + return ESP_OK; +} + +static esp_err_t req_wifi_sta_itwt_send_probe_req(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespWifiStaItwtSendProbeReq, resp_wifi_sta_itwt_send_probe_req, + RpcReqWifiStaItwtSendProbeReq, req_wifi_sta_itwt_send_probe_req, + rpc__resp__wifi_sta_itwt_send_probe_req__init); + + int timeout_ms = req_payload->timeout_ms; + + RPC_RET_FAIL_IF(esp_wifi_sta_itwt_send_probe_req(timeout_ms)); + + return ESP_OK; +} + +static esp_err_t req_wifi_sta_itwt_set_target_wake_time_offset(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespWifiStaItwtSetTargetWakeTimeOffset, resp_wifi_sta_itwt_set_target_wake_time_offset, + RpcReqWifiStaItwtSetTargetWakeTimeOffset, req_wifi_sta_itwt_set_target_wake_time_offset, + rpc__resp__wifi_sta_itwt_set_target_wake_time_offset__init); + + int offset_us = req_payload->offset_us; + + RPC_RET_FAIL_IF(esp_wifi_sta_itwt_set_target_wake_time_offset(offset_us)); + + return ESP_OK; +} +#endif // CONFIG_SOC_WIFI_HE_SUPPORT + +#if H_DPP_SUPPORT +#if H_SUPP_DPP_SUPPORT +void dpp_enrollee_event_cb(esp_supp_dpp_event_t event, void *data); +#endif + +static esp_err_t req_supp_dpp_init(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespSuppDppInit, resp_supp_dpp_init, + RpcReqSuppDppInit, req_supp_dpp_init, + rpc__resp__supp_dpp_init__init); + + if (req_payload->cb) { +#if H_SUPP_DPP_SUPPORT + // init with callback + ESP_LOGI(TAG, "dpp init with callback"); + RPC_RET_FAIL_IF(esp_supp_dpp_init(dpp_enrollee_event_cb)); +#else + ESP_LOGE(TAG, "dpp init with callback NOT supported"); + resp_payload->resp = ESP_ERR_INVALID_ARG; +#endif + } else { + // init without callback + ESP_LOGI(TAG, "dpp init WITHOUT callback"); +#if H_SUPP_DPP_SUPPORT + RPC_RET_FAIL_IF(esp_supp_dpp_init(NULL)); +#else + RPC_RET_FAIL_IF(esp_supp_dpp_init()); +#endif + } + return ESP_OK; +} + +static esp_err_t req_supp_dpp_deinit(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE_SIMPLE(RpcRespSuppDppDeinit, resp_supp_dpp_deinit, + RpcReqSuppDppDeinit, req_supp_dpp_deinit, + rpc__resp__supp_dpp_deinit__init); + + RPC_RET_FAIL_IF(esp_supp_dpp_deinit()); + + return ESP_OK; +} + +static esp_err_t req_supp_dpp_bootstrap_gen(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespSuppDppBootstrapGen, resp_supp_dpp_bootstrap_gen, + RpcReqSuppDppBootstrapGen, req_supp_dpp_bootstrap_gen, + rpc__resp__supp_dpp_bootstrap_gen__init); + + const char *chan_list = NULL; + esp_supp_dpp_bootstrap_t type; + const char *key = NULL; + const char *info = NULL; + + chan_list = (const char *)req_payload->chan_list.data; + type = req_payload->type; + if (req_payload->key.len) { + key = (const char *)req_payload->key.data; + } + if (req_payload->info.len) { + info = (const char *)req_payload->info.data; + } + + RPC_RET_FAIL_IF(esp_supp_dpp_bootstrap_gen(chan_list, type, key, info)); + + return ESP_OK; +} + +static esp_err_t req_supp_dpp_start_listen(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE_SIMPLE(RpcRespSuppDppStartListen, resp_supp_dpp_start_listen, + RpcReqSuppDppStartListen, req_supp_dpp_start_listen, + rpc__resp__supp_dpp_start_listen__init); + + RPC_RET_FAIL_IF(esp_supp_dpp_start_listen()); + + return ESP_OK; +} + +static esp_err_t req_supp_dpp_stop_listen(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE_SIMPLE(RpcRespSuppDppStopListen, resp_supp_dpp_stop_listen, + RpcReqSuppDppStopListen, req_supp_dpp_stop_listen, + rpc__resp__supp_dpp_stop_listen__init); + + RPC_RET_FAIL_IF(esp_supp_dpp_stop_listen()); + + return ESP_OK; +} +#endif + +#if CONFIG_ESP_HOSTED_ENABLE_GPIO_RPC +static esp_err_t req_gpio_config(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespGpioConfig, resp_gpio_config, + RpcReqGpioConfig, req_gpio_config, + rpc__resp__gpio_config__init); + + gpio_config_t config; + + config.mode = req_payload->config->mode; + config.pull_up_en = req_payload->config->pull_up_en; + config.pull_down_en = req_payload->config->pull_down_en; + config.intr_type = req_payload->config->intr_type; + config.pin_bit_mask = req_payload->config->pin_bit_mask; + + for (int pin = 0; pin < GPIO_NUM_MAX; ++pin) { + if (config.pin_bit_mask & (1ULL << pin)) { + if (!transport_gpio_pin_guard_is_eligible((gpio_num_t)pin)) { + ESP_LOGE(TAG, "GPIO pin %d is not allowed to be configured", pin);; + resp_payload->resp = ESP_ERR_INVALID_ARG; + return ESP_OK; + } + } + } + + RPC_RET_FAIL_IF(gpio_config(&config)); + + return ESP_OK; +} + +static esp_err_t req_gpio_reset(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespGpioResetPin, resp_gpio_reset, + RpcReqGpioReset, req_gpio_reset, + rpc__resp__gpio_reset_pin__init); + + gpio_num_t gpio_num; + gpio_num = req_payload->gpio_num; + + if (!transport_gpio_pin_guard_is_eligible(gpio_num)) { + ESP_LOGE(TAG, "GPIO pin %d is not allowed to be configured", gpio_num); + resp_payload->resp = ESP_ERR_INVALID_ARG; + return ESP_OK; + } + + RPC_RET_FAIL_IF(gpio_reset_pin(gpio_num)); + + return ESP_OK; +} + +static esp_err_t req_gpio_set_level(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespGpioSetLevel, resp_gpio_set_level, + RpcReqGpioSetLevel, req_gpio_set_level, + rpc__resp__gpio_set_level__init); + + gpio_num_t gpio_num; + gpio_num = req_payload->gpio_num; + + uint32_t level; + level = req_payload->level; + + if (!transport_gpio_pin_guard_is_eligible(gpio_num)) { + ESP_LOGE(TAG, "GPIO pin %d is not allowed to be configured", gpio_num); + resp_payload->resp = ESP_ERR_INVALID_ARG; + return ESP_OK; + } + + RPC_RET_FAIL_IF(gpio_set_level(gpio_num, level)); + + return ESP_OK; +} + +static esp_err_t req_gpio_get_level(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespGpioGetLevel, resp_gpio_get_level, + RpcReqGpioGetLevel, req_gpio_get_level, + rpc__resp__gpio_get_level__init); + + gpio_num_t gpio_num; + gpio_num = req_payload->gpio_num; + + if (!transport_gpio_pin_guard_is_eligible(gpio_num)) { + ESP_LOGE(TAG, "GPIO pin %d is not allowed to be configured", gpio_num); + resp_payload->resp = ESP_ERR_INVALID_ARG; + return ESP_OK; + } + + int level = gpio_get_level(gpio_num); + + resp_payload->level = level; + + return ESP_OK; +} + +static esp_err_t req_gpio_set_direction(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespGpioSetDirection, resp_gpio_set_direction, + RpcReqGpioSetDirection, req_gpio_set_direction, + rpc__resp__gpio_set_direction__init); + + gpio_num_t gpio_num; + gpio_num = req_payload->gpio_num; + + gpio_mode_t mode; + mode = req_payload->mode; + + if (!transport_gpio_pin_guard_is_eligible(gpio_num)) { + ESP_LOGE(TAG, "GPIO pin %d is not allowed to be configured", gpio_num); + resp_payload->resp = ESP_ERR_INVALID_ARG; + return ESP_OK; + } + + RPC_RET_FAIL_IF(gpio_set_direction(gpio_num, mode)); + + return ESP_OK; +} + +static esp_err_t req_gpio_input_enable(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespGpioInputEnable, resp_gpio_input_enable, + RpcReqGpioInputEnable, req_gpio_input_enable, + rpc__resp__gpio_input_enable__init); + + gpio_num_t gpio_num; + gpio_num = req_payload->gpio_num; + + if (!transport_gpio_pin_guard_is_eligible(gpio_num)) { + ESP_LOGE(TAG, "GPIO pin %d is not allowed to be configured", gpio_num); + resp_payload->resp = ESP_ERR_INVALID_ARG; + return ESP_OK; + } + + RPC_RET_FAIL_IF(gpio_input_enable(gpio_num)); + + return ESP_OK; +} + +static esp_err_t req_gpio_set_pull_mode(Rpc *req, Rpc *resp, void *priv_data) +{ + RPC_TEMPLATE(RpcRespGpioSetPullMode, resp_gpio_set_pull_mode, + RpcReqGpioSetPullMode, req_gpio_set_pull_mode, + rpc__resp__gpio_set_pull_mode__init); + + gpio_num_t gpio_num; + gpio_num = req_payload->gpio_num; + + gpio_pull_mode_t pull_mode; + pull_mode = req_payload->pull; + + if (!transport_gpio_pin_guard_is_eligible(gpio_num)) { + ESP_LOGE(TAG, "GPIO pin %d is not allowed to be configured", gpio_num); + resp_payload->resp = ESP_ERR_INVALID_ARG; + return ESP_OK; + } + + RPC_RET_FAIL_IF(gpio_set_pull_mode(gpio_num, pull_mode)); + + return ESP_OK; +} +#endif // CONFIG_ESP_HOSTED_ENABLE_GPIO_RPC + +static esp_rpc_req_t req_table[] = { + { + .req_num = RPC_ID__Req_GetMACAddress , + .command_handler = req_wifi_get_mac + }, + { + .req_num = RPC_ID__Req_GetWifiMode, + .command_handler = req_wifi_get_mode + }, + { + .req_num = RPC_ID__Req_SetWifiMode, + .command_handler = req_wifi_set_mode + }, + { + .req_num = RPC_ID__Req_SetMacAddress, + .command_handler = req_wifi_set_mac + }, + { + .req_num = RPC_ID__Req_WifiSetPs, + .command_handler = req_wifi_set_ps + }, + { + .req_num = RPC_ID__Req_WifiGetPs, + .command_handler = req_wifi_get_ps + }, + { + .req_num = RPC_ID__Req_OTABegin, + .command_handler = req_ota_begin_handler + }, + { + .req_num = RPC_ID__Req_OTAWrite, + .command_handler = req_ota_write_handler + }, + { + .req_num = RPC_ID__Req_OTAEnd, + .command_handler = req_ota_end_handler + }, + { + .req_num = RPC_ID__Req_OTAActivate, + .command_handler = req_ota_activate_handler + }, { .req_num = RPC_ID__Req_WifiSetMaxTxPower, .command_handler = req_wifi_set_max_tx_power @@ -2025,6 +3954,7 @@ static esp_rpc_req_t req_table[] = { .req_num = RPC_ID__Req_WifiStaGetNegotiatedPhymode, .command_handler = req_wifi_sta_get_negotiated_phymode }, +#if H_PRESENT_IN_ESP_IDF_5_4_0 { .req_num = RPC_ID__Req_WifiSetProtocols, .command_handler = req_wifi_set_protocols @@ -2057,16 +3987,237 @@ static esp_rpc_req_t req_table[] = { .req_num = RPC_ID__Req_WifiGetBandMode, .command_handler = req_wifi_get_band_mode }, +#endif + { + .req_num = RPC_ID__Req_WifiSetInactiveTime, + .command_handler = req_wifi_set_inactive_time + }, + { + .req_num = RPC_ID__Req_WifiGetInactiveTime, + .command_handler = req_wifi_get_inactive_time + }, { .req_num = RPC_ID__Req_GetCoprocessorFwVersion, .command_handler = req_get_coprocessor_fw_version }, + { + .req_num = RPC_ID__Req_SetDhcpDnsStatus, + .command_handler = req_set_dhcp_dns_status + }, + { + .req_num = RPC_ID__Req_GetDhcpDnsStatus, + .command_handler = req_get_dhcp_dns_status + }, +#if CONFIG_SOC_WIFI_HE_SUPPORT +#if H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 + { + .req_num = RPC_ID__Req_WifiStaTwtConfig, + .command_handler = req_wifi_sta_twt_config + }, +#endif + { + .req_num = RPC_ID__Req_WifiStaItwtSetup, + .command_handler = req_wifi_sta_itwt_setup + }, + { + .req_num = RPC_ID__Req_WifiStaItwtTeardown, + .command_handler = req_wifi_sta_itwt_teardown + }, + { + .req_num = RPC_ID__Req_WifiStaItwtSuspend, + .command_handler = req_wifi_sta_itwt_suspend + }, + { + .req_num = RPC_ID__Req_WifiStaItwtGetFlowIdStatus, + .command_handler = req_wifi_sta_itwt_get_flow_id_status + }, + { + .req_num = RPC_ID__Req_WifiStaItwtSendProbeReq, + .command_handler = req_wifi_sta_itwt_send_probe_req + }, + { + .req_num = RPC_ID__Req_WifiStaItwtSetTargetWakeTimeOffset, + .command_handler = req_wifi_sta_itwt_set_target_wake_time_offset + }, +#endif // CONFIG_SOC_WIFI_HE_SUPPORT +#if H_WIFI_ENTERPRISE_SUPPORT + { + .req_num = RPC_ID__Req_WifiStaEnterpriseEnable, + .command_handler = req_wifi_sta_enterprise_enable + }, + { + .req_num = RPC_ID__Req_WifiStaEnterpriseDisable, + .command_handler = req_wifi_sta_enterprise_disable + }, + { + .req_num = RPC_ID__Req_EapSetIdentity, + .command_handler = req_eap_set_identity + }, + { + .req_num = RPC_ID__Req_EapClearIdentity, + .command_handler = req_eap_clear_identity + }, + { + .req_num = RPC_ID__Req_EapSetUsername, + .command_handler = req_eap_set_username + }, + { + .req_num = RPC_ID__Req_EapClearUsername, + .command_handler = req_eap_clear_username + }, + { + .req_num = RPC_ID__Req_EapSetPassword, + .command_handler = req_eap_set_password + }, + { + .req_num = RPC_ID__Req_EapClearPassword, + .command_handler = req_eap_clear_password + }, + { + .req_num = RPC_ID__Req_EapSetNewPassword, + .command_handler = req_eap_set_new_password + }, + { + .req_num = RPC_ID__Req_EapClearNewPassword, + .command_handler = req_eap_clear_new_password + }, + { + .req_num = RPC_ID__Req_EapSetCaCert, + .command_handler = req_eap_set_ca_cert + }, + { + .req_num = RPC_ID__Req_EapClearCaCert, + .command_handler = req_eap_clear_ca_cert + }, + { + .req_num = RPC_ID__Req_EapSetCertificateAndKey, + .command_handler = req_eap_set_certificate_and_key + }, + { + .req_num = RPC_ID__Req_EapClearCertificateAndKey, + .command_handler = req_eap_clear_certificate_and_key + }, + { + .req_num = RPC_ID__Req_EapGetDisableTimeCheck, + .command_handler = req_eap_get_disable_time_check + }, + { + .req_num = RPC_ID__Req_EapSetTtlsPhase2Method, + .command_handler = req_eap_set_ttls_phase2_method + }, + { + .req_num = RPC_ID__Req_EapSetSuitebCertification, + .command_handler = req_eap_set_suiteb_certification + }, + { + .req_num = RPC_ID__Req_EapSetPacFile, + .command_handler = req_eap_set_pac_file + }, + { + .req_num = RPC_ID__Req_EapSetFastParams, + .command_handler = req_eap_set_fast_params + }, + { + .req_num = RPC_ID__Req_EapUseDefaultCertBundle, + .command_handler = req_eap_use_default_cert_bundle + }, +#if H_GOT_EAP_OKC_SUPPORT + { + .req_num = RPC_ID__Req_WifiSetOkcSupport, + .command_handler = req_wifi_set_okc_support + }, +#endif +#if H_GOT_EAP_SET_DOMAIN_NAME + { + .req_num = RPC_ID__Req_EapSetDomainName, + .command_handler = req_eap_set_domain_name + }, +#endif + { + .req_num = RPC_ID__Req_EapSetDisableTimeCheck, + .command_handler = req_eap_set_disable_time_check + }, +#if H_GOT_SET_EAP_METHODS_API + { + .req_num = RPC_ID__Req_EapSetEapMethods, + .command_handler = req_eap_set_eap_methods + }, +#endif +#endif +#if H_DPP_SUPPORT + { + .req_num = RPC_ID__Req_SuppDppInit, + .command_handler = req_supp_dpp_init + }, + { + .req_num = RPC_ID__Req_SuppDppDeinit, + .command_handler = req_supp_dpp_deinit + }, + { + .req_num = RPC_ID__Req_SuppDppDeinit, + .command_handler = req_supp_dpp_deinit + }, + { + .req_num = RPC_ID__Req_SuppDppBootstrapGen, + .command_handler = req_supp_dpp_bootstrap_gen + }, + { + .req_num = RPC_ID__Req_SuppDppStartListen, + .command_handler = req_supp_dpp_start_listen, + }, + { + .req_num = RPC_ID__Req_SuppDppStopListen, + .command_handler = req_supp_dpp_stop_listen, + }, +#endif + { + .req_num = RPC_ID__Req_IfaceMacAddrSetGet, + .command_handler = req_iface_mac_addr_set_get + }, + { + .req_num = RPC_ID__Req_IfaceMacAddrLenGet, + .command_handler = req_iface_mac_addr_len_get + }, + { + .req_num = RPC_ID__Req_FeatureControl, + .command_handler = req_feature_control + }, +#if CONFIG_ESP_HOSTED_ENABLE_GPIO_RPC + { + .req_num = RPC_ID__Req_GpioConfig, + .command_handler = req_gpio_config + }, + { + .req_num = RPC_ID__Req_GpioResetPin, + .command_handler = req_gpio_reset + }, + { + .req_num = RPC_ID__Req_GpioSetLevel, + .command_handler = req_gpio_set_level + }, + { + .req_num = RPC_ID__Req_GpioGetLevel, + .command_handler = req_gpio_get_level + }, + { + .req_num = RPC_ID__Req_GpioSetDirection, + .command_handler = req_gpio_set_direction + }, + { + .req_num = RPC_ID__Req_GpioInputEnable, + .command_handler = req_gpio_input_enable + }, + { + .req_num = RPC_ID__Req_GpioSetPullMode, + .command_handler = req_gpio_set_pull_mode + }, +#endif // CONFIG_ESP_HOSTED_ENABLE_GPIO_RPC }; static int lookup_req_handler(int req_id) { - for (int i = 0; i < sizeof(req_table)/sizeof(esp_rpc_req_t); i++) { + for (int i = 0; i < sizeof(req_table)/sizeof(esp_rpc_req_t); i++) { if (req_table[i].req_num == req_id) { return i; } @@ -2089,22 +4240,30 @@ static esp_err_t esp_rpc_command_dispatcher( if ((req->msg_id <= RPC_ID__Req_Base) || (req->msg_id >= RPC_ID__Req_Max)) { ESP_LOGE(TAG, "Invalid command request lookup"); + goto err_not_supported; } - ESP_LOGI(TAG, "Received Req [0x%x]", req->msg_id); + if (req->msg_id != RPC_ID__Req_OTAWrite) { + ESP_LOGI(TAG, "Received Req [0x%x]", req->msg_id); + } req_index = lookup_req_handler(req->msg_id); if (req_index < 0) { ESP_LOGE(TAG, "Invalid command handler lookup"); - return ESP_FAIL; + goto err_not_supported; } ret = req_table[req_index].command_handler(req, resp, priv_data); if (ret) { ESP_LOGE(TAG, "Error executing command handler"); - return ESP_FAIL; + goto err_cmd_error; } + return ESP_OK; + err_not_supported: + // response ID Resp_Base means RPC Request was not supported + resp->msg_id = RPC_ID__Resp_Base; + err_cmd_error: return ESP_OK; } @@ -2149,7 +4308,10 @@ esp_err_t data_transfer_handler(uint32_t session_id,const uint8_t *inbuf, resp->msg_id = req->msg_id - RPC_ID__Req_Base + RPC_ID__Resp_Base; resp->uid = req->uid; resp->payload_case = resp->msg_id; - ESP_LOGI(TAG, "Resp_MSGId for req[0x%x] is [0x%x], uid %ld", req->msg_id, resp->msg_id, resp->uid); + + if (resp->msg_id != RPC_ID__Resp_OTAWrite) { + ESP_LOGI(TAG, "Resp_MSGId for req[0x%x] is [0x%x], uid %ld", req->msg_id, resp->msg_id, resp->uid); + } ret = esp_rpc_command_dispatcher(req,resp,NULL); if (ret) { ESP_LOGE(TAG, "Command dispatching not happening"); @@ -2164,6 +4326,8 @@ esp_err_t data_transfer_handler(uint32_t session_id,const uint8_t *inbuf, goto err; } + // ESP_LOGE(TAG, "len %" PRIi16, *outlen); + *outbuf = (uint8_t *)calloc(1, *outlen); if (!*outbuf) { ESP_LOGE(TAG, "No memory allocated for outbuf"); @@ -2341,6 +4505,134 @@ static esp_err_t rpc_evt_ap_staconn_conn_disconn(Rpc *ntfy, return ESP_FAIL; } +#if CONFIG_SOC_WIFI_HE_SUPPORT +static esp_err_t rpc_evt_itwt_setup(Rpc *ntfy, + const uint8_t *data, ssize_t len, int event_id) +{ + wifi_event_sta_itwt_setup_t *p_a = (wifi_event_sta_itwt_setup_t*)data; + RpcEventStaItwtSetup *p_c = NULL; + + ESP_LOGI(TAG, "%s event:%u",__func__,event_id); + + NTFY_TEMPLATE(RPC_ID__Event_StaItwtSetup, + RpcEventStaItwtSetup, event_sta_itwt_setup, + rpc__event__sta_itwt_setup__init); + + NTFY_ALLOC_ELEMENT(WifiItwtSetupConfig, ntfy_payload->config, + wifi_itwt_setup_config__init); + + p_c = ntfy_payload; + + p_c->config->setup_cmd = p_a->config.setup_cmd; + + if (p_a->config.trigger) + H_SET_BIT(WIFI_ITWT_CONFIG_1_trigger_BIT, p_c->config->bitmask_1); + + if (p_a->config.flow_type) + H_SET_BIT(WIFI_ITWT_CONFIG_1_flow_type_BIT, p_c->config->bitmask_1); + + /* WIFI_ITWT_CONFIG_1_flow_id_BIT is three bits wide */ + if (p_a->config.flow_id & 0x07) + p_c->config->bitmask_1 |= (p_a->config.flow_id & 0x07) << WIFI_ITWT_CONFIG_1_flow_id_BIT; + + /* WIFI_ITWT_CONFIG_1_wake_invl_expn_BIT is five bits wide */ + if (p_a->config.wake_invl_expn & 0x1F) + p_c->config->bitmask_1 |= (p_a->config.wake_invl_expn & 0x1F) << WIFI_ITWT_CONFIG_1_wake_invl_expn_BIT; + + if (p_a->config.wake_duration_unit) + H_SET_BIT(WIFI_ITWT_CONFIG_1_wake_duration_unit_BIT, p_c->config->bitmask_1); + +#if H_DECODE_WIFI_RESERVED_FIELD + WIFI_ITWT_CONFIG_1_SET_RESERVED_VAL(p_a->config.reserved, p_c->config->bitmask_1) +#endif + + p_c->config->min_wake_dura = p_a->config.min_wake_dura; + p_c->config->wake_invl_mant = p_a->config.wake_invl_mant; + p_c->config->twt_id = p_a->config.twt_id; + p_c->config->timeout_time_ms = p_a->config.timeout_time_ms; + p_c->status = p_a->status; + p_c->reason = p_a->reason; + p_c->target_wake_time = p_a->target_wake_time; + + err: + return ESP_OK; +} + +static esp_err_t rpc_evt_itwt_teardown(Rpc *ntfy, + const uint8_t *data, ssize_t len, int event_id) +{ + wifi_event_sta_itwt_teardown_t *p_a = (wifi_event_sta_itwt_teardown_t*)data; + RpcEventStaItwtTeardown *p_c = NULL; + + ESP_LOGI(TAG, "%s event:%u",__func__,event_id); + + NTFY_TEMPLATE(RPC_ID__Event_StaItwtTeardown, + RpcEventStaItwtTeardown, event_sta_itwt_teardown, + rpc__event__sta_itwt_teardown__init); + + p_c = ntfy_payload; + + p_c->flow_id = p_a->flow_id; + p_c->status = p_a->status; + + return ESP_OK; +} + +static esp_err_t rpc_evt_itwt_suspend(Rpc *ntfy, + const uint8_t *data, ssize_t len, int event_id) +{ + wifi_event_sta_itwt_suspend_t *p_a = (wifi_event_sta_itwt_suspend_t*)data; + RpcEventStaItwtSuspend *p_c = NULL; + int i; + int num_elements = sizeof(p_a->actual_suspend_time_ms) / sizeof(p_a->actual_suspend_time_ms[0]); + + ESP_LOGI(TAG, "%s event:%u",__func__,event_id); + + NTFY_TEMPLATE(RPC_ID__Event_StaItwtSuspend, + RpcEventStaItwtSuspend, event_sta_itwt_suspend, + rpc__event__sta_itwt_suspend__init); + + p_c = ntfy_payload; + + p_c->status = p_a->status; + p_c->flow_id_bitmap = p_a->flow_id_bitmap; + + p_c->actual_suspend_time_ms = calloc(num_elements, sizeof(p_a->actual_suspend_time_ms[0])); + if (!p_c->actual_suspend_time_ms) { + ESP_LOGE(TAG,"resp: malloc failed for ntfy_payload->actual_suspend_time_ms"); + ntfy_payload->resp = RPC_ERR_MEMORY_FAILURE; \ + goto err; + } + + for (i = 0; i < num_elements; i++) { + p_c->actual_suspend_time_ms[i] = p_a->actual_suspend_time_ms[i]; + } + p_c->n_actual_suspend_time_ms = num_elements; + err: + return ESP_OK; +} + +static esp_err_t rpc_evt_itwt_probe(Rpc *ntfy, + const uint8_t *data, ssize_t len, int event_id) +{ + wifi_event_sta_itwt_probe_t *p_a = (wifi_event_sta_itwt_probe_t*)data; + RpcEventStaItwtProbe *p_c = NULL; + + ESP_LOGI(TAG, "%s event:%u",__func__,event_id); + + NTFY_TEMPLATE(RPC_ID__Event_StaItwtProbe, + RpcEventStaItwtProbe, event_sta_itwt_probe, + rpc__event__sta_itwt_probe__init); + + p_c = ntfy_payload; + + p_c->status = p_a->status; + p_c->reason = p_a->reason; + + return ESP_OK; +} +#endif + static esp_err_t rpc_evt_Event_WifiEventNoArgs(Rpc *ntfy, const uint8_t *data, ssize_t len) { @@ -2353,8 +4645,190 @@ static esp_err_t rpc_evt_Event_WifiEventNoArgs(Rpc *ntfy, ntfy_payload->event_id = event_id; + ntfy_payload->resp = SUCCESS; + return ESP_OK; +} +#ifdef CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED +static esp_err_t rpc_evt_Event_DhcpDnsStatus(Rpc *ntfy, + const uint8_t *data, ssize_t len) +{ + NTFY_TEMPLATE(RPC_ID__Event_DhcpDnsStatus, + RpcEventDhcpDnsStatus, event_dhcp_dns, + rpc__event__dhcp_dns_status__init); + + rpc_dhcp_dns_status_t * p_a = (rpc_dhcp_dns_status_t*)data; + + ntfy_payload->iface = p_a->iface; + ntfy_payload->net_link_up = p_a->net_link_up; + ntfy_payload->dhcp_up = p_a->dhcp_up; + ntfy_payload->dns_up = p_a->dns_up; + ntfy_payload->dns_type = p_a->dns_type; + + NTFY_COPY_BYTES(ntfy_payload->dhcp_ip, p_a->dhcp_ip, sizeof(p_a->dhcp_ip)); + NTFY_COPY_BYTES(ntfy_payload->dhcp_nm, p_a->dhcp_nm, sizeof(p_a->dhcp_nm)); + NTFY_COPY_BYTES(ntfy_payload->dhcp_gw, p_a->dhcp_gw, sizeof(p_a->dhcp_gw)); + NTFY_COPY_BYTES(ntfy_payload->dns_ip, p_a->dns_ip, sizeof(p_a->dns_ip)); + + ntfy_payload->resp = SUCCESS; + return ESP_OK; +} +#endif + +#if H_DPP_SUPPORT +#if H_SUPP_DPP_SUPPORT +void dpp_enrollee_event_cb(esp_supp_dpp_event_t event, void *data) +{ + switch (event) { + case ESP_SUPP_DPP_URI_READY: + if (data != NULL) { + // data is a URI to be passed back to host + int len = strlen(data) + 1; // include terminating null in data + send_event_data_to_host(RPC_ID__Event_SuppDppUriReady, data, len); + } else { + ESP_LOGE(TAG, "ESP_SUPP_DPP_URI_READY with no URI data"); + } + break; + case ESP_SUPP_DPP_CFG_RECVD: + if (data != NULL) { + // pass wifi config back to host + send_event_data_to_host(RPC_ID__Event_SuppDppCfgRecvd, data, sizeof(wifi_config_t)); + } else { + ESP_LOGE(TAG, "ESP_SUPP_DPP_URICFG_RECVD with no wifi config data"); + } + break; + case ESP_SUPP_DPP_FAIL: + { + // reason code is given, not pointer to reason code + // see https://github.com/espressif/esp-idf/blob/7912b04e6bdf8c9aeea88baff9e46794d04e4200/examples/wifi/wifi_easy_connect/dpp-enrollee/main/dpp_enrollee_main.c#L96 + int reason = (int)data; + send_event_data_to_host(RPC_ID__Event_SuppDppFail, &reason, sizeof(int)); + } + break; + default: + { + ESP_LOGE(TAG, "Unknown ESP_SUPP event"); + } + break; + } +} + +static esp_err_t rpc_evt_supp_dpp_uri_ready(Rpc *ntfy, + const uint8_t *data, ssize_t len) +{ + uint8_t *uri = (uint8_t *)data; + int uri_len = len; + + NTFY_TEMPLATE(RPC_ID__Event_SuppDppUriReady, + RpcEventSuppDppUriReady, event_supp_dpp_uri_ready, + rpc__event__supp_dpp_uri_ready__init); + + NTFY_COPY_BYTES(ntfy_payload->qrcode, uri, uri_len); + + ntfy_payload->resp = SUCCESS; + return ESP_OK; +} + +static esp_err_t rpc_evt_supp_dpp_cfg_recvd(Rpc *ntfy, + const uint8_t *data, ssize_t len) +{ + wifi_config_t *config = (wifi_config_t *)data; + wifi_sta_config_t *sta_config = &(config->sta); + esp_err_t res; + + NTFY_TEMPLATE(RPC_ID__Event_SuppDppCfgRecvd, + RpcEventSuppDppCfgRecvd, event_supp_dpp_cfg_recvd, + rpc__event__supp_dpp_cfg_recvd__init); + NTFY_ALLOC_ELEMENT(WifiConfig, ntfy_payload->cfg, wifi_config__init); + ntfy_payload->cfg->u_case = WIFI_CONFIG__U_STA; + + res = copy_wifi_sta_cfg_to_rpc_struct(ntfy_payload, + PAYLOAD_TYPE_RPC_EVENT_SUPP_DPP_GET_CONFIG, sta_config); + + if (res == ESP_OK) { + ntfy_payload->resp = SUCCESS; + return ESP_OK; + } else { + ESP_LOGE(TAG, "NTFY: copy_wifi_sta_cfg_to_rpc_struct() FAILED"); + return res; + } + err: + return ESP_FAIL; +} + +static esp_err_t rpc_evt_supp_dpp_fail(Rpc *ntfy, + const uint8_t *data, ssize_t len) +{ + NTFY_TEMPLATE(RPC_ID__Event_SuppDppFail, + RpcEventSuppDppFail, event_supp_dpp_fail, + rpc__event__supp_dpp_fail__init); + + int *reason = (int *)data; + + ntfy_payload->reason = *reason; + ntfy_payload->resp = SUCCESS; + return ESP_OK; +} +#endif // H_SUPP_DPP_SUPPORT + +#if H_WIFI_DPP_SUPPORT +static esp_err_t rpc_evt_wifi_dpp_uri_ready(Rpc *ntfy, + const uint8_t *data, ssize_t len) +{ + wifi_event_dpp_uri_ready_t *uri = (wifi_event_dpp_uri_ready_t *)data; + int uri_len = uri->uri_data_len; + + NTFY_TEMPLATE(RPC_ID__Event_WifiDppUriReady, + RpcEventWifiDppUriReady, event_wifi_dpp_uri_ready, + rpc__event__wifi_dpp_uri_ready__init); + + NTFY_COPY_BYTES(ntfy_payload->qrcode, uri->uri, uri_len); + + ntfy_payload->resp = SUCCESS; + return ESP_OK; +} + +static esp_err_t rpc_evt_wifi_dpp_cfg_recvd(Rpc *ntfy, + const uint8_t *data, ssize_t len) +{ + wifi_config_t *config = (wifi_config_t *)data; + wifi_sta_config_t *sta_config = &(config->sta); + esp_err_t res; + + NTFY_TEMPLATE(RPC_ID__Event_WifiDppCfgRecvd, + RpcEventWifiDppCfgRecvd, event_wifi_dpp_cfg_recvd, + rpc__event__wifi_dpp_cfg_recvd__init); + NTFY_ALLOC_ELEMENT(WifiConfig, ntfy_payload->cfg, wifi_config__init); + ntfy_payload->cfg->u_case = WIFI_CONFIG__U_STA; + + res = copy_wifi_sta_cfg_to_rpc_struct(ntfy_payload, + PAYLOAD_TYPE_RPC_EVENT_WIFI_DPP_GET_CONFIG, sta_config); + + if (res == ESP_OK) { + ntfy_payload->resp = SUCCESS; + return ESP_OK; + } else { + ESP_LOGE(TAG, "NTFY: copy_wifi_sta_cfg_to_rpc_struct() FAILED"); + return res; + } + err: + return ESP_FAIL; +} + +static esp_err_t rpc_evt_wifi_dpp_fail(Rpc *ntfy, + const uint8_t *data, ssize_t len) +{ + NTFY_TEMPLATE(RPC_ID__Event_WifiDppFail, + RpcEventWifiDppFail, event_wifi_dpp_fail, + rpc__event__wifi_dpp_fail__init); + + int *reason = (int *)data; + + ntfy_payload->reason = *reason; + ntfy_payload->resp = SUCCESS; return ESP_OK; } +#endif // H_WIFI_DPP_SUPPORT +#endif // H_DPP_SUPPORT esp_err_t rpc_evt_handler(uint32_t session_id,const uint8_t *inbuf, ssize_t inlen, uint8_t **outbuf, ssize_t *outlen, void *priv_data) @@ -2398,9 +4872,50 @@ esp_err_t rpc_evt_handler(uint32_t session_id,const uint8_t *inbuf, } case RPC_ID__Event_StaDisconnected: { ret = rpc_evt_sta_disconnected(ntfy, inbuf, inlen, WIFI_EVENT_STA_DISCONNECTED); break; +#if CONFIG_SOC_WIFI_HE_SUPPORT + } case RPC_ID__Event_StaItwtSetup: { + ret = rpc_evt_itwt_setup(ntfy, inbuf, inlen, WIFI_EVENT_ITWT_SETUP); + break; + } case RPC_ID__Event_StaItwtTeardown: { + ret = rpc_evt_itwt_teardown(ntfy, inbuf, inlen, WIFI_EVENT_ITWT_TEARDOWN); + break; + } case RPC_ID__Event_StaItwtSuspend: { + ret = rpc_evt_itwt_suspend(ntfy, inbuf, inlen, WIFI_EVENT_ITWT_SUSPEND); + break; + } case RPC_ID__Event_StaItwtProbe: { + ret = rpc_evt_itwt_probe(ntfy, inbuf, inlen, WIFI_EVENT_ITWT_PROBE); + break; +#endif } case RPC_ID__Event_WifiEventNoArgs: { ret = rpc_evt_Event_WifiEventNoArgs(ntfy, inbuf, inlen); break; +#ifdef CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED + } case RPC_ID__Event_DhcpDnsStatus: { + ret = rpc_evt_Event_DhcpDnsStatus(ntfy, inbuf, inlen); + break; +#endif +#if H_SUPP_DPP_SUPPORT + } case RPC_ID__Event_SuppDppUriReady: { + ret = rpc_evt_supp_dpp_uri_ready(ntfy, inbuf, inlen); + break; + } case RPC_ID__Event_SuppDppCfgRecvd: { + ret = rpc_evt_supp_dpp_cfg_recvd(ntfy, inbuf, inlen); + break; + } case RPC_ID__Event_SuppDppFail: { + ret = rpc_evt_supp_dpp_fail(ntfy, inbuf, inlen); + break; +#endif // H_SUPP_DPP_SUPPORT +#if H_WIFI_DPP_SUPPORT + } case RPC_ID__Event_WifiDppUriReady: { + ret = rpc_evt_wifi_dpp_uri_ready(ntfy, inbuf, inlen); + break; + } case RPC_ID__Event_WifiDppCfgRecvd: { + ret = rpc_evt_wifi_dpp_cfg_recvd(ntfy, inbuf, inlen); + break; + } case RPC_ID__Event_WifiDppFail: { + ret = rpc_evt_wifi_dpp_fail(ntfy, inbuf, inlen); + break; +#endif // H_WIFI_DPP_SUPPORT } default: { ESP_LOGE(TAG, "Incorrect/unsupported Ctrl Notification[%u]\n",ntfy->msg_id); goto err; diff --git a/slave/main/slave_control.h b/slave/main/slave_control.h index a2ef28a8..f4dbf9a3 100644 --- a/slave/main/slave_control.h +++ b/slave/main/slave_control.h @@ -1,22 +1,14 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef __SLAVE_CONTROL__H__ #define __SLAVE_CONTROL__H__ #include #include "interface.h" +#include "sdkconfig.h" #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) #define TIMEOUT_IN_SEC (1000 / portTICK_PERIOD_MS) @@ -28,6 +20,184 @@ #define PASSWORD_LENGTH 64 #define VENDOR_OUI_BUF 3 + + +#define mem_free(x) \ + { \ + if (x) { \ + free(x); \ + x = NULL; \ + } \ + } + + +#define NTFY_TEMPLATE(NtFy_MsgId, NtFy_TyPe, NtFy_StRuCt, InIt_FuN) \ + NtFy_TyPe *ntfy_payload = NULL; \ + ntfy_payload = (NtFy_TyPe*)calloc(1,sizeof(NtFy_TyPe)); \ + if (!ntfy_payload) { \ + ESP_LOGE(TAG,"Failed to allocate memory"); \ + return ESP_ERR_NO_MEM; \ + } \ + InIt_FuN(ntfy_payload); \ + ntfy->payload_case = NtFy_MsgId; \ + ntfy->NtFy_StRuCt = ntfy_payload; \ + ntfy_payload->resp = SUCCESS; + +#define RPC_TEMPLATE(RspTyPe, RspStRuCt, ReqType, ReqStruct, InIt_FuN) \ + RspTyPe *resp_payload = NULL; \ + ReqType *req_payload = NULL; \ + if (!req || !resp || !req->ReqStruct) { \ + ESP_LOGE(TAG, "Invalid parameters"); \ + return ESP_FAIL; \ + } \ + req_payload = req->ReqStruct; \ + resp_payload = (RspTyPe *)calloc(1, sizeof(RspTyPe)); \ + if (!resp_payload) { \ + ESP_LOGE(TAG, "Failed to alloc mem for resp.%s\n",#RspStRuCt); \ + return ESP_ERR_NO_MEM; \ + } \ + resp->RspStRuCt = resp_payload; \ + InIt_FuN(resp_payload); \ + resp_payload->resp = SUCCESS; \ + + +/* Simple is same above just, we dod not need req_payload unused warning */ +#define RPC_TEMPLATE_SIMPLE(RspTyPe, RspStRuCt, ReqType, ReqStruct, InIt_FuN) \ + RspTyPe *resp_payload = NULL; \ + if (!req || !resp) { \ + ESP_LOGE(TAG, "Invalid parameters"); \ + return ESP_FAIL; \ + } \ + resp_payload = (RspTyPe *)calloc(1, sizeof(RspTyPe)); \ + if (!resp_payload) { \ + ESP_LOGE(TAG, "Failed to alloc mem for resp.%s\n",#RspStRuCt); \ + return ESP_ERR_NO_MEM; \ + } \ + resp->RspStRuCt = resp_payload; \ + InIt_FuN(resp_payload); \ + resp_payload->resp = SUCCESS; \ + +#define RPC_RESP_ASSIGN_FIELD(PaRaM) \ + resp_payload->PaRaM = PaRaM + +#define RPC_RET_FAIL_IF(ConDiTiOn) do { \ + int rEt = (ConDiTiOn); \ + if (rEt) { \ + resp_payload->resp = rEt; \ + ESP_LOGE(TAG, "%s:%u failed [%s] = [%d]", __func__,__LINE__,#ConDiTiOn, rEt); \ + return ESP_OK; \ + } \ +} while(0); + + +#define RPC_ALLOC_ELEMENT(TyPe,MsG_StRuCt,InIt_FuN) { \ + TyPe *NeW_AllocN = (TyPe *)calloc(1, sizeof(TyPe)); \ + if (!NeW_AllocN) { \ + ESP_LOGI(TAG,"Failed to allocate memory for req.%s\n",#MsG_StRuCt); \ + resp_payload->resp = RPC_ERR_MEMORY_FAILURE; \ + goto err; \ + } \ + MsG_StRuCt = NeW_AllocN; \ + InIt_FuN(MsG_StRuCt); \ +} + +#define NTFY_ALLOC_ELEMENT(TyPe,MsG_StRuCt,InIt_FuN) { \ + TyPe *NeW_AllocN = (TyPe *)calloc(1, sizeof(TyPe)); \ + if (!NeW_AllocN) { \ + ESP_LOGI(TAG,"Failed to allocate memory for req.%s\n",#MsG_StRuCt); \ + ntfy_payload->resp = RPC_ERR_MEMORY_FAILURE; \ + goto err; \ + } \ + MsG_StRuCt = NeW_AllocN; \ + InIt_FuN(MsG_StRuCt); \ +} + +#define NTFY_COPY_BYTES(dest, src, num) \ + do { \ + if (num) { \ + dest.data = (uint8_t *)calloc(1, num); \ + if (!dest.data) { \ + ESP_LOGE(TAG, "%s:%u Failed to duplicate bytes\n",__func__,__LINE__); \ + ntfy_payload->resp = FAILURE; \ + return ESP_OK; \ + } \ + memcpy(dest.data, src, num); \ + dest.len = num; \ + } \ + } while(0) + +#define NTFY_COPY_STR(dest, src, max_len) \ + if (src) { \ + dest.data = (uint8_t*)strndup((char*)src, max_len); \ + if (!dest.data) { \ + ESP_LOGE(TAG, "%s:%u Failed to duplicate bytes\n",__func__,__LINE__); \ + ntfy_payload->resp = FAILURE; \ + return ESP_OK; \ + } \ + dest.len = min(max_len,strlen((char*)src)+1); \ + } + +#define RPC_REQ_COPY_BYTES(dest, src, num_bytes) \ + if (src.len && src.data) \ + memcpy((char*)dest, src.data, min(min(sizeof(dest), num_bytes), src.len)); + +#define RPC_REQ_COPY_STR RPC_REQ_COPY_BYTES + +#define RPC_RESP_COPY_STR(dest, src, max_len) \ + if (src) { \ + dest.data = (uint8_t*)strndup((char*)src, max_len); \ + if (!dest.data) { \ + ESP_LOGE(TAG, "%s:%u Failed to duplicate bytes\n",__func__,__LINE__); \ + resp_payload->resp = FAILURE; \ + return ESP_OK; \ + } \ + dest.len = min(max_len,strlen((char*)src)+1); \ + } + +#define RPC_RESP_COPY_BYTES_SRC_UNCHECKED(dest, src, num) \ + do { \ + if (num) { \ + dest.data = (uint8_t *)calloc(1, num); \ + if (!dest.data) { \ + ESP_LOGE(TAG, "%s:%u Failed to duplicate bytes\n",__func__,__LINE__); \ + resp_payload->resp = FAILURE; \ + return ESP_OK; \ + } \ + memcpy(dest.data, src, num); \ + dest.len = num; \ + } \ + } while(0) + +#define RPC_RESP_COPY_BYTES(dest, src, num) \ + if (src) { \ + RPC_RESP_COPY_BYTES_SRC_UNCHECKED(dest, src, num); \ + } + +#define RPC_COPY_STR(dest, src, max_len) \ + if (src) { \ + dest.data = (uint8_t*)strndup((char*)src, max_len); \ + if (!dest.data) { \ + ESP_LOGE(TAG, "%s:%u Failed to duplicate bytes\n",__func__,__LINE__); \ + return FAILURE; \ + } \ + dest.len = min(max_len,strlen((char*)src)+1); \ + } + +#define RPC_COPY_BYTES(dest, src, num) \ + do { \ + if (num) { \ + dest.data = (uint8_t *)calloc(1, num); \ + if (!dest.data) { \ + ESP_LOGE(TAG, "%s:%u Failed to duplicate bytes\n",__func__,__LINE__); \ + return FAILURE; \ + } \ + memcpy(dest.data, src, num); \ + dest.len = num; \ + } \ + } while(0) + + + esp_err_t data_transfer_handler(uint32_t session_id,const uint8_t *inbuf, ssize_t inlen,uint8_t **outbuf, ssize_t *outlen, void *priv_data); esp_err_t rpc_evt_handler(uint32_t session_id,const uint8_t *inbuf, @@ -35,4 +205,28 @@ esp_err_t rpc_evt_handler(uint32_t session_id,const uint8_t *inbuf, void send_event_to_host(int event_id); void send_event_data_to_host(int event_id, void *data, int size); + +#include "esp_wifi.h" + +esp_err_t esp_hosted_set_sta_config(wifi_interface_t iface, wifi_config_t *cfg); +esp_err_t esp_hosted_register_wifi_event_handlers(void); + +#ifdef CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED +/* DHCP/DNS status structure */ +typedef struct { + int iface; + int net_link_up; + int dhcp_up; + uint8_t dhcp_ip[64]; + uint8_t dhcp_nm[64]; + uint8_t dhcp_gw[64]; + int dns_up; + uint8_t dns_ip[64]; + int dns_type; +} rpc_dhcp_dns_status_t; + +/* Function declarations */ + +#endif /* CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED */ + #endif /*__SLAVE_CONTROL__H__*/ diff --git a/slave/main/slave_wifi_config.h b/slave/main/slave_wifi_config.h new file mode 100644 index 00000000..0b5536ad --- /dev/null +++ b/slave/main/slave_wifi_config.h @@ -0,0 +1,105 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __SLAVE_WIFI_CONFIG_H__ +#define __SLAVE_WIFI_CONFIG_H__ + +#include "esp_idf_version.h" + +// HE support changed after ESP-IDF v5.3 +#if CONFIG_SOC_WIFI_HE_SUPPORT && (ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 3, 0)) + #define H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 1 +#else + #define H_WIFI_HE_GREATER_THAN_ESP_IDF_5_3 0 +#endif + +/* ESP-IDF 5.5.0: renamed reserved fields to reserved1/reserved2 */ +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0) +#define H_WIFI_NEW_RESERVED_FIELD_NAMES 1 +#define H_PRESENT_IN_ESP_IDF_5_5_0 1 +#define H_IF_AVAILABLE_SPI_SLAVE_ENABLE_DISABLE 1 +#else +#define H_WIFI_NEW_RESERVED_FIELD_NAMES 0 +#define H_PRESENT_IN_ESP_IDF_5_5_0 0 +#define H_IF_AVAILABLE_SPI_SLAVE_ENABLE_DISABLE 0 +#endif + +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) +#define H_PRESENT_IN_ESP_IDF_5_4_0 1 +#else +#define H_PRESENT_IN_ESP_IDF_5_4_0 0 +#endif + +/* + * wifi_twt_config_t::twt_enable_keep_alive only found in + * IDF v5.3.2 and above + */ +#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 3, 1) +#define H_GOT_TWT_ENABLE_KEEP_ALIVE 1 +#else +#define H_GOT_TWT_ENABLE_KEEP_ALIVE 0 +#endif + +/* wifi_ap_config_t::transition_disable only found in + * IDF v5.3.3 and above, or + * IDF v5.4.1 and above + */ +#if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 3)) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 1)) +#define H_GOT_AP_CONFIG_PARAM_TRANSITION_DISABLE 0 +#else +#define H_GOT_AP_CONFIG_PARAM_TRANSITION_DISABLE 1 +#endif + +/* WIFI_ENABLE_CACHE_TX_BUFFER only found in + * IDF 5.3.3 and above + * reused config for WIFI_ENABLE_SPIRAM + */ +#ifndef WIFI_ENABLE_CACHE_TX_BUFFER +#define WIFI_ENABLE_CACHE_TX_BUFFER WIFI_ENABLE_SPIRAM +#endif + +#ifdef CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT + #define H_WIFI_ENTERPRISE_SUPPORT 1 +#else + #define H_WIFI_ENTERPRISE_SUPPORT 0 +#endif + +#if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 4)) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 3)) || (H_PRESENT_IN_ESP_IDF_5_5_0) +#define H_GOT_SET_EAP_METHODS_API 0 +#else +#define H_GOT_SET_EAP_METHODS_API 1 +#endif + +/** + * Wi-Fi Easy Connect (DPP) events is returned to user via + * Supplicant Callback or Wi-Fi DPP events, + * depending on IDF version + * + * IDF v6.0 and above only support Wi-Fi DPP events + * IDF v5.5 support Wi-Fi and Supplicant DPP events + * earlier versions support only Supplicant DPP events + */ +// Supplicant Callback DPP Events: removed from IDF v6.0 +#if CONFIG_ESP_WIFI_DPP_SUPPORT && (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0)) +#define H_SUPP_DPP_SUPPORT 1 +#else +#define H_SUPP_DPP_SUPPORT 0 +#endif + +// Wi-Fi DPP Events: only in IDF v5.5 and above +#if CONFIG_ESP_WIFI_DPP_SUPPORT && (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0)) +#define H_WIFI_DPP_SUPPORT 1 +#else +#define H_WIFI_DPP_SUPPORT 0 +#endif + +// for generic DPP support +#if H_SUPP_DPP_SUPPORT || H_WIFI_DPP_SUPPORT +#define H_DPP_SUPPORT 1 +#else +#define H_DPP_SUPPORT 0 +#endif + +#endif diff --git a/slave/main/spi_hd_slave_api.c b/slave/main/spi_hd_slave_api.c index 6bb1f503..0a11789f 100644 --- a/slave/main/spi_hd_slave_api.c +++ b/slave/main/spi_hd_slave_api.c @@ -1,17 +1,8 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2024 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "sdkconfig.h" @@ -31,6 +22,7 @@ #include "esp_hosted_transport.h" #include "esp_hosted_transport_init.h" #include "esp_hosted_transport_spi_hd.h" +#include "esp_hosted_coprocessor_fw_ver.h" #include "esp_log.h" static const char TAG[] = "SPI_HD_DRIVER"; @@ -96,11 +88,11 @@ static const char TAG[] = "SPI_HD_DRIVER"; #endif #if H_DATAREADY_ACTIVE_HIGH - #define set_dataready_gpio() { data_ready_gpio_active = true; gpio_set_level(GPIO_DATA_READY, 1); } - #define reset_dataready_gpio() { gpio_set_level(GPIO_DATA_READY, 0); data_ready_gpio_active = false; } + #define set_dataready_gpio() { ESP_EARLY_LOGV(TAG, "set_dataready_gpio"); data_ready_gpio_active = true; gpio_set_level(GPIO_DATA_READY, 1); } + #define reset_dataready_gpio() { ESP_EARLY_LOGV(TAG, "reset_dataready_gpio"); gpio_set_level(GPIO_DATA_READY, 0); data_ready_gpio_active = false; } #else - #define set_dataready_gpio() { data_ready_gpio_active = true; gpio_set_level(GPIO_DATA_READY, 0); } - #define reset_dataready_gpio() { gpio_set_level(GPIO_DATA_READY, 1); data_ready_gpio_active = false; } + #define set_dataready_gpio() { ESP_EARLY_LOGV(TAG, "set_dataready_gpio"); data_ready_gpio_active = true; gpio_set_level(GPIO_DATA_READY, 0); } + #define reset_dataready_gpio() { ESP_EARLY_LOGV(TAG, "reset_dataready_gpio"); gpio_set_level(GPIO_DATA_READY, 1); data_ready_gpio_active = false; } #endif // for flow control @@ -145,7 +137,7 @@ static struct hosted_mempool * trans_tx_g; static struct hosted_mempool * trans_rx_g; static SemaphoreHandle_t mempool_tx_sem = NULL; // to count number of Tx bufs in IDF SPI HD driver -static inline void spi_hd_mempool_create() +static inline void spi_hd_mempool_create(void) { buf_mp_tx_g = hosted_mempool_create(NULL, 0, TX_MEMPOOL_NUM_BLOCKS, SPI_HD_BUFFER_SIZE); @@ -163,7 +155,7 @@ static inline void spi_hd_mempool_create() #endif } -static inline void spi_hd_mempool_destroy() +static inline void spi_hd_mempool_destroy(void) { hosted_mempool_destroy(buf_mp_tx_g); hosted_mempool_destroy(buf_mp_rx_g); @@ -214,6 +206,7 @@ static inline void spi_hd_trans_rx_free(spi_slave_hd_data_t *trans) static bool cb_rx_ready(void *arg, spi_slave_hd_event_t *event, BaseType_t *awoken) { // rx dma buffer ready + ESP_EARLY_LOGV(TAG, "cb_rx_ready"); // update count rx_ready_buf_num++; @@ -226,7 +219,7 @@ static bool cb_rx_ready(void *arg, spi_slave_hd_event_t *event, BaseType_t *awok static bool cb_tx_ready(void *arg, spi_slave_hd_event_t *event, BaseType_t *awoken) { // tx buffer loaded to DMA - + ESP_EARLY_LOGD(TAG, "cb_tx_ready %u (current %u)", event->trans->len, tx_ready_buf_size); // save the int mask uint32_t int_mask = tx_ready_buf_size & SPI_HD_INT_MASK; @@ -251,6 +244,7 @@ static bool cb_cmd9_recv(void *arg, spi_slave_hd_event_t *event, BaseType_t *awo // clear the mask tx_ready_buf_size &= SPI_HD_TX_BUF_LEN_MASK; + ESP_EARLY_LOGD(TAG, "cb_cmd9_recv %u", tx_ready_buf_size); // clear Data Ready reset_dataready_gpio(); @@ -289,14 +283,14 @@ static void start_rx_data_throttling_if_needed(void) return; queue_load = uxQueueMessagesWaiting(spi_hd_rx_queue[PRIO_Q_OTHERS]); -#if ESP_PKT_STATS - pkt_stats.slave_wifi_rx_msg_loaded = queue_load; -#endif load_percent = (queue_load*100/SPI_HD_QUEUE_SIZE); if (load_percent > slv_cfg_g.throttle_high_threshold) { slv_state_g.current_throttling = 1; wifi_flow_ctrl = 1; +#if ESP_PKT_STATS + pkt_stats.sta_flowctrl_on++; +#endif TRIGGER_FLOW_CTRL(); } } @@ -310,14 +304,15 @@ static void stop_rx_data_throttling_if_needed(void) if (slv_state_g.current_throttling) { queue_load = uxQueueMessagesWaiting(spi_hd_rx_queue[PRIO_Q_OTHERS]); -#if ESP_PKT_STATS - pkt_stats.slave_wifi_rx_msg_loaded = queue_load; -#endif + load_percent = (queue_load*100/SPI_HD_QUEUE_SIZE); if (load_percent < slv_cfg_g.throttle_low_threshold) { slv_state_g.current_throttling = 0; wifi_flow_ctrl = 0; +#if ESP_PKT_STATS + pkt_stats.sta_flowctrl_off++; +#endif TRIGGER_FLOW_CTRL(); } } @@ -334,6 +329,12 @@ static void esp_spi_hd_get_bus_cfg(spi_bus_config_t * bus_cfg) bus_cfg->data2_io_num = -1; bus_cfg->data3_io_num = -1; #endif + // mark octal SPI_HD signals as not in use + bus_cfg->data4_io_num = -1; + bus_cfg->data5_io_num = -1; + bus_cfg->data6_io_num = -1; + bus_cfg->data7_io_num = -1; + bus_cfg->sclk_io_num = GPIO_SCLK; bus_cfg->max_transfer_sz = SPI_HD_BUFFER_SIZE; #if (NUM_DATA_BITS == 4) @@ -406,6 +407,7 @@ static void spi_hd_rx_task(void* pvParameters) spi_slave_hd_data_t *ret_trans = NULL; esp_err_t res; uint16_t len = 0, offset = 0; + uint8_t flags = 0; struct esp_payload_header *header = NULL; interface_buffer_handle_t buf_handle = {0}; @@ -413,6 +415,8 @@ static void spi_hd_rx_task(void* pvParameters) uint16_t rx_checksum = 0, checksum = 0; #endif + ESP_LOGD(TAG, "starting spi_hd_rx_task"); + // prepare buffers and preload rx transactions for (i = 0; i < SPI_HD_QUEUE_SIZE; i++) { buf = spi_hd_buffer_rx_alloc(MEMSET_REQUIRED); @@ -433,10 +437,14 @@ static void spi_hd_rx_task(void* pvParameters) // spi hd now ready: open data path if (context.event_handler) { + ESP_LOGD(TAG, "Trigger open data path at slave"); context.event_handler(ESP_OPEN_DATA_PATH); + } else { + ESP_LOGW(TAG, "No event handler, skipping open data path"); } while (1) { + // wait for incoming transactions res = spi_slave_hd_get_trans_res(SPI_HOST, SPI_SLAVE_CHAN_RX, &ret_trans, portMAX_DELAY); @@ -460,7 +468,22 @@ static void spi_hd_rx_task(void* pvParameters) header = (struct esp_payload_header *)buf_handle.payload; len = le16toh(header->len); offset = le16toh(header->offset); - + flags = header->flags; + + ESP_LOGV(TAG, "Received flags: 0x%02x", flags); + + if (flags & FLAG_POWER_SAVE_STARTED) { + ESP_LOGI(TAG, "Host informed starting to power sleep"); + if (context.event_handler) { + context.event_handler(ESP_POWER_SAVE_ON); + } + } else if (flags & FLAG_POWER_SAVE_STOPPED) { + ESP_LOGI(TAG, "Host informed that it waken up"); + tx_ready_buf_size = 0; + if (context.event_handler) { + context.event_handler(ESP_POWER_SAVE_OFF); + } + } if (buf_handle.payload_len < len+offset) { ESP_LOGE(TAG, "%s: err: read_len[%u] < len[%u]+offset[%u]", __func__, buf_handle.payload_len, len, offset); @@ -529,6 +552,10 @@ static void spi_hd_tx_done_task(void* pvParameters) static interface_handle_t * esp_spi_hd_init(void) { + if (if_handle_g.state >= DEACTIVE) { + return &if_handle_g; + } + esp_err_t ret = ESP_OK; uint32_t value = 0; uint16_t prio_q_idx = 0; @@ -559,7 +586,7 @@ static interface_handle_t * esp_spi_hd_init(void) gpio_set_pull_mode(GPIO_SCLK, GPIO_PULLUP_ONLY); gpio_set_pull_mode(GPIO_CS, GPIO_PULLUP_ONLY); - ESP_LOGI(TAG, "SPI HD Host:%"PRIu16 " mode: %"PRIu16 ", Freq:ConfigAtHost", + ESP_LOGI(TAG, "SPI HD Host:%"PRIu16" mode: %"PRIu16 ", Freq:ConfigAtHost", SPI_HOST, slave_hd_cfg.mode); #if (NUM_DATA_BITS == 4) ESP_LOGI(TAG, "SPI HD GPIOs: Dat0: %"PRIu16 ", Dat1: %"PRIu16 ", Dat2: %"PRIu16 @@ -627,27 +654,34 @@ static interface_handle_t * esp_spi_hd_init(void) } assert(xTaskCreate(spi_hd_rx_task, "spi_hd_rx_task" , - CONFIG_ESP_DEFAULT_TASK_STACK_SIZE, NULL, - CONFIG_ESP_DEFAULT_TASK_PRIO, NULL) == pdTRUE); + CONFIG_ESP_HOSTED_DEFAULT_TASK_STACK_SIZE, NULL, + CONFIG_ESP_HOSTED_DEFAULT_TASK_PRIORITY, NULL) == pdTRUE); // task to clean up after doing tx assert(xTaskCreate(spi_hd_tx_done_task, "spi_hd_tx_done_task" , - CONFIG_ESP_DEFAULT_TASK_STACK_SIZE, NULL, - CONFIG_ESP_DEFAULT_TASK_PRIO, NULL) == pdTRUE); + CONFIG_ESP_HOSTED_DEFAULT_TASK_STACK_SIZE, NULL, + CONFIG_ESP_HOSTED_DEFAULT_TASK_PRIORITY, NULL) == pdTRUE); assert(xTaskCreate(flow_ctrl_task, "flow_ctrl_task" , - CONFIG_ESP_DEFAULT_TASK_STACK_SIZE, NULL , - CONFIG_ESP_DEFAULT_TASK_PRIO, NULL) == pdTRUE); + CONFIG_ESP_HOSTED_DEFAULT_TASK_STACK_SIZE, NULL , + CONFIG_ESP_HOSTED_DEFAULT_TASK_PRIORITY, NULL) == pdTRUE); // data path opened. Continue memset(&if_handle_g, 0, sizeof(if_handle_g)); - if_handle_g.state = INIT; + if_handle_g.state = ACTIVE; return &if_handle_g; } static void esp_spi_hd_deinit(interface_handle_t * handle) { +#if H_PS_UNLOAD_BUS_WHILE_PS + + if (if_handle_g.state == DEINIT) { + ESP_LOGW(TAG, "SPI HD already deinitialized"); + return; + } + if_handle_g.state = DEINIT; spi_hd_mempool_destroy(); vSemaphoreDelete(mempool_tx_sem); mempool_tx_sem = NULL; @@ -658,6 +692,7 @@ static void esp_spi_hd_deinit(interface_handle_t * handle) } assert(spi_slave_hd_deinit(SPI_HOST) == ESP_OK); +#endif } static esp_err_t esp_spi_hd_reset(interface_handle_t *handle) @@ -725,6 +760,7 @@ static int32_t esp_spi_hd_write(interface_handle_t *handle, interface_buffer_han header->seq_num = htole16(buf_handle->seq_num); header->flags = buf_handle->flag; header->throttle_cmd = buf_handle->wifi_flow_ctrl_en; + header->flags = buf_handle->flag; memcpy(sendbuf + offset, buf_handle->payload, buf_handle->payload_len); @@ -733,8 +769,8 @@ static int32_t esp_spi_hd_write(interface_handle_t *handle, interface_buffer_han offset+buf_handle->payload_len)); #endif - ESP_LOGD(TAG, "sending %"PRIu32 " bytes", total_len); - ESP_HEXLOGD("spi_hd_tx", sendbuf, total_len); + ESP_LOGD(TAG, "sending %"PRIu32 " bytes, flag: 0x%02x", total_len, buf_handle->flag); + ESP_HEXLOGD("spi_hd_tx", sendbuf, total_len, 32); tx_trans = spi_hd_trans_tx_alloc(MEMSET_REQUIRED); tx_trans->data = sendbuf; @@ -843,6 +879,20 @@ void generate_startup_event(uint8_t cap, uint32_t ext_cap) *pos = LENGTH_1_BYTE; pos++;len++; *pos = SPI_HD_QUEUE_SIZE; pos++;len++; + // convert fw version into a uint32_t + uint32_t fw_version = ESP_HOSTED_VERSION_VAL(PROJECT_VERSION_MAJOR_1, + PROJECT_VERSION_MINOR_1, + PROJECT_VERSION_PATCH_1); + + // send fw version as a little-endian uint32_t + *pos = ESP_PRIV_FIRMWARE_VERSION; pos++;len++; + *pos = LENGTH_4_BYTE; pos++;len++; + // send fw_version as a little endian 32bit value + *pos = (fw_version & 0xff); pos++;len++; + *pos = (fw_version >> 8) & 0xff; pos++;len++; + *pos = (fw_version >> 16) & 0xff; pos++;len++; + *pos = (fw_version >> 24) & 0xff; pos++;len++; + /* TLVs end */ event->event_len = len; diff --git a/slave/main/spi_slave_api.c b/slave/main/spi_slave_api.c index b51903e8..6f9db3b7 100644 --- a/slave/main/spi_slave_api.c +++ b/slave/main/spi_slave_api.c @@ -1,17 +1,5 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2015-2025 Espressif Systems (Shanghai) PTE LTD */ #include "sdkconfig.h" #include @@ -32,6 +20,10 @@ #include "esp_hosted_transport.h" #include "esp_hosted_transport_init.h" #include "esp_hosted_header.h" +#include "host_power_save.h" +#include "esp_hosted_interface.h" +#include "slave_wifi_config.h" +#include "esp_hosted_coprocessor_fw_ver.h" static const char TAG[] = "SPI_DRIVER"; /* SPI settings */ @@ -50,6 +42,13 @@ static const char TAG[] = "SPI_DRIVER"; #define SPI_RX_QUEUE_SIZE CONFIG_ESP_SPI_RX_Q_SIZE #define SPI_TX_QUEUE_SIZE CONFIG_ESP_SPI_TX_Q_SIZE +// de-assert HS signal on CS, instead of at end of transaction +#if defined(CONFIG_ESP_SPI_DEASSERT_HS_ON_CS) +#define HS_DEASSERT_ON_CS (1) +#else +#define HS_DEASSERT_ON_CS (0) +#endif + /* By default both Handshake and Data Ready used Active High, * unless configured otherwise. * For Active low, set value as 0 */ @@ -68,6 +67,7 @@ static const char TAG[] = "SPI_DRIVER"; #else #define DMA_CHAN SPI_DMA_CH_AUTO #endif +static uint8_t hosted_constructs_init_done = 0; #if ESP_SPI_MODE==0 @@ -80,7 +80,11 @@ static const char TAG[] = "SPI_DRIVER"; #define GPIO_MASK_DATA_READY (1ULL << GPIO_DATA_READY) #define GPIO_MASK_HANDSHAKE (1ULL << GPIO_HANDSHAKE) +#if HS_DEASSERT_ON_CS +#define H_CS_INTR_TO_CLEAR_HS GPIO_INTR_ANYEDGE +#else #define H_CS_INTR_TO_CLEAR_HS GPIO_INTR_NEGEDGE +#endif #if H_HANDSHAKE_ACTIVE_HIGH #define H_HS_VAL_ACTIVE GPIO_OUT_W1TS_REG @@ -106,11 +110,11 @@ static interface_context_t context; static interface_handle_t if_handle_g; static SemaphoreHandle_t spi_tx_sem; static SemaphoreHandle_t spi_rx_sem; +#if HS_DEASSERT_ON_CS +static SemaphoreHandle_t wait_cs_deassert_sem; +#endif static QueueHandle_t spi_rx_queue[MAX_PRIORITY_QUEUES]; static QueueHandle_t spi_tx_queue[MAX_PRIORITY_QUEUES]; -#if DUMMY_TRANS_DESIGN -static SemaphoreHandle_t spi_sema; -#endif static interface_handle_t * esp_spi_init(void); static int32_t esp_spi_write(interface_handle_t *handle, @@ -119,9 +123,7 @@ static int esp_spi_read(interface_handle_t *if_handle, interface_buffer_handle_t static esp_err_t esp_spi_reset(interface_handle_t *handle); static void esp_spi_deinit(interface_handle_t *handle); static void esp_spi_read_done(void *handle); -#if !DUMMY_TRANS_DESIGN static void queue_next_transaction(void); -#endif if_ops_t if_ops = { .init = esp_spi_init, @@ -135,11 +137,8 @@ if_ops_t if_ops = { static struct hosted_mempool * buf_mp_tx_g; static struct hosted_mempool * buf_mp_rx_g; static struct hosted_mempool * trans_mp_g; -#if DUMMY_TRANS_DESIGN -static uint8_t dummy_queued = pdFALSE; -#endif -static inline void spi_mempool_create() +static inline void spi_mempool_create(void) { buf_mp_tx_g = hosted_mempool_create(NULL, 0, SPI_MEMPOOL_NUM_BLOCKS, SPI_BUFFER_SIZE); @@ -151,10 +150,12 @@ static inline void spi_mempool_create() assert(buf_mp_tx_g); assert(buf_mp_rx_g); assert(trans_mp_g); +#else + ESP_LOGI(TAG, "Using dynamic heap for mem alloc"); #endif } -static inline void spi_mempool_destroy() +static inline void spi_mempool_destroy(void) { hosted_mempool_destroy(buf_mp_tx_g); hosted_mempool_destroy(trans_mp_g); @@ -189,11 +190,11 @@ static inline void spi_trans_free(spi_slave_transaction_t *trans) { hosted_mempool_free(trans_mp_g, trans); } - -#define set_handshake_gpio() gpio_set_level(GPIO_HANDSHAKE, 1); -#define reset_handshake_gpio() gpio_set_level(GPIO_HANDSHAKE, 0); -#define set_dataready_gpio() gpio_set_level(GPIO_DATA_READY, 1); -#define reset_dataready_gpio() gpio_set_level(GPIO_DATA_READY, 0); +volatile uint8_t data_ready_flag = 0; +#define set_handshake_gpio() ESP_EARLY_LOGD(TAG, "+ set handshake gpio");gpio_set_level(GPIO_HANDSHAKE, 1); +#define reset_handshake_gpio() ESP_EARLY_LOGD(TAG, "- reset handshake gpio");gpio_set_level(GPIO_HANDSHAKE, 0); +#define set_dataready_gpio() if (!data_ready_flag) {ESP_EARLY_LOGD(TAG, "+ set dataready gpio");gpio_set_level(GPIO_DATA_READY, 1);data_ready_flag = 1;} +#define reset_dataready_gpio() if (data_ready_flag) {ESP_EARLY_LOGD(TAG, "- reset dataready gpio");gpio_set_level(GPIO_DATA_READY, 0);data_ready_flag = 0;} interface_context_t *interface_insert_driver(int (*event_handler)(uint8_t val)) { @@ -225,20 +226,23 @@ static inline int find_wifi_tx_throttling_to_be_set(void) } queue_load = uxQueueMessagesWaiting(spi_rx_queue[PRIO_Q_OTHERS]); -#if ESP_PKT_STATS - pkt_stats.slave_wifi_rx_msg_loaded = queue_load; -#endif load_percent = (queue_load*100/SPI_RX_QUEUE_SIZE); if (load_percent > slv_cfg_g.throttle_high_threshold) { slv_state_g.current_throttling = 1; ESP_LOGV(TAG, "throttling started"); +#if ESP_PKT_STATS + pkt_stats.sta_flowctrl_on++; +#endif } if (load_percent < slv_cfg_g.throttle_low_threshold) { slv_state_g.current_throttling = 0; ESP_LOGV(TAG, "throttling stopped"); +#if ESP_PKT_STATS + pkt_stats.sta_flowctrl_off++; +#endif } return slv_state_g.current_throttling; @@ -266,7 +270,7 @@ void generate_startup_event(uint8_t cap, uint32_t ext_cap) header->if_num = 0; header->offset = htole16(sizeof(struct esp_payload_header)); header->priv_pkt_type = ESP_PACKET_TYPE_EVENT; - header->throttle_cmd = find_wifi_tx_throttling_to_be_set(); + header->throttle_cmd = 0; /* Populate event data */ event = (struct esp_priv_event *) (buf_handle.payload + sizeof(struct esp_payload_header)); @@ -301,6 +305,20 @@ void generate_startup_event(uint8_t cap, uint32_t ext_cap) *pos = LENGTH_1_BYTE; pos++;len++; *pos = SPI_TX_QUEUE_SIZE; pos++;len++; + // convert fw version into a uint32_t + uint32_t fw_version = ESP_HOSTED_VERSION_VAL(PROJECT_VERSION_MAJOR_1, + PROJECT_VERSION_MINOR_1, + PROJECT_VERSION_PATCH_1); + + // send fw version as a little-endian uint32_t + *pos = ESP_PRIV_FIRMWARE_VERSION; pos++;len++; + *pos = LENGTH_4_BYTE; pos++;len++; + // send fw_version as a little endian 32bit value + *pos = (fw_version & 0xff); pos++;len++; + *pos = (fw_version >> 8) & 0xff; pos++;len++; + *pos = (fw_version >> 16) & 0xff; pos++;len++; + *pos = (fw_version >> 24) & 0xff; pos++;len++; + /* TLVs end */ event->event_len = len; @@ -324,11 +342,9 @@ void generate_startup_event(uint8_t cap, uint32_t ext_cap) xQueueSend(spi_tx_queue[PRIO_Q_OTHERS], &buf_handle, portMAX_DELAY); xSemaphoreGive(spi_tx_sem); -#if !DUMMY_TRANS_DESIGN set_dataready_gpio(); /* process first data packet here to start transactions */ queue_next_transaction(); -#endif } @@ -339,50 +355,14 @@ static void IRAM_ATTR spi_post_setup_cb(spi_slave_transaction_t *trans) set_handshake_gpio(); } -#if DUMMY_TRANS_DESIGN -static inline int is_valid_trans_buffer(uint8_t *trans_buf) -{ - struct esp_payload_header *header; - uint16_t len, offset; - - if (!trans_buf) { - return pdFALSE; - } - - header = (struct esp_payload_header *) trans_buf; - - len = le16toh(header->len); - offset = le16toh(header->offset); - - if (!len || (len > SPI_BUFFER_SIZE) || - (offset != sizeof(struct esp_payload_header))) { - return pdFALSE; - } - - if ((header->if_type >= ESP_MAX_IF) || (header->if_num)) { - return pdFALSE; - } - - return pdTRUE; -} -#endif /* Invoked after transaction is sent/received. * Use this to set the handshake line low */ static void IRAM_ATTR spi_post_trans_cb(spi_slave_transaction_t *trans) { -#if DUMMY_TRANS_DESIGN - if (trans && is_valid_trans_buffer((uint8_t *)trans->tx_buffer)) { - /* Host has consumed a valid TX buffer - * Clear Data ready line and release semaphore */ - reset_dataready_gpio(); - - if (spi_sema) - xSemaphoreGive(spi_sema); - } -#endif +#if !HS_DEASSERT_ON_CS /* Clear handshake line */ reset_handshake_gpio(); - +#endif } static uint8_t * get_next_tx_buffer(uint32_t *len) @@ -416,17 +396,8 @@ static uint8_t * get_next_tx_buffer(uint32_t *len) return buf_handle.payload; } -#if DUMMY_TRANS_DESIGN - /* Dummy transaction is already queued. Return. */ - if (dummy_queued) { - if (len) - *len = 0; - return NULL; - } -#else /* No real data pending, clear ready line and indicate host an idle state */ reset_dataready_gpio(); -#endif /* Create empty dummy buffer */ sendbuf = spi_buffer_tx_alloc(MEMSET_REQUIRED); @@ -456,6 +427,7 @@ static int process_spi_rx(interface_buffer_handle_t *buf_handle) { struct esp_payload_header *header = NULL; uint16_t len = 0, offset = 0; + uint8_t flags = 0; #if CONFIG_ESP_SPI_CHECKSUM uint16_t rx_checksum = 0, checksum = 0; #endif @@ -470,12 +442,28 @@ static int process_spi_rx(interface_buffer_handle_t *buf_handle) header = (struct esp_payload_header *) buf_handle->payload; len = le16toh(header->len); offset = le16toh(header->offset); + flags = header->flags; + ESP_LOGV(TAG, "process_spi_rx: flags[%u]", flags); - if (!len) + if (flags & FLAG_POWER_SAVE_STARTED) { + ESP_LOGI(TAG, "Host informed starting to power sleep"); + if (context.event_handler) { + context.event_handler(ESP_POWER_SAVE_ON); + } + } else if (flags & FLAG_POWER_SAVE_STOPPED) { + ESP_LOGI(TAG, "Host informed that it waken up"); + if (context.event_handler) { + context.event_handler(ESP_POWER_SAVE_OFF); + } + } + + if (!len) { + ESP_LOGV(TAG, "rx_pkt len[%u] is 0, dropping it", len); return -1; + } if ((len+offset) > SPI_BUFFER_SIZE) { - ESP_LOGE(TAG, "rx_pkt len[%u]>max[%u], dropping it", len+offset, SPI_BUFFER_SIZE); + ESP_LOGE(TAG, "rx_pkt len+offset[%u]>max[%u], dropping it", len+offset, SPI_BUFFER_SIZE); return -1; } @@ -492,6 +480,7 @@ static int process_spi_rx(interface_buffer_handle_t *buf_handle) return -1; } #endif + ESP_HEXLOGD("spi_rx", header, len, 32); /* Buffer is valid */ buf_handle->if_type = header->if_type; @@ -517,112 +506,28 @@ static int process_spi_rx(interface_buffer_handle_t *buf_handle) return 0; } -#if DUMMY_TRANS_DESIGN -static void spi_transaction_tx_task(void* pvParameters) -{ - spi_slave_transaction_t *spi_trans; - esp_err_t ret = 0; - interface_buffer_handle_t buf_handle; - - for(;;) { - xSemaphoreTake(spi_tx_sem, portMAX_DELAY); - - if (pdFALSE == xQueueReceive(spi_tx_queue[PRIO_Q_SERIAL], &buf_handle, 0)) - if (pdFALSE == xQueueReceive(spi_tx_queue[PRIO_Q_BT], &buf_handle, 0)) - if (pdFALSE == xQueueReceive(spi_tx_queue[PRIO_Q_OTHERS], &buf_handle, 0)) - ret = pdFALSE; - - if (ret == pdTRUE && buf_handle.payload) { - spi_trans = spi_trans_alloc(MEMSET_REQUIRED); - assert(spi_trans); - - /* Attach Rx Buffer */ - spi_trans->rx_buffer = spi_buffer_rx_alloc(MEMSET_REQUIRED); - assert(spi_trans->rx_buffer); - - /* Attach Tx Buffer */ - spi_trans->tx_buffer = buf_handle.payload; - - /* Transaction len */ - spi_trans->length = SPI_BUFFER_SIZE * SPI_BITS_PER_WORD; - - /* Execute transaction */ - xSemaphoreTake(spi_sema, portMAX_DELAY); - - spi_slave_queue_trans(ESP_SPI_CONTROLLER, spi_trans, - portMAX_DELAY); - - /* Set Data ready high */ - set_dataready_gpio(); - } - } -} - -static void queue_dummy_transaction() -{ - spi_slave_transaction_t *spi_trans = NULL; - esp_err_t ret = ESP_OK; - uint32_t len = 0; - uint8_t *tx_buffer = NULL; - - tx_buffer = get_next_tx_buffer(&len); - if (!tx_buffer) { - /* No need to queue dummy transaction */ - xSemaphoreGive(spi_sema); - return; - } - - spi_trans = spi_trans_alloc(MEMSET_REQUIRED); - assert(spi_trans); - - /* Attach Rx Buffer */ - spi_trans->rx_buffer = spi_buffer_rx_alloc(MEMSET_REQUIRED); - assert(spi_trans->rx_buffer); - - /* Attach Tx Buffer */ - spi_trans->tx_buffer = tx_buffer; - - /* Transaction len */ - spi_trans->length = SPI_BUFFER_SIZE * SPI_BITS_PER_WORD; - - ret = spi_slave_queue_trans(ESP_SPI_CONTROLLER, spi_trans, 0); - if (ret != ESP_OK) { - free(spi_trans->rx_buffer); - free((void *)spi_trans->tx_buffer); - free(spi_trans); - xSemaphoreGive(spi_sema); - return; - } - - if (!len) { - /* queued dummy transaction, release semaphore */ - dummy_queued = pdTRUE; - xSemaphoreGive(spi_sema); - } else { - /* Queued transaction with valid TX Buffer. Set Data ready high. */ - set_dataready_gpio(); - } -} - -#else static void queue_next_transaction(void) { spi_slave_transaction_t *spi_trans = NULL; uint32_t len = 0; uint8_t *tx_buffer = get_next_tx_buffer(&len); - if (!tx_buffer) { + if (unlikely(!tx_buffer)) { /* Queue next transaction failed */ ESP_LOGE(TAG , "Failed to queue new transaction\r\n"); return; } - ESP_HEXLOGD("spi_tx", tx_buffer, len); + ESP_HEXLOGD("spi_tx", tx_buffer, len, 32); spi_trans = spi_trans_alloc(MEMSET_REQUIRED); - assert(spi_trans); + if (unlikely(!spi_trans)) { + assert(spi_trans); + } /* Attach Rx Buffer */ spi_trans->rx_buffer = spi_buffer_rx_alloc(MEMSET_REQUIRED); - assert(spi_trans->rx_buffer); + if (unlikely(!spi_trans->rx_buffer)) { + assert(spi_trans->rx_buffer); + } /* Attach Tx Buffer */ spi_trans->tx_buffer = tx_buffer; @@ -632,51 +537,42 @@ static void queue_next_transaction(void) spi_slave_queue_trans(ESP_SPI_CONTROLLER, spi_trans, portMAX_DELAY); } -#endif static void spi_transaction_post_process_task(void* pvParameters) { spi_slave_transaction_t *spi_trans = NULL; -#if DUMMY_TRANS_DESIGN - struct esp_payload_header *header; -#endif esp_err_t ret = ESP_OK; interface_buffer_handle_t rx_buf_handle; + ESP_LOGI(TAG, "SPI post process task started"); for (;;) { + /* Check if interface is being deinitialized */ +#if H_PS_UNLOAD_BUS_WHILE_PS + if (if_handle_g.state == DEINIT) { + vTaskDelay(pdMS_TO_TICKS(10)); + ESP_LOGI(TAG, "spi deinit"); + continue; + } +#endif + memset(&rx_buf_handle, 0, sizeof(rx_buf_handle)); /* Await transmission result, after any kind of transmission a new packet * (dummy or real) must be placed in SPI slave */ - spi_slave_get_trans_result(ESP_SPI_CONTROLLER, &spi_trans, - portMAX_DELAY); -#if DUMMY_TRANS_DESIGN - if (spi_trans->tx_buffer) { - header = (struct esp_payload_header *) spi_trans->tx_buffer; - - if (header->if_type == 0xF && header->if_num == 0xF && header->offset == 0) { - /* Dummy Tx buffer consumed by host */ - dummy_queued = pdFALSE; - } - - spi_buffer_tx_free((void *)spi_trans->tx_buffer); - spi_trans->tx_buffer = NULL; - } + ESP_ERROR_CHECK(spi_slave_get_trans_result(ESP_SPI_CONTROLLER, &spi_trans, + portMAX_DELAY)); - /* Check if dummy transaction is needed +#if HS_DEASSERT_ON_CS + /* Wait until CS has been deasserted before we queue a new transaction. * - * If failed to obtain spi_sema: - * - Transaction is already queued. - * - No need to queue dummy transaction - * - * If spi_sema is obtained: queue dummy transaction - **/ - - ret = xSemaphoreTake(spi_sema, 0); - if (ret == pdTRUE) - queue_dummy_transaction(); -#else + * Some MCUs delay deasserting CS at the end of a transaction. + * If we queue a new transaction without waiting for CS to deassert, + * the slave SPI can start (since CS is still asserted), and data is lost + * as host is not expecting any data. + */ + xSemaphoreTake(wait_cs_deassert_sem, portMAX_DELAY); +#endif /* Queue new transaction to get ready as soon as possible */ queue_next_transaction(); assert(spi_trans); @@ -689,17 +585,15 @@ static void spi_transaction_post_process_task(void* pvParameters) /* Free any tx buffer, data is not relevant anymore */ spi_buffer_tx_free((void *)spi_trans->tx_buffer); -#endif - /* Process received data */ - if (spi_trans->rx_buffer) { + if (likely(spi_trans->rx_buffer)) { rx_buf_handle.payload = spi_trans->rx_buffer; ret = process_spi_rx(&rx_buf_handle); /* free rx_buffer if process_spi_rx returns an error * In success case it will be freed later */ - if (ret != ESP_OK) { + if (unlikely(ret)) { spi_buffer_rx_free((void *)spi_trans->rx_buffer); } } else { @@ -713,7 +607,19 @@ static void spi_transaction_post_process_task(void* pvParameters) static void IRAM_ATTR gpio_disable_hs_isr_handler(void* arg) { +#if HS_DEASSERT_ON_CS + int level = gpio_get_level(GPIO_CS); + if (level == 0) { + /* CS is asserted, disable HS */ + reset_handshake_gpio(); + } else { + /* Last transaction complete, populate next one */ + if (wait_cs_deassert_sem) + xSemaphoreGive(wait_cs_deassert_sem); + } +#else reset_handshake_gpio(); +#endif } static void register_hs_disable_pin(uint32_t gpio_num) @@ -736,6 +642,21 @@ static void register_hs_disable_pin(uint32_t gpio_num) static interface_handle_t * esp_spi_init(void) { + if (unlikely(if_handle_g.state >= DEACTIVE)) { + return &if_handle_g; + } + +#if H_PS_UNLOAD_BUS_WHILE_PS + if (hosted_constructs_init_done) { + + #if H_IF_AVAILABLE_SPI_SLAVE_ENABLE_DISABLE + spi_slave_enable(ESP_SPI_CONTROLLER); + #endif + if_handle_g.state = ACTIVE; + return &if_handle_g; + } +#endif + esp_err_t ret = ESP_OK; uint16_t prio_q_idx = 0; @@ -766,95 +687,97 @@ static interface_handle_t * esp_spi_init(void) .post_trans_cb=spi_post_trans_cb }; - /* Configuration for the handshake line */ - gpio_config_t io_conf={ - .intr_type=GPIO_INTR_DISABLE, - .mode=GPIO_MODE_OUTPUT, - .pin_bit_mask=GPIO_MASK_HANDSHAKE - }; + if (!hosted_constructs_init_done) { + /* Configuration for the handshake line */ + gpio_config_t io_conf={ + .intr_type=GPIO_INTR_DISABLE, + .mode=GPIO_MODE_OUTPUT, + .pin_bit_mask=GPIO_MASK_HANDSHAKE + }; - /* Configuration for data_ready line */ - gpio_config_t io_data_ready_conf={ - .intr_type=GPIO_INTR_DISABLE, - .mode=GPIO_MODE_OUTPUT, - .pin_bit_mask=GPIO_MASK_DATA_READY - }; + /* Configuration for data_ready line */ + gpio_config_t io_data_ready_conf={ + .intr_type=GPIO_INTR_DISABLE, + .mode=GPIO_MODE_OUTPUT, + .pin_bit_mask=GPIO_MASK_DATA_READY + }; - spi_mempool_create(); + spi_mempool_create(); - /* Configure handshake and data_ready lines as output */ - gpio_config(&io_conf); - gpio_config(&io_data_ready_conf); - reset_handshake_gpio(); - reset_dataready_gpio(); + /* Configure handshake and data_ready lines as output */ + gpio_config(&io_conf); + gpio_config(&io_data_ready_conf); + reset_handshake_gpio(); + reset_dataready_gpio(); - /* Enable pull-ups on SPI lines - * so that no rogue pulses when no master is connected - */ - gpio_set_pull_mode(CONFIG_ESP_SPI_GPIO_HANDSHAKE, H_HS_PULL_REGISTER); - gpio_set_pull_mode(CONFIG_ESP_SPI_GPIO_DATA_READY, H_DR_PULL_REGISTER); - gpio_set_pull_mode(GPIO_MOSI, GPIO_PULLUP_ONLY); - gpio_set_pull_mode(GPIO_SCLK, GPIO_PULLUP_ONLY); - gpio_set_pull_mode(GPIO_CS, GPIO_PULLUP_ONLY); + /* Enable pull-ups on SPI lines + * so that no rogue pulses when no master is connected + */ + gpio_set_pull_mode(CONFIG_ESP_SPI_GPIO_HANDSHAKE, H_HS_PULL_REGISTER); + gpio_set_pull_mode(CONFIG_ESP_SPI_GPIO_DATA_READY, H_DR_PULL_REGISTER); + gpio_set_pull_mode(GPIO_MOSI, GPIO_PULLUP_ONLY); + gpio_set_pull_mode(GPIO_SCLK, GPIO_PULLUP_ONLY); + gpio_set_pull_mode(GPIO_CS, GPIO_PULLUP_ONLY); - ESP_LOGI(TAG, "SPI Ctrl:%u mode: %u, Freq:ConfigAtHost\nGPIOs: MOSI: %u, MISO: %u, CS: %u, CLK: %u HS: %u DR: %u\n", - ESP_SPI_CONTROLLER, slvcfg.mode, - GPIO_MOSI, GPIO_MISO, GPIO_CS, GPIO_SCLK, - GPIO_HANDSHAKE, GPIO_DATA_READY); + ESP_LOGI(TAG, "SPI Ctrl:%u mode: %u, Freq:ConfigAtHost\nGPIOs: CLK:%u MOSI:%u MISO:%u CS:%u HS:%u DR:%u\n", + ESP_SPI_CONTROLLER, slvcfg.mode, + GPIO_SCLK, GPIO_MOSI, GPIO_MISO, GPIO_CS, + GPIO_HANDSHAKE, GPIO_DATA_READY); - ESP_LOGI(TAG, "Hosted SPI queue size: Tx:%u Rx:%u", SPI_TX_QUEUE_SIZE, SPI_RX_QUEUE_SIZE); - register_hs_disable_pin(GPIO_CS); + ESP_LOGI(TAG, "Hosted SPI queue size: Tx:%u Rx:%u", SPI_TX_QUEUE_SIZE, SPI_RX_QUEUE_SIZE); + register_hs_disable_pin(GPIO_CS); #if !H_HANDSHAKE_ACTIVE_HIGH - ESP_LOGI(TAG, "Handshake: Active Low"); + ESP_LOGI(TAG, "Handshake: Active Low"); #endif #if !H_DATAREADY_ACTIVE_HIGH - ESP_LOGI(TAG, "DataReady: Active Low"); + ESP_LOGI(TAG, "DataReady: Active Low"); #endif + } /* Initialize SPI slave interface */ ret=spi_slave_initialize(ESP_SPI_CONTROLLER, &buscfg, &slvcfg, DMA_CHAN); assert(ret==ESP_OK); - //gpio_set_drive_capability(CONFIG_ESP_SPI_GPIO_HANDSHAKE, GPIO_DRIVE_CAP_3); - //gpio_set_drive_capability(CONFIG_ESP_SPI_GPIO_DATA_READY, GPIO_DRIVE_CAP_3); - gpio_set_drive_capability(GPIO_SCLK, GPIO_DRIVE_CAP_3); - gpio_set_drive_capability(GPIO_MISO, GPIO_DRIVE_CAP_3); - gpio_set_pull_mode(GPIO_MISO, GPIO_PULLDOWN_ONLY); - + if (!hosted_constructs_init_done) { + //gpio_set_drive_capability(CONFIG_ESP_SPI_GPIO_HANDSHAKE, GPIO_DRIVE_CAP_3); + //gpio_set_drive_capability(CONFIG_ESP_SPI_GPIO_DATA_READY, GPIO_DRIVE_CAP_3); + gpio_set_drive_capability(GPIO_SCLK, GPIO_DRIVE_CAP_3); + gpio_set_drive_capability(GPIO_MISO, GPIO_DRIVE_CAP_3); + gpio_set_pull_mode(GPIO_MISO, GPIO_PULLDOWN_ONLY); + +#if HS_DEASSERT_ON_CS + wait_cs_deassert_sem = xSemaphoreCreateBinary(); + assert(wait_cs_deassert_sem!= NULL); + ret = xSemaphoreTake(wait_cs_deassert_sem, 0); +#endif + } memset(&if_handle_g, 0, sizeof(if_handle_g)); - if_handle_g.state = INIT; + if_handle_g.state = ACTIVE; - spi_tx_sem = xSemaphoreCreateCounting(SPI_TX_QUEUE_SIZE*3, 0); - assert(spi_tx_sem != NULL); - spi_rx_sem = xSemaphoreCreateCounting(SPI_RX_QUEUE_SIZE*3, 0); - assert(spi_rx_sem != NULL); + if (!hosted_constructs_init_done) { + spi_tx_sem = xSemaphoreCreateCounting(SPI_TX_QUEUE_SIZE*3, 0); + assert(spi_tx_sem != NULL); + spi_rx_sem = xSemaphoreCreateCounting(SPI_RX_QUEUE_SIZE*3, 0); + assert(spi_rx_sem != NULL); - for (prio_q_idx=0; prio_q_idxstate < ACTIVE)) { + ESP_LOGE(TAG, "SPI is not active\n"); + return ESP_FAIL; + } + + if (unlikely(!handle || !buf_handle)) { ESP_LOGE(TAG , "Invalid arguments\n"); return ESP_FAIL; } - if (!buf_handle->payload_len || !buf_handle->payload) { + if (unlikely(!buf_handle->payload_len || !buf_handle->payload)) { ESP_LOGE(TAG , "Invalid arguments, len:%d\n", buf_handle->payload_len); return ESP_FAIL; } @@ -883,7 +811,7 @@ static int32_t esp_spi_write(interface_handle_t *handle, interface_buffer_handle MAKE_SPI_DMA_ALIGNED(total_len); } - if (total_len > SPI_BUFFER_SIZE) { + if (unlikely(total_len > SPI_BUFFER_SIZE)) { #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) ESP_LOGE(TAG, "Max frame length exceeded %ld.. drop it\n", total_len); #else @@ -912,7 +840,7 @@ static int32_t esp_spi_write(interface_handle_t *handle, interface_buffer_handle header->seq_num = htole16(buf_handle->seq_num); header->flags = buf_handle->flag; - header->throttle_cmd = find_wifi_tx_throttling_to_be_set(); + tx_buf_handle.wifi_flow_ctrl_en = find_wifi_tx_throttling_to_be_set(); /* copy the data from caller */ memcpy(tx_buf_handle.payload + offset, buf_handle->payload, buf_handle->payload_len); @@ -930,11 +858,11 @@ static int32_t esp_spi_write(interface_handle_t *handle, interface_buffer_handle else xQueueSend(spi_tx_queue[PRIO_Q_OTHERS], &tx_buf_handle, portMAX_DELAY); - xSemaphoreGive(spi_tx_sem); - /* indicate waiting data on ready pin */ set_dataready_gpio(); + xSemaphoreGive(spi_tx_sem); + return buf_handle->payload_len; } @@ -945,12 +873,18 @@ static void IRAM_ATTR esp_spi_read_done(void *handle) static int esp_spi_read(interface_handle_t *if_handle, interface_buffer_handle_t *buf_handle) { - if (!if_handle) { + if (unlikely(!if_handle)) { ESP_LOGE(TAG, "Invalid arguments to esp_spi_read\n"); return ESP_FAIL; } - xSemaphoreTake(spi_rx_sem, portMAX_DELAY); + if (likely(spi_rx_sem)) { + xSemaphoreTake(spi_rx_sem, portMAX_DELAY); + } + if (unlikely(if_handle->state < DEACTIVE)) { + ESP_LOGE(TAG, "spi slave bus inactive\n"); + return ESP_FAIL; + } if (pdFALSE == xQueueReceive(spi_rx_queue[PRIO_Q_SERIAL], buf_handle, 0)) if (pdFALSE == xQueueReceive(spi_rx_queue[PRIO_Q_BT], buf_handle, 0)) @@ -974,23 +908,18 @@ static esp_err_t esp_spi_reset(interface_handle_t *handle) static void esp_spi_deinit(interface_handle_t *handle) { - esp_err_t ret = ESP_OK; - - spi_mempool_destroy(); -#if DUMMY_TRANS_DESIGN - if (spi_sema) - vSemaphoreDelete(spi_sema); -#endif - - ret = spi_slave_free(ESP_SPI_CONTROLLER); - if (ESP_OK != ret) { - ESP_LOGE(TAG, "spi slave bus free failed\n"); + if (!handle) { return; } - - ret = spi_bus_free(ESP_SPI_CONTROLLER); - if (ESP_OK != ret) { - ESP_LOGE(TAG, "spi all bus free failed\n"); +#if H_PS_UNLOAD_BUS_WHILE_PS + if (if_handle_g.state == DEINIT) { + ESP_LOGW(TAG, "SPI already deinitialized"); return; } + #if H_IF_AVAILABLE_SPI_SLAVE_ENABLE_DISABLE + spi_slave_disable(ESP_SPI_CONTROLLER); + #endif + handle->state = DEINIT; + ESP_LOGI(TAG, "SPI deinit requested. Signaling spi task to exit."); +#endif } diff --git a/slave/main/stats.c b/slave/main/stats.c index 202de30d..b82df0f6 100644 --- a/slave/main/stats.c +++ b/slave/main/stats.c @@ -1,133 +1,212 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2022 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "stats.h" #include #include "esp_log.h" +#include "esp_hosted_transport_init.h" +#include "esp_hosted_header.h" -#if TEST_RAW_TP || ESP_PKT_STATS +#if TEST_RAW_TP || ESP_PKT_STATS || CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS static const char TAG[] = "stats"; -#endif +#endif /* TEST_RAW_TP || ESP_PKT_STATS || CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS || ESP_PKT_NUM_DEBUG */ -#if ESP_PKT_STATS || TEST_RAW_TP -#define ESP_PKT_STATS_REPORT_INTERVAL 10 -struct pkt_stats_t pkt_stats; +#if ESP_PKT_NUM_DEBUG +struct dbg_stats_t dbg_stats; +#endif /* ESP_PKT_NUM_DEBUG */ + +#if TEST_RAW_TP + #define ESP_PKT_STATS_REPORT_INTERVAL CONFIG_ESP_RAW_TP_REPORT_INTERVAL +#elif ESP_PKT_STATS + #define ESP_PKT_STATS_REPORT_INTERVAL CONFIG_ESP_PKT_STATS_INTERVAL_SEC #endif +#if ESP_PKT_STATS + struct pkt_stats_t pkt_stats; +#endif /* ESP_PKT_STATS */ + +#ifdef ESP_FUNCTION_PROFILING +/* Define the global variables */ +struct timing_stats_entry timing_entries[CONFIG_ESP_HOSTED_FUNCTION_PROFILING_MAX_ENTRIES] = {0}; +int num_timing_entries = 0; + +/* Function to register new timing stats */ +struct timing_stats* register_prof_stats(const char *func_name) +{ + if (num_timing_entries >= CONFIG_ESP_HOSTED_FUNCTION_PROFILING_MAX_ENTRIES) { + ESP_LOGE(TAG, "Max timing stats reached"); + return NULL; + } + + /* Check if already registered */ + for (int i = 0; i < num_timing_entries; i++) { + if (strcmp(timing_entries[i].name, func_name) == 0) { + return &timing_entries[i].stats; + } + } + + /* Add new entry */ + timing_entries[num_timing_entries].name = func_name; + timing_entries[num_timing_entries].active = true; + num_timing_entries++; + + return &timing_entries[num_timing_entries-1].stats; +} + +/* Function to get timing measure for a stats entry */ +struct timing_measure* get_prof_data(struct timing_stats *s) +{ + for (int i = 0; i < num_timing_entries; i++) { + if (&timing_entries[i].stats == s) { + return &timing_entries[i].measure; + } + } + return NULL; +} + +/* Print timing stats function */ +static void print_timing_stats(struct timing_measure *t, struct timing_stats *s, const char *name) +{ + if (!t || !s || !name) { + ESP_LOGE(TAG, "Invalid arguments"); + return; + } + + s->avg_time = t->total_time / t->count; + + ESP_LOGI(TAG, "[%s] Timing Stats - Count: %" PRIu32 ", Min: %" PRIu32 " us, Max: %" PRIu32 " us, Avg: %" PRIu32 " us", + name, + t->count, + s->min_time, + s->max_time, + s->avg_time); +} +#endif /* ESP_FUNCTION_PROFILING */ + #ifdef CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS /* These functions are only for debugging purpose * Please do not enable in production environments */ -static esp_err_t log_real_time_stats(TickType_t xTicksToWait) { - TaskStatus_t *start_array = NULL, *end_array = NULL; - UBaseType_t start_array_size, end_array_size; - uint32_t start_run_time, end_run_time; - esp_err_t ret; - - /*Allocate array to store current task states*/ - start_array_size = uxTaskGetNumberOfTasks() + ARRAY_SIZE_OFFSET; - start_array = malloc(sizeof(TaskStatus_t) * start_array_size); - if (start_array == NULL) { - ret = ESP_ERR_NO_MEM; - goto exit; - } - /*Get current task states*/ - start_array_size = uxTaskGetSystemState(start_array, start_array_size, &start_run_time); - if (start_array_size == 0) { - ret = ESP_ERR_INVALID_SIZE; - goto exit; - } - - vTaskDelay(xTicksToWait); - - /*Allocate array to store tasks states post delay*/ - end_array_size = uxTaskGetNumberOfTasks() + ARRAY_SIZE_OFFSET; - end_array = malloc(sizeof(TaskStatus_t) * end_array_size); - if (end_array == NULL) { - ret = ESP_ERR_NO_MEM; - goto exit; - } - /*Get post delay task states*/ - end_array_size = uxTaskGetSystemState(end_array, end_array_size, &end_run_time); - if (end_array_size == 0) { - ret = ESP_ERR_INVALID_SIZE; - goto exit; - } - - /*Calculate total_elapsed_time in units of run time stats clock period.*/ - uint32_t total_elapsed_time = (end_run_time - start_run_time); - if (total_elapsed_time == 0) { - ret = ESP_ERR_INVALID_STATE; - goto exit; - } - - ESP_LOGI(TAG,"| Task | Run Time | Percentage\n"); - /*Match each task in start_array to those in the end_array*/ - for (int i = 0; i < start_array_size; i++) { - int k = -1; - for (int j = 0; j < end_array_size; j++) { - if (start_array[i].xHandle == end_array[j].xHandle) { - k = j; - /*Mark that task have been matched by overwriting their handles*/ - start_array[i].xHandle = NULL; - end_array[j].xHandle = NULL; - break; - } - } - /*Check if matching task found*/ - if (k >= 0) { - uint32_t task_elapsed_time = end_array[k].ulRunTimeCounter - start_array[i].ulRunTimeCounter; - uint32_t percentage_time = (task_elapsed_time * 100UL) / (total_elapsed_time * portNUM_PROCESSORS); - ESP_LOGI(TAG,"| %s | %d | %d%%\n", start_array[i].pcTaskName, task_elapsed_time, percentage_time); - } - } - - /*Print unmatched tasks*/ - for (int i = 0; i < start_array_size; i++) { - if (start_array[i].xHandle != NULL) { - ESP_LOGI(TAG,"| %s | Deleted\n", start_array[i].pcTaskName); - } - } - for (int i = 0; i < end_array_size; i++) { - if (end_array[i].xHandle != NULL) { - ESP_LOGI(TAG,"| %s | Created\n", end_array[i].pcTaskName); - } - } - ret = ESP_OK; +static esp_err_t log_real_time_stats(TickType_t xTicksToWait) +{ + TaskStatus_t *start_array = NULL, *end_array = NULL; + UBaseType_t start_array_size, end_array_size; + uint32_t start_run_time, end_run_time; + esp_err_t ret; + + /*Allocate array to store current task states*/ + start_array_size = uxTaskGetNumberOfTasks() + ARRAY_SIZE_OFFSET; + start_array = malloc(sizeof(TaskStatus_t) * start_array_size); + if (start_array == NULL) { + ret = ESP_ERR_NO_MEM; + goto exit; + } + /*Get current task states*/ + start_array_size = uxTaskGetSystemState(start_array, start_array_size, &start_run_time); + if (start_array_size == 0) { + ret = ESP_ERR_INVALID_SIZE; + goto exit; + } + + vTaskDelay(xTicksToWait); + + /*Allocate array to store tasks states post delay*/ + end_array_size = uxTaskGetNumberOfTasks() + ARRAY_SIZE_OFFSET; + end_array = malloc(sizeof(TaskStatus_t) * end_array_size); + if (end_array == NULL) { + ret = ESP_ERR_NO_MEM; + goto exit; + } + /*Get post delay task states*/ + end_array_size = uxTaskGetSystemState(end_array, end_array_size, &end_run_time); + if (end_array_size == 0) { + ret = ESP_ERR_INVALID_SIZE; + goto exit; + } + + /*Calculate total_elapsed_time in units of run time stats clock period.*/ + uint32_t total_elapsed_time = (end_run_time - start_run_time); + if (total_elapsed_time == 0) { + ret = ESP_ERR_INVALID_STATE; + goto exit; + } + + ESP_LOGI(TAG,"| Task | Run Time | Percentage\n"); + /*Match each task in start_array to those in the end_array*/ + for (int i = 0; i < start_array_size; i++) { + int k = -1; + for (int j = 0; j < end_array_size; j++) { + if (start_array[i].xHandle == end_array[j].xHandle) { + k = j; + /*Mark that task have been matched by overwriting their handles*/ + start_array[i].xHandle = NULL; + end_array[j].xHandle = NULL; + break; + } + } + /*Check if matching task found*/ + if (k >= 0) { + uint32_t task_elapsed_time = end_array[k].ulRunTimeCounter - start_array[i].ulRunTimeCounter; + uint32_t percentage_time = (task_elapsed_time * 100UL) / (total_elapsed_time * portNUM_PROCESSORS); + ESP_LOGI(TAG,"| %s | %" PRIu32 " | %" PRIu32 "%%\n", start_array[i].pcTaskName, task_elapsed_time, percentage_time); + } + } + + /*Print unmatched tasks*/ + for (int i = 0; i < start_array_size; i++) { + if (start_array[i].xHandle != NULL) { + ESP_LOGI(TAG,"| %s | Deleted\n", start_array[i].pcTaskName); + } + } + for (int i = 0; i < end_array_size; i++) { + if (end_array[i].xHandle != NULL) { + ESP_LOGI(TAG,"| %s | Created\n", end_array[i].pcTaskName); + } + } + ret = ESP_OK; exit: /*Common return path*/ if (start_array) free(start_array); if (end_array) free(end_array); - return ret; + return ret; } -static void log_runtime_stats_task(void* pvParameters) { - while (1) { - ESP_LOGI(TAG,"\n\nGetting real time stats over %d ticks\n", STATS_TICKS); - if (log_real_time_stats(STATS_TICKS) == ESP_OK) { - ESP_LOGI(TAG,"Real time stats obtained\n"); - } else { - ESP_LOGE(TAG,"Error getting real time stats\n"); - } - vTaskDelay(pdMS_TO_TICKS(1000*2)); - } +static void print_mem_stats() +{ + uint32_t freeSize = esp_get_free_heap_size(); + printf("The available total size of heap:%" PRIu32 "\n", freeSize); + + printf("\tDescription\tInternal\tSPIRAM\n"); + printf("Current Free Memory\t%d\t\t%d\n", + heap_caps_get_free_size(MALLOC_CAP_8BIT) - heap_caps_get_free_size(MALLOC_CAP_SPIRAM), + heap_caps_get_free_size(MALLOC_CAP_SPIRAM)); + printf("Largest Free Block\t%d\t\t%d\n", + heap_caps_get_largest_free_block(MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL), + heap_caps_get_largest_free_block(MALLOC_CAP_SPIRAM)); + printf("Min. Ever Free Size\t%d\t\t%d\n", + heap_caps_get_minimum_free_size(MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL), + heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM)); } -#endif + +static void log_runtime_stats_task(void* pvParameters) +{ + while (1) { + ESP_LOGI(TAG, "\n\nGetting real time stats over %d ticks\n", (int)STATS_TICKS); + if (log_real_time_stats(STATS_TICKS) == ESP_OK) { + ESP_LOGI(TAG, "Real time stats obtained\n"); + } else { + ESP_LOGE(TAG, "Error getting real time stats\n"); + } + print_mem_stats(); + vTaskDelay(STATS_TICKS); + } +} +#endif /* CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS */ #if TEST_RAW_TP uint64_t test_raw_tp_rx_len; @@ -135,10 +214,10 @@ uint64_t test_raw_tp_tx_len; void debug_update_raw_tp_rx_count(uint16_t len) { - test_raw_tp_rx_len += (len); + test_raw_tp_rx_len += len; } -// static buffer to hold tx data during test +/* static buffer to hold tx data during test */ DMA_ATTR static uint8_t tx_buf[TEST_RAW_TP__BUF_SIZE]; extern volatile uint8_t datapath; @@ -152,10 +231,10 @@ static void raw_tp_tx_task(void* pvParameters) sleep(5); - // initialise the static buffer + /* initialise the static buffer */ raw_tp_tx_buf = tx_buf; ptr = (uint32_t*)raw_tp_tx_buf; - // initialise the tx buffer + /* initialise the tx buffer */ for (i=0; i<(TEST_RAW_TP__BUF_SIZE/4-1); i++, ptr++) *ptr = 0xdeadbeef; @@ -171,7 +250,7 @@ static void raw_tp_tx_task(void* pvParameters) buf_handle.payload = raw_tp_tx_buf; buf_handle.payload_len = TEST_RAW_TP__BUF_SIZE; - // free the buffer after it has been sent + /* free the buffer after it has been sent */ buf_handle.free_buf_handle = NULL; buf_handle.priv_buffer_handle = buf_handle.payload; @@ -184,12 +263,13 @@ static void raw_tp_tx_task(void* pvParameters) test_raw_tp_tx_len += (TEST_RAW_TP__BUF_SIZE); } } -#endif +#endif /* TEST_RAW_TP */ #if TEST_RAW_TP || ESP_PKT_STATS static void stats_timer_func(void* arg) { + /* Rest of existing stats_timer_func code */ #if TEST_RAW_TP static int32_t cur = 0; double actual_bandwidth_rx = 0; @@ -207,13 +287,40 @@ static void stats_timer_func(void* arg) test_raw_tp_rx_len = test_raw_tp_tx_len = 0; #endif #if ESP_PKT_STATS - ESP_LOGI(TAG, "slave StaRxQLoad: %8lu \nH=>S: sta: in: %8lu out: %8lu fail: %8lu \nH<=S: sta: in: %8lu out: %8lu \n serial : in: %8lu rsp: %8lu evt: %8lu", - pkt_stats.slave_wifi_rx_msg_loaded, + ESP_LOGI(TAG, "STA: flw_ctrl(on[%lu] off[%lu]) H2S(in[%lu] out[%lu] fail[%lu]) S2H(in[%lu] out[%lu]) Ctrl: (in[%lu] rsp[%lu] evt[%lu])", + pkt_stats.sta_flowctrl_on, pkt_stats.sta_flowctrl_off, pkt_stats.hs_bus_sta_in,pkt_stats.hs_bus_sta_out, pkt_stats.hs_bus_sta_fail, pkt_stats.sta_sh_in,pkt_stats.sta_sh_out, pkt_stats.serial_rx, pkt_stats.serial_tx_total, pkt_stats.serial_tx_evt); + ESP_LOGI(TAG, "Lwip: in[%lu] slave_out[%lu] host_out[%lu] both_out[%lu]", + pkt_stats.sta_lwip_in, pkt_stats.sta_slave_lwip_out, + pkt_stats.sta_host_lwip_out, pkt_stats.sta_both_lwip_out); + +#ifdef ESP_FUNCTION_PROFILING + /* Print timing stats for all active entries */ + for (int i = 0; i < num_timing_entries; i++) { + if (!timing_entries[i].active || !timing_entries[i].measure.count) { + continue; + } + + struct timing_measure *t = &timing_entries[i].measure; + struct timing_stats *s = &timing_entries[i].stats; + + /* Calculate rate and print stats in one pass */ + uint32_t rate = (uint32_t)(t->count / CONFIG_ESP_PKT_STATS_INTERVAL_SEC); + s->avg_time = t->total_time / t->count; + + ESP_LOGI(TAG, "[%s] Stats - Count: %" PRIu32 ", Min: %" PRIu32 ", Max: %" PRIu32 ", Avg: %" PRIu32 " us, Rate: %" PRIu32 "/s", + timing_entries[i].name, + t->count, + s->min_time, + s->max_time, + s->avg_time, + rate); + } +#endif /* ESP_FUNCTION_PROFILING */ +#endif /* ESP_PKT_STATS */ -#endif } static void start_timer_to_display_stats(int periodic_time_sec) @@ -232,7 +339,7 @@ static void start_timer_to_display_stats(int periodic_time_sec) ESP_ERROR_CHECK(esp_timer_start_periodic(raw_tp_timer, SEC_TO_USEC(periodic_time_sec))); } -#endif +#endif /* TEST_RAW_TP || ESP_PKT_STATS */ #if TEST_RAW_TP @@ -240,21 +347,21 @@ void process_test_capabilities(uint8_t capabilities) { ESP_LOGD(TAG, "capabilites: %d", capabilities); if ((capabilities & ESP_TEST_RAW_TP__ESP_TO_HOST) || - (capabilities & ESP_TEST_RAW_TP__BIDIRECTIONAL)) { + (capabilities & ESP_TEST_RAW_TP__BIDIRECTIONAL)) { assert(xTaskCreate(raw_tp_tx_task , "raw_tp_tx_task", - CONFIG_ESP_DEFAULT_TASK_STACK_SIZE, NULL , - CONFIG_ESP_DEFAULT_TASK_PRIO, NULL) == pdTRUE); + CONFIG_ESP_HOSTED_DEFAULT_TASK_STACK_SIZE, NULL , + CONFIG_ESP_HOSTED_DEFAULT_TASK_PRIORITY, NULL) == pdTRUE); } } -#endif +#endif /* TEST_RAW_TP */ void create_debugging_tasks(void) { #ifdef CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS assert(xTaskCreate(log_runtime_stats_task, "log_runtime_stats_task", - CONFIG_ESP_DEFAULT_TASK_STACK_SIZE, NULL, - CONFIG_ESP_DEFAULT_TASK_PRIO, NULL) == pdTRUE); -#endif + CONFIG_ESP_HOSTED_DEFAULT_TASK_STACK_SIZE, NULL, + /*CONFIG_ESP_HOSTED_DEFAULT_TASK_PRIORITY*/ 1, NULL) == pdTRUE); +#endif /* CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS */ #if TEST_RAW_TP || ESP_PKT_STATS start_timer_to_display_stats(ESP_PKT_STATS_REPORT_INTERVAL); @@ -269,4 +376,3 @@ uint8_t debug_get_raw_tp_conf(void) { #endif return raw_tp_cap; } - diff --git a/slave/main/stats.h b/slave/main/stats.h index 14dea402..148e26bd 100644 --- a/slave/main/stats.h +++ b/slave/main/stats.h @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD +// Copyright 2015-2025 Espressif Systems (Shanghai) PTE LTD // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,11 +23,18 @@ #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" #include "freertos/task.h" +#include "esp_timer.h" +#include "esp_hosted_header.h" #define SEC_TO_MSEC(x) (x*1000) #define MSEC_TO_USEC(x) (x*1000) #define SEC_TO_USEC(x) (x*1000*1000) +/* Change the feature flag definition */ +#ifdef CONFIG_ESP_HOSTED_FUNCTION_PROFILING +#define ESP_FUNCTION_PROFILING 1 +#endif + /* Stats CONFIG: * @@ -104,7 +111,33 @@ typedef struct { void debug_update_raw_tp_rx_count(uint16_t len); #endif -#if ESP_PKT_STATS || TEST_RAW_TP +#ifdef ESP_PKT_NUM_DEBUG +struct dbg_stats_t { + uint16_t tx_pkt_num; + uint16_t exp_rx_pkt_num; +}; + +extern struct dbg_stats_t dbg_stats; +#define UPDATE_HEADER_TX_PKT_NO(h) h->pkt_num = htole16(dbg_stats.tx_pkt_num++) +#define UPDATE_HEADER_RX_PKT_NO(h) \ + do { \ + uint16_t rcvd_pkt_num = le16toh(header->pkt_num); \ + if (dbg_stats.exp_rx_pkt_num != rcvd_pkt_num) { \ + ESP_LOGW(TAG, "exp_pkt_num[%u], rx_pkt_num[%u]", \ + dbg_stats.exp_rx_pkt_num, rcvd_pkt_num); \ + dbg_stats.exp_rx_pkt_num = rcvd_pkt_num; \ + } \ + dbg_stats.exp_rx_pkt_num++; \ + } while(0); + +#else /*ESP_PKT_NUM_DEBUG*/ + +#define UPDATE_HEADER_TX_PKT_NO(h) +#define UPDATE_HEADER_RX_PKT_NO(h) + +#endif /*ESP_PKT_NUM_DEBUG*/ + +#if ESP_PKT_STATS struct pkt_stats_t { uint32_t sta_sh_in; uint32_t sta_sh_out; @@ -114,14 +147,102 @@ struct pkt_stats_t { uint32_t serial_rx; uint32_t serial_tx_total; uint32_t serial_tx_evt; - uint32_t slave_wifi_rx_msg_loaded; + uint32_t sta_flowctrl_on; + uint32_t sta_flowctrl_off; + uint32_t sta_lwip_in; + uint32_t sta_slave_lwip_out; + uint32_t sta_host_lwip_out; + uint32_t sta_both_lwip_out; }; extern struct pkt_stats_t pkt_stats; + #endif void process_test_capabilities(uint8_t capabilities); void create_debugging_tasks(void); uint8_t debug_get_raw_tp_conf(void); + +/* Add these declarations before the macros */ + +#ifdef ESP_FUNCTION_PROFILING + +/* Timing measurement stats */ +struct timing_measure { + uint32_t start_time; + uint32_t end_time; + uint32_t total_time; + uint32_t count; +}; + +struct timing_stats { + uint32_t min_time; + uint32_t max_time; + uint32_t avg_time; +}; + +/* Move struct definition to header file */ +struct timing_stats_entry { + const char *name; + struct timing_measure measure; + struct timing_stats stats; + bool active; +}; + + +#define ESP_HOSTED_FUNC_PROF_START(func_name) do { \ + struct timing_stats *s = register_prof_stats(func_name); \ + if (!s) { \ + ESP_LOGE(TAG, "Failed to register timing stats for %s", func_name); \ + break; \ + } \ + struct timing_measure *t = get_prof_data(s); \ + if (!t) { \ + ESP_LOGE(TAG, "Failed to get timing measure for %s", func_name); \ + break; \ + } \ + t->start_time = esp_timer_get_time(); \ +} while(0) + +#define ESP_HOSTED_FUNC_PROF_END(func_name) do { \ + struct timing_stats *s = NULL; \ + struct timing_measure *t = NULL; \ + for (int i = 0; i < num_timing_entries; i++) { \ + if (strcmp(timing_entries[i].name, func_name) == 0) { \ + s = &timing_entries[i].stats; \ + t = &timing_entries[i].measure; \ + break; \ + } \ + } \ + if (!s || !t) { \ + ESP_LOGE(TAG, "Failed to find timing stats for %s", func_name); \ + break; \ + } \ + t->end_time = esp_timer_get_time(); \ + t->count++; \ + int64_t elapsed = t->end_time - t->start_time; \ + t->total_time += elapsed; \ + if (s->min_time == 0 || elapsed < s->min_time) { \ + s->min_time = elapsed; \ + } \ + if (elapsed > s->max_time) { \ + s->max_time = elapsed; \ + } \ + if (t->count > 0) { \ + s->avg_time = t->total_time / t->count; \ + } \ +} while(0) + +extern struct timing_stats_entry timing_entries[CONFIG_ESP_HOSTED_FUNCTION_PROFILING_MAX_ENTRIES]; +extern int num_timing_entries; + +/* Function declarations */ +struct timing_stats* register_prof_stats(const char *func_name); +struct timing_measure* get_prof_data(struct timing_stats *s); +#else +#define ESP_HOSTED_FUNC_PROF_START(func_name) +#define ESP_HOSTED_FUNC_PROF_END(func_name) +#endif + #endif /*__STATS__H__*/ diff --git a/slave/main/transport_gpio_pin_guard.c b/slave/main/transport_gpio_pin_guard.c new file mode 100644 index 00000000..d781b31e --- /dev/null +++ b/slave/main/transport_gpio_pin_guard.c @@ -0,0 +1,71 @@ +#include "sdkconfig.h" + +#if CONFIG_ESP_HOSTED_ENABLE_GPIO_RPC +#include "transport_gpio_pin_guard.h" + +static inline void add_pin(uint64_t *mask, int pin) +{ + if (pin >= 0 && pin < GPIO_NUM_MAX) { + *mask |= (1ULL << pin); + } +} + +static uint64_t get_reserved_pin_mask(void) +{ + static bool initialized = false; + static uint64_t mask = 0; + + if (initialized) return mask; + initialized = true; + + /* ---------- SDIO ---------- */ +#ifdef CONFIG_ESP_SDIO_HOST_INTERFACE + add_pin(&mask, CONFIG_ESP_SDIO_PIN_CMD); + add_pin(&mask, CONFIG_ESP_SDIO_PIN_CLK); + add_pin(&mask, CONFIG_ESP_SDIO_PIN_D0); + add_pin(&mask, CONFIG_ESP_SDIO_PIN_D1); + add_pin(&mask, CONFIG_ESP_SDIO_PIN_D2); + add_pin(&mask, CONFIG_ESP_SDIO_PIN_D3); +#endif + + /* ---------- SPI (full duplex) ---------- */ +#ifdef CONFIG_ESP_SPI_HOST_INTERFACE + add_pin(&mask, CONFIG_ESP_SPI_GPIO_MOSI); + add_pin(&mask, CONFIG_ESP_SPI_GPIO_MISO); + add_pin(&mask, CONFIG_ESP_SPI_GPIO_CLK); + add_pin(&mask, CONFIG_ESP_SPI_GPIO_CS); + add_pin(&mask, CONFIG_ESP_SPI_GPIO_HANDSHAKE); + add_pin(&mask, CONFIG_ESP_SPI_GPIO_DATA_READY); + add_pin(&mask, CONFIG_ESP_SPI_GPIO_RESET); +#endif + + /* ---------- SPI (half duplex) ---------- */ +#ifdef CONFIG_ESP_SPI_HD_HOST_INTERFACE + add_pin(&mask, CONFIG_ESP_SPI_HD_GPIO_CS); + add_pin(&mask, CONFIG_ESP_SPI_HD_GPIO_CLK); + add_pin(&mask, CONFIG_ESP_SPI_HD_GPIO_D0); + add_pin(&mask, CONFIG_ESP_SPI_HD_GPIO_D1); + add_pin(&mask, CONFIG_ESP_SPI_HD_GPIO_D2); + add_pin(&mask, CONFIG_ESP_SPI_HD_GPIO_D3); + add_pin(&mask, CONFIG_ESP_SPI_HD_GPIO_DATA_READY); + add_pin(&mask, CONFIG_ESP_SPI_HD_GPIO_RESET); +#endif + + /* ---------- UART ---------- */ +#ifdef CONFIG_ESP_UART_HOST_INTERFACE + add_pin(&mask, CONFIG_ESP_UART_PIN_TX); + add_pin(&mask, CONFIG_ESP_UART_PIN_RX); + add_pin(&mask, CONFIG_ESP_UART_GPIO_RESET); +#endif + + return mask; +} + +uint8_t transport_gpio_pin_guard_is_eligible(gpio_num_t pin) +{ + if (pin < 0 || pin >= GPIO_NUM_MAX) return false; + uint64_t reserved = get_reserved_pin_mask(); + return ((reserved & (1ULL << pin)) == 0); +} + +#endif // CONFIG_ESP_HOSTED_ENABLE_GPIO_RPC diff --git a/slave/main/transport_gpio_pin_guard.h b/slave/main/transport_gpio_pin_guard.h new file mode 100644 index 00000000..3b473d74 --- /dev/null +++ b/slave/main/transport_gpio_pin_guard.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include "sdkconfig.h" + +#if CONFIG_ESP_HOSTED_ENABLE_GPIO_RPC + +#include "driver/gpio.h" + +/** + * @brief Check if a GPIO pin is free for general use. + * + * @param pin GPIO number to test + * @return true Pin is free (eligible for GPIO) + * false Pin is reserved by a host transport interface + */ +uint8_t transport_gpio_pin_guard_is_eligible(gpio_num_t pin); + +#endif diff --git a/slave/main/uart_slave_api.c b/slave/main/uart_slave_api.c index d3a618ab..1cfc4d91 100644 --- a/slave/main/uart_slave_api.c +++ b/slave/main/uart_slave_api.c @@ -32,6 +32,7 @@ #include "esp_hosted_transport.h" #include "esp_hosted_transport_init.h" #include "esp_hosted_header.h" +#include "esp_hosted_coprocessor_fw_ver.h" #define HOSTED_UART CONFIG_ESP_UART_PORT #define HOSTED_UART_GPIO_TX CONFIG_ESP_UART_PIN_TX @@ -103,7 +104,7 @@ static QueueHandle_t uart_rx_queue[MAX_PRIORITY_QUEUES]; static void uart_rx_task(void* pvParameters); -static inline void h_uart_mempool_create() +static inline void h_uart_mempool_create(void) { buf_mp_tx_g = hosted_mempool_create(NULL, 0, HOSTED_UART_TX_QUEUE_SIZE, BUFFER_SIZE); @@ -115,7 +116,7 @@ static inline void h_uart_mempool_create() #endif } -static inline void h_uart_mempool_destroy() +static inline void h_uart_mempool_destroy(void) { hosted_mempool_destroy(buf_mp_tx_g); hosted_mempool_destroy(buf_mp_rx_g); @@ -174,14 +175,15 @@ static void start_rx_data_throttling_if_needed(void) return; queue_load = uxQueueMessagesWaiting(uart_rx_queue[PRIO_Q_OTHERS]); -#if ESP_PKT_STATS - pkt_stats.slave_wifi_rx_msg_loaded = queue_load; -#endif + load_percent = (queue_load*100/HOSTED_UART_RX_QUEUE_SIZE); if (load_percent > slv_cfg_g.throttle_high_threshold) { slv_state_g.current_throttling = 1; wifi_flow_ctrl = 1; +#if ESP_PKT_STATS + pkt_stats.sta_flowctrl_on++; +#endif TRIGGER_FLOW_CTRL(); } } @@ -195,14 +197,15 @@ static void stop_rx_data_throttling_if_needed(void) if (slv_state_g.current_throttling) { queue_load = uxQueueMessagesWaiting(uart_rx_queue[PRIO_Q_OTHERS]); -#if ESP_PKT_STATS - pkt_stats.slave_wifi_rx_msg_loaded = queue_load; -#endif + load_percent = (queue_load*100/HOSTED_UART_RX_QUEUE_SIZE); if (load_percent < slv_cfg_g.throttle_low_threshold) { slv_state_g.current_throttling = 0; wifi_flow_ctrl = 0; +#if ESP_PKT_STATS + pkt_stats.sta_flowctrl_off++; +#endif TRIGGER_FLOW_CTRL(); } } @@ -229,6 +232,7 @@ static void uart_rx_task(void* pvParameters) #endif int bytes_read; int total_len; + uint8_t flags = 0; // delay for a while to let app main threads start and become ready vTaskDelay(100 / portTICK_PERIOD_MS); @@ -256,6 +260,19 @@ static void uart_rx_task(void* pvParameters) continue; } + flags = header->flags; + + if (flags & FLAG_POWER_SAVE_STARTED) { + ESP_LOGI(TAG, "Host informed starting to power sleep"); + if (context.event_handler) { + context.event_handler(ESP_POWER_SAVE_ON); + } + } else if (flags & FLAG_POWER_SAVE_STOPPED) { + ESP_LOGI(TAG, "Host informed that it waken up"); + if (context.event_handler) { + context.event_handler(ESP_POWER_SAVE_OFF); + } + } len = le16toh(header->len); offset = le16toh(header->offset); total_len = len + sizeof(struct esp_payload_header); @@ -397,7 +414,7 @@ static int32_t h_uart_write(interface_handle_t *handle, interface_buffer_handle_ #endif ESP_LOGD(TAG, "sending %"PRIu32 " bytes", total_len); - ESP_HEXLOGD("spi_hd_tx", sendbuf, total_len); + ESP_HEXLOGD("uart_tx", sendbuf, total_len, 32); tx_len = uart_write_bytes(HOSTED_UART, (const char*)sendbuf, total_len); @@ -424,6 +441,10 @@ static int32_t h_uart_write(interface_handle_t *handle, interface_buffer_handle_ static interface_handle_t * h_uart_init(void) { + if (if_handle_g.state >= DEACTIVE) { + return &if_handle_g; + } + uint16_t prio_q_idx = 0; uart_word_length_t uart_word_length; uart_parity_t parity; @@ -506,23 +527,29 @@ static interface_handle_t * h_uart_init(void) // start up tasks assert(xTaskCreate(uart_rx_task, "uart_rx_task" , - CONFIG_ESP_DEFAULT_TASK_STACK_SIZE, NULL, - CONFIG_ESP_DEFAULT_TASK_PRIO, NULL) == pdTRUE); + CONFIG_ESP_HOSTED_DEFAULT_TASK_STACK_SIZE, NULL, + CONFIG_ESP_HOSTED_DEFAULT_TASK_PRIORITY, NULL) == pdTRUE); assert(xTaskCreate(flow_ctrl_task, "flow_ctrl_task" , - CONFIG_ESP_DEFAULT_TASK_STACK_SIZE, NULL , - CONFIG_ESP_DEFAULT_TASK_PRIO, NULL) == pdTRUE); + CONFIG_ESP_HOSTED_DEFAULT_TASK_STACK_SIZE, NULL , + CONFIG_ESP_HOSTED_DEFAULT_TASK_PRIORITY, NULL) == pdTRUE); // data path opened memset(&if_handle_g, 0, sizeof(if_handle_g)); - if_handle_g.state = INIT; + if_handle_g.state = ACTIVE; return &if_handle_g; } static void h_uart_deinit(interface_handle_t * handle) { +#if H_HOST_PS_ALLOWED && H_PS_UNLOAD_BUS_WHILE_PS esp_err_t ret; + if (if_handle_g.state == DEINIT) { + ESP_LOGW(TAG, "UART already deinitialized"); + return; + } + if_handle_g.state = DEINIT; h_uart_mempool_destroy(); @@ -538,6 +565,7 @@ static void h_uart_deinit(interface_handle_t * handle) if (ret != ESP_OK) ESP_LOGE(TAG, "%s: Failed to flush uart Tx", __func__); uart_driver_delete(HOSTED_UART); +#endif } static esp_err_t h_uart_reset(interface_handle_t *handle) @@ -636,6 +664,20 @@ void generate_startup_event(uint8_t cap, uint32_t ext_cap) *pos = LENGTH_1_BYTE; pos++;len++; *pos = HOSTED_UART_TX_QUEUE_SIZE; pos++;len++; + // convert fw version into a uint32_t + uint32_t fw_version = ESP_HOSTED_VERSION_VAL(PROJECT_VERSION_MAJOR_1, + PROJECT_VERSION_MINOR_1, + PROJECT_VERSION_PATCH_1); + + // send fw version as a little-endian uint32_t + *pos = ESP_PRIV_FIRMWARE_VERSION; pos++;len++; + *pos = LENGTH_4_BYTE; pos++;len++; + // send fw_version as a little endian 32bit value + *pos = (fw_version & 0xff); pos++;len++; + *pos = (fw_version >> 8) & 0xff; pos++;len++; + *pos = (fw_version >> 16) & 0xff; pos++;len++; + *pos = (fw_version >> 24) & 0xff; pos++;len++; + /* TLVs end */ event->event_len = len; diff --git a/slave/partitions.esp32c3.csv b/slave/partitions.esp32c3.csv new file mode 100644 index 00000000..0252a551 --- /dev/null +++ b/slave/partitions.esp32c3.csv @@ -0,0 +1,7 @@ +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +nvs,data,nvs,0x9000,16K, +otadata,data,ota,0xd000,8K, +phy_init,data,phy,0xf000,4K, +ota_0,app,ota_0,0x10000,1536K, +ota_1,app,ota_1,0x190000,1536K, diff --git a/slave/partitions.esp32c5.csv b/slave/partitions.esp32c5.csv index 0252a551..a35ba86f 100644 --- a/slave/partitions.esp32c5.csv +++ b/slave/partitions.esp32c5.csv @@ -1,7 +1,11 @@ -# ESP-IDF Partition Table -# Name, Type, SubType, Offset, Size, Flags -nvs,data,nvs,0x9000,16K, -otadata,data,ota,0xd000,8K, -phy_init,data,phy,0xf000,4K, -ota_0,app,ota_0,0x10000,1536K, -ota_1,app,ota_1,0x190000,1536K, +#Name,Type,SubType,Offset,Size,Flags +#Note:Firmware partition offset needs to be 64K aligned,initial 36K(9 sectors)are reserved for bootloader and partition table +esp_secure_cert,0x3F,,0xD000,0x2000,encrypted +nvs_key,data,nvs_keys,0xF000,0x1000,encrypted +nvs,data,nvs,0x10000,0x6000, +otadata,data,ota,,0x2000 +phy_init,data,phy,,0x1000, +ota_0,app,ota_0,0x20000,0x1E0000, +ota_1,app,ota_1,0x200000,0x1E0000, +reserved,0x06,,0x3E0000,0x1A000, +fctry,data,nvs,0x3FA000,0x6000 diff --git a/slave/partitions.esp32c61.csv b/slave/partitions.esp32c61.csv new file mode 100644 index 00000000..0252a551 --- /dev/null +++ b/slave/partitions.esp32c61.csv @@ -0,0 +1,7 @@ +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +nvs,data,nvs,0x9000,16K, +otadata,data,ota,0xd000,8K, +phy_init,data,phy,0xf000,4K, +ota_0,app,ota_0,0x10000,1536K, +ota_1,app,ota_1,0x190000,1536K, diff --git a/slave/partitions.esp32s2.csv b/slave/partitions.esp32s2.csv new file mode 100644 index 00000000..0252a551 --- /dev/null +++ b/slave/partitions.esp32s2.csv @@ -0,0 +1,7 @@ +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +nvs,data,nvs,0x9000,16K, +otadata,data,ota,0xd000,8K, +phy_init,data,phy,0xf000,4K, +ota_0,app,ota_0,0x10000,1536K, +ota_1,app,ota_1,0x190000,1536K, diff --git a/slave/partitions.esp32s3.csv b/slave/partitions.esp32s3.csv new file mode 100644 index 00000000..0252a551 --- /dev/null +++ b/slave/partitions.esp32s3.csv @@ -0,0 +1,7 @@ +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +nvs,data,nvs,0x9000,16K, +otadata,data,ota,0xd000,8K, +phy_init,data,phy,0xf000,4K, +ota_0,app,ota_0,0x10000,1536K, +ota_1,app,ota_1,0x190000,1536K, diff --git a/slave/sdkconfig.ci.all_features b/slave/sdkconfig.ci.all_features new file mode 100644 index 00000000..72f3f9f6 --- /dev/null +++ b/slave/sdkconfig.ci.all_features @@ -0,0 +1,7 @@ +CONFIG_ESP_SDIO_HOST_INTERFACE=y + +CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED=y +CONFIG_ESP_HOSTED_HOST_POWER_SAVE_ENABLED=y +CONFIG_ESP_HOSTED_CLI_ENABLED=y +CONFIG_ESP_HOSTED_USE_EXAMPLE_WIFI_PRE_PROVISION_CONFIG=y +CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=n diff --git a/slave/sdkconfig.ci.dpp b/slave/sdkconfig.ci.dpp new file mode 100644 index 00000000..e4ad017a --- /dev/null +++ b/slave/sdkconfig.ci.dpp @@ -0,0 +1,2 @@ +CONFIG_ESP_SDIO_HOST_INTERFACE=y +CONFIG_ESP_WIFI_DPP_SUPPORT=y diff --git a/slave/sdkconfig.ci.sdio b/slave/sdkconfig.ci.sdio new file mode 100644 index 00000000..289917fa --- /dev/null +++ b/slave/sdkconfig.ci.sdio @@ -0,0 +1 @@ +CONFIG_ESP_SDIO_HOST_INTERFACE=y diff --git a/slave/sdkconfig.ci.spi b/slave/sdkconfig.ci.spi new file mode 100644 index 00000000..7c46fdf0 --- /dev/null +++ b/slave/sdkconfig.ci.spi @@ -0,0 +1 @@ +CONFIG_ESP_SPI_HOST_INTERFACE=y diff --git a/slave/sdkconfig.ci.spi_hd b/slave/sdkconfig.ci.spi_hd new file mode 100644 index 00000000..e2ec35db --- /dev/null +++ b/slave/sdkconfig.ci.spi_hd @@ -0,0 +1 @@ +CONFIG_ESP_SPI_HD_HOST_INTERFACE=y diff --git a/slave/sdkconfig.ci.uart b/slave/sdkconfig.ci.uart new file mode 100644 index 00000000..68990b64 --- /dev/null +++ b/slave/sdkconfig.ci.uart @@ -0,0 +1 @@ +CONFIG_ESP_UART_HOST_INTERFACE=y diff --git a/slave/sdkconfig.ci.wifi_enterprise b/slave/sdkconfig.ci.wifi_enterprise new file mode 100644 index 00000000..d036e06b --- /dev/null +++ b/slave/sdkconfig.ci.wifi_enterprise @@ -0,0 +1 @@ +CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=y diff --git a/slave/sdkconfig.defaults b/slave/sdkconfig.defaults index 9313e28e..91777c7c 100644 --- a/slave/sdkconfig.defaults +++ b/slave/sdkconfig.defaults @@ -8,3 +8,8 @@ CONFIG_PARTITION_TABLE_TWO_OTA=y # OS CONFIG_FREERTOS_HZ=1000 +CONFIG_ESP_WIFI_NVS_ENABLED=y +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=y + +#Disable enterprise support by default +CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=n diff --git a/slave/sdkconfig.defaults.esp32 b/slave/sdkconfig.defaults.esp32 index 644bc570..55c0c346 100644 --- a/slave/sdkconfig.defaults.esp32 +++ b/slave/sdkconfig.defaults.esp32 @@ -1,5 +1,4 @@ CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y -CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 CONFIG_SDIO_DAT2_DISABLED= # BT Configuration @@ -37,3 +36,7 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.esp32.csv" # iram text saving CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y + +# OS +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=n diff --git a/slave/sdkconfig.defaults.esp32c2 b/slave/sdkconfig.defaults.esp32c2 index cbfecde8..1bc6b7cb 100644 --- a/slave/sdkconfig.defaults.esp32c2 +++ b/slave/sdkconfig.defaults.esp32c2 @@ -1,19 +1,120 @@ -CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y -CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160 -CONFIG_FREERTOS_UNICORE=y -CONFIG_SDIO_DAT2_DISABLED= +# 1. CPU +#-------- +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_120=y -# BT Configuration -CONFIG_BT_ENABLED=n ## temporary disable +# 2. BT Configuration +#--------------------- +CONFIG_BT_ENABLED=n CONFIG_BT_CONTROLLER_ONLY=y CONFIG_BT_BLUEDROID_ENABLED= CONFIG_BT_LE_SLEEP_ENABLE=y -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n -CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y -CONFIG_PARTITION_TABLE_TWO_OTA=y +# 3.1 BLE over SPI/SDIO +#----------------------- +CONFIG_BT_LE_HCI_INTERFACE_USE_RAM=y + +# 3.2 BLE over UART +#------------------- +#UART pins, Enable below config, delete sdkconfig and rebuild +#CONFIG_BT_LE_HCI_INTERFACE_USE_UART=y +#CONFIG_BT_LE_HCI_UART_FLOWCTRL=n +#CONFIG_BT_LE_HCI_UART_TX_PIN=5 +#CONFIG_BT_LE_HCI_UART_RX_PIN=18 + + +# 4. Partition Table +#-------------------- CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.esp32c2.csv" -CONFIG_PARTITION_TABLE_FILENAME="partitions.esp32c2.csv" + +# 5. Mempool +#------------ +CONFIG_ESP_CACHE_MALLOC=y + + +# 6.1 LWIP split +#--------------- +#CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED=n +#CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_START=61440 +#CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_END=65535 +#CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_START=61440 +#CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_END=65535 + +# 6.2 LWIP split examples +#------------------------- +#CONFIG_ESP_HOSTED_COPROCESSOR_EXAMPLE_MQTT=n + + +# 7. Transport config +#--------------------- +# CONFIG_ESP_SDIO_NSEND_PSAMPLE=y +# CONFIG_ESP_SDIO_DEFAULT_SPEED=y +# CONFIG_ESP_SDIO_STREAMING_MODE=n + + + +# 8. Wifi config +#---------------- +CONFIG_WIFI_CMD_BASIC_ONLY=y + +CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=8 +CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=16 +CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=16 +CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP_WIFI_TX_BA_WIN=8 +CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP_WIFI_RX_BA_WIN=8 + +CONFIG_ESP_WIFI_RX_IRAM_OPT=y +CONFIG_ESP_WIFI_IRAM_OPT=y + +# 9. LWIP config +#---------------- +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=11520 +CONFIG_LWIP_TCP_WND_DEFAULT=11520 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=16 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=16 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_TCP_SACK_OUT=y +CONFIG_LWIP_TCPIP_CORE_LOCKING=y +CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y + + +# 10. Optimizations +#------------------- +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +#CONFIG_COMPILER_OPTIMIZATION_PERF=y +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y + + +# 11. Stats +#----------- +#CONFIG_ESP_HOSTED_FUNCTION_PROFILING=y +CONFIG_ESP_PKT_STATS=y + +# 12. Priorities +---------------- +CONFIG_IPERF_TRAFFIC_TASK_PRIORITY=18 +CONFIG_IPERF_REPORT_TASK_PRIORITY=18 + + +#13. Mem optimizations +#--------------------- +CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=120 +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_120=y +CONFIG_FREERTOS_UNICORE=y + +#14. C2 specific opts +#--------------------- +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n +CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y CONFIG_ESP_DEFAULT_TASK_STACK_SIZE=2048 +CONFIG_C2_C5_MODULE_SUB_BOARD=y + +#15. For C2 26 MHz XTAL chips only +#--------------------------------- +CONFIG_SOC_XTAL_SUPPORT_26M=y +CONFIG_XTAL_FREQ_26=y diff --git a/slave/sdkconfig.defaults.esp32c3 b/slave/sdkconfig.defaults.esp32c3 index 3f8bab9a..a3f9cd99 100644 --- a/slave/sdkconfig.defaults.esp32c3 +++ b/slave/sdkconfig.defaults.esp32c3 @@ -1,10 +1,107 @@ -CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y -CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160 -CONFIG_FREERTOS_UNICORE=y -CONFIG_SDIO_DAT2_DISABLED= +# 1. CPU +#-------- +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160=y -# BT Configuration +# 2. BT Configuration +#--------------------- CONFIG_BT_ENABLED=y CONFIG_BT_CONTROLLER_ONLY=y CONFIG_BT_BLUEDROID_ENABLED= CONFIG_BT_LE_SLEEP_ENABLE=y + +# 3.1 BLE over SPI/SDIO +#----------------------- +CONFIG_BT_LE_HCI_INTERFACE_USE_RAM=y + +# 3.2 BLE over UART +#------------------- +# Enable below config, delete sdkconfig, build/ and rebuild +# CONFIG_BT_LE_HCI_INTERFACE_USE_UART=y +# CONFIG_BT_LE_HCI_UART_TX_PIN=5 +# CONFIG_BT_LE_HCI_UART_RX_PIN=18 +# CONFIG_BT_LE_HCI_UART_FLOWCTRL=n +# #CONFIG_BT_LE_HCI_UART_RTS_PIN=19 +# #CONFIG_BT_LE_HCI_UART_CTS_PIN=8 + + +# 4. Partition Table +#-------------------- +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.esp32c3.csv" + +# 5. Mempool +#------------ +CONFIG_ESP_CACHE_MALLOC=y + + +# 6.1 LWIP split +#--------------- +#CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED=n +#CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_START=61440 +#CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_END=65535 +#CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_START=61440 +#CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_END=65535 + + +# 6.2 LWIP split examples +#------------------------- +CONFIG_ESP_HOSTED_COPROCESSOR_EXAMPLE_MQTT=n + + +# 7. Transport config +#--------------------- +# CONFIG_ESP_SDIO_NSEND_PSAMPLE=y +# CONFIG_ESP_SDIO_DEFAULT_SPEED=y +# CONFIG_ESP_SDIO_STREAMING_MODE=n + + + +# 8. Wifi config +#---------------- +CONFIG_WIFI_CMD_BASIC_ONLY=y + +CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=32 +CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP_WIFI_TX_BA_WIN=16 +CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP_WIFI_RX_BA_WIN=16 + +CONFIG_ESP_WIFI_RX_IRAM_OPT=y +CONFIG_ESP_WIFI_IRAM_OPT=y + +# 9. LWIP config +#---------------- +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=11520 +CONFIG_LWIP_TCP_WND_DEFAULT=11520 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=16 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=16 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_TCP_SACK_OUT=y +CONFIG_LWIP_TCPIP_CORE_LOCKING=y +CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y + + +# 10. Optimizations +#------------------- +CONFIG_COMPILER_OPTIMIZATION_PERF=y +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y + + +# 11. Stats +#----------- +#CONFIG_ESP_HOSTED_FUNCTION_PROFILING=y +CONFIG_ESP_PKT_STATS=y + +# 12. Priorities +---------------- +CONFIG_IPERF_TRAFFIC_TASK_PRIORITY=18 +CONFIG_IPERF_REPORT_TASK_PRIORITY=18 +CONFIG_ESP_HOSTED_DEFAULT_TASK_STACK_SIZE=4096 + + +#13. Mem optimizations +#--------------------- +CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y diff --git a/slave/sdkconfig.defaults.esp32c5 b/slave/sdkconfig.defaults.esp32c5 index acfbb017..c6bacd69 100644 --- a/slave/sdkconfig.defaults.esp32c5 +++ b/slave/sdkconfig.defaults.esp32c5 @@ -1,10 +1,106 @@ -CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y -CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 +# 1. CPU +#-------- +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y -# BT Configuration +# 2. BT Configuration +#--------------------- CONFIG_BT_ENABLED=y CONFIG_BT_CONTROLLER_ONLY=y CONFIG_BT_BLUEDROID_ENABLED= CONFIG_BT_LE_SLEEP_ENABLE=y + +# 3.1 BLE over SPI/SDIO +#----------------------- +CONFIG_BT_LE_HCI_INTERFACE_USE_RAM=y + +# 3.2 BLE over UART +#------------------- +# Enable below config, delete sdkconfig, build/ and rebuild +# CONFIG_BT_LE_HCI_INTERFACE_USE_UART=y +# CONFIG_BT_LE_HCI_UART_TX_PIN=5 +# CONFIG_BT_LE_HCI_UART_RX_PIN=18 +# CONFIG_BT_LE_HCI_UART_FLOWCTRL=n +# #CONFIG_BT_LE_HCI_UART_RTS_PIN=19 +# #CONFIG_BT_LE_HCI_UART_CTS_PIN=8 + + +# 4. Partition Table +#-------------------- +CONFIG_PARTITION_TABLE_OFFSET=0xc000 CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.esp32c5.csv" + +# 5. Mempool +#------------ +CONFIG_ESP_CACHE_MALLOC=y + + +# 6.1 LWIP split +#--------------- + +#CONFIG_ESP_HOSTED_NETWORK_SPLIT_ENABLED=n +#CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_START=61440 +#CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_END=65535 +#CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_START=61440 +#CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_END=65535 + + +# 6.2 LWIP split examples +#------------------------- +#CONFIG_ESP_HOSTED_COPROCESSOR_EXAMPLE_MQTT=n + + +# 7. Transport config +#--------------------- +# CONFIG_ESP_SDIO_NSEND_PSAMPLE=y +# CONFIG_ESP_SDIO_DEFAULT_SPEED=y +# CONFIG_ESP_SDIO_STREAMING_MODE=n + + +# 8. Wifi config +#---------------- +CONFIG_WIFI_CMD_BASIC_ONLY=y + +CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=32 +CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP_WIFI_TX_BA_WIN=16 +CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP_WIFI_RX_BA_WIN=16 + +CONFIG_ESP_WIFI_RX_IRAM_OPT=y +CONFIG_ESP_WIFI_IRAM_OPT=y + +# 9. LWIP config +#---------------- +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=11520 +CONFIG_LWIP_TCP_WND_DEFAULT=11520 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=16 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=16 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_TCP_SACK_OUT=y +CONFIG_LWIP_TCPIP_CORE_LOCKING=y +CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y + +# 10. Optimizations +#------------------- +CONFIG_COMPILER_OPTIMIZATION_PERF=y +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y + + +# 11. Stats +#----------- +#CONFIG_ESP_HOSTED_FUNCTION_PROFILING=y +CONFIG_ESP_PKT_STATS=y + +# 12. Priorities +#---------------- +CONFIG_IPERF_TRAFFIC_TASK_PRIORITY=18 +CONFIG_IPERF_REPORT_TASK_PRIORITY=18 + + +#13. Mem optimizations +#--------------------- +CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y diff --git a/slave/sdkconfig.defaults.esp32c6 b/slave/sdkconfig.defaults.esp32c6 index d67e40de..a4762334 100644 --- a/slave/sdkconfig.defaults.esp32c6 +++ b/slave/sdkconfig.defaults.esp32c6 @@ -1,15 +1,20 @@ +# 1. CPU +#-------- CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160=y -# BT Configuration +# 2. BT Configuration +#--------------------- CONFIG_BT_ENABLED=y CONFIG_BT_CONTROLLER_ONLY=y CONFIG_BT_BLUEDROID_ENABLED= CONFIG_BT_LE_SLEEP_ENABLE=y -# SPI/SDIO only +# 3.1 BLE over SPI/SDIO +#----------------------- CONFIG_BT_LE_HCI_INTERFACE_USE_RAM=y -# BLE over UART: +# 3.2 BLE over UART +#------------------- # Enable below config, delete sdkconfig, build/ and rebuild # CONFIG_BT_LE_HCI_INTERFACE_USE_UART=y # CONFIG_BT_LE_HCI_UART_TX_PIN=5 @@ -19,8 +24,79 @@ CONFIG_BT_LE_HCI_INTERFACE_USE_RAM=y # #CONFIG_BT_LE_HCI_UART_RTS_PIN=9 # #CONFIG_BT_LE_HCI_UART_CTS_PIN=13 -CONFIG_ESP_CACHE_MALLOC=n +# 4. Partition Table +#-------------------- CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.esp32c6.csv" -CONFIG_ESP_PKT_STATS=y + +# 5. Mempool +#------------ +CONFIG_ESP_CACHE_MALLOC=n + + +# 6 Network split +#----------------- + +# # 6.1 LWIP split +# #--------------- +# +# CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_START=61440 +# CONFIG_LWIP_TCP_LOCAL_PORT_RANGE_END=65535 +# CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_START=61440 +# CONFIG_LWIP_UDP_LOCAL_PORT_RANGE_END=65535 +# +# # 6.2 LWIP split examples +# #------------------------- +# CONFIG_ESP_HOSTED_COPROCESSOR_EXAMPLE_MQTT=n + + +# 7. Transport config +#--------------------- +# CONFIG_ESP_SDIO_NSEND_PSAMPLE=y +# CONFIG_ESP_SDIO_DEFAULT_SPEED=y +# CONFIG_ESP_SDIO_STREAMING_MODE=n + +# For SPI Full duplex C6 on ESP32-P4-Function-EV-Board, please uncomment below +#CONFIG_ESP_HOST_DEV_BOARD_P4_FUNC_BOARD=y +#CONFIG_ESP_SPI_HOST_INTERFACE=y + + +# 8. Wifi config +#---------------- +CONFIG_WIFI_CMD_BASIC_ONLY=y + +CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=32 +CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP_WIFI_TX_BA_WIN=32 +CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP_WIFI_RX_BA_WIN=6 + +CONFIG_ESP_WIFI_RX_IRAM_OPT=y +CONFIG_ESP_WIFI_IRAM_OPT=y + +# 9. LWIP config +#---------------- +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=11520 +CONFIG_LWIP_TCP_WND_DEFAULT=11520 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=16 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=16 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_TCP_SACK_OUT=y +CONFIG_LWIP_TCPIP_CORE_LOCKING=y +CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y + + +# 10. Optimizations +#------------------- +CONFIG_COMPILER_OPTIMIZATION_PERF=y +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y + + +# 11. Stats +#----------- +#CONFIG_ESP_HOSTED_FUNCTION_PROFILING=y +#CONFIG_ESP_PKT_STATS=y diff --git a/slave/sdkconfig.defaults.esp32c61 b/slave/sdkconfig.defaults.esp32c61 new file mode 100644 index 00000000..56dd3a78 --- /dev/null +++ b/slave/sdkconfig.defaults.esp32c61 @@ -0,0 +1,16 @@ +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160=y + +# BT Configuration +CONFIG_BT_ENABLED=y +CONFIG_BT_CONTROLLER_ONLY=y +CONFIG_BT_BLUEDROID_ENABLED= +CONFIG_BT_LE_SLEEP_ENABLE=y + +# SPI/SDIO only +CONFIG_BT_LE_HCI_INTERFACE_USE_RAM=y + +CONFIG_ESP_CACHE_MALLOC=n + +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.esp32c61.csv" +CONFIG_ESP_PKT_STATS=y diff --git a/slave/sdkconfig.defaults.esp32s3 b/slave/sdkconfig.defaults.esp32s3 index e137797c..21045edd 100644 --- a/slave/sdkconfig.defaults.esp32s3 +++ b/slave/sdkconfig.defaults.esp32s3 @@ -7,3 +7,33 @@ CONFIG_BT_ENABLED=y CONFIG_BT_CONTROLLER_ONLY=y CONFIG_BT_BLUEDROID_ENABLED= CONFIG_BT_LE_SLEEP_ENABLE=y + +# Partition +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.esp32s3.csv" + +# Wifi config +CONFIG_WIFI_CMD_BASIC_ONLY=y +CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=32 +CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP_WIFI_TX_BA_WIN=32 +CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP_WIFI_RX_BA_WIN=6 +CONFIG_ESP_WIFI_RX_IRAM_OPT=y +CONFIG_ESP_WIFI_IRAM_OPT=y + +# LWIP config +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=11520 +CONFIG_LWIP_TCP_WND_DEFAULT=11520 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=16 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=16 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_TCP_SACK_OUT=y +CONFIG_LWIP_TCPIP_CORE_LOCKING=y +CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y + + +# Optimizations +CONFIG_COMPILER_OPTIMIZATION_PERF=y diff --git a/tools/check_changelog.py b/tools/check_changelog.py new file mode 100755 index 00000000..a7292bbe --- /dev/null +++ b/tools/check_changelog.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python +# +# SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Apache-2.0 + +# check that the CHANGELOG.md file contains the changelog for the version +# in idf_component.yml +# exit with 0 if ok +# exit with 1 if fail + +# to be run whenever idf_component.yml is updated + +import re +import sys + +# paths to files to check +yml_file = "idf_component.yml" +changelog_file = "CHANGELOG.md" + +def get_idf_yml_version_as_string() -> str: + # read the yml file + file_info = open(yml_file, "r") + info = file_info.read() + file_info.close() + + # extract the version info + ver = re.search("^version: \"([0-9.]+)\"", info) + # print("yml:", ver.group(1)) + return ver.group(1) + +def changelog_has_version(ver_string: str) -> int: + # iterate over the changelog file + matching_line = "## " + ver_string + with open(changelog_file, "r") as changelog: + for line in changelog: + if re.match(matching_line, line): + return 0 + return 1 + +def check() -> int: + yml_string = get_idf_yml_version_as_string() + result = changelog_has_version(yml_string) + if result: + print(f"Changelog for version {yml_string} not found in {changelog_file}") + return 1 + return 0 + +if __name__ == '__main__': + sys.exit(check()) diff --git a/tools/check_copyright_config.yaml b/tools/check_copyright_config.yaml new file mode 100644 index 00000000..37a03c34 --- /dev/null +++ b/tools/check_copyright_config.yaml @@ -0,0 +1,37 @@ +# don't modify this section! +DEFAULT: + perform_check: yes # should the check be performed? + # Sections setting this to 'no' don't need to include any other options as they are ignored + # When a file is using a section with the option set to 'no', no checks are performed. + + # what licenses (or license expressions) are allowed for files in this section + # when setting this option in a section, you need to list all the allowed licenses + allowed_licenses: + - Apache-2.0 + - Unlicense + - CC0-1.0 + license_for_new_files: Apache-2.0 # license to be used when inserting a new copyright notice + new_notice_c: | # notice for new C, CPP, H, HPP and LD files + /* + * SPDX-FileCopyrightText: {years} Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: {license} + */ + new_notice_python: | # notice for new python files + # SPDX-FileCopyrightText: {years} Espressif Systems (Shanghai) CO LTD + # SPDX-License-Identifier: {license} + + # comment lines matching: + # SPDX-FileCopyrightText: year[-year] Espressif Systems + # or + # SPDX-FileContributor: year[-year] Espressif Systems + # are replaced with this template prefixed with the correct comment notation (# or // or *) and SPDX- notation + espressif_copyright: '{years} Espressif Systems (Shanghai) CO LTD' + +ignore: # You can also select ignoring files here + perform_check: no # Don't check files from that block + include: + - common/proto/ + - common/protobuf-c/ + - build/ + - docs/ diff --git a/tools/check_fw_versions.py b/tools/check_fw_versions.py new file mode 100755 index 00000000..cecbeb9d --- /dev/null +++ b/tools/check_fw_versions.py @@ -0,0 +1,184 @@ +#!/usr/bin/env python +# +# SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Apache-2.0 + +# check the host and co-processor version numbers aginst the value in +# idf_component.yml +# exit with 0 if ok +# exit with 1 if fail + +import argparse +from datetime import date +import os +import re +import sys + +# paths to files to check +yml_file = "idf_component.yml" +coprocessor_version_file = "slave/main/esp_hosted_coprocessor_fw_ver.h" +host_version_file = "host/esp_hosted_host_fw_ver.h" + +# year starts from 2025 +start_year = 2025 + +def get_idf_yml_version() -> (int, int, int): + # read the yml file + file_info = open(yml_file, "r") + info = file_info.read() + file_info.close() + + # extract the version info + ver = re.search("^version: \"([0-9]+).([0-9]+).([0-9]+)\"", info) + #print("yml:", ver.group(1), ver.group(2), ver.group(3)) + + # return version info as a tuple (major, minor, patch) + return (ver.group(1), ver.group(2), ver.group(3)) + +def get_coprocessor_version() -> (int, int, int): + # read the coprocessor file + try: + file_info = open(coprocessor_version_file, "r") + except: + print("Coprocessor file open error: default to 0.0.0") + return (0, 0, 0) + info = file_info.read() + file_info.close() + + # extract the version info + major_re = re.search("_VERSION_MAJOR_1 ([0-9]+)", info) + minor_re = re.search("_VERSION_MINOR_1 ([0-9]+)", info) + patch_re = re.search("_VERSION_PATCH_1 ([0-9]+)", info) + + if ((not major_re) or (not minor_re) or (not patch_re)): + print("No coprocessor version info found: default to 0.0.0") + return (0, 0, 0) + + #print("coprocessor:", major_re.group(1), minor_re.group(1), patch_re.group(1)) + + return (major_re.group(1), minor_re.group(1), patch_re.group(1)) + +def get_host_version() -> (int, int, int): + # read the host file + try: + file_info = open(host_version_file, "r") + except: + print("Host file open error: default to 0.0.0") + return (0, 0, 0) + info = file_info.read() + file_info.close() + + # extract the version info + major_re = re.search("_VERSION_MAJOR_1 ([0-9]+)", info) + minor_re = re.search("_VERSION_MINOR_1 ([0-9]+)", info) + patch_re = re.search("_VERSION_PATCH_1 ([0-9]+)", info) + + if ((not major_re) or (not minor_re) or (not patch_re)): + print("No host version info found: default to 0.0.0") + return (0, 0, 0) + + #print("host:", major_re.group(1), minor_re.group(1), patch_re.group(1)) + + return (major_re.group(1), minor_re.group(1), patch_re.group(1)) + +# write common header using the provided file handle +def write_common_header(file_info): + year = date.today().year + + file_info.write("/*\n") + if (year == start_year): + file_info.write(f" * SPDX-FileCopyrightText: {year} Espressif Systems (Shanghai) CO LTD\n") + else: + file_info.write(f" * SPDX-FileCopyrightText: {start_year}-{year} Espressif Systems (Shanghai) CO LTD\n") + file_info.write(" *\n") + file_info.write(" * SPDX-License-Identifier: Apache-2.0\n") + file_info.write(" */\n") + +def set_coprocessor_version(version: tuple) -> int: + # write the coprocessor file + file_info = open(coprocessor_version_file, "w") + + write_common_header(file_info) + + file_info.write("#ifndef __ESP_HOSTED_COPROCESSOR_FW_VER_H__\n") + file_info.write("#define __ESP_HOSTED_COPROCESSOR_FW_VER_H__\n") + ver = version[0] + file_info.write(f"#define PROJECT_VERSION_MAJOR_1 {ver}\n") + ver = version[1] + file_info.write(f"#define PROJECT_VERSION_MINOR_1 {ver}\n") + ver = version[2] + file_info.write(f"#define PROJECT_VERSION_PATCH_1 {ver}\n") + file_info.write("#endif\n") + file_info.close() + return 0 + +def set_host_version(version: tuple) -> int: + # write the host file + file_info = open(host_version_file, "w") + + write_common_header(file_info) + + file_info.write("#ifndef __ESP_HOSTED_HOST_FW_VERSION_H__\n"); + file_info.write("#define __ESP_HOSTED_HOST_FW_VERSION_H__\n"); + ver = version[0] + file_info.write(f"#define ESP_HOSTED_VERSION_MAJOR_1 {ver}\n") + ver = version[1] + file_info.write(f"#define ESP_HOSTED_VERSION_MINOR_1 {ver}\n") + ver = version[2] + file_info.write(f"#define ESP_HOSTED_VERSION_PATCH_1 {ver}\n") + file_info.write("#endif\n") + file_info.close() + return 0 + +def check_slave_version(yml_version: tuple) -> int: + version = get_coprocessor_version() + if (version == yml_version): + return 0 + else: + return 1 + +def check_host_version(yml_version: tuple) -> int: + version = get_host_version() + if (version == yml_version): + return 0 + else: + return 1 + +def check(args) -> int: + ret = 0 + yml_version = get_idf_yml_version() + update = args.update + force = args.force + + if (check_slave_version(yml_version)): + print(f"Co-processor version check failed. Info in {coprocessor_version_file} different from {yml_file}.") + if (update or force): + print(f"{coprocessor_version_file} updated with correct version info.") + set_coprocessor_version(yml_version) + ret = 1 + elif force: + print(f"Force updating version info in {coprocessor_version_file}.") + set_coprocessor_version(yml_version) + + if (check_host_version(yml_version)): + print(f"Host version check failed. Info in {host_version_file} different from {yml_file}.") + if (update or force): + set_host_version(yml_version) + print(f"{host_version_file} updated with correct version info.") + ret = 1 + elif force: + print(f"Force updating version info in {host_version_file}.") + set_host_version(yml_version) + + return ret + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description = "Check, update version headers against component version") + parser.add_argument('-u', '--update', action = 'store_true', + help = "Updates version headers if different from component version") + parser.add_argument('-f', '--force', action = 'store_true', + help = "Force update version headers") + + args = parser.parse_args() + + sys.exit(check(args)) diff --git a/tools/check_rpc_calls.py b/tools/check_rpc_calls.py new file mode 100755 index 00000000..87dfd6cd --- /dev/null +++ b/tools/check_rpc_calls.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# +# SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Apache-2.0 + +# check that RPC calls in protobuf and documentation files match +# exit with 0 if ok +# exit with 1 if fail + +import os +import re +import sys + +# method: +# 1. get the set of RPC calls from both the protobuf and documentation files +# 2. compare the sets +# 3. if there are differences, print the differences + +protobuf_file = "common/proto/esp_hosted_rpc.proto" +doc_file = "docs/implemented_rpcs.md" + +def get_set_from_document() -> set: + set_rpcs = set() + + # read the protobuf file + try: + file_info = open(doc_file, "r") + except: + print("Document file open error") + return set_of_rpcs + + # from this pattern in the doc_file: + # | 1 | 257 | GetMacAddress | 0.0.6 | + # it will extract GetMacAddress + # this pattern works for the list of RCP Requests and Events + pattern = re.compile("\|\s*\d+\s*\|\s*\d+\s*\|\s*(\S+)") + + for line in file_info: + # get the list of rpc calls + rpc_call = pattern.search(line) + if rpc_call: + # print(rpc_call.group(1)) + set_rpcs.add(rpc_call.group(1)) + + file_info.close() + + # print(set_rpcs) + + return set_rpcs + +def get_set_from_protobuf() -> set: + set_rpcs = set() + + # read the protobuf file + try: + file_info = open(protobuf_file, "r") + except: + print("Protobuf file open error") + return set_of_rpcs + + # extract requests + # from this pattern in the protobuf_file + # Rpc_Req_GetMacAddress req_get_mac_address = 257; + # it will extract GetMacAddress + pattern_req = re.compile("\s+(Rpc_Req_)(\S+)\s+req_") + + # extract events + # from this pattern in the protobuf_file + # Rpc_Event_ESPInit event_esp_init = 769; + # it will extract ESPInit + pattern_event = re.compile("\s+(Rpc_Event_)(\S+)\s+event_") + + for line in file_info: + # get the list of rpc calls + rpc_call = pattern_req.search(line) + if rpc_call: + set_rpcs.add(rpc_call.group(2)) + rpc_call = pattern_event.search(line) + if rpc_call: + set_rpcs.add(rpc_call.group(2)) + + file_info.close() + + # print(set_rpcs) + + return set_rpcs + +def check() -> int: + ret = 1 + + # get the set of RPC calls in the protobuf file + protobuf_set = get_set_from_protobuf() + + # get the set of RPC calls in the documentation file + document_set = get_set_from_document() + + # compare the two + + # if not equal + if (protobuf_set == document_set): + ret = 0 + else: + # get the differences + only_in_docs = document_set.difference(protobuf_set) + only_in_protobuf = protobuf_set.difference(document_set) + + if only_in_docs: + print("Error: RPCs only found in document:", only_in_docs) + if only_in_protobuf: + print("Error: RPCs only found in protobuf:", only_in_protobuf) + + return ret + +if __name__ == '__main__': + sys.exit(check())