Clock Capability Interface

The Clock capability comprises the mechanics that enable a device to synchronize its local clock with AIA.

It defines messages on the directive and event topics.

Getting Started

AIA Envelope

This capability interface is compatible with v1 of the AIA envelope.

Topic Management

To support Clock 1.0 messages, the device must participate in the directive and event topics.

Capability Assertion

To use the Clock 1.0 interface, the device must assert support through the Publish message on the capabilities topic.

Sample Object

{
  "type": "AisInterface",
  "interface": "Clock",
  "version": "1.0"
}

directive Topic

SetClock

The SetClock directive instructs the device to set its local clock to the specified time.

The directive may be sent

  • after the device first establishes a connection to AIA and sends a Publish message that asserts support for the Clock interface;
  • after the device reconnects to AIA when there has been some period of disconnectivity;
  • alongside other time-sensitive directives, such as SetAlert;
  • periodically to mitigate clock drift; and
  • in response to the device's explicit request for synchronization via the SynchronizeClock event

Sample Message

{
  "header": {
    "name": "SetClock",
    "messageId": "{{STRING}}"
  },
  "payload": {
    "currentTime": {{LONG}}
  }
}

Payload Parameters

Field Name Description Value Type
currentTime The UTC time in seconds since NTP Epoch to which the device should set its local clock.

Note: NTP Epoch is 1990-01-01 00:00:00, which differs from Unix Epoch (1970-01-01 00:00:00).
long

event Topic

SynchronizeClock

The device may send the SynchronizeClock event to AIA under any circumstances where the device may have experienced clock drift or ensuring synchronization would be valuable.

AIA will respond with the SetClock directive.

Sample Message

{
  "header": {
    "name": "SynchronizeClock",
    "messageId": "{{STRING}}"
  }
}

Note: There is no payload object in this event.