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

Implement the codegen-data-model Write support #34139

Merged
merged 98 commits into from
Jul 5, 2024

Conversation

andy31415
Copy link
Contributor

@andy31415 andy31415 commented Jun 28, 2024

This implements the write support via ember/attribute-access-interface. Generally the equivalent that today exists in ember-compatibility-functions.

image

Copy link

github-actions bot commented Jul 5, 2024

PR #34139: Size comparison from e8bc7e7 to 08c4fbd

Full report (85 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section e8bc7e7 08c4fbd change % change
bl602 lighting-app bl602 FLASH 1271026 1271026 0 0.0
RAM 95328 95328 0 0.0
bl602+mfd FLASH 1285284 1285284 0 0.0
RAM 95472 95472 0 0.0
bl602+rpc FLASH 1309986 1309986 0 0.0
RAM 103752 103752 0 0.0
bl702 lighting-app bl702 FLASH 1091924 1091924 0 0.0
RAM 15265 15265 0 0.0
bl702+mfd FLASH 1102618 1102618 0 0.0
RAM 15417 15417 0 0.0
bl702+rpc FLASH 1181734 1181734 0 0.0
RAM 24285 24285 0 0.0
bl706-eth FLASH 875196 875196 0 0.0
RAM 27376 27376 0 0.0
bl706-wifi FLASH 1127270 1127270 0 0.0
RAM 14709 14709 0 0.0
bl702l lighting-app bl702l FLASH 1078806 1078806 0 0.0
RAM 21836 21836 0 0.0
bl702l+mfd FLASH 1090068 1090068 0 0.0
RAM 21996 21996 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 797084 797084 0 0.0
RAM 106636 106636 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 816000 816000 0 0.0
RAM 116956 116956 0 0.0
lock-mtd LP_EM_CC1354P10_6 FLASH 807452 807452 0 0.0
RAM 111236 111236 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 760308 760308 0 0.0
RAM 105336 105336 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 746036 746036 0 0.0
RAM 105576 105576 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 605706 605706 0 0.0
RAM 204508 204508 0 0.0
lock CC3235SF_LAUNCHXL FLASH 650734 650734 0 0.0
RAM 204780 204780 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 666225 666225 0 0.0
RAM 75100 75100 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 686077 686077 0 0.0
RAM 77732 77732 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 686077 686077 0 0.0
RAM 77732 77732 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 643013 643013 0 0.0
RAM 70168 70168 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 608745 608745 0 0.0
RAM 70804 70804 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 628389 628389 0 0.0
RAM 73348 73348 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 628389 628389 0 0.0
RAM 73348 73348 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 624273 624273 0 0.0
RAM 73820 73820 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 643989 643989 0 0.0
RAM 76364 76364 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 643989 643989 0 0.0
RAM 76364 76364 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 592845 592845 0 0.0
RAM 67788 67788 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 612689 612689 0 0.0
RAM 70428 70428 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 612689 612689 0 0.0
RAM 70428 70428 0 0.0
efr32 lighting-app BRD4187C FLASH 923312 923312 0 0.0
RAM 134984 134984 0 0.0
lock-app BRD4338a FLASH 733068 733068 0 0.0
RAM 207996 207996 0 0.0
window-app BRD4187C FLASH 1012016 1012016 0 0.0
RAM 129620 129620 0 0.0
esp32 all-clusters-app c3devkit DRAM 88332 88332 0 0.0
FLASH 1467674 1467672 -2 -0.0
IRAM 75570 75570 0 0.0
m5stack DRAM 114868 114868 0 0.0
FLASH 1536675 1536675 0 0.0
IRAM 125403 125403 0 0.0
linux air-purifier-app debug unknown 4592 4592 0 0.0
FLASH 2529008 2529008 0 0.0
RAM 125072 125072 0 0.0
all-clusters-app debug unknown 5368 5368 0 0.0
FLASH 5582574 5582574 0 0.0
RAM 488144 488144 0 0.0
all-clusters-minimal-app debug unknown 5288 5288 0 0.0
FLASH 5052856 5052856 0 0.0
RAM 232992 232992 0 0.0
bridge-app debug unknown 5256 5256 0 0.0
FLASH 4477208 4477208 0 0.0
RAM 212744 212744 0 0.0
chip-tool debug unknown 5728 5728 0 0.0
FLASH 11713207 11713207 0 0.0
RAM 543386 543386 0 0.0
chip-tool-ipv6only arm64 unknown 20008 20008 0 0.0
FLASH 10829612 10829612 0 0.0
RAM 592192 592192 0 0.0
fabric-admin debug unknown 5616 5616 0 0.0
FLASH 10797431 10797431 0 0.0
RAM 540226 540226 0 0.0
fabric-bridge-app debug unknown 4528 4528 0 0.0
FLASH 4242760 4242760 0 0.0
RAM 198808 198808 0 0.0
lighting-app debug+rpc+ui unknown 5936 5936 0 0.0
FLASH 5372450 5372450 0 0.0
RAM 221600 221600 0 0.0
lock-app debug unknown 5192 5192 0 0.0
FLASH 4540776 4540776 0 0.0
RAM 200240 200240 0 0.0
ota-provider-app debug unknown 4576 4576 0 0.0
FLASH 4196616 4196616 0 0.0
RAM 194520 194520 0 0.0
ota-requestor-app debug unknown 4512 4512 0 0.0
FLASH 4322152 4322152 0 0.0
RAM 199176 199176 0 0.0
shell debug unknown 4112 4112 0 0.0
FLASH 2795981 2795981 0 0.0
RAM 150504 150504 0 0.0
thermostat-no-ble arm64 unknown 9144 9144 0 0.0
FLASH 4167132 4167132 0 0.0
RAM 235640 235640 0 0.0
tv-app debug unknown 5472 5472 0 0.0
FLASH 5604696 5604696 0 0.0
RAM 341760 341760 0 0.0
tv-casting-app debug unknown 5096 5096 0 0.0
FLASH 9882974 9882974 0 0.0
RAM 400816 400816 0 0.0
mbed lock-app-release cy8cproto_062_4343w FLASH 1502292 1502292 0 0.0
RAM 226640 226640 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 881364 881364 0 0.0
RAM 139573 139573 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 951880 951880 0 0.0
RAM 138001 138001 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 826896 826896 0 0.0
RAM 138487 138487 0 0.0
nxp contact k32w0+release FLASH 575916 575916 0 0.0
RAM 70004 70004 0 0.0
k32w1+release FLASH 591144 591144 0 0.0
RAM 74056 74056 0 0.0
light k32w0+release FLASH 610016 610016 0 0.0
RAM 69480 69480 0 0.0
k32w1+release FLASH 674728 674728 0 0.0
RAM 82816 82816 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1613700 1613700 0 0.0
RAM 207148 207148 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1534468 1534468 0 0.0
RAM 204036 204036 0 0.0
light cy8ckit_062s2_43012 FLASH 1460972 1460972 0 0.0
RAM 197308 197308 0 0.0
lock cy8ckit_062s2_43012 FLASH 1462828 1462828 0 0.0
RAM 224380 224380 0 0.0
qpg lighting-app qpg6105+debug FLASH 651052 651052 0 0.0
RAM 104560 104560 0 0.0
lock-app qpg6105+debug FLASH 611168 611168 0 0.0
RAM 99228 99228 0 0.0
stm32 light STM32WB5MM-DK FLASH 472440 472440 0 0.0
RAM 141660 141660 0 0.0
telink air-quality-sensor-app tlsr9528a_retention FLASH 632486 632484 -2 -0.0
RAM 50424 50424 0 0.0
all-clusters-app tlsr9118bdk40d FLASH 657232 657230 -2 -0.0
RAM 145760 145760 0 0.0
all-clusters-minimal-app tlsr9528a FLASH 777548 777546 -2 -0.0
RAM 110580 110580 0 0.0
bridge-app tlsr9258a FLASH 675472 675470 -2 -0.0
RAM 95200 95200 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 634070 634068 -2 -0.0
RAM 50468 50468 0 0.0
light-switch-app-ota-shell-factory-data tlsr9528a FLASH 719860 719858 -2 -0.0
RAM 77044 77044 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 612288 612286 -2 -0.0
RAM 142000 142000 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 800074 800072 -2 -0.0
RAM 100404 100404 0 0.0
lock-app-dfu tlsr9528a FLASH 665634 665632 -2 -0.0
RAM 69756 69756 0 0.0
ota-requestor-app tlsr9258a FLASH 694802 694800 -2 -0.0
RAM 94924 94924 0 0.0
pump-app tlsr9518adk80d FLASH 616334 616332 -2 -0.0
RAM 56848 56848 0 0.0
pump-controller-app tlsr9518adk80d FLASH 606718 606716 -2 -0.0
RAM 56648 56648 0 0.0
shell tlsr9518adk80d FLASH 466150 466150 0 0.0
RAM 72460 72460 0 0.0
smoke_co_alarm-app tlsr9528a_retention FLASH 640684 640682 -2 -0.0
RAM 52096 52096 0 0.0
temperature-measurement-app-mars-ota tlsr9518adk80d FLASH 650544 650542 -2 -0.0
RAM 60284 60284 0 0.0
thermostat tlsr9518adk80d FLASH 625608 625606 -2 -0.0
RAM 56980 56980 0 0.0
window-covering tlsr9118bdk40d FLASH 518834 518832 -2 -0.0
RAM 97696 97696 0 0.0
tizen all-clusters-app arm unknown 1584 1584 0 0.0
FLASH 1633868 1633868 0 0.0
RAM 46004 46004 0 0.0
chip-tool-ubsan arm unknown 2384 2384 0 0.0
FLASH 16153886 16153886 0 0.0
RAM 7097212 7097212 0 0.0

@mergify mergify bot merged commit fec6c7e into project-chip:master Jul 5, 2024
68 checks passed
austina-csa pushed a commit to austina-csa/connectedhomeip that referenced this pull request Jul 10, 2024
* Initial copy/merge of the codegendatamodel::write support

* Restyle

* Remove the error translation for ACL checks for attribute writes

* Comment correction after special access error code guarantees were removed

* Set the namespace for DataModel to resolve nameclash for android builds

* Restyle

* Some changes to make darwin builds happy

* Do not clang-tidy on CodegenDataModel_Write

* Update src/app/codegen-data-model/CodegenDataModel_Write.cpp

Co-authored-by: Tennessee Carmel-Veilleux <[email protected]>

* Update src/app/codegen-data-model/CodegenDataModel_Write.cpp

Co-authored-by: Tennessee Carmel-Veilleux <[email protected]>

* Update src/app/codegen-data-model/CodegenDataModel_Write.cpp

Co-authored-by: Tennessee Carmel-Veilleux <[email protected]>

* Use little endian encoding for pascal long strings, since this is what ember-strings uses

* Restyle

* Fix code to compile and pass tests

* Code review comments

* Comment update

* Update based on code review feedback

* Wrong condition. Fixed

* Return invalid value to match ember-compatibility-functions

* switch invalid data point to constraint error for return codes

* Fix code review comments: comments and return unsupportedaccess

* Remove useless comment - error check should be clear enough

* Comment update

* Re-arrange code for read only and timed

* Re-format the read only checks a bit

* Use CHIP_ERROR_NOT_FOUND

* Separate out variable names

* Slight updated code layout

* Updated return value for chip error

* Updated test to verifyordie instead of just logging errors

* Update src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp

Co-authored-by: Tennessee Carmel-Veilleux <[email protected]>

* Update based on review feedback

* Fix endianess and copying in test code

* Restyle

* Updated comment

* Update src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp

Co-authored-by: Tennessee Carmel-Veilleux <[email protected]>

* Add unit test for "lowest signed value write"

* Restyle

* A constraint error update and better tests for AAI returning errors

* One more test for invalid ember usage

* Restyle

* more tests for more coverage

* Comment update

* Fix comment

* One more test for more coverage

* Also cover writing non-null value to nullable attribute

* Fix the ember string usage

* Update src/app/codegen-data-model/CodegenDataModel_Read.cpp

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

* Update src/app/codegen-data-model/CodegenDataModel_Read.cpp

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

* Remove duplicate code

* Update src/app/codegen-data-model/CodegenDataModel_Write.cpp

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

* Remove chip::app:: prefix in unit test since we have a top level using

* Fix copy & paste encode to decode

* Replace decoded with converted

* Update src/app/codegen-data-model/CodegenDataModel_Write.cpp

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

* Start using Failure for invalid data type instead of unsupported read. I do not expect this code path to actually be hit much

* Fix comments

* Updated encode/decode comment

* Use failure instead of constraint error

* Update src/app/codegen-data-model/CodegenDataModel_Write.cpp

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

* Update src/app/codegen-data-model/CodegenDataModel_Write.cpp

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

* Update src/app/codegen-data-model/CodegenDataModel_Write.cpp

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

* Use dataversion mismatch for write without a version

* Add extra IsGlobalAttribute check

* use external writes for the ember write logic, so that we have extra size and validations

* Updated comments

* more comments

* Restyle

* Use emberAfWriteAttribute

* Add comment about ember-string

* Restyle

* Add context to unit tests, make write do the marking of dirty paths

* Add some unit tests for dirty path handling

* Move the change callback around a bit

* Restyle

* Fixed unit tests to support size checks

* Add unit test for invalid data

* Restyle

* Fix linter errors

* Update to make size enforcement and guarantees clearer

* use size_t for getlength sizes

* Review comments and updated code to compile for android

* make datamodel unambiguous

* More fixes for clang compilation for DataModel scoping

* Restyle

* Try to make darwin compiler happy ... ssize_t vs size_t

* Fix typo

* Restyle

* Code review updates

* Undo submodule update

---------

Co-authored-by: Andrei Litvin <[email protected]>
Co-authored-by: Tennessee Carmel-Veilleux <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants