Skip to content

Commit 4efe777

Browse files
andy31415andreilitvinrestyled-commitsbzbarsky-applejmartinez-silabs
authored
Enforce DataModel::Provider everywhere (#36319)
* 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 <bzbarsky@apple.com> * Update src/app/AttributePathExpandIterator.h Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * Update src/darwin/Framework/CHIP/ServerEndpoint/MTRServerAccessControl.mm Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * Add back missed code * Restyled by clang-format * Update src/app/tests/BUILD.gn Co-authored-by: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> --------- Co-authored-by: Andrei Litvin <andreilitvin@google.com> Co-authored-by: Restyled.io <commits@restyled.io> Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> Co-authored-by: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com>
1 parent e5ae065 commit 4efe777

File tree

67 files changed

+197
-3148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+197
-3148
lines changed

.github/workflows/build.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
with:
7777
languages: "cpp"
7878
- name: Setup Build
79-
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"
79+
run: scripts/build/gn_gen.sh --args="chip_config_memory_debug_checks=true chip_config_memory_debug_dmalloc=false"
8080
- name: Run Build
8181
run: scripts/run_in_build_env.sh "ninja -C ./out"
8282
- name: Run Tests
@@ -183,7 +183,7 @@ jobs:
183183
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"
184184
- name: Setup Build, Run Build and Run Tests
185185
run: |
186-
BUILD_TYPE=gcc_release scripts/build/gn_gen.sh --args="is_debug=false chip_data_model_check_die_on_failure=true"
186+
BUILD_TYPE=gcc_release scripts/build/gn_gen.sh --args="is_debug=false"
187187
scripts/run_in_build_env.sh "ninja -C ./out/gcc_release"
188188
BUILD_TYPE=gcc_release scripts/tests/gn_tests.sh
189189
- name: Clean output
@@ -205,14 +205,14 @@ jobs:
205205
esac
206206
207207
rm -rf ./out/sanitizers
208-
BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands
208+
BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="$GN_ARGS" --export-compile-commands
209209
BUILD_TYPE=sanitizers scripts/tests/gn_tests.sh
210210
done
211211
- name: Generate tests with sanitizers (for tidy)
212212
if: github.event.pull_request.number != null
213213
run: |
214214
rm -rf ./out/sanitizers
215-
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
215+
BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="is_clang=true is_asan=true" --export-compile-commands
216216
- name: Ensure codegen is done for sanitize
217217
run: |
218218
./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/sanitizers"
@@ -333,7 +333,7 @@ jobs:
333333

334334
- name: Setup Build, Run Build and Run Tests
335335
run: |
336-
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"
336+
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"
337337
scripts/run_in_build_env.sh "ninja -C ./out"
338338
scripts/tests/gn_tests.sh
339339
- name: Setup test python environment
@@ -439,7 +439,7 @@ jobs:
439439
# We want to build various standalone example apps (similar to what examples-linux-standalone.yaml
440440
# does), so use target_os="all" to get those picked up as part of the "unified" build. But then
441441
# to save CI resources we want to exclude the "host clang" build, which uses the pigweed clang.
442-
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
442+
scripts/build/gn_gen.sh --args='target_os="all" is_asan=true enable_host_clang_build=false' --export-compile-commands
443443
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"
444444
scripts/tests/gn_tests.sh
445445
- name: Ensure codegen is done for default

.github/workflows/examples-linux-arm.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
--target linux-arm64-chip-tool-nodeps-ipv6only \
6666
--target linux-arm64-lock-clang \
6767
--target linux-arm64-minmdns-clang \
68-
--target linux-arm64-light-data-model-enabled-rpc-ipv6only-clang \
68+
--target linux-arm64-light-rpc-ipv6only-clang \
6969
--target linux-arm64-thermostat-no-ble-clang \
7070
--target linux-arm64-lit-icd-no-ble-clang \
7171
--target linux-arm64-fabric-admin-clang-rpc \

.github/workflows/lint.yml

-3
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ jobs:
114114
--known-failure app/util/config.h \
115115
--known-failure app/util/DataModelHandler.cpp \
116116
--known-failure app/util/DataModelHandler.h \
117-
--known-failure app/util/ember-compatibility-functions.cpp \
118-
--known-failure app/util/ember-compatibility-functions.h \
119117
--known-failure app/util/ember-global-attribute-access-interface.h \
120118
--known-failure app/util/ember-io-storage.h \
121119
--known-failure app/util/endpoint-config-api.h \
@@ -299,7 +297,6 @@ jobs:
299297
':(exclude)src/app/dynamic_server/DynamicDispatcher.cpp' \
300298
':(exclude)src/app/util/attribute-table.cpp' \
301299
':(exclude)src/app/util/attribute-table.h' \
302-
':(exclude)src/app/util/ember-compatibility-functions.cpp' \
303300
':(exclude)src/app/util/mock/CodegenEmberMocks.cpp' \
304301
':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' \
305302
':(exclude)src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm' \

.github/workflows/tests.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ jobs:
487487
scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv'
488488
./scripts/run_in_build_env.sh \
489489
"./scripts/build/build_examples.py \
490-
--target linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test-data-model-check-check-failure-die \
490+
--target linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test \
491491
--target linux-x64-lock-ipv6only-no-ble-no-wifi-tsan-clang-test \
492492
--target linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test \
493493
--target linux-x64-energy-management-ipv6only-no-ble-no-wifi-tsan-clang-test \
@@ -504,7 +504,7 @@ jobs:
504504
- name: Generate an argument environment file
505505
run: |
506506
echo -n "" >/tmp/test_env.yaml
507-
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
507+
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
508508
echo "CHIP_LOCK_APP: out/linux-x64-lock-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-lock-app" >> /tmp/test_env.yaml
509509
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
510510
echo "LIT_ICD_APP: out/linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test/lit-icd-app" >> /tmp/test_env.yaml
@@ -523,7 +523,7 @@ jobs:
523523
mkdir -p out/trace_data
524524
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'
525525
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'
526-
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'
526+
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'
527527
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestIdChecks.py'
528528
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingDeviceType.py'
529529
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceSupport.py'

.github/workflows/unit_integration_test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
*) ;;
7575
esac
7676
77-
scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true"
77+
scripts/build/gn_gen.sh --args="$GN_ARGS"
7878
- name: Run Build
7979
run: scripts/run_in_build_env.sh "ninja -C out/$BUILD_TYPE"
8080
- name: Run Tests

build/chip/esp32/esp32_codegen.cmake

+1-9
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,7 @@ macro(chip_app_component_zapgen ZAP_NAME)
7171

7272
add_dependencies(${COMPONENT_LIB} app-zapgen)
7373
target_include_directories(${COMPONENT_LIB} PUBLIC "${APP_TEMPLATE_GEN_DIR}")
74-
target_sources(${COMPONENT_LIB} PRIVATE ${APP_TEMPLATE_GEN_FILES})
75-
76-
# When data model interface is used, provide a default code-generation data model as
77-
# part of zapgen. See `chip_data_model.cmake` for similar logic
78-
set(CHIP_DATA_MODEL_INTERFACE "enabled" CACHE STRING "Data model interface option to use: enabled or disabled")
79-
80-
if ("${CHIP_DATA_MODEL_INTERFACE}" STREQUAL "enabled")
81-
target_sources(${COMPONENT_LIB} PRIVATE ${CODEGEN_DATA_MODEL_SOURCES})
82-
endif()
74+
target_sources(${COMPONENT_LIB} PRIVATE ${APP_TEMPLATE_GEN_FILES} ${CODEGEN_DATA_MODEL_SOURCES})
8375

8476
endif()
8577
endmacro()

config/common/cmake/chip_gn_args.cmake

-5
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ macro(matter_common_gn_args)
171171
LIB_PW_RPC
172172
DEVICE_INFO_EXAMPLE_PROVIDER
173173
PROJECT_CONFIG
174-
DATA_MODEL_INTERFACE
175174
)
176175
set(multiValueArgs
177176
PROJECT_CONFIG_INC_DIR
@@ -204,10 +203,6 @@ macro(matter_common_gn_args)
204203
matter_add_gn_arg_bool ("chip_build_example_providers" ${ARG_DEVICE_INFO_EXAMPLE_PROVIDER})
205204
endif() # ARG_DEVICE_INFO_EXAMPLE_PROVIDER
206205

207-
if (ARG_DATA_MODEL_INTERFACE)
208-
matter_add_gn_arg_string("chip_use_data_model_interface" "${ARG_DATA_MODEL_INTERFACE}")
209-
endif()
210-
211206
if (ARG_PROJECT_CONFIG)
212207
get_filename_component(PROJECT_CONFIG
213208
${ARG_PROJECT_CONFIG}

config/esp32/components/chip/CMakeLists.txt

-8
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/ota-image.cmake)
3333

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

36-
set(CHIP_DATA_MODEL_INTERFACE "enabled" CACHE STRING "Data model interface option to use: enabled or disabled")
37-
3836
if(NOT "${IDF_TARGET}" STREQUAL "esp32h2")
3937
list(APPEND CHIP_REQUIRE_COMPONENTS mdns)
4038
endif()
@@ -66,12 +64,6 @@ macro(chip_gn_arg_bool arg boolean)
6664
endif()
6765
endmacro()
6866

69-
if ("${CHIP_DATA_MODEL_INTERFACE}" STREQUAL "enabled")
70-
chip_gn_arg_append("chip_use_data_model_interface" "\"enabled\"")
71-
else()
72-
chip_gn_arg_append("chip_use_data_model_interface" "\"disabled\"")
73-
endif()
74-
7567
# ESP-IDF lets user set software version string by two ways:
7668
# 1. Project's CMakeLists.txt file and 2. Config option
7769
# It depends on CONFIG_APP_PROJECT_VER_FROM_CONFIG option

config/mbed/CMakeLists.txt

-4
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ if (CONFIG_MBED_BSD_SOCKET_TRACE)
112112
matter_add_flags(-DMBED_BSD_SOCKET_TRACE=1)
113113
endif()
114114

115-
# Option can be set with `-DCHIP_DATA_MODEL_INTERFACE=enabled` or similar on the command line
116-
set(CHIP_DATA_MODEL_INTERFACE "enabled" CACHE STRING "Data model interface option to use: enabled or disabled")
117-
118115
# ==============================================================================
119116
# Generate configuration for CHIP GN build system
120117
# ==============================================================================
@@ -124,7 +121,6 @@ matter_common_gn_args(
124121
LIB_TESTS CONFIG_CHIP_BUILD_TESTS
125122
LIB_PW_RPC CONFIG_CHIP_PW_RPC
126123
PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG}
127-
DATA_MODEL_INTERFACE ${CHIP_DATA_MODEL_INTERFACE}
128124
)
129125
if (CONFIG_CHIP_PW_RPC)
130126
matter_add_gn_arg_import("${GN_ROOT_TARGET}/lib/pw_rpc/pw_rpc.gni")

config/nrfconnect/chip-module/CMakeLists.txt

-8
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,6 @@ endif()
106106

107107
get_property(CHIP_COMPILER_LAUNCHER GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
108108

109-
110-
if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE)
111-
set(DATA_MODEL_INTERFACE "enabled")
112-
else()
113-
set(DATA_MODEL_INTERFACE "disabled")
114-
endif()
115-
116109
# ==============================================================================
117110
# Generate configuration for CHIP GN build system
118111
# ==============================================================================
@@ -123,7 +116,6 @@ matter_common_gn_args(
123116
LIB_TESTS CONFIG_CHIP_BUILD_TESTS
124117
PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG}
125118
DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER
126-
DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE}
127119
)
128120
matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR})
129121
matter_add_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER})

config/nxp/chip-cmake-freertos/CMakeLists.txt

-7
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ matter_add_gn_arg_bool("nxp_enable_secure_whole_factory_data" ${CONFIG_CHIP_ENAB
5050
matter_add_gn_arg_bool("nxp_enable_matter_cli" CONFIG_CHIP_LIB_SHELL)
5151
matter_add_gn_arg_bool("chip_enable_pairing_autostart" CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART)
5252

53-
if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE)
54-
set(DATA_MODEL_INTERFACE "enabled")
55-
else()
56-
set(DATA_MODEL_INTERFACE "disabled")
57-
endif()
58-
5953
if(CONFIG_BOOTLOADER_MCUBOOT)
6054
matter_add_gn_arg_bool("no_mcuboot" false)
6155
endif(CONFIG_BOOTLOADER_MCUBOOT)
@@ -73,7 +67,6 @@ else()
7367
PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG}
7468
PROJECT_CONFIG_INC_DIR ${CONFIG_CHIP_PROJECT_CONFIG_INCLUDE_DIRS}
7569
DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER
76-
DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE}
7770
)
7871
endif()
7972

config/nxp/chip-module/CMakeLists.txt

-8
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,6 @@ endif()
9191

9292
get_property(CHIP_COMPILER_LAUNCHER GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
9393

94-
if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE)
95-
set(DATA_MODEL_INTERFACE "enabled")
96-
else()
97-
set(DATA_MODEL_INTERFACE "disabled")
98-
endif()
99-
100-
10194
# ==============================================================================
10295
# Generate configuration for CHIP GN build system
10396
# ==============================================================================
@@ -108,7 +101,6 @@ matter_common_gn_args(
108101
LIB_TESTS CONFIG_CHIP_BUILD_TESTS
109102
PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG}
110103
DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER
111-
DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE}
112104
)
113105
matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR})
114106
matter_add_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER})

config/telink/chip-module/CMakeLists.txt

-7
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@ if (CONFIG_CHIP_OPENTHREAD_CONFIG)
7777
zephyr_set_openthread_config(${CHIP_OPENTHREAD_CONFIG})
7878
endif()
7979

80-
if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE)
81-
set(DATA_MODEL_INTERFACE "enabled")
82-
else()
83-
set(DATA_MODEL_INTERFACE "disabled")
84-
endif()
85-
8680
# ==============================================================================
8781
# Generate configuration for CHIP GN build system
8882
# ==============================================================================
@@ -93,7 +87,6 @@ matter_common_gn_args(
9387
LIB_TESTS CONFIG_CHIP_BUILD_TESTS
9488
PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG}
9589
DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER
96-
DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE}
9790
)
9891
matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR})
9992
matter_add_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER})

config/zephyr/Kconfig

-8
Original file line numberDiff line numberDiff line change
@@ -581,12 +581,4 @@ config CHIP_BLE_ADVERTISING_DURATION
581581
If CHIP_BLE_EXT_ADVERTISING is set to false, the maximum duration time is 15 minutes,
582582
else the maximum duration time can be extended to 2880 minutes (48h).
583583

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

config/zephyr/chip-module/CMakeLists.txt

-7
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ if(CONFIG_CHIP)
7070
zephyr_set_openthread_config(${CHIP_OPENTHREAD_CONFIG})
7171
endif()
7272

73-
if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE)
74-
set(DATA_MODEL_INTERFACE "enabled")
75-
else()
76-
set(DATA_MODEL_INTERFACE "disabled")
77-
endif()
78-
7973
# ==============================================================================
8074
# Generate configuration for CHIP GN build system
8175
# ==============================================================================
@@ -84,7 +78,6 @@ if(CONFIG_CHIP)
8478
LIB_SHELL CONFIG_CHIP_LIB_SHELL
8579
LIB_TESTS CONFIG_CHIP_BUILD_TESTS
8680
PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG}
87-
DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE}
8881
)
8982

9083
matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR})

examples/common/pigweed/rpc_services/Attributes.h

+4-13
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,19 @@
2323

2424
#include <app-common/zap-generated/attribute-type.h>
2525
#include <app/AppConfig.h>
26+
#include <app/AttributeValueEncoder.h>
2627
#include <app/InteractionModelEngine.h>
2728
#include <app/MessageDef/AttributeReportIBs.h>
29+
#include <app/data-model-provider/ActionReturnStatus.h>
30+
#include <app/data-model-provider/OperationTypes.h>
31+
#include <app/data-model-provider/Provider.h>
2832
#include <app/util/attribute-storage.h>
2933
#include <app/util/attribute-table.h>
30-
#include <app/util/ember-compatibility-functions.h>
3134
#include <lib/core/TLV.h>
3235
#include <lib/core/TLVTags.h>
3336
#include <lib/core/TLVTypes.h>
3437
#include <platform/PlatformManager.h>
3538

36-
#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE
37-
#include <app/AttributeValueEncoder.h>
38-
#include <app/data-model-provider/ActionReturnStatus.h>
39-
#include <app/data-model-provider/OperationTypes.h>
40-
#include <app/data-model-provider/Provider.h>
41-
#endif
42-
4339
namespace chip {
4440
namespace rpc {
4541

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

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

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

246-
#else
247-
PW_TRY(ChipErrorToPwStatus(app::ReadSingleClusterData(subjectDescriptor, false, path, attributeReports, nullptr)));
248-
#endif
249-
250241
attributeReports.EndOfContainer();
251242
PW_TRY(ChipErrorToPwStatus(writer.EndContainer(outer)));
252243
PW_TRY(ChipErrorToPwStatus(writer.Finalize()));

0 commit comments

Comments
 (0)