SeaBreeze
Public Member Functions | Static Public Member Functions
SeaBreezeAPI Class Reference

This is an interface to SeaBreeze that allows the user to connect to devices over USB and other buses. This is intended as a usable and extensible API. More...

#include <SeaBreezeAPI.h>

Collaboration diagram for SeaBreezeAPI:
Collaboration graph

Public Member Functions

int probeDevices ()
 
int addTCPIPv4DeviceLocation (char *deviceTypeName, char *ipAddr, int port)
 
int addRS232DeviceLocation (char *deviceTypeName, char *deviceBusPath, unsigned int baud)
 
int getNumberOfDeviceIDs ()
 
int getDeviceIDs (long *ids, unsigned long maxLength)
 
int openDevice (long id, int *errorCode)
 
void closeDevice (long id, int *errorCode)
 
int getDeviceType (long id, int *errorCode, char *buffer, unsigned int length)
 
unsigned char getDeviceEndpoint (long id, int *error_code, usbEndpointType endpointType)
 
int getNumberOfRawUSBBusAccessFeatures (long deviceID, int *errorCode)
 
int getRawUSBBusAccessFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
int rawUSBBusAccessRead (long deviceID, long featureID, int *errorCode, unsigned char *buffer, unsigned int bufferLength, unsigned char endpoint)
 
int rawUSBBusAccessWrite (long deviceID, long featureID, int *errorCode, unsigned char *buffer, unsigned int bufferLength, unsigned char endpoint)
 
int getNumberOfSerialNumberFeatures (long deviceID, int *errorCode)
 
int getSerialNumberFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
int getSerialNumber (long deviceID, long featureID, int *errorCode, char *buffer, int bufferLength)
 
unsigned char getSerialNumberMaximumLength (long deviceID, long featureID, int *errorCode)
 
int getNumberOfSpectrometerFeatures (long id, int *errorCode)
 
int getSpectrometerFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
void spectrometerSetTriggerMode (long deviceID, long spectrometerFeatureID, int *errorCode, int mode)
 
void spectrometerSetIntegrationTimeMicros (long deviceID, long spectrometerFeatureID, int *errorCode, unsigned long integrationTimeMicros)
 
unsigned long spectrometerGetMinimumIntegrationTimeMicros (long deviceID, long spectrometerFeatureID, int *errorCode)
 
unsigned long spectrometerGetMaximumIntegrationTimeMicros (long deviceID, long spectrometerFeatureID, int *errorCode)
 
double spectrometerGetMaximumIntensity (long deviceID, long spectrometerFeatureID, int *errorCode)
 
int spectrometerGetUnformattedSpectrumLength (long deviceID, long spectrometerFeatureID, int *errorCode)
 
int spectrometerGetUnformattedSpectrum (long deviceID, long spectrometerFeatureID, int *errorCode, unsigned char *buffer, int bufferLength)
 
int spectrometerGetFormattedSpectrumLength (long deviceID, long spectrometerFeatureID, int *errorCode)
 
int spectrometerGetFormattedSpectrum (long deviceID, long spectrometerFeatureID, int *errorCode, double *buffer, int bufferLength)
 
int spectrometerGetWavelengths (long deviceID, long spectrometerFeatureID, int *errorCode, double *wavelengths, int length)
 
int spectrometerGetElectricDarkPixelCount (long deviceID, long spectrometerFeatureID, int *errorCode)
 
int spectrometerGetElectricDarkPixelIndices (long deviceID, long spectrometerFeatureID, int *errorCode, int *indices, int length)
 
int getNumberOfPixelBinningFeatures (long id, int *errorCode)
 
int getPixelBinningFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
void binningSetPixelBinningFactor (long deviceID, long spectrometerFeatureID, int *errorCode, const unsigned char binningFactor)
 
unsigned char binningGetPixelBinningFactor (long deviceID, long spectrometerFeatureID, int *errorCode)
 
void binningSetDefaultPixelBinningFactor (long deviceID, long spectrometerFeatureID, int *errorCode, const unsigned char binningFactor)
 
void binningSetDefaultPixelBinningFactor (long deviceID, long spectrometerFeatureID, int *errorCode)
 
unsigned char binningGetDefaultPixelBinningFactor (long deviceID, long spectrometerFeatureID, int *errorCode)
 
unsigned char binningGetMaxPixelBinningFactor (long deviceID, long spectrometerFeatureID, int *errorCode)
 
int getNumberOfThermoElectricFeatures (long deviceID, int *errorCode)
 
int getThermoElectricFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
double tecReadTemperatureDegreesC (long deviceID, long featureID, int *errorCode)
 
void tecSetTemperatureSetpointDegreesC (long deviceID, long featureID, int *errorCode, double temperatureDegreesCelsius)
 
void tecSetEnable (long deviceID, long featureID, int *errorCode, unsigned char tecEnable)
 
int getNumberOfIrradCalFeatures (long deviceID, int *errorCode)
 
int getIrradCalFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
int irradCalibrationRead (long deviceID, long featureID, int *errorCode, float *buffer, int bufferLength)
 
int irradCalibrationWrite (long deviceID, long featureID, int *errorCode, float *buffer, int bufferLength)
 
int irradCalibrationHasCollectionArea (long deviceID, long featureID, int *errorCode)
 
float irradCalibrationReadCollectionArea (long deviceID, long featureID, int *errorCode)
 
void irradCalibrationWriteCollectionArea (long deviceID, long featureID, int *errorCode, float area)
 
int getNumberOfEEPROMFeatures (long deviceID, int *errorCode)
 
int getEEPROMFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
int eepromReadSlot (long deviceID, long featureID, int *errorCode, int slotNumber, unsigned char *buffer, int bufferLength)
 
int getNumberOfLightSourceFeatures (long deviceID, int *errorCode)
 
int getLightSourceFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
int lightSourceGetCount (long deviceID, long featureID, int *errorCode)
 
bool lightSourceHasEnable (long deviceID, long featureID, int *errorCode, int lightSourceIndex)
 
bool lightSourceIsEnabled (long deviceID, long featureID, int *errorCode, int lightSourceIndex)
 
void lightSourceSetEnable (long deviceID, long featureID, int *errorCode, int lightSourceIndex, bool enable)
 
bool lightSourceHasVariableIntensity (long deviceID, long featureID, int *errorCode, int lightSourceIndex)
 
double lightSourceGetIntensity (long deviceID, long featureID, int *errorCode, int lightSourceIndex)
 
void lightSourceSetIntensity (long deviceID, long featureID, int *errorCode, int lightSourceIndex, double intensity)
 
int getNumberOfLampFeatures (long deviceID, int *errorCode)
 
int getLampFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
void lampSetLampEnable (long deviceID, long featureID, int *errorCode, bool strobeEnable)
 
int getNumberOfContinuousStrobeFeatures (long deviceID, int *errorCode)
 
int getContinuousStrobeFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
void continuousStrobeSetContinuousStrobeEnable (long deviceID, long featureID, int *errorCode, bool strobeEnable)
 
void continuousStrobeSetContinuousStrobePeriodMicroseconds (long deviceID, long featureID, int *errorCode, unsigned long strobePeriodMicroseconds)
 
int getNumberOfShutterFeatures (long deviceID, int *errorCode)
 
int getShutterFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
void shutterSetShutterOpen (long deviceID, long featureID, int *errorCode, bool opened)
 
int getNumberOfNonlinearityCoeffsFeatures (long deviceID, int *errorCode)
 
int getNonlinearityCoeffsFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
int nonlinearityCoeffsGet (long deviceID, long featureID, int *errorCode, double *buffer, int maxLength)
 
int getNumberOfTemperatureFeatures (long deviceID, int *errorCode)
 
int getTemperatureFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
unsigned char temperatureCountGet (long deviceID, long featureID, int *errorCode)
 
double temperatureGet (long deviceID, long featureID, int *errorCode, int index)
 
int temperatureGetAll (long deviceID, long featureID, int *errorCode, double *buffer, int maxLength)
 
int getNumberOfSpectrumProcessingFeatures (long deviceID, int *errorCode)
 
int getSpectrumProcessingFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
unsigned char spectrumProcessingBoxcarWidthGet (long deviceID, long featureID, int *errorCode)
 
unsigned short int spectrumProcessingScansToAverageGet (long deviceID, long featureID, int *errorCode)
 
void spectrumProcessingBoxcarWidthSet (long deviceID, long featureID, int *errorCode, unsigned char boxcarWidth)
 
void spectrumProcessingScansToAverageSet (long deviceID, long featureID, int *errorCode, unsigned short int scansToAverage)
 
int getNumberOfRevisionFeatures (long deviceID, int *errorCode)
 
int getRevisionFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
unsigned char revisionHardwareGet (long deviceID, long featureID, int *errorCode)
 
unsigned short int revisionFirmwareGet (long deviceID, long featureID, int *errorCode)
 
int getNumberOfOpticalBenchFeatures (long deviceID, int *errorCode)
 
int getOpticalBenchFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
unsigned short int opticalBenchGetFiberDiameterMicrons (long deviceID, long featureID, int *errorCode)
 
unsigned short int opticalBenchGetSlitWidthMicrons (long deviceID, long featureID, int *errorCode)
 
int opticalBenchGetID (long deviceID, long featureID, int *errorCode, char *buffer, int bufferLength)
 
int opticalBenchGetSerialNumber (long deviceID, long featureID, int *errorCode, char *buffer, int bufferLength)
 
int opticalBenchGetCoating (long deviceID, long featureID, int *errorCode, char *buffer, int bufferLength)
 
