Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
time synchronization cluster (#26082)
* update time sync cluster XML based on updated spec added attribute access interface handled attributes GNSS Co-authored-by: Boris Zbarsky <[email protected]> TrustedTimeSource is optional with TSC feature Co-authored-by: Boris Zbarsky <[email protected]> SetUTCTime Co-authored-by: Boris Zbarsky <[email protected]> SetTrustedTimeSource is optional Co-authored-by: Boris Zbarsky <[email protected]> UTCTime Co-authored-by: Boris Zbarsky <[email protected]> TimeZoneDatabase default 2 (None) MissingTrustedTimeSource is optional regenerate code update default values * update time sync cluster XML based on updated spec * added attribute access interface handled attributes * GNSS Co-authored-by: Boris Zbarsky <[email protected]> * TrustedTimeSource is optional with TSC feature Co-authored-by: Boris Zbarsky <[email protected]> * SetUTCTime Co-authored-by: Boris Zbarsky <[email protected]> * SetTrustedTimeSource is optional Co-authored-by: Boris Zbarsky <[email protected]> * UTCTime Co-authored-by: Boris Zbarsky <[email protected]> * TimeZoneDatabase default 2 (None) MissingTrustedTimeSource is optional * regenerate code * update default values * updated time-synchronization cluster definition based on PR #6352 add Time Synchronization cluster in all-clusters-app, controller-app and light-switch-app zap and regenerate all remove constraint from a single element attribute first code commit initialize timezone and trustedtimesource to 0 and null added statuscode and changed to fabricIndex regenerate zap use time sync server code set default zap setting to external for complex time sync attributes add endpoint to trustedtimesourcestruct and set command for it regenerate using updated trustedtimesourcestruct update time sync xml definition update zap files regenerate added persistent data provider for time sync cluster added new commands based on PR #6353 added test template for TimeSyncDataProvider changed command arguments to list type regenerate update SetTrustedTimeSource definition regenerate use consistent data types of attributes user CHIP_CONFIG to set size of lists clean up read handler adde TSC feature and change attribute ids include time sync related resource for build regenerate after changing attribute ids and adding time sync client feature reorganize code and implement defaultNTP handlers handle span data the right way improved overall implementation change default time zone list size to 1 made settrustedtimesource command to be fabric scoped update time sync cluster definition based on latest PR merges regenerate and changes related to attribute names and access setdefaultntp parameter is nullable implemented setdefaultntp changed the id of settimezoneresponse command to the current in spec removed curly brace that sneaked in to previous commits ValidUntil of DSTOffsetStruct is nullable added basic rules of operation in comment/psuedo-code added DSTOffsetActive predicate for DSTStatus event fixed clang compiler errors added skeleton delegate implementation for time sync use delegate placeholder and implemented events clean up usage of namespaces seems like unused code skleton verifiers for NTP address moved init from header removed conflicting generated files regenerate all enum now starts at 0, name field is optional in timezonestatus event force external storage for UTCTime and LocalTime attributes moved time sync cluster code to cpp file added mechanism to track real size of list data removed custom encoder for TimeZone attribute changed TimeZone list size to 2 for better testing behavior addressed multiple PR comments improved defaultNTP implementation and storage usage cleaned up return usage changed time logic to be able to set older time but not old than default LastKnownTime ignore attribute storage values for sizes with F quality resolve rebase conflicts some random generated code that needs to be there use consistent data types changes based on CI failures TrustedTimeSource is not a list fixed response behavior of setttimezone command missed generated code * added SupportsDNSResolve attribute and corrected featuremap value * code improvements * truncate span size to actual data when retreiving defaultNTP wrote test for time sync persistent storage * bring back section removed by rebase Signed-off-by: Fesseha <[email protected]> * fix CI error do not use 'else' after 'return' * updated descriptor cluster test to include time sync server * added mechanisms to get local time and set utc time from application * regenerate after merge to master and fix missed server implementation reference * added CI test for time sync cluster * improved time zone and dst offset attributes validation, skeleton functions for validating and purging time zone and dst offset, made dst offset list size to 2 for testing purposes * logic to purge expired time zone and dst offset * set default value for time zone attribute * use AttributeAccessInterface for Granularity attribute * UTCTime is in chipepoch and not unixepoch * localtime should be null if dstoffset is empty * regen after merge to master * update feature map attribute name validate offset in timezone bring back merge removed code in CHIPConfig.h * use static_cast instead * cast the whole thing since the operator is causing int usage * timezone always has a default UTC zone * improved handling of setting empty lists * run restyler * update external hanlded attributes in ZAP files * update tests and remove dstoffset sorting on server side * update yaml test and generate code fix type error * use TLV size estimator * addressed a bunch of PR comments * declare attributes handled by AAI * Update src/app/clusters/time-synchronization-server/TimeSyncDataProvider.cpp Co-authored-by: Boris Zbarsky <[email protected]> * added mechanism to better track when events shall be emitted * address PR comments Co-authored-by: Boris Zbarsky <[email protected]> * typo changes * Revert parts of "address PR comments" This reverts commit e2a2f10. * clean up time sync persistent storage interface * error if list sizes are not correct * addressed PR comments * rename default delegate implementation * few more improvements based on PR comments * changed time zone stuct, improved tests, fixed local time calculation overflow and more PR comments fix * restyle, use DSTOffsetobj with size element, improved error response in few instances, and some more minor tweaks * replace list with span, not sure if it is needed * update dstoffset NL test * cleaned up for loop indexes, catch dst validUntil expiring, nullable localtime, generate dst table empty event correctly * disabled darwin time sync SDK test * change indexer to size_t type * validate NTP addresses in default delegate and few more improvements Co-authored-by: C Freeman <[email protected]> * fixed few overflow potentials, lots of minor improvements * fix uninitialized corner case and update NL tests * apply restyle patch * another restyle patch * return tz and dst lists by reference, fixed based on TC_TIMESYNC results * apply restyler patch * fix readability-else-after-return * kickout all DST items if they are all in the past * use const and reference whenever possible --------- Signed-off-by: Fesseha <[email protected]> Co-authored-by: Boris Zbarsky <[email protected]> Co-authored-by: C Freeman <[email protected]>
- Loading branch information