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

Add Matter framework API for converting data-value dictionaries into strongly typed structs #26305

Closed
bzbarsky-apple opened this issue Apr 28, 2023 · 2 comments · Fixed by #26321
Assignees

Comments

@bzbarsky-apple
Copy link
Contributor

The idea would be to allow consumers to try using the Matter framework to convert to a strongly typed thing, and then if we don't have the schema for it fall back on their own processing.

@bzbarsky-apple bzbarsky-apple self-assigned this Apr 28, 2023
@bzbarsky-apple
Copy link
Contributor Author

bzbarsky-apple commented Apr 28, 2023

Implementation plan, courtesy of @jtung-apple:

  1. Use MTREncodeTLVFromDataValueDictionary to convert the dictionary to TLV.
  2. Use our existing "parse it from TLV" code for attributes and events.

@bzbarsky-apple
Copy link
Contributor Author

And for command payloads, need to think a bit about what we do.

bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue May 1, 2023
This adds a way to initialize an MTRAttributeReport or MTREventReport from a
response-value dictionary, if we have known schema for the attribute/event path.

Fixes project-chip#26305
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue May 2, 2023
This adds a way to initialize an MTRAttributeReport or MTREventReport from a
response-value dictionary, if we have known schema for the attribute/event path.

Fixes project-chip#26305
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue May 3, 2023
This adds a way to initialize an MTRAttributeReport or MTREventReport from a
response-value dictionary, if we have known schema for the attribute/event path.

Fixes project-chip#26305
bzbarsky-apple added a commit that referenced this issue May 9, 2023
…26321)

* Add methods for doing schema-checks on response-value dictionaries.

This adds a way to initialize an MTRAttributeReport or MTREventReport from a
response-value dictionary, if we have known schema for the attribute/event path.

Fixes #26305

* Address review comment.

* Address review comment.

* Stop requiring a fixed-size up-front allocation for our attribute value.

* Improve comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant