Skip to content

Commit

Permalink
updated time-synchronization cluster definition based on PR project-c…
Browse files Browse the repository at this point in the history
  • Loading branch information
fessehaeve committed Apr 28, 2023
1 parent 77d72a8 commit 2602c09
Showing 1 changed file with 75 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,43 @@ limitations under the License.

<enum name="GranularityEnum" type="ENUM8">
<cluster code="0x0038"/>
<item name="NoTimeGranularity" value="0x00"/>
<item name="MinutesGranularity" value="0x01"/>
<item name="SecondsGranularity" value="0x02"/>
<item name="MillisecondsGranularity" value="0x03"/>
<item name="MicrosecondsGranularity" value="0x04"/>
<item name="NoTimeGranularity" value="0x00"/>
<item name="MinutesGranularity" value="0x01"/>
<item name="SecondsGranularity" value="0x02"/>
<item name="MillisecondsGranularity" value="0x03"/>
<item name="MicrosecondsGranularity" value="0x04"/>
</enum>

<enum name="TimeSourceEnum" type="ENUM8">
<cluster code="0x0038"/>
<item name="None" value="0x00"/>
<item name="Unknown" value="0x01"/>
<item name="Admin" value="0x02"/>
<item name="NodeTimeCluster" value="0x03"/>
<item name="NonFabricSntp" value="0x04"/>
<item name="NonFabricNtp" value="0x05"/>
<item name="FabricSntp" value="0x06"/>
<item name="FabricNtp" value="0x07"/>
<item name="MixedNtp" value="0x08"/>
<item name="NonFabricSntpNts" value="0x09"/>
<item name="NonFabricNtpNts" value="0x0A"/>
<item name="FabricSntpNts" value="0x0B"/>
<item name="FabricNtpNts" value="0x0C"/>
<item name="MixedNtpNts" value="0x0D"/>
<item name="CloudSource" value="0x0E"/>
<item name="Ptp" value="0x0F"/>
<item name="Gnss" value="0x10"/>
<item name="None" value="0x00"/>
<item name="Unknown" value="0x01"/>
<item name="Admin" value="0x02"/>
<item name="NodeTimeCluster" value="0x03"/>
<item name="NonMatterSntp" value="0x04"/>
<item name="NonMatterNtp" value="0x05"/>
<item name="MatterSntp" value="0x06"/>
<item name="MatterNtp" value="0x07"/>
<item name="MixedNtp" value="0x08"/>
<item name="NonMatterSntpNts" value="0x09"/>
<item name="NonMatterNtpNts" value="0x0A"/>
<item name="MatterSntpNts" value="0x0B"/>
<item name="MatterNtpNts" value="0x0C"/>
<item name="MixedNtpNts" value="0x0D"/>
<item name="CloudSource" value="0x0E"/>
<item name="Ptp" value="0x0F"/>
<item name="Gnss" value="0x10"/>
</enum>

<struct name="TrustedTimeSourceStruct">
<cluster code="0x0038"/>
<item fieldId="0" name="FabricID" type="FABRIC_ID"/>
<item fieldId="1" name="NodeID" type="node_id"/>
</struct>

<struct name="TimeZoneStruct">
<cluster code="0x0038"/>
<item fieldId="0" name="Offset" type="INT32S"/>
<item fieldId="0" name="Offset" type="INT32S" min="-43200" max="50400"/>
<item fieldId="1" name="ValidAt" type="epoch_us"/>
<item fieldId="2" name="Name" type="CHAR_STRING" length="64" optional="true"/>
</struct>
Expand All @@ -68,42 +74,64 @@ limitations under the License.
<define>TIME_SYNCHRONIZATION_CLUSTER</define>
<client init="false" tick="false">true</client>
<server init="false" tick="false">true</server>
<description>Accurate time is required for a number of reasons, including scheduling, display and validating
security materials.</description>
<description>Accurate time is required for a number of reasons, including scheduling, display and validating security materials.</description>
<!-- Base data types -->
<attribute side="server" code="0x0000" define="UTC_TIME" type="epoch_us" isNullable="true" optional="false">UTCTime</attribute>
<attribute side="server" code="0x0001" define="GRANULARITY" type="GranularityEnum" default="0x00" optional="false">Granularity</attribute>
<attribute side="server" code="0x0002" define="TIME_SOURCE" type="TimeSourceEnum" default="0x00" optional="true">TimeSource</attribute>
<attribute side="server" code="0x0003" define="TRUSTED_TIME_NODE_ID" type="node_id" writable="true" isNullable="true" optional="false">
<description>TrustedTimeNodeId</description>
<access op="read" privilege="view"/>
<access op="write" privilege="administer"/>
</attribute>
<attribute side="server" code="0x0003" define="TRUSTED_TIME_SOURCE" type="ARRAY" entryType="TrustedTimeSourceStruct" max="1" isNullable="true" optional="false">TrustedTimeSource</attribute>
<attribute side="server" code="0x0004" define="DEFAULT_NTP" type="CHAR_STRING" length="128" writable="true" isNullable="true" optional="true">
<description>DefaultNtp</description>
<access op="read" privilege="view"/>
<access op="write" privilege="administer"/>
</attribute>
<description>DefaultNtp</description>
<access op="read" privilege="view"/>
<access op="write" privilege="administer"/>
</attribute>
<attribute side="server" code="0x0005" define="TIME_ZONE" type="ARRAY" entryType="TimeZoneStruct" min="1" max="2" writable="true" optional="true">
<description>TimeZone</description>
<access op="read" privilege="view"/>
<access op="write" privilege="manage"/>
<description>TimeZone</description>
<access op="read" privilege="view"/>
<access op="write" privilege="manage"/>
</attribute>
<attribute side="server" code="0x0006" define="DST_OFFSET" type="ARRAY" entryType="DSTOffsetStruct" max="20" writable="true" optional="true">
<description>DSTOffset</description>
<access op="read" privilege="view"/>
<access op="write" privilege="manage"/>
</attribute>
<description>DSTOffset</description>
<access op="read" privilege="view"/>
<access op="write" privilege="manage"/>
</attribute>
<attribute side="server" code="0x0007" define="LOCAL_TIME" type="epoch_us" default="0x00" isNullable="true" optional="true">LocalTime</attribute>
<attribute side="server" code="0x0008" define="TIME_ZONE_DATABASE" type="boolean" default="0" optional="true">TimeZoneDatabase</attribute>
<attribute side="server" code="0x0009" define="NTP_SERVER_PORT" type="INT16U" isNullable="true" optional="true">NtpServerPort</attribute>

<!-- Test Commands -->
<command source="client" code="0x00" name="SetUtcTime" optional="false">
<description>Upon receipt of this command, the server MAY update its UTCTime Attribute to match the time specified in the command</description>
<arg name="UtcTime" type="epoch_us"/>
<arg name="Granularity" type="GranularityEnum"/>
<arg name="TimeSource" type="TimeSourceEnum" optional="true"/>
</command>
<description>This command MAY be issued by Administrator to set the time.</description>
<arg name="UtcTime" type="epoch_us"/>
<arg name="Granularity" type="GranularityEnum"/>
<arg name="TimeSource" type="TimeSourceEnum" optional="true"/>
</command>

<command source="client" code="0x01" name="SetTrustedTimeSource" optional="false">
<description>This command SHALL set the TrustedTimeSource.</description>
<arg name="NodeID" type="node_id"/>
</command>

<event code="0x0000" name="DSTTableEmpty" priority="info" side="server" optional="true">
<description>This event SHALL be generated when the server stops applying the current DSTOffset and there are no entries in the list with a larger ValidStarting time.</description>
</event>

<event code="0x0001" name="DSTStatus" priority="info" side="server" optional="true">
<description>This event SHALL be generated when the server starts or stops applying a DST offset.</description>
</event>

<event code="0x0002" name="TimeZoneStatus" priority="info" side="server" optional="true">
<description>This event SHALL be generated when the server changes its time zone offset or name.</description>
<field id="0" name="Offset" type="INT32S"/>
<field id="1" name="Name" type="CHAR_STRING" length="64"/>
</event>

<event code="0x0003" name="TimeFailure" priority="info" side="server" optional="false">
<description>This event SHALL be generated if the node has attempted to update its time, but was unable to find a good time from any source.</description>
</event>

<event code="0x0004" name="MissingTrustedTimeSource" priority="info" side="server" optional="false">
<description>This event SHALL be generated if the node attempts to update its time and finds that the TrustedTimeSource is null, or the specified peer cannot be reached.</description>
</event>

</cluster>
</configurator>

0 comments on commit 2602c09

Please sign in to comment.