Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch DataModel::Provider interface to default enabled (except on linux where it stays as check) #36042

Merged
merged 152 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
15987e7
Switch data model provider usage to default to enabled
andreilitvin Oct 11, 2024
ca283ac
Decouple pump configuration and control from compatibility functions.…
andreilitvin Oct 11, 2024
4ca2dd2
Fix up some private/public dependencies: instance header should alway…
andreilitvin Oct 11, 2024
8f48f68
Allow java (or generally dynamic server) controller builds to compile…
andreilitvin Oct 11, 2024
860baf5
Restyled by clang-format
restyled-commits Oct 11, 2024
30c1a7f
Restyled by gn
restyled-commits Oct 11, 2024
52f80b0
Better dynamic dispatch implementation, removed extra TODO functions
andreilitvin Oct 11, 2024
73c68ab
Restyled by whitespace
restyled-commits Oct 11, 2024
14ad89e
Update dep a bit more
andreilitvin Oct 11, 2024
53313ca
Fix linter
andreilitvin Oct 11, 2024
ef5e660
Fix linter again
andreilitvin Oct 11, 2024
42eb582
Update NXP to support various logging targets and for K32W0 enable pr…
andreilitvin Oct 11, 2024
3f92ba4
Fix nxp compile (ordering issue)
andreilitvin Oct 11, 2024
8e8e1a3
Update logic a bit to use log level for low power
andreilitvin Oct 11, 2024
10ecddb
Update builds to consider low power already removing logs
andreilitvin Oct 11, 2024
dc46aa8
Merge branch 'master' into default_enable_dm_provider
andy31415 Oct 12, 2024
04ae851
Make microwave oven cluster compilable
andy31415 Oct 15, 2024
f16d02e
Restyle
andy31415 Oct 15, 2024
5b95f5b
Add codegen data model to darwin xproject: given that we add ember, w…
andy31415 Oct 15, 2024
e098072
Add missing override for darwin dispatch when codegen data model uses…
andy31415 Oct 15, 2024
5aefe4b
Fix linter
andy31415 Oct 15, 2024
272cc1c
Add ability to track structural changes in ember for the purpose of c…
andy31415 Oct 16, 2024
bdea29d
Fix typo: uint is unsigned
andy31415 Oct 16, 2024
c64a59e
Restyle
andy31415 Oct 16, 2024
ee82266
Fix android to also provide a generation version
andy31415 Oct 16, 2024
629f147
Fix another uint/unsigned typo ... oops
andy31415 Oct 16, 2024
b651953
Add assertion of stack lock in darwin override of emberAfWriteAttribute
andy31415 Oct 16, 2024
6a882a4
Merge branch 'master' into default_enable_dm_provider
andy31415 Oct 16, 2024
be68d72
Merge branch 'master' into default_enable_dm_provider
andy31415 Oct 17, 2024
45b43d5
Restyled by isort
restyled-commits Oct 17, 2024
418a434
Remove formatting changes from python files
andy31415 Oct 17, 2024
c2c64ec
Pick up restyle changes too
andy31415 Oct 17, 2024
ef95d9c
Merge branch 'master' into default_enable_dm_provider
andy31415 Oct 17, 2024
b31de5c
Merge branch 'master' into default_enable_dm_provider
andy31415 Oct 17, 2024
a11d455
Add comment on attribute laregest
andy31415 Oct 18, 2024
4874a3c
Merge branch 'master' into default_enable_dm_provider
andy31415 Oct 18, 2024
dbaf112
Use TLV-based encoding for ember data buffer.
andy31415 Oct 17, 2024
7372298
Restyled by clang-format
restyled-commits Oct 21, 2024
8a82ac7
Restyled by shfmt
restyled-commits Oct 21, 2024
bff7f03
Undo unrelated change
andy31415 Oct 21, 2024
fe4a937
Merge branch 'ember_tlv_reader_encoding' into default_enable_dm_provider
andy31415 Oct 21, 2024
a89f016
Add some casts to make android compiler happy
andy31415 Oct 21, 2024
fd7b6ca
Merge branch 'ember_tlv_reader_encoding' into default_enable_dm_provider
andy31415 Oct 21, 2024
6cd1e82
Update darwin build project as well with the new files
andy31415 Oct 21, 2024
30a3f32
Updates based on code review
andy31415 Oct 21, 2024
f90de00
Added unit tests for min/max int64 values
andy31415 Oct 21, 2024
9048c88
Rename PascalString to PascalStringType
andy31415 Oct 21, 2024
1f1975f
Merge branch 'ember_tlv_reader_encoding' into default_enable_dm_provider
andy31415 Oct 21, 2024
254af50
Fix rename
andy31415 Oct 21, 2024
b35855f
Merge branch 'ember_tlv_reader_encoding' into default_enable_dm_provider
andy31415 Oct 21, 2024
a702c04
Restyle
andy31415 Oct 21, 2024
224d1e7
Merge branch 'ember_tlv_reader_encoding' into default_enable_dm_provider
andy31415 Oct 21, 2024
e466c11
Add helper methods inside odd sized integers to localize code logic
andreilitvin Oct 22, 2024
788351c
Merge branch 'ember_tlv_reader_encoding' into default_enable_dm_provider
andreilitvin Oct 22, 2024
5836cea
Restyled by clang-format
restyled-commits Oct 22, 2024
b560d06
Merge branch 'ember_tlv_reader_encoding' into default_enable_dm_provider
andreilitvin Oct 22, 2024
fac403a
Fix up negative ranges
andreilitvin Oct 22, 2024
a8b76f6
Fixed ranges
andreilitvin Oct 22, 2024
717348c
Fix signed max bug and update unit tests
andreilitvin Oct 22, 2024
d6073eb
Merge branch 'master' into ember_tlv_reader_encoding
andreilitvin Oct 22, 2024
a17c8a6
Merge branch 'ember_tlv_reader_encoding' into default_enable_dm_provider
andreilitvin Oct 22, 2024
8c91bb0
Make android happy
andreilitvin Oct 22, 2024
e8b5cbe
Typo fix
andreilitvin Oct 22, 2024
b04dd20
Merge branch 'ember_tlv_reader_encoding' into default_enable_dm_provider
andreilitvin Oct 22, 2024
ecdca36
Switch up unit tests
andy31415 Oct 23, 2024
e0811b7
Merge branch 'master' into ember_tlv_reader_encoding
andy31415 Oct 23, 2024
f80cf68
Update a nullable check to make use of ValueToNullValue
andy31415 Oct 23, 2024
cee5602
Add namespace prefix
andy31415 Oct 23, 2024
4738e1e
Update src/app/codegen-data-model-provider/EmberDataBuffer.cpp
andy31415 Oct 24, 2024
c719787
Update src/app/codegen-data-model-provider/EmberDataBuffer.h
andy31415 Oct 24, 2024
23095c3
Correct comments:signed, not unsigned
andreilitvin Oct 24, 2024
972643b
Use constructors for the buffer info
andreilitvin Oct 24, 2024
3c87c45
Rename things to EmberAttributeDataBuffer
andreilitvin Oct 24, 2024
4e05e99
Merge branch 'master' into ember_tlv_reader_encoding
andreilitvin Oct 24, 2024
a2558cf
Undo submodule updates
andreilitvin Oct 24, 2024
62de798
Merge branch 'ember_tlv_reader_encoding' into default_enable_dm_provider
andreilitvin Oct 24, 2024
efe8b28
Restyled by clang-format
restyled-commits Oct 24, 2024
0268655
Merge branch 'ember_tlv_reader_encoding' into default_enable_dm_provider
andreilitvin Oct 24, 2024
0f2efaf
Merge branch 'master' into ember_tlv_reader_encoding
andreilitvin Oct 24, 2024
9ea8dc9
Merge branch 'ember_tlv_reader_encoding' into default_enable_dm_provider
andreilitvin Oct 24, 2024
3817075
Use EmberAttributeDataBuffer for codegen provider _Read
andreilitvin Oct 24, 2024
43b4eee
Merge branch 'master' into ember_tlv_writer_encoding
andreilitvin Oct 24, 2024
f32cb77
Fix comments
andreilitvin Oct 24, 2024
2c29f50
Merge branch 'ember_tlv_writer_encoding' into default_enable_dm_provider
andreilitvin Oct 24, 2024
91d5458
Restyled by clang-format
restyled-commits Oct 24, 2024
29e7418
Merge branch 'ember_tlv_writer_encoding' into default_enable_dm_provider
andreilitvin Oct 24, 2024
2c6893d
Update DynamicDispatcher comment
andreilitvin Oct 24, 2024
3c62942
Rename file
andreilitvin Oct 24, 2024
aa30b50
Merge branch 'master' into ember_tlv_writer_encoding
andreilitvin Oct 24, 2024
aaa7b0e
Merge branch 'ember_tlv_writer_encoding' into default_enable_dm_provider
andreilitvin Oct 24, 2024
3171569
Merge branch 'master' into default_enable_dm_provider
andreilitvin Oct 25, 2024
a791d23
Use a pointer for the subject descriptor.
andreilitvin Oct 25, 2024
2cb803f
Restyle
andreilitvin Oct 25, 2024
18d0ee7
Fix include
andreilitvin Oct 25, 2024
f4920ce
Fix include
andreilitvin Oct 25, 2024
057f7a7
Merge branch 'use_pointer_for_subject_descriptor' into default_enable…
andreilitvin Oct 25, 2024
267b2c5
Also fix PW rpc
andreilitvin Oct 25, 2024
ef71b30
This saves 136 bytes...
andreilitvin Oct 25, 2024
3e56e2a
More changes to save slightly more flash for code
andreilitvin Oct 25, 2024
23576da
Restyle
andreilitvin Oct 25, 2024
b50af7e
Fix typo
andreilitvin Oct 25, 2024
8a06568
Fix includes
andreilitvin Oct 25, 2024
4bd9f1d
Merge branch 'test_first_next_updates' into default_enable_dm_provider
andreilitvin Oct 25, 2024
ebd6f0f
Merge branch 'use_pointer_for_subject_descriptor' into default_enable…
andreilitvin Oct 25, 2024
0063384
Merge branch 'master' into default_enable_dm_provider
andreilitvin Oct 25, 2024
597d206
make more detailed logging optional in the codegen data model and ena…
andreilitvin Oct 25, 2024
6a40ad2
Merge branch 'remove_logging_from_codegen_dm' into default_enable_dm_…
andreilitvin Oct 25, 2024
79a90cd
Pull back the event path validity mixin, start with a datamodel imple…
andreilitvin Oct 25, 2024
8e26e8c
Fix compile logic after I moved things away
andreilitvin Oct 25, 2024
edd57c0
Add one more check
andreilitvin Oct 25, 2024
c43a821
Restyle
andreilitvin Oct 25, 2024
28a39e6
Fix typo
andreilitvin Oct 25, 2024
a27660c
Fix includes
andreilitvin Oct 25, 2024
11b2196
Restyle
andreilitvin Oct 25, 2024
1217941
Move decodable lists bits as a non-template class to save flash
andreilitvin Oct 25, 2024
785b356
Update src/app/InteractionModelEngine.cpp
andy31415 Oct 28, 2024
ea70aaf
Rename method
andy31415 Oct 28, 2024
52f43da
Restyle
andy31415 Oct 28, 2024
1f6d535
More renames
andy31415 Oct 28, 2024
8d36889
Restyle
andy31415 Oct 28, 2024
4784042
Fix some renames
andy31415 Oct 28, 2024
dcf3770
Restyle
andy31415 Oct 28, 2024
325395e
Merge branch 'master' into untemplate_parts_of_decodable_list
andy31415 Oct 28, 2024
2a026c5
Merge branch 'untemplate_parts_of_decodable_list' into default_enable…
andy31415 Oct 28, 2024
adc8c1b
A few more renames
andy31415 Oct 28, 2024
7964207
Restyle
andy31415 Oct 28, 2024
14b5f30
Merge branch 'cleanup_event_logic' into default_enable_dm_provider
andy31415 Oct 28, 2024
2a75a2e
Use chip::app::IsSignedAttributeType
andy31415 Oct 28, 2024
1ac822c
Fix up put as well as naming for null value and comment
andy31415 Oct 28, 2024
469c65a
Fix up nullable tests
andy31415 Oct 28, 2024
f88b744
Test that you cannot decode a null value for non-nullable double and …
andy31415 Oct 28, 2024
e063fb2
Allow NAN for non-nullable floating points
andy31415 Oct 28, 2024
f5cf059
Add test case for non nullable bool
andy31415 Oct 28, 2024
ed35ddd
Restyle
andy31415 Oct 28, 2024
d460d5b
Merge branch 'post_merge_cleanup_36229_ember_buffer_encode' into defa…
andy31415 Oct 28, 2024
7ac4e4f
Add a header for efr32
andy31415 Oct 28, 2024
919a42e
Update src/app/codegen-data-model-provider/EmberAttributeDataBuffer.cpp
andy31415 Oct 28, 2024
b55d7ff
Update src/app/codegen-data-model-provider/EmberAttributeDataBuffer.cpp
andy31415 Oct 28, 2024
c1c607c
Remove extra comment
andy31415 Oct 28, 2024
cb63350
Replace switch with if
andy31415 Oct 28, 2024
d0e58ef
Comment fix
andy31415 Oct 28, 2024
a2e64ab
Merge branch 'post_merge_cleanup_36229_ember_buffer_encode' into defa…
andy31415 Oct 28, 2024
4a2aa86
Merge branch 'master' into default_enable_dm_provider
andy31415 Oct 28, 2024
3d364fa
Merge branch 'master' into post_merge_cleanup_36229_ember_buffer_encode
andy31415 Oct 28, 2024
5a2681f
Another try to make efr32 build of tests happy
andy31415 Oct 28, 2024
a0ec78b
Move includes around, to try to work around issues within efr32 compi…
andy31415 Oct 28, 2024
8276b4d
more updates, this time local efr32 compiles
andy31415 Oct 28, 2024
b43b80b
Merge branch 'post_merge_cleanup_36229_ember_buffer_encode' into defa…
andy31415 Oct 28, 2024
87a3f58
Remove lookup tables from ember attribute data buffer
andy31415 Oct 28, 2024
c015903
Merge branch 'even_smaller_ember_code' into default_enable_dm_provider
andy31415 Oct 28, 2024
f13aa6c
Merge branch 'master' into default_enable_dm_provider
andy31415 Oct 28, 2024
5e230fa
Merge branch 'master' into default_enable_dm_provider
andreilitvin Oct 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/examples-nxp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
run: |
scripts/run_in_build_env.sh "\
./scripts/build/build_examples.py \
--target nxp-k32w0-freertos-lighting-factory \
--target nxp-k32w0-freertos-lighting-factory-log-progress \
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
--target nxp-k32w0-freertos-contact-sensor-low-power-factory \
build \
--copy-artifacts-to out/artifacts \
Expand All @@ -79,7 +79,7 @@ jobs:
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nxp k32w0+release light \
out/artifacts/nxp-k32w0-freertos-lighting-factory/chip-k32w0x-light-example.elf \
out/artifacts/nxp-k32w0-freertos-lighting-factory-log-progress/chip-k32w0x-light-example.elf \
/tmp/bloat_reports/
- name: Get K32W0 contact sensor size stats
run: |
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ jobs:
--known-failure app/reporting/reporting.cpp \
--known-failure app/reporting/tests/MockReportScheduler.cpp \
--known-failure app/reporting/tests/MockReportScheduler.h \
--known-failure app/util/attribute-storage.cpp \
--known-failure app/util/attribute-storage-detail.h \
--known-failure app/util/attribute-storage.h \
--known-failure app/util/attribute-table.cpp \
--known-failure app/util/attribute-table-detail.h \
--known-failure app/util/attribute-table.h \
--known-failure app/util/binding-table.cpp \
Expand All @@ -118,9 +116,7 @@ jobs:
--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.cpp \
--known-failure app/util/ember-global-attribute-access-interface.h \
--known-failure app/util/ember-io-storage.cpp \
--known-failure app/util/ember-io-storage.h \
--known-failure app/util/endpoint-config-api.h \
--known-failure app/util/generic-callbacks.h \
Expand All @@ -135,7 +131,12 @@ jobs:
--known-failure platform/GLibTypeDeleter.h \
--known-failure platform/SingletonConfigurationManager.cpp \
"
# These ARE actually orphaned but due to dynamic-server we have code paths
# for them. Keeping them as a list as they still need review ...
# --known-failure app/util/attribute-table.cpp \
# --known-failure app/util/ember-io-storage.cpp \
# --known-failure app/util/ember-global-attribute-access-interface.cpp \
# --known-failure app/util/attribute-storage.cpp \
- name: Check for matter lint errors
if: always()
run: |
Expand Down Expand Up @@ -295,11 +296,13 @@ jobs:
':(exclude)examples/common/pigweed/rpc_services/Attributes.h' \
':(exclude)src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp' \
':(exclude)src/app/codegen-data-model-provider/tests/EmberReadWriteOverride.cpp' \
':(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' \
':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' \
&& exit 1 || exit 0
Expand Down
2 changes: 1 addition & 1 deletion build/chip/esp32/esp32_codegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ macro(chip_app_component_zapgen ZAP_NAME)

