Skip to content

OcaSensor#

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

Abstract base class for all sensor classes.


Overview#

Class Declaration#

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

    // Control Methods
    // Calls GetReadingState and calls on_result or on_failure
    void GetReadingState(auto on_result, failure_callback on_failure);

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

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

Methods#

GetReadingState#

void GetReadingState(auto on_result, failure_callback on_failure)

Calls the method GetReadingState in the remote device.

Parameters:#

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

observeReadingState#

subscription observeReadingState(auto callback, failure_callback on_failure)

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

Parameters:#

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

OnReadingStateChanged#

subscription OnReadingStateChanged(auto callback, failure_callback on_failure)

Parameters#

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