@@ -56,15 +56,15 @@ class Delegate
56
56
*
57
57
* @param timeZoneList new time zone list
58
58
*/
59
- virtual void TimeZoneListChanged (const Span<TimeSyncDataProvider::TimeZoneStore> timeZoneList) = 0;
59
+ virtual void TimeZoneListChanged (const Span<TimeSyncDataProvider::TimeZoneStore> timeZoneList) {}
60
60
/* *
61
61
* @brief Give the delegate the chance to call SetDSTOffset on the TimeSynchronizationServer with a list of
62
62
* DST offsets based on the provided time zone name. If the delegate does so, it should return true.
63
63
* If the delegate does not want to set DST offsets based on the time zone, it should return false.
64
64
*
65
65
* @param name name of active time zone
66
66
*/
67
- virtual bool HandleUpdateDSTOffset (const CharSpan name) = 0;
67
+ virtual bool HandleUpdateDSTOffset (const CharSpan name) { return false ; }
68
68
/* *
69
69
* @brief Returns true if the provided string is a valid NTP address (either domain name or IPv6 address).
70
70
*
@@ -104,12 +104,26 @@ class Delegate
104
104
* a CHIP_ERROR.
105
105
*/
106
106
virtual CHIP_ERROR UpdateTimeUsingNTPFallback (const CharSpan & fallbackNTP,
107
- chip::Callback::Callback<OnFallbackNTPCompletion> * callback) = 0;
107
+ chip::Callback::Callback<OnFallbackNTPCompletion> * callback)
108
+ {
109
+ return CHIP_ERROR_NOT_IMPLEMENTED;
110
+ }
108
111
109
112
/* *
110
- * @brief Signals application that UTCTime has changed through the timesync cluster.
113
+ * @brief Signals application that UTCTime has changed through the timesync cluster. This gets called when
114
+ * time is available for the first time or is updated. Therefore, @param time will always have a valid value.
115
+ * The negative case of time being unavailable is handled by NotifyTimeFailure().
116
+ */
117
+ virtual void UTCTimeAvailabilityChanged (uint64_t time) {}
118
+ /* *
119
+ * @brief Signals application that a new trusted time source is available. The application can then decide
120
+ * if it wants to attempt to query for time from this source.
121
+ */
122
+ virtual void TrustedTimeSourceAvailabilityChanged (bool available, GranularityEnum granularity) {}
123
+ /* *
124
+ * @brief Signals application that fetching time has failed. The reason is not relevant.
111
125
*/
112
- virtual void UTCTimeAvailabilityChanged ( uint64_t time) = 0;
126
+ virtual void NotifyTimeFailure () {}
113
127
114
128
virtual ~Delegate () = default ;
115
129
0 commit comments