Skip to content

OcaCounterNotifier#

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

Notifier for an OCA counter. Observes the value of the counter and emits a CounterUpdate notification when specified criteria are met.

An OCA counter wishing to notify controllers of its changing value can designate one or more notifier objects to which the controllers may subscribe. See the definition of the OcaCounter datatype for additional detail. Notification criteria are as follows:

Threshold. The counter value meets a certain comparison condition. A selection of comparison operators is available. The Operator property is the comparison operator to use for Threshold., Period. The value of the Period parameter, if nonzero, is a the time interval for the recurrent timed emission of CounterUpdate events. Such events are emitted regardless of the counter's value., CountIncrement. An CounterUpdate event is emitted every time the counter value changes by an amount equal to or greater than the value of this parameter.

For combinations of (1), (2), and (3), the criteria are applied as follows:

if (1) is specified and not satisfied, then no observation is emitted. else if (2) is specified and satisfied or (3) is specified and satisfied, then an observation is emitted. end end

Regardless of filter parameter values, a notification is always emitted when a counter is explicitly reset using a Reset() method.

An OcaCounterNotifier instance and the counter it observes are bound at the time the OcaCounterNotifier instance is constructed. For static devices, construction will occur during manufacture, or possibly during a subsequent hardware configuration step. For reconfigurable devices, construction might be done by online controllers as part of device configuration activity.


Overview#

Class Declaration#

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

    // Control Methods
    // Calls GetLastUpdate and calls on_result or on_failure
    void GetLastUpdate(auto on_result, failure_callback on_failure);
    // Calls GetFilterParameters and calls on_result or on_failure
    void GetFilterParameters(auto on_result, failure_callback on_failure);
    // Calls SetFilterParameters and calls on_result or on_failure
    void SetFilterParameters(OcaCounterNotifierFilterParameters Parameters, auto on_result, failure_callback on_failure);
    // Calls SetFilterParameters and does not wait for the response
    void SetFilterParameters(OcaCounterNotifierFilterParameters Parameters);

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

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

Methods#

GetLastUpdate#

void GetLastUpdate(auto on_result, failure_callback on_failure)

Calls the method GetLastUpdate in the remote device.

Parameters:#

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

GetFilterParameters#

void GetFilterParameters(auto on_result, failure_callback on_failure)

Calls the method GetFilterParameters in the remote device.

Parameters:#

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

SetFilterParameters#

void SetFilterParameters(OcaCounterNotifierFilterParameters Parameters, auto on_result, failure_callback on_failure)

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

Parameters:#

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

observeFilterParameters#

subscription observeFilterParameters(auto callback, failure_callback on_failure)

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

Parameters:#

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

OnFilterParametersChanged#

subscription OnFilterParametersChanged(auto callback, failure_callback on_failure)

Parameters#

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