Commit 2fd49164 authored by Peter Waher's avatar Peter Waher

Clock synchronization

parent efef6ccc
......@@ -51,13 +51,13 @@ Examples
A simple clock synchronization request can look as follows:
<iq type='get' id='3' from='client@server1/resource' to='source@server2/resource'>
<clock xmlns='urn:ieee:iot:synchronization:1.0'>2018-07-01T12:31:07.1627163Z</clock>
<req xmlns='urn:ieee:iot:synchronization:1.0'/>
</iq>
The source responds:
<iq id='3' type='result' to='client@server1/resource' from='source@server2/resource'>
<clock xmlns='urn:ieee:iot:synchronization:1.0'>2018-07-01T12:31:07.2642974Z</clock>
<resp xmlns='urn:ieee:iot:synchronization:1.0' hf='79528' freq='2630640'>2018-07-02T09:47:38.5102314Z</resp>
</iq>
**Note**: The `xs:dateTime` data type allows for arbitrary resoulution of the seconds part. In this example, a resolution of 100 ns has been used,
......@@ -70,11 +70,11 @@ conforming to the capabilities of systems having an on-board high-resolution clo
An entity can ask another entity what clock source it uses:
<iq id='4' type='get' to='client@server1/resource' from='client@server2/resource'>
<source xmlns='urn:ieee:iot:synchronization:1.0'/>
<sourceReq xmlns='urn:ieee:iot:synchronization:1.0'/>
</iq>
If the entity is synchronizing its clock with an external clock source, it responds:
<iq type='result' id='4' to='client@sever2/resource' from='client@server1/resource'>
<source xmlns='urn:ieee:iot:synchronization:1.0'>source@server2/resource</source>
<sourceResp xmlns='urn:ieee:iot:synchronization:1.0'>source@server2/resource</source>
</iq>
......@@ -59,17 +59,55 @@ IEEE standards must not be utilized for any conformance/compliance
purposes.
-->
<xs:element name='clock' type='xs:dateTime'>
<xs:element name='req'>
<xs:annotation>
<xs:documentation>Element used to synchronize clocks.</xs:documentation>
<xs:documentation>Used in both iq get and result stanzas.</xs:documentation>
<xs:documentation>Element used to request clock information.</xs:documentation>
<xs:documentation>Used in an iq get stanza.</xs:documentation>
</xs:annotation>
<xs:complexType>
</xs:complexType>
</xs:element>
<xs:element name='source' type='xs:string'>
<xs:element name='resp'>
<xs:annotation>
<xs:documentation>Element used for clock information responses.</xs:documentation>
<xs:documentation>Used in a iq result stanza.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base='xs:dateTime'>
<xs:annotation>
<xs:documentation>Use as high a precision as possible for the fractions of a second portion.</xs:documentation>
</xs:annotation>
<xs:attribute name='hf' type='xs:long' use='optional'>
<xs:annotation>
<xs:documentation>Allows the clock source to provide information from an internal high-resolution timer.</xs:documentation>
<xs:documentation>The ticks are relative to some unspecified reference point that might change every time the source is restarted.</xs:documentation>
<xs:documentation>High-resolution timing is not used for synchronizing timestamps, but to synchronize events in time, where knowledge about absolute time is not important.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name='freq' type='xs:long' use='optional'>
<xs:annotation>
<xs:documentation>Number of incerments of the hf attribute, if provided, per second.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name='sourceReq'>
<xs:annotation>
<xs:documentation>Element used to query about what clock source is used.</xs:documentation>
<xs:documentation>Used as empty element in iq get stanzas, and with Bare JD of cloc source as a value in result stanzas.</xs:documentation>
<xs:documentation>Used in an iq get stanza.</xs:documentation>
</xs:annotation>
<xs:complexType>
</xs:complexType>
</xs:element>
<xs:element name='sourceResp' type='xs:string'>
<xs:annotation>
<xs:documentation>Used in an iq result stanza containing the Bare JiD of clock source.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment