-
Notifications
You must be signed in to change notification settings - Fork 2k
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
dynamic endpoints: add automatic attr storage, instantiation from ZAP templates #28372
base: master
Are you sure you want to change the base?
Commits on Oct 25, 2024
-
[attribute storage] add automatic attribute storage for dynamic endpo…
…ints Dynamically defined endpoints can now have their own block of storage (to be provided by the caller of emberAfSetDynamicEndpoint()). If no storage is set for a dynamic endpoint, it behaves exactly as before, which is treating all attributes as "external", regardless of the respective bit in the attribute's metadata. With a storage provided, attributes behave the same way as static endpoint's do, that is, only those marked "external" need to be handled programmatically in the respective callbacks, other attributes' storage is automatic.
Configuration menu - View commit details
-
Copy full SHA for 044ecd9 - Browse repository at this point
Copy the full SHA 044ecd9View commit details -
[attribute storage] allow setting up dynamic endpoints from templates
Instead of re-creating dynamic endpoint's cluster declarations using the DECLARE_DYNAMIC_xxx macros, the new `setupDynamicEndpointDeclaration()` function allows setting up a dynamic endpoint by using clusters defined in another endpoint as templates. Usually that is a disabled endpoint created in ZAP with all possibly dynamically used clusters assigned. In combination with dynamic endpoint attribute storage, this greatly simplifies implementing dynamic endpoints and allows configuring them using the ZAP tool to ensure specs conformance, much the same way as with statically defined endpoints.
Configuration menu - View commit details
-
Copy full SHA for fc210b5 - Browse repository at this point
Copy the full SHA fc210b5View commit details -
Configuration menu - View commit details
-
Copy full SHA for a7aec68 - Browse repository at this point
Copy the full SHA a7aec68View commit details -
Configuration menu - View commit details
-
Copy full SHA for 995f04b - Browse repository at this point
Copy the full SHA 995f04bView commit details -
[attribute storage] template cluster specification now includes mask...
...to allow differentiating server and client sides of the same cluster type
Configuration menu - View commit details
-
Copy full SHA for a2486e9 - Browse repository at this point
Copy the full SHA a2486e9View commit details -
[attribute storage] dynamic attribute storage is now passed as Span...
to allow checking that it has sufficient size
Configuration menu - View commit details
-
Copy full SHA for de5bf7c - Browse repository at this point
Copy the full SHA de5bf7cView commit details -
[attribute storage] apply suggestion from PR review
more readable attributeLocation calculation, remove unneeded ugly C cast
Configuration menu - View commit details
-
Copy full SHA for 42bd306 - Browse repository at this point
Copy the full SHA 42bd306View commit details -
[attribute storage] BUILD.gn: apply suggestions from PR review
- af-types needs platform/CHIPDeviceConfig.h for CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT - reflect this in BUILD.gn by adding the platform_config_header sourceset as dependency - remove unneeded comment lines in agreement with original author
Configuration menu - View commit details
-
Copy full SHA for b868ea6 - Browse repository at this point
Copy the full SHA b868ea6View commit details -
[attribute storage] apply help and review suggestions
- check passed in endpointType is explicitly "empty" (zeroed out) - use CanCastTo instead of literally testing against 255 - return appropriate errors - only return completely set-up or untouched endpointType - no const cast needed
Configuration menu - View commit details
-
Copy full SHA for 6478bb5 - Browse repository at this point
Copy the full SHA 6478bb5View commit details -
[attribute storage] revert attempt to use constexpr to skip compiling…
… code Turns out that while this works well on current compilers, it does not with many embedded toolchains. - idea was that an if testing an always false constexpr bool should skip *compiling* its body. - we need that because that body refers to a struct field that is non-existing in the case when the if condition is constexpr false - note that we can't use a real >=C++17 constexpr if, because in the CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT>0 case, the condition cannot be a constexpr Bottom line: there seems no way around the uglier #ifdef around the `else if` clause. We can avoid an #ifdef in the middle of a condition expression.
Configuration menu - View commit details
-
Copy full SHA for 7560590 - Browse repository at this point
Copy the full SHA 7560590View commit details -
[attribute storage] avoid problems with summing up size in restricted…
… int size result on some platforms - took the chance to add safe error exit on excessive cumulative cluster storage size. - using `typeof()` and `CanCastTo` throughout to make code independent of struct field sizes.
Configuration menu - View commit details
-
Copy full SHA for 287b7d8 - Browse repository at this point
Copy the full SHA 287b7d8View commit details
Commits on Oct 28, 2024
-
[attribute storage] apply comment clarification from PR review
Co-authored-by: Andrei Litvin <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fd5b66c - Browse repository at this point
Copy the full SHA fd5b66cView commit details