BACnet.Protocol.Services.TimeSynchronization (bacstack v0.1.0-dev.1)

Copy Markdown View Source

This module represents the BACnet Time Synchronization service.

The Time Synchronization service is used to send the correct local date and time onto the BACnet network or to a single recipient.

Service Description (ASHRAE 135)

The TimeSynchronization service is used by a requesting BACnet-user to notify a remote device of the correct current time. This service may be broadcast, multicast, or addressed to a single recipient. Its purpose is to notify recipients of the correct current time so that devices may synchronize their internal clocks with one another.

Service Procedure (ASHRAE 135)

Since this is an unconfirmed service, no response primitives are expected. A device receiving a TimeSynchronization service indication shall update its local representation of time. This change shall be reflected in the Local_Time and Local_Date properties of the Device object. No restrictions on the use of this service exist when it is invoked at the request of an operator. Otherwise, the use of this service is controlled by the value of the Time_Synchronization_Recipients property in the Device object. When the Time_Synchronization_Recipients list is of length zero, a device may not automatically send a TimeSynchronization request. When Time_Synchronization_Recipients list is of length one or more, a device may automatically send a TimeSynchronization request but only to the devices or addresses contained in the Time_Synchronization_Recipients list.

Summary

Types

t()

Parameters for the Time Synchronization service (unconfirmed).

Functions

Whether the service is of type confirmed or unconfirmed.

Converts the given Unconfirmed Service Request into an TimeSynchronization Service.

Get the service name atom.

Get the Unconfirmed Service request for the given TimeSynchronization Service.

Types

t()

@type t() :: %BACnet.Protocol.Services.TimeSynchronization{
  date: BACnet.Protocol.BACnetDate.t(),
  time: BACnet.Protocol.BACnetTime.t()
}

Parameters for the Time Synchronization service (unconfirmed).

Distributes the current local date and time to one or more devices so they can synchronize their internal clocks. See also UTCTimeSynchronization for UTC-based sync.

Functions

confirmed?()

@spec confirmed?() :: false

Whether the service is of type confirmed or unconfirmed.

from_apdu(request)

@spec from_apdu(BACnet.Protocol.APDU.UnconfirmedServiceRequest.t()) ::
  {:ok, t()} | {:error, term()}

Converts the given Unconfirmed Service Request into an TimeSynchronization Service.

See the BACnet.Protocol.Services.Protocol function documentation for more information.

get_name()

@spec get_name() :: atom()

Get the service name atom.

to_apdu(service, request_data)

@spec to_apdu(t(), Keyword.t()) ::
  {:ok, BACnet.Protocol.APDU.UnconfirmedServiceRequest.t()} | {:error, term()}

Get the Unconfirmed Service request for the given TimeSynchronization Service.

See the BACnet.Protocol.Services.Protocol function documentation for more information.