OceanDirectLighthouseC++ 3.1.3
OceanDirect Lighthouse C++/C API
oceandirect::api::LightSourceAPI Class Reference

#include <LightSourceAPI.h>

Public Member Functions

 LightSourceAPI ()
 
virtual ~LightSourceAPI ()
 
virtual int getCount (long deviceID, int *errorCode)
 
virtual bool getLampStrobeEnable (long deviceID, int *errorCode)
 
virtual bool hasEnable (long deviceID, int *errorCode, int lightSourceIndex)
 
virtual bool isEnabled (long deviceID, int *errorCode, int lightSourceIndex)
 
virtual void setEnable (long deviceID, int *errorCode, int lightSourceIndex, bool enable)
 
virtual void setLampStrobeEnable (long deviceID, int *errorCode, bool strobeEnable)
 

Static Public Member Functions

static LightSourceAPIgetInstance ()
 
static void shutdown ()
 

Static Protected Attributes

static LightSourceAPIinstance
 

Constructor & Destructor Documentation

◆ LightSourceAPI()

oceandirect::api::LightSourceAPI::LightSourceAPI ( )

◆ ~LightSourceAPI()

virtual oceandirect::api::LightSourceAPI::~LightSourceAPI ( )
virtual

Member Function Documentation

◆ getCount()

virtual int oceandirect::api::LightSourceAPI::getCount ( long deviceID,
int * errorCode )
virtual

Gets the number of light sources that are connected to the given device. Such light sources could be individual LEDs, light bulbs, lasers, etc. Each of these light sources may have different capabilities, such as programmable intensities and enables, which should be queried before they are used.

Parameters
deviceIDthe device ID for the device to be queried (from OceanDirect::findDevices())
errorCodeset to 0 if successful, an OceanDirect error code (nonzero) otherwise
Returns
number of light sources connected to the given device

◆ getInstance()

static LightSourceAPI * oceandirect::api::LightSourceAPI::getInstance ( )
static

◆ getLampStrobeEnable()

virtual bool oceandirect::api::LightSourceAPI::getLampStrobeEnable ( long deviceID,
int * errorCode )
virtual

Get strobe enable.

See also
setLampStrobeEnable()
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found.
Returns
true if strobe is enabled, false otherwise.

◆ hasEnable()

virtual bool oceandirect::api::LightSourceAPI::hasEnable ( long deviceID,
int * errorCode,
int lightSourceIndex )
virtual

Determine if the specified light source has enable/disable functionality.

Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found.
lightSourceIndexthe index of the specified light source.
Returns
true if the light source has enable/disable capability, false otherwise.

◆ isEnabled()

virtual bool oceandirect::api::LightSourceAPI::isEnabled ( long deviceID,
int * errorCode,
int lightSourceIndex )
virtual

Determine if the specified light source is enabled or disabled.

See also
setEnable()
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found.
lightSourceIndexthe index of the specified light source.
Returns
true if the light source is enabled, false if the light source is disabled.

◆ setEnable()

virtual void oceandirect::api::LightSourceAPI::setEnable ( long deviceID,
int * errorCode,
int lightSourceIndex,
bool enable )
virtual

Set the specified light source to enabled or disabled.

See also
isEnabled()
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found.
lightSourceIndexthe index of the specified light source.
enabletrue to enable the light source, false to disable the light source.

◆ setLampStrobeEnable()

virtual void oceandirect::api::LightSourceAPI::setLampStrobeEnable ( long deviceID,
int * errorCode,
bool strobeEnable )
virtual

Set strobe enable.

See also
getLampStrobeEnable()
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found.
strobeEnabletrue to set strobe enable, false to disable.

◆ shutdown()

static void oceandirect::api::LightSourceAPI::shutdown ( )
static

Member Data Documentation

◆ instance

LightSourceAPI* oceandirect::api::LightSourceAPI::instance
staticprotected

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