nx_server_plugin_sdk 1.0 Server Plugin SDK

Public Member Functions | List of all members
nxcip::CameraRelayIOManager Class Referenceabstract

Relay input/output management. More...

`#include <camera_plugin.h>`

Inheritance diagram for nxcip::CameraRelayIOManager:

## Public Member Functions
virtual int | getRelayOutputList (char **idList, int *idNum) const =0
| Returns list of IDs of available relay output ports. More...
virtual int | getInputPortList (char **idList, int *idNum) const =0
| Returns list of IDs of available relay input ports. More...
virtual int | setRelayOutputState (const char *outputId, int activate, unsigned int autoResetTimeoutMS)=0
| Change state of relay output port. More...
virtual int | startInputPortMonitoring ()=0
| Starts relay input monitoring or increments internal counter, if already started. More...
virtual void | stopInputPortMonitoring ()=0
| Stops input port monitoring if internal monitoring counter has reached zero. More...
virtual void | registerEventHandler (CameraInputEventHandler *handler)=0
| Registers handler as event receiver. More...
virtual void | unregisterEventHandler (CameraInputEventHandler *handler)=0
| Removes handler from event receiver list. More...
virtual void | getLastErrorString (char *errorString) const =0
| Returns text description of last error. More...
Public Member Functions inherited from nxpl::PluginInterface
virtual void * | queryInterface (const nxpl::NX_GUID &interfaceID)=0
| Cast to type, specified by interfaceID. More...
virtual int | addRef () const =0
| Increment reference counter. More...
virtual int | releaseRef () const =0
| Decrement reference counter. More...

## Detailed Description

Relay input/output management.

It is implementation defined within which thread event (nxcip::CameraInputEventHandler::inputPortStateChanged) will be delivered to

## Member Function Documentation

## ◆ getInputPortList()

virtual int nxcip::CameraRelayIOManager::getInputPortList | ( | char ** | idList,
|  | int * | idNum
| ) |  | const
| pure virtual

Returns list of IDs of available relay input ports.

Parameters

  [out] | idList | Array of size MAX_RELAY_PORT_COUNT of MAX_ID_LEN - length strings. All strings MUST be NULL-terminated
  [out] | idNum | Size of returned id list

Returns
  0 on success, otherwise - error code

Implemented in AxisRelayIOManager.

## ◆ getLastErrorString()

virtual void nxcip::CameraRelayIOManager::getLastErrorString | ( | char * | errorString | ) | const
| pure virtual

Returns text description of last error.

Parameters

  [out] | errorString | Buffer of size MAX_TEXT_LEN

Implemented in AxisRelayIOManager.

## ◆ getRelayOutputList()

virtual int nxcip::CameraRelayIOManager::getRelayOutputList | ( | char ** | idList,
|  | int * | idNum
| ) |  | const
| pure virtual

Returns list of IDs of available relay output ports.

Parameters

  [out] | idList | Array of size MAX_RELAY_PORT_COUNT of MAX_ID_LEN - length strings. All strings MUST be NULL-terminated
  [out] | idNum | Size of returned id list

Returns
  0 on success, otherwise - error code

Implemented in AxisRelayIOManager.

## ◆ registerEventHandler()

virtual void nxcip::CameraRelayIOManager::registerEventHandler | ( | CameraInputEventHandler * | handler | ) |
| pure virtual

Registers handler as event receiver.

Usually, events are delivered (by handler->inputPortStateChanged call) to some plugin internal thread

Note
  Does not call handler->addRef

Implemented in AxisRelayIOManager.

## ◆ setRelayOutputState()

virtual int nxcip::CameraRelayIOManager::setRelayOutputState | ( | const char * | outputId,
|  | int | activate,
|  | unsigned int | autoResetTimeoutMS
| ) |  |
| pure virtual

Change state of relay output port.

Parameters

  [in] | outputId | NULL-terminated ID of output port
  [in] | activate | If non-zero, port should be activated (closed circuit), otherwise - deactivated (opened circuit)
  [in] | autoResetTimeoutMS | If non-zero, port MUST return to deactivated state in autoResetTimeoutMS millis

Returns
  0 on success, otherwise - error code

Implemented in AxisRelayIOManager.

## ◆ startInputPortMonitoring()

virtual int nxcip::CameraRelayIOManager::startInputPortMonitoring | ( |  | ) |
| pure virtual

Starts relay input monitoring or increments internal counter, if already started.

Returns
  0 on success (or input is already monitored), otherwise - error code

Note
  Multiple startInputPortMonitoring() require multiple stopInputPortMonitoring() call. E.g., if input is already monitored, increases internal counter

Implemented in AxisRelayIOManager.

## ◆ stopInputPortMonitoring()

virtual void nxcip::CameraRelayIOManager::stopInputPortMonitoring | ( |  | ) |
| pure virtual

Stops input port monitoring if internal monitoring counter has reached zero.

Implementation MUST guarantee:

- no CameraInputEventHandler::inputPortStateChanged method MUST be called after this method have returned
- if CameraInputEventHandler::inputPortStateChanged is currently running in different thread, this method MUST block until CameraInputEventHandler::inputPortStateChanged has returned
  Note
    Multiple startInputPortMonitoring() require multiple stopInputPortMonitoring() call.

Implemented in AxisRelayIOManager.

## ◆ unregisterEventHandler()

virtual void nxcip::CameraRelayIOManager::unregisterEventHandler | ( | CameraInputEventHandler * | handler | ) |
| pure virtual

Removes handler from event receiver list.

If handler is not registered, nothing is done Implementation MUST guarantee:

- no handler->inputPortStateChanged method MUST be called after this method have returned
- if handler->inputPortStateChanged is currently running in different thread, this method MUST block until handler->inputPortStateChanged has returned

Note
  handler->releaseRef() is not called in this method

Implemented in AxisRelayIOManager.

The documentation for this class was generated from the following file:

- src/camera/camera_plugin.h