Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the codegen-data-model Write support (#34139)
* 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 <tennessee.carmelveilleux@gmail.com> * Update src/app/codegen-data-model/CodegenDataModel_Write.cpp Co-authored-by: Tennessee Carmel-Veilleux <tennessee.carmelveilleux@gmail.com> * Update src/app/codegen-data-model/CodegenDataModel_Write.cpp Co-authored-by: Tennessee Carmel-Veilleux <tennessee.carmelveilleux@gmail.com> * 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 <tennessee.carmelveilleux@gmail.com> * 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 <tennessee.carmelveilleux@gmail.com> * 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 <bzbarsky@apple.com> * Update src/app/codegen-data-model/CodegenDataModel_Read.cpp Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * Remove duplicate code * Update src/app/codegen-data-model/CodegenDataModel_Write.cpp Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * 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 <bzbarsky@apple.com> * 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 <bzbarsky@apple.com> * Update src/app/codegen-data-model/CodegenDataModel_Write.cpp Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * Update src/app/codegen-data-model/CodegenDataModel_Write.cpp Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * 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 <andreilitvin@google.com> Co-authored-by: Tennessee Carmel-Veilleux <tennessee.carmelveilleux@gmail.com> Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
- Loading branch information