nx_cloud_storage_sdk  1.0
Cloud Storage 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:
nxpl::PluginInterface

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]idListArray of size MAX_RELAY_PORT_COUNT of MAX_ID_LEN - length strings. All strings MUST be NULL-terminated
[out]idNumSize of returned id list
Returns
0 on success, otherwise - error code

◆ getLastErrorString()

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

Returns text description of last error.

Parameters
[out]errorStringBuffer of size MAX_TEXT_LEN

◆ getRelayOutputList()

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

Returns list of IDs of available relay output ports.

Parameters
[out]idListArray of size MAX_RELAY_PORT_COUNT of MAX_ID_LEN - length strings. All strings MUST be NULL-terminated
[out]idNumSize of returned id list
Returns
0 on success, otherwise - error code

◆ 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

◆ setRelayOutputState()

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

Change state of relay output port.

Parameters
[in]outputIDNULL-terminated ID of output port
[in]activateIf non-zero, port should be activated (closed circuit), otherwise - deactivated (opened circuit)
[in]autoResetTimeoutMSIf non-zero, port MUST return to deactivated state in autoResetTimeoutMS millis
Returns
0 on success, otherwise - error code

◆ 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

◆ stopInputPortMonitoring()

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

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

Implementation MUST guarantee:

◆ 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

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