int opticalBenchGetFilter (long deviceID, long featureID, int *errorCode, char *buffer, int bufferLength)
 
int opticalBenchGetGrating (long deviceID, long featureID, int *errorCode, char *buffer, int bufferLength)
 
int getNumberOfStrayLightCoeffsFeatures (long deviceID, int *errorCode)
 
int getStrayLightCoeffsFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
int strayLightCoeffsGet (long deviceID, long featureID, int *errorCode, double *buffer, int maxLength)
 
int getNumberOfDataBufferFeatures (long deviceID, int *errorCode)
 
int getDataBufferFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
void dataBufferClear (long deviceID, long featureID, int *errorCode)
 
unsigned long dataBufferGetNumberOfElements (long deviceID, long featureID, int *errorCode)
 
unsigned long dataBufferGetBufferCapacity (long deviceID, long featureID, int *errorCode)
 
unsigned long dataBufferGetBufferCapacityMaximum (long deviceID, long featureID, int *errorCode)
 
unsigned long dataBufferGetBufferCapacityMinimum (long deviceID, long featureID, int *errorCode)
 
void dataBufferSetBufferCapacity (long deviceID, long featureID, int *errorCode, unsigned long capacity)
 
int getNumberOfAcquisitionDelayFeatures (long deviceID, int *errorCode)
 
int getAcquisitionDelayFeatures (long deviceID, int *errorCode, long *buffer, unsigned int maxLength)
 
void acquisitionDelaySetDelayMicroseconds (long deviceID, long featureID, int *errorCode, unsigned long delay_usec)
 
unsigned long acquisitionDelayGetDelayMicroseconds (long deviceID, long featureID, int *errorCode)
 
unsigned long acquisitionDelayGetDelayIncrementMicroseconds (long deviceID, long featureID, int *errorCode)
 
unsigned long acquisitionDelayGetDelayMaximumMicroseconds (long deviceID, long featureID, int *errorCode)
 
unsigned long acquisitionDelayGetDelayMinimumMicroseconds (long deviceID, long featureID, int *errorCode)
 

Static Public Member Functions

static SeaBreezeAPIgetInstance ()
 
static void shutdown ()
 

Detailed Description

This is an interface to SeaBreeze that allows the user to connect to devices over USB and other buses. This is intended as a usable and extensible API.

Note
Detailed method documentation is available in the analogous C functions in SeaBreezeAPI.h

Member Function Documentation

◆ getInstance()

static SeaBreezeAPI* SeaBreezeAPI::getInstance ( )
static

No public constructor. To use this class in C++, you must first call getInstance(). This provides a singleton: it is the same on every call.

◆ shutdown()

static void SeaBreezeAPI::shutdown ( )
static

No public destructor. Call this to force memory cleanup.

◆ probeDevices()

int SeaBreezeAPI::probeDevices ( )

Use the probeDevices() method to force the driver to look for any device that can be found automatically. If this is not called then such devices will not be available for use. This should be used when attempting to find USB devices.

◆ addTCPIPv4DeviceLocation()

int SeaBreezeAPI::addTCPIPv4DeviceLocation ( char *  deviceTypeName,
char *  ipAddr,
int  port 
)

Use the addIPv4DeviceLocation() method to specify that a device may be found on a TCP/IPv4 network on a given port. Once specified, the typical openDevice() function can be used to access it.

◆ addRS232DeviceLocation()

int SeaBreezeAPI::addRS232DeviceLocation ( char *  deviceTypeName,
char *  deviceBusPath,
unsigned int  baud 
)

Use the addRS232DeviceLocation() method to specify that a device may be found on a particular serial bus with a given baud rate. Once specified, the typical openDevice() function can be used to access it.

◆ getNumberOfDeviceIDs()

int SeaBreezeAPI::getNumberOfDeviceIDs ( )

This provides the number of devices that have either been probed or manually specified. Devices are not opened automatically, but this can provide a bound for getDeviceIDs().

◆ getDeviceIDs()

int SeaBreezeAPI::getDeviceIDs ( long *  ids,
unsigned long  maxLength 
)

This provides a unique ID of each device that is detected or specified. The IDs are copied into the user-provided buffer. These IDs are weak references: attempting to access a device that no longer exists will cause an error value to be returned but should not cause any instability. The IDs may be entirely random, but a given ID will always refer to the same device for as long as the program is running. This will return the number of device IDs actually copied into the array or 0 on error.

◆ openDevice()

int SeaBreezeAPI::openDevice ( long  id,
int *  errorCode 
)

This will attempt to open the bus connetion to the device with the given ID. Returns 0 on success, other value on error.

◆ closeDevice()

void SeaBreezeAPI::closeDevice ( long  id,
int *  errorCode 
)

This will attempt to close the bus connection to the device with the given ID.


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