Skip to content

OcaDeviceTimeManager#

This document describes the controller implementation of OcaDeviceTimeManager. This class is documented in the AES70 standard as:

Manager that allows controlling and monitoring a device's time-of-day clock, and that collects the device's time source objects. Must be instantiated in every device that has more than one time source object. In this context, a "time source object" is an instance of OcaTimeSource or a subclass of it., May be instantiated at most once in any device., If instantiated, object number must be 10.

Note: The clock value is accessible via Get and Set methods, but has not been defined as a public property because its value is volatile and should not cause property-change events.

The current value of the OcaTimeSource object designated by the CurrentDeviceTimeSource property of this Manager is known as the Device Time.

The property TimeSources was added in version 2 of this class.


Overview#

Class Declaration#

namespace aes70::controller
{
  class OcaDeviceTimeManager : public OcaManager
  {
  public:
    OcaDeviceTimeManager(std::shared_ptr<connection> connection,
            uin32_t object_number);
    OcaDeviceTimeManager(const OcaDeviceTimeManager &o);

    // Control Methods
    // Calls GetDeviceTimeNTP and calls on_result or on_failure
    void GetDeviceTimeNTP(auto on_result, failure_callback on_failure);
    // Calls SetDeviceTimeNTP and calls on_result or on_failure
    void SetDeviceTimeNTP(OcaTimeNTP DeviceTime, auto on_result, failure_callback on_failure);
    // Calls SetDeviceTimeNTP and does not wait for the response
    void SetDeviceTimeNTP(OcaTimeNTP DeviceTime);
    // Calls GetTimeSources and calls on_result or on_failure
    void GetTimeSources(auto on_result, failure_callback on_failure);
    // Calls GetCurrentDeviceTimeSource and calls on_result or on_failure
    void GetCurrentDeviceTimeSource(auto on_result, failure_callback on_failure);
    // Calls SetCurrentDeviceTimeSource and calls on_result or on_failure
    void SetCurrentDeviceTimeSource(OcaONo TimeSourceONo, auto on_result, failure_callback on_failure);
    // Calls SetCurrentDeviceTimeSource and does not wait for the response
    void SetCurrentDeviceTimeSource(OcaONo TimeSourceONo);
    // Calls GetDeviceTime and calls on_result or on_failure
    void GetDeviceTime(auto on_result, failure_callback on_failure);
    // Calls SetDeviceTime and calls on_result or on_failure
    void SetDeviceTime(OcaTime DeviceTime, auto on_result, failure_callback on_failure);
    // Calls SetDeviceTime and does not wait for the response
    void SetDeviceTime(OcaTime DeviceTime);

    // Observing Properties
    subscription observeTimeSources(auto callback, failure_callback on_failure);
    subscription observeCurrentDeviceTimeSource(auto callback, failure_callback on_failure);

    // Property Changed Subscriptions
    subscription OnTimeSourcesChanged(auto callback, failure_callback on_failure);
    subscription OnCurrentDeviceTimeSourceChanged(auto callback, failure_callback on_failure);
  };
}

Methods#

GetDeviceTimeNTP#

void GetDeviceTimeNTP(auto on_result, failure_callback on_failure)

Calls the method GetDeviceTimeNTP in the remote device.

Parameters:#

  • auto on_result: A callable (e.g. a lambda) with the following arguments:
    • OcaTimeNTP DeviceTime
  • failure_callback on_failure: A callback which is called on error.

SetDeviceTimeNTP#

void SetDeviceTimeNTP(OcaTimeNTP DeviceTime, auto on_result, failure_callback on_failure)

Calls the method SetDeviceTimeNTP in the remote device. If no result and error callback is specified, the method will be called without requesting a response.

Parameters:#

  • OcaTimeNTP DeviceTime
  • auto on_result: A callable (e.g. a lambda) with 0 arguments.
  • failure_callback on_failure: A callback which is called on error.

GetTimeSources#

void GetTimeSources(auto on_result, failure_callback on_failure)

Calls the method GetTimeSources in the remote device.

Parameters:#

  • auto on_result: A callable (e.g. a lambda) with the following arguments:
    • OcaList<OcaONo> TimeSourceONos
  • failure_callback on_failure: A callback which is called on error.

GetCurrentDeviceTimeSource#

void GetCurrentDeviceTimeSource(auto on_result, failure_callback on_failure)

Calls the method GetCurrentDeviceTimeSource in the remote device.

Parameters:#

  • auto on_result: A callable (e.g. a lambda) with the following arguments:
    • OcaONo TimeSourceONo
  • failure_callback on_failure: A callback which is called on error.

SetCurrentDeviceTimeSource#

void SetCurrentDeviceTimeSource(OcaONo TimeSourceONo, auto on_result, failure_callback on_failure)

Calls the method SetCurrentDeviceTimeSource in the remote device. If no result and error callback is specified, the method will be called without requesting a response.

Parameters:#

  • OcaONo TimeSourceONo
  • auto on_result: A callable (e.g. a lambda) with 0 arguments.
  • failure_callback on_failure: A callback which is called on error.

GetDeviceTime#

void GetDeviceTime(auto on_result, failure_callback on_failure)

Calls the method GetDeviceTime in the remote device.

Parameters:#

  • auto on_result: A callable (e.g. a lambda) with the following arguments:
    • OcaTime DeviceTime
  • failure_callback on_failure: A callback which is called on error.

SetDeviceTime#

void SetDeviceTime(OcaTime DeviceTime, auto on_result, failure_callback on_failure)

Calls the method SetDeviceTime in the remote device. If no result and error callback is specified, the method will be called without requesting a response.

Parameters:#

  • OcaTime DeviceTime
  • auto on_result: A callable (e.g. a lambda) with 0 arguments.
  • failure_callback on_failure: A callback which is called on error.

observeTimeSources#

subscription observeTimeSources(auto callback, failure_callback on_failure)

Fetches the remote property TimeSources and subscribes for modifications. The callback is called with the initial values of TimeSources and whenever it changes.

Parameters:#

  • auto callback: A callable (e.g. a lambda) with one argument: OcaList<OcaONo> TimeSources
  • failure_callback on_failure: A callback which is called on error.

observeCurrentDeviceTimeSource#

subscription observeCurrentDeviceTimeSource(auto callback, failure_callback on_failure)

Fetches the remote property CurrentDeviceTimeSource and subscribes for modifications. The callback is called with the initial values of CurrentDeviceTimeSource and whenever it changes.

Parameters:#

  • auto callback: A callable (e.g. a lambda) with one argument: OcaONo CurrentDeviceTimeSource
  • failure_callback on_failure: A callback which is called on error.

OnTimeSourcesChanged#

subscription OnTimeSourcesChanged(auto callback, failure_callback on_failure)

Parameters#

  • auto callback: A callable (e.g. a lambda) with one argument: OcaList<OcaONo> TimeSources
  • failure_callback on_failure: A callback which is called on error.

OnCurrentDeviceTimeSourceChanged#

subscription OnCurrentDeviceTimeSourceChanged(auto callback, failure_callback on_failure)

Parameters#

  • auto callback: A callable (e.g. a lambda) with one argument: OcaONo CurrentDeviceTimeSource
  • failure_callback on_failure: A callback which is called on error.