Skip to content

Commit

Permalink
Enforce DataModel::Provider everywhere (#36319)
Browse files Browse the repository at this point in the history
* Pass 1: remove a large set of ifdefs

* More flags removes

* Remove more flags

* More flags removes

* Clean up a few more builders

* Clean up references from ember compatibility functions and make the data model implementation of reporting and attribute path expand iterator be the only implemented versions

* Remove ServerClusterCommandExists

* Remove ConcreteAttributePathExists

* Remove ReadSingleClusterData

* Remove GetAttributeMetadata

* Even more cleanup

* Remove invalid include

* Update target test file: we removed all DM enable/disable

* Add back endif

* Cleanup targets for building

* Cleanup unused target

* one more unused function removal

* Fix up one condition

* Restyled by clang-format

* Update src/app/AttributePathExpandIterator.h

Co-authored-by: Boris Zbarsky <[email protected]>

* Update src/app/AttributePathExpandIterator.h

Co-authored-by: Boris Zbarsky <[email protected]>

* Update src/darwin/Framework/CHIP/ServerEndpoint/MTRServerAccessControl.mm

Co-authored-by: Boris Zbarsky <[email protected]>

* Add back missed code

* Restyled by clang-format

* Update src/app/tests/BUILD.gn

Co-authored-by: Junior Martinez <[email protected]>

---------

Co-authored-by: Andrei Litvin <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Junior Martinez <[email protected]>
  • Loading branch information
5 people authored Oct 31, 2024
1 parent e5ae065 commit 4efe777
Show file tree
Hide file tree
Showing 67 changed files with 197 additions and 3,148 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
with:
languages: "cpp"
- name: Setup Build
run: scripts/build/gn_gen.sh --args="chip_config_memory_debug_checks=true chip_config_memory_debug_dmalloc=false chip_data_model_check_die_on_failure=true"
run: scripts/build/gn_gen.sh --args="chip_config_memory_debug_checks=true chip_config_memory_debug_dmalloc=false"
- name: Run Build
run: scripts/run_in_build_env.sh "ninja -C ./out"
- name: Run Tests
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"
- name: Setup Build, Run Build and Run Tests
run: |
BUILD_TYPE=gcc_release scripts/build/gn_gen.sh --args="is_debug=false chip_data_model_check_die_on_failure=true"
BUILD_TYPE=gcc_release scripts/build/gn_gen.sh --args="is_debug=false"
scripts/run_in_build_env.sh "ninja -C ./out/gcc_release"
BUILD_TYPE=gcc_release scripts/tests/gn_tests.sh
- name: Clean output
Expand All @@ -205,14 +205,14 @@ jobs:
esac
rm -rf ./out/sanitizers
BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands
BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="$GN_ARGS" --export-compile-commands
BUILD_TYPE=sanitizers scripts/tests/gn_tests.sh
done
- name: Generate tests with sanitizers (for tidy)
if: github.event.pull_request.number != null
run: |
rm -rf ./out/sanitizers
BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="is_clang=true is_asan=true chip_data_model_check_die_on_failure=true" --export-compile-commands
BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="is_clang=true is_asan=true" --export-compile-commands
- name: Ensure codegen is done for sanitize
run: |
./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/sanitizers"
Expand Down Expand Up @@ -333,7 +333,7 @@ jobs:

- name: Setup Build, Run Build and Run Tests
run: |
scripts/build/gn_gen.sh --args="enable_rtti=true chip_config_memory_debug_checks=false chip_config_memory_debug_dmalloc=false chip_generate_link_map_file=false chip_data_model_check_die_on_failure=true"
scripts/build/gn_gen.sh --args="enable_rtti=true chip_config_memory_debug_checks=false chip_config_memory_debug_dmalloc=false chip_generate_link_map_file=false"
scripts/run_in_build_env.sh "ninja -C ./out"
scripts/tests/gn_tests.sh
- name: Setup test python environment
Expand Down Expand Up @@ -439,7 +439,7 @@ jobs:
# We want to build various standalone example apps (similar to what examples-linux-standalone.yaml
# does), so use target_os="all" to get those picked up as part of the "unified" build. But then
# to save CI resources we want to exclude the "host clang" build, which uses the pigweed clang.
scripts/build/gn_gen.sh --args='target_os="all" is_asan=true enable_host_clang_build=false chip_data_model_check_die_on_failure=true' --export-compile-commands
scripts/build/gn_gen.sh --args='target_os="all" is_asan=true enable_host_clang_build=false' --export-compile-commands
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"
scripts/tests/gn_tests.sh
- name: Ensure codegen is done for default
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-linux-arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
--target linux-arm64-chip-tool-nodeps-ipv6only \
--target linux-arm64-lock-clang \
--target linux-arm64-minmdns-clang \
--target linux-arm64-light-data-model-enabled-rpc-ipv6only-clang \
--target linux-arm64-light-rpc-ipv6only-clang \
--target linux-arm64-thermostat-no-ble-clang \
--target linux-arm64-lit-icd-no-ble-clang \
--target linux-arm64-fabric-admin-clang-rpc \
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ jobs:
--known-failure app/util/config.h \
--known-failure app/util/DataModelHandler.cpp \
--known-failure app/util/DataModelHandler.h \
--known-failure app/util/ember-compatibility-functions.cpp \
--known-failure app/util/ember-compatibility-functions.h \
--known-failure app/util/ember-global-attribute-access-interface.h \
--known-failure app/util/ember-io-storage.h \
--known-failure app/util/endpoint-config-api.h \
Expand Down Expand Up @@ -299,7 +297,6 @@ jobs:
':(exclude)src/app/dynamic_server/DynamicDispatcher.cpp' \
':(exclude)src/app/util/attribute-table.cpp' \
':(exclude)src/app/util/attribute-table.h' \
':(exclude)src/app/util/ember-compatibility-functions.cpp' \
':(exclude)src/app/util/mock/CodegenEmberMocks.cpp' \
':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' \
':(exclude)src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm' \
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ jobs:
scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv'
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test-data-model-check-check-failure-die \
--target linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test \
--target linux-x64-lock-ipv6only-no-ble-no-wifi-tsan-clang-test \
--target linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test \
--target linux-x64-energy-management-ipv6only-no-ble-no-wifi-tsan-clang-test \
Expand All @@ -504,7 +504,7 @@ jobs:
- name: Generate an argument environment file
run: |
echo -n "" >/tmp/test_env.yaml
echo "ALL_CLUSTERS_APP: out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test-data-model-check-check-failure-die/chip-all-clusters-app" >> /tmp/test_env.yaml
echo "ALL_CLUSTERS_APP: out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app" >> /tmp/test_env.yaml
echo "CHIP_LOCK_APP: out/linux-x64-lock-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-lock-app" >> /tmp/test_env.yaml
echo "ENERGY_MANAGEMENT_APP: out/linux-x64-energy-management-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-energy-management-app" >> /tmp/test_env.yaml
echo "LIT_ICD_APP: out/linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test/lit-icd-app" >> /tmp/test_env.yaml
Expand All @@ -523,7 +523,7 @@ jobs:
mkdir -p out/trace_data
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/controller/python/test/test_scripts/mobile-device-test.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/execute_python_tests.py --env-file /tmp/test_env.yaml --search-directory src/python_testing'
scripts/run_in_python_env.sh out/venv './scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py --all-clusters out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test-data-model-check-check-failure-die/chip-all-clusters-app'
scripts/run_in_python_env.sh out/venv './scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py --all-clusters out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestIdChecks.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingDeviceType.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceSupport.py'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
*) ;;
esac
scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true"
scripts/build/gn_gen.sh --args="$GN_ARGS"
- name: Run Build
run: scripts/run_in_build_env.sh "ninja -C out/$BUILD_TYPE"
- name: Run Tests
Expand Down
10 changes: 1 addition & 9 deletions build/chip/esp32/esp32_codegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,7 @@ macro(chip_app_component_zapgen ZAP_NAME)

add_dependencies(${COMPONENT_LIB} app-zapgen)
target_include_directories(${COMPONENT_LIB} PUBLIC "${APP_TEMPLATE_GEN_DIR}")
target_sources(${COMPONENT_LIB} PRIVATE ${APP_TEMPLATE_GEN_FILES})

# When data model interface is used, provide a default code-generation data model as
# part of zapgen. See `chip_data_model.cmake` for similar logic
set(CHIP_DATA_MODEL_INTERFACE "enabled" CACHE STRING "Data model interface option to use: enabled or disabled")

if ("${CHIP_DATA_MODEL_INTERFACE}" STREQUAL "enabled")
target_sources(${COMPONENT_LIB} PRIVATE ${CODEGEN_DATA_MODEL_SOURCES})
endif()
target_sources(${COMPONENT_LIB} PRIVATE ${APP_TEMPLATE_GEN_FILES} ${CODEGEN_DATA_MODEL_SOURCES})

endif()
endmacro()
5 changes: 0 additions & 5 deletions config/common/cmake/chip_gn_args.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ macro(matter_common_gn_args)
LIB_PW_RPC
DEVICE_INFO_EXAMPLE_PROVIDER
PROJECT_CONFIG
DATA_MODEL_INTERFACE
)
set(multiValueArgs
PROJECT_CONFIG_INC_DIR
Expand Down Expand Up @@ -204,10 +203,6 @@ macro(matter_common_gn_args)
matter_add_gn_arg_bool ("chip_build_example_providers" ${ARG_DEVICE_INFO_EXAMPLE_PROVIDER})
endif() # ARG_DEVICE_INFO_EXAMPLE_PROVIDER

if (ARG_DATA_MODEL_INTERFACE)
matter_add_gn_arg_string("chip_use_data_model_interface" "${ARG_DATA_MODEL_INTERFACE}")
endif()

if (ARG_PROJECT_CONFIG)
get_filename_component(PROJECT_CONFIG
${ARG_PROJECT_CONFIG}
Expand Down
8 changes: 0 additions & 8 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/ota-image.cmake)

set(CHIP_REQUIRE_COMPONENTS esp_eth freertos lwip bt mbedtls fatfs app_update console openthread nvs_flash spi_flash)

set(CHIP_DATA_MODEL_INTERFACE "enabled" CACHE STRING "Data model interface option to use: enabled or disabled")

if(NOT "${IDF_TARGET}" STREQUAL "esp32h2")
list(APPEND CHIP_REQUIRE_COMPONENTS mdns)
endif()
Expand Down Expand Up @@ -66,12 +64,6 @@ macro(chip_gn_arg_bool arg boolean)
endif()
endmacro()

if ("${CHIP_DATA_MODEL_INTERFACE}" STREQUAL "enabled")
chip_gn_arg_append("chip_use_data_model_interface" "\"enabled\"")
else()
chip_gn_arg_append("chip_use_data_model_interface" "\"disabled\"")
endif()

# ESP-IDF lets user set software version string by two ways:
# 1. Project's CMakeLists.txt file and 2. Config option
# It depends on CONFIG_APP_PROJECT_VER_FROM_CONFIG option
Expand Down
4 changes: 0 additions & 4 deletions config/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ if (CONFIG_MBED_BSD_SOCKET_TRACE)
matter_add_flags(-DMBED_BSD_SOCKET_TRACE=1)
endif()

# Option can be set with `-DCHIP_DATA_MODEL_INTERFACE=enabled` or similar on the command line
set(CHIP_DATA_MODEL_INTERFACE "enabled" CACHE STRING "Data model interface option to use: enabled or disabled")

# ==============================================================================
# Generate configuration for CHIP GN build system
# ==============================================================================
Expand All @@ -124,7 +121,6 @@ matter_common_gn_args(
LIB_TESTS CONFIG_CHIP_BUILD_TESTS
LIB_PW_RPC CONFIG_CHIP_PW_RPC
PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG}
DATA_MODEL_INTERFACE ${CHIP_DATA_MODEL_INTERFACE}
)
if (CONFIG_CHIP_PW_RPC)
matter_add_gn_arg_import("${GN_ROOT_TARGET}/lib/pw_rpc/pw_rpc.gni")
Expand Down
8 changes: 0 additions & 8 deletions config/nrfconnect/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,6 @@ endif()

get_property(CHIP_COMPILER_LAUNCHER GLOBAL PROPERTY RULE_LAUNCH_COMPILE)


if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE)
set(DATA_MODEL_INTERFACE "enabled")
else()
set(DATA_MODEL_INTERFACE "disabled")
endif()

# ==============================================================================
# Generate configuration for CHIP GN build system
# ==============================================================================
Expand All @@ -123,7 +116,6 @@ matter_common_gn_args(
LIB_TESTS CONFIG_CHIP_BUILD_TESTS
PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG}
DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER
DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE}
)
matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR})
matter_add_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER})
Expand Down
7 changes: 0 additions & 7 deletions config/nxp/chip-cmake-freertos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ matter_add_gn_arg_bool("nxp_enable_secure_whole_factory_data" ${CONFIG_CHIP_ENAB
matter_add_gn_arg_bool("nxp_enable_matter_cli" CONFIG_CHIP_LIB_SHELL)
matter_add_gn_arg_bool("chip_enable_pairing_autostart" CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART)

if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE)
set(DATA_MODEL_INTERFACE "enabled")
else()
set(DATA_MODEL_INTERFACE "disabled")
endif()

if(CONFIG_BOOTLOADER_MCUBOOT)
matter_add_gn_arg_bool("no_mcuboot" false)
endif(CONFIG_BOOTLOADER_MCUBOOT)
Expand All @@ -73,7 +67,6 @@ else()
PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG}
PROJECT_CONFIG_INC_DIR ${CONFIG_CHIP_PROJECT_CONFIG_INCLUDE_DIRS}
DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER
DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE}
)
endif()

Expand Down
8 changes: 0 additions & 8 deletions config/nxp/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,6 @@ endif()

get_property(CHIP_COMPILER_LAUNCHER GLOBAL PROPERTY RULE_LAUNCH_COMPILE)

if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE)
set(DATA_MODEL_INTERFACE "enabled")
else()
set(DATA_MODEL_INTERFACE "disabled")
endif()


# ==============================================================================
# Generate configuration for CHIP GN build system
# ==============================================================================
Expand All @@ -108,7 +101,6 @@ matter_common_gn_args(
LIB_TESTS CONFIG_CHIP_BUILD_TESTS
PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG}
DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER
DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE}
)
matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR})
matter_add_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER})
Expand Down
7 changes: 0 additions & 7 deletions config/telink/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ if (CONFIG_CHIP_OPENTHREAD_CONFIG)
zephyr_set_openthread_config(${CHIP_OPENTHREAD_CONFIG})
endif()

if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE)
set(DATA_MODEL_INTERFACE "enabled")
else()
set(DATA_MODEL_INTERFACE "disabled")
endif()

# ==============================================================================
# Generate configuration for CHIP GN build system
# ==============================================================================
Expand All @@ -93,7 +87,6 @@ matter_common_gn_args(
LIB_TESTS CONFIG_CHIP_BUILD_TESTS
PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG}
DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER
DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE}
)
matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR})
matter_add_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER})
Expand Down
8 changes: 0 additions & 8 deletions config/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -581,12 +581,4 @@ config CHIP_BLE_ADVERTISING_DURATION
If CHIP_BLE_EXT_ADVERTISING is set to false, the maximum duration time is 15 minutes,
else the maximum duration time can be extended to 2880 minutes (48h).

config USE_CHIP_DATA_MODEL_INTERFACE
bool "Use a DataModel::Provider interface for data access"
default y
help
This enables a level of indiraction in the CHIP interaction model engine in
accessing underlying data and executing operations such as
wildcard-expansion, read, write and invoke.

endif
7 changes: 0 additions & 7 deletions config/zephyr/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ if(CONFIG_CHIP)
zephyr_set_openthread_config(${CHIP_OPENTHREAD_CONFIG})
endif()

if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE)
set(DATA_MODEL_INTERFACE "enabled")
else()
set(DATA_MODEL_INTERFACE "disabled")
endif()

# ==============================================================================
# Generate configuration for CHIP GN build system
# ==============================================================================
Expand All @@ -84,7 +78,6 @@ if(CONFIG_CHIP)
LIB_SHELL CONFIG_CHIP_LIB_SHELL
LIB_TESTS CONFIG_CHIP_BUILD_TESTS
PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG}
DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE}
)

matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR})
Expand Down
17 changes: 4 additions & 13 deletions examples/common/pigweed/rpc_services/Attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,19 @@

#include <app-common/zap-generated/attribute-type.h>
#include <app/AppConfig.h>
#include <app/AttributeValueEncoder.h>
#include <app/InteractionModelEngine.h>
#include <app/MessageDef/AttributeReportIBs.h>
#include <app/data-model-provider/ActionReturnStatus.h>
#include <app/data-model-provider/OperationTypes.h>
#include <app/data-model-provider/Provider.h>
#include <app/util/attribute-storage.h>
#include <app/util/attribute-table.h>
#include <app/util/ember-compatibility-functions.h>
#include <lib/core/TLV.h>
#include <lib/core/TLVTags.h>
#include <lib/core/TLVTypes.h>
#include <platform/PlatformManager.h>

#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE
#include <app/AttributeValueEncoder.h>
#include <app/data-model-provider/ActionReturnStatus.h>
#include <app/data-model-provider/OperationTypes.h>
#include <app/data-model-provider/Provider.h>
#endif

namespace chip {
namespace rpc {

Expand Down Expand Up @@ -217,7 +213,6 @@ class Attributes : public pw_rpc::nanopb::Attributes::Service<Attributes>
PW_TRY(ChipErrorToPwStatus(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outer)));
PW_TRY(ChipErrorToPwStatus(attributeReports.Init(&writer, kReportContextTag)));

#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE
// TODO: this assumes a singleton data model provider
app::DataModel::Provider * provider = app::InteractionModelEngine::GetInstance()->GetDataModelProvider();

Expand All @@ -243,10 +238,6 @@ class Attributes : public pw_rpc::nanopb::Attributes::Service<Attributes>
return ::pw::Status::Internal();
}

#else
PW_TRY(ChipErrorToPwStatus(app::ReadSingleClusterData(subjectDescriptor, false, path, attributeReports, nullptr)));
#endif

attributeReports.EndOfContainer();
PW_TRY(ChipErrorToPwStatus(writer.EndContainer(outer)));
PW_TRY(ChipErrorToPwStatus(writer.Finalize()));
Expand Down
Loading

0 comments on commit 4efe777

Please sign in to comment.