# 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 "disabled" CACHE STRING "Data model interface option to use: enabled or disabled")
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})
Expand Down
2 changes: 1 addition & 1 deletion config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ 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 "disabled" CACHE STRING "Data model interface option to use: enabled or disabled")
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)
Expand Down
2 changes: 1 addition & 1 deletion config/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ if (CONFIG_MBED_BSD_SOCKET_TRACE)
endif()

# Option can be set with `-DCHIP_DATA_MODEL_INTERFACE=enabled` or similar on the command line
set(CHIP_DATA_MODEL_INTERFACE "disabled" CACHE STRING "Data model interface option to use: enabled or disabled")
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 Down
1 change: 1 addition & 0 deletions config/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ config CHIP_BLE_ADVERTISING_DURATION

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
Expand Down
17 changes: 15 additions & 2 deletions src/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,17 @@ static_library("interaction-model") {

deps = [ "${chip_root}/src/app:events" ]

# Temporary dependency: codegen data provider instance should be provided
# by the application
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
deps += [ "${chip_root}/src/app/codegen-data-model-provider:instance-header" ]

public_deps = [
":app_config",
":command-handler-impl",
":constants",
":paths",
":subscription-info-provider",
"${chip_root}/src/app/MessageDef",
"${chip_root}/src/app/codegen-data-model-provider:instance-header",
"${chip_root}/src/app/data-model-provider",
"${chip_root}/src/app/icd/server:icd-server-config",
"${chip_root}/src/app/icd/server:manager",
Expand Down Expand Up @@ -291,13 +294,23 @@ static_library("interaction-model") {
"clusters/ota-provider/ota-provider.cpp",
"dynamic_server/AccessControl.cpp",
"dynamic_server/AccessControl.h",
]

# DynamicDispatcher is actually an ember-override that takes over
# util/attribute-storage.cpp and util/attribute-table.cpp functions.
#
# We likely should formalize and change this with a proper DataModel::Provider that
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
# is consistent instead
sources += [
"${chip_root}/src/app/util/ember-global-attribute-access-interface.cpp",
"${chip_root}/src/app/util/ember-io-storage.cpp",
"dynamic_server/DynamicDispatcher.cpp",
]

public_deps += [
":global-attributes",
"${chip_root}/src/access",
"${chip_root}/src/app/dynamic_server:mock-codegen-includes",
"${chip_root}/src/app/common:attribute-type",
]

public_configs += [ ":config-controller-dynamic-server" ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,16 @@ void Instance::HandleSetCookingParameters(HandlerContext & ctx, const Commands::

if (startAfterSetting.HasValue())
{
ConcreteCommandPath commandPath(mEndpointId, OperationalState::Id, OperationalState::Commands::Start::Id);

#if CHIP_CONFIG_USE_EMBER_DATA_MODEL
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
bool commandExists = ServerClusterCommandExists(commandPath) == Status::Success;
#else
bool commandExists =
InteractionModelEngine::GetInstance()->GetDataModelProvider()->GetAcceptedCommandInfo(commandPath).has_value();
#endif
VerifyOrExit(
ServerClusterCommandExists(
ConcreteCommandPath(mEndpointId, OperationalState::Id, OperationalState::Commands::Start::Id)) == Status::Success,
status = Status::InvalidCommand;
ChipLogError(
commandExists, status = Status::InvalidCommand; ChipLogError(
Zcl,
"Microwave Oven Control: Failed to set cooking parameters, Start command of operational state is not supported"));
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/common_flags.gni
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ declare_args() {
if (matter_enable_recommended && current_os == "linux") {
chip_use_data_model_interface = "check"
} else {
chip_use_data_model_interface = "disabled"
chip_use_data_model_interface = "enabled"
}

# Whether we call `chipDie` on DM `check` errors
Expand Down
64 changes: 64 additions & 0 deletions src/app/dynamic_server/DynamicDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
#include <app/WriteHandler.h>
#include <app/data-model/Decode.h>
#include <app/util/att-storage.h>
#include <app/util/attribute-table.h>
#include <app/util/endpoint-config-api.h>
#include <cstddef>
#include <lib/core/CHIPError.h>
#include <lib/core/DataModelTypes.h>
#include <lib/core/Optional.h>
Expand All @@ -57,6 +59,8 @@ namespace {
// AccessControl.cpp.
constexpr EndpointId kSupportedEndpoint = 0;

DataVersion gMockDataVersion = 0;

} // anonymous namespace

namespace chip {
Expand Down Expand Up @@ -381,3 +385,63 @@ const EmberAfCluster * emberAfFindServerCluster(EndpointId endpoint, ClusterId c

return nullptr;
}

unsigned emberAfMetadataStructureGeneration()
{
// DynamicDispatcher at this point hardcodes a single OTA provider cluster.
// The structure does not change over time, so the current version stays at 0.
return 0;
}

Protocols::InteractionModel::Status emberAfWriteAttribute(const ConcreteAttributePath & path, const EmberAfWriteDataInput & input)
{
return Protocols::InteractionModel::Status::UnsupportedAttribute;
}

Protocols::InteractionModel::Status emAfReadOrWriteAttribute(const EmberAfAttributeSearchRecord * attRecord,
const EmberAfAttributeMetadata ** metadata, uint8_t * buffer,
uint16_t readLength, bool write)
{
return Protocols::InteractionModel::Status::UnsupportedAttribute;
}

void emberAfAttributeChanged(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId,
AttributesChangedListener * listener)
{
gMockDataVersion++;
listener->MarkDirty(AttributePathParams(endpoint, clusterId, attributeId));
}

DataVersion * emberAfDataVersionStorage(const ConcreteClusterPath & aConcreteClusterPath)
{
return &gMockDataVersion;
}

Protocols::InteractionModel::Status emAfWriteAttributeExternal(const ConcreteAttributePath & path,
const EmberAfWriteDataInput & input)
{
return Protocols::InteractionModel::Status::UnsupportedAttribute;
}

Span<const EmberAfDeviceType> emberAfDeviceTypeListFromEndpointIndex(unsigned endpointIndex, CHIP_ERROR & err)
{
err = CHIP_ERROR_NOT_IMPLEMENTED;
return Span<const EmberAfDeviceType>();
}

const EmberAfCluster * emberAfFindClusterInType(const EmberAfEndpointType * endpointType, ClusterId clusterId,
EmberAfClusterMask mask, uint8_t * index)
{
if ((endpointType == &otaProviderEndpoint) && (clusterId == Clusters::OtaSoftwareUpdateProvider::Id))
{
return &otaProviderCluster;
}

return nullptr;
}

const EmberAfAttributeMetadata * emberAfLocateAttributeMetadata(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId)
{
// no known attributes even for OTA
return nullptr;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/app/icd/client/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ source_set("handler") {
]
public_deps = [
":manager",
"${chip_root}/src/app",
"${chip_root}/src/controller",
"${chip_root}/src/lib/core",
"${chip_root}/src/messaging",
Expand Down
4 changes: 4 additions & 0 deletions src/app/util/mock/include/zap-generated/endpoint_config.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/controller/java/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import("${chip_root}/build/chip/buildconfig_header.gni")
import("${chip_root}/build/chip/java/config.gni")
import("${chip_root}/build/chip/java/rules.gni")
import("${chip_root}/build/chip/tests.gni")
import("${chip_root}/src/app/codegen-data-model-provider/model.gni")
import("${chip_root}/src/app/common_flags.gni")
import("${chip_root}/src/platform/device.gni")

Expand Down Expand Up @@ -169,6 +170,15 @@ shared_library("jni") {
defines += [ "CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES=1" ]

deps += [ "${chip_root}/src/controller:nodatamodel" ]

# Temporary dependency: InteractionModelEngine NEEDS a codegen data model instance
# defined and application is supposed to provide it. This adds the sources
# in the same way "data_model" implementations do
#
# DynamicDispatcher in src/app:interaction-model implements the actual required
# ember callbacks in this case...
sources += codegen_data_model_SOURCES
public_deps = codegen_data_model_PUBLIC_DEPS
} else {
deps += [ "${chip_root}/src/controller/data_model" ]
}
Expand Down
9 changes: 9 additions & 0 deletions src/darwin/Framework/CHIP/ServerEndpoint/MTRIMDispatch.mm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId)
return Protocols::InteractionModel::Status::UnsupportedAttribute;
}

Protocols::InteractionModel::Status emberAfWriteAttribute(const ConcreteAttributePath & path, const EmberAfWriteDataInput & input)
{
assertChipStackLockedByCurrentThread();

// All of our attributes are handled via AttributeAccessInterface, so this
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
// should be unreached.
return Protocols::InteractionModel::Status::UnsupportedAttribute;
}

namespace chip {
namespace app {

Expand Down
Loading
Loading