dl::IGateway Class Referenceabstract

Gateway object for controlling device discovery, and lifetime management. More...

#include <dlapi.h>

Public Member Functions

virtual ~IGateway ()=0
 Virtual destructor to ensure the class is an abstract. More...
 
virtual TConnectionDetails getCameraConnectionDetails (unsigned int serial) const =0
 Returns the connection details for a camera with the provided serial number. More...
 
virtual ICameraPtr getCamera (TConnectionDetails details) const =0
 Fetches a pointer to a camera with the provided connection details (if one is available). More...
 
virtual void queryUSBCameras ()=0
 Query the computer for any DLAPI compliant cameras connected via USB. More...
 
virtual size_t getUSBCameraCount () const =0
 Returns the number of cameras found via the last call to IGateway::queryUSBCameras(). More...
 
virtual ICameraPtr getUSBCamera (unsigned int id) const =0
 Returns a pointer to the camera with the supplied index, from zero to IGateway::getUSBCameraCount(). More...
 
virtual void queryNetCameras ()=0
 Broadcast and enumerate any DLAPI compliant cameras connected to your network. More...
 
virtual void queryNetCamera (const char *ip, size_t port)=0
 Attempt to connect to a camera with the supplied IP Address and port. More...
 
virtual size_t getNetCameraCount () const =0
 Returns the number of cameras found after a call to IGateway::queryNetCameras(). More...
 
virtual ICameraPtr getNetCamera (unsigned int id) const =0
 Get a pointer to a camera found on the network via IGateway::queryNetCameras() with the given index, from zero to IGateway::getNetCameraCount(). More...
 
virtual ICameraPtr getNetCamera (const char *ip, unsigned int port) const =0
 Get a pointer to a queried camera with a given IP and port, if it exists. More...
 
virtual size_t getCommProtocolVersion () const =0
 Returns the maximum FPGA revision supported by this version of DLAPI. More...
 
virtual void initFitsDebugSettings ()=0
 

Detailed Description

Gateway object for controlling device discovery, and lifetime management.

The IGateway interface provides users with a single point of access for discovering DLAPI devices, and managing their resources from the start to finish of an of an imaging lifecycle.

An example application would wrap all API calls in the dl::getGateway() and dl::deleteGateway() function as follows:

#include <dlapi.h>
int main()
{
pGateway->queryUSBCameras();
if (pGateway->getUSBCameraCount() <= 0) return 1;
// If we find a camera in the USB device list, initialize it and retrieve its ICamera interface.
dl::ICameraPtr pCamera = pGateway->getUSBCamera(0);
// do stuff ...
dl::deleteGateway(pGateway);
return 0;
}

Constructor & Destructor Documentation

◆ ~IGateway()

virtual dl::IGateway::~IGateway ( )
pure virtual

Virtual destructor to ensure the class is an abstract.

Used to ensure IGateway is pure-virtual.

Member Function Documentation

◆ getCamera()

virtual ICameraPtr dl::IGateway::getCamera ( TConnectionDetails  details) const
pure virtual

Fetches a pointer to a camera with the provided connection details (if one is available).

Parameters
detailsobtain a camera using the connection details supplied.
Returns
ICameraPtr a pointer to a camera with matching connection details.
See also
ICameraPtr, TConnectionDetails

This convenience function takes a TConnectionDetails structure, and attempts to access a camera from the appropriate USB, or UDP device list. If no camera can be found matching those connection details, nullptr is returned.

◆ getCameraConnectionDetails()

virtual TConnectionDetails dl::IGateway::getCameraConnectionDetails ( unsigned int  serial) const
pure virtual

Returns the connection details for a camera with the provided serial number.

Parameters
seriala buffer containing the serial number to look up connection details of.
Returns
TConnectionDetails the structure containing internal API indexing information for connecting to the camera.
See also
TConnectionDetails, EEndpointType

This function takes a serial number input, and searches the list of found devices for one with a matching serial. If a camera with a matching serial is found, the function returns a TConnectionDetails structure with the appropriate EEndpointType, and device index. The user can use this information to access the appropriate USB, or UDP camera access points.

If no camera is found, TConnectionDetails::endpointType will be set to InvalidEndpoint.

◆ getCommProtocolVersion()

virtual size_t dl::IGateway::getCommProtocolVersion ( ) const
pure virtual

Returns the maximum FPGA revision supported by this version of DLAPI.

Returns
size_t the maximum camera FPGA revision the driver is capable of running without error

◆ getNetCamera() [1/2]

virtual ICameraPtr dl::IGateway::getNetCamera ( unsigned int  id) const
pure virtual

Get a pointer to a camera found on the network via IGateway::queryNetCameras() with the given index, from zero to IGateway::getNetCameraCount().

Parameters
idzero-based index of the UDP camera to retrieve
Returns
ICameraPtr pointer to camera with index id.

Returns the Networked camera associated with the provided zero-based index. Attempting to access indices below zero, or at the value returned by IGateway::getNetCameraCount() will return nullptr.

◆ getNetCamera() [2/2]

virtual ICameraPtr dl::IGateway::getNetCamera ( const char *  ip,
unsigned int  port 
) const
pure virtual

Get a pointer to a queried camera with a given IP and port, if it exists.

Parameters
ipa null-terminated string containing the IP address of the camera to obtain.
portthe network port to query.
Returns
ICameraPtr pointer to camera with index id.

Returns the Networked camera at the given ip address. if no camera is found at the given IP address, the function returns nullptr.

◆ getNetCameraCount()

virtual size_t dl::IGateway::getNetCameraCount ( ) const
pure virtual

Returns the number of cameras found after a call to IGateway::queryNetCameras().

Returns
size_t the number of discovered UDP cameras.
See also
IGateway::queryUSBCameras(), IGateway::getUSBCamera(), IGateway::getUSBCameraCount(), IGateway::getNetCamera(), IGateway::getNetCameraCount(),

Returns the number of cameras found using the IGateway::queryNetCameras() function. Retrieve pointers to found cameras via IGateway::getNetCamera().

◆ getUSBCamera()

virtual ICameraPtr dl::IGateway::getUSBCamera ( unsigned int  id) const
pure virtual

Returns a pointer to the camera with the supplied index, from zero to IGateway::getUSBCameraCount().

Parameters
idzero-based index of the usb camera to retrieve
Returns
ICameraPtr pointer to camera with index id.
See also
IGateway::queryUSBCameras(), IGateway::getUSBCameraCount(), IGateway::queryNetCamera(), IGateway::getNetCamera(), IGateway::getNetCameraCount(),

Returns the usb camera associated with the provided zero-based index. Attempting to access indices below zero, or at the value returned by IGateway::getUSBCameraCount() will return nullptr.

◆ getUSBCameraCount()

virtual size_t dl::IGateway::getUSBCameraCount ( ) const
pure virtual

Returns the number of cameras found via the last call to IGateway::queryUSBCameras().

Returns
size_t the number of discovered USB cameras.
See also
IGateway::queryUSBCameras(), IGateway::getUSBCamera(), IGateway::queryNetCamera(), IGateway::getNetCamera(), IGateway::getNetCameraCount(),

Returns the number of cameras found using the IGateway::queryUSBCameras() function. Retrieve pointers to found cameras via IGateway::getUSBCamera().

◆ initFitsDebugSettings()

virtual void dl::IGateway::initFitsDebugSettings ( )
pure virtual

◆ queryNetCamera()

virtual void dl::IGateway::queryNetCamera ( const char *  ip,
size_t  port 
)
pure virtual

Attempt to connect to a camera with the supplied IP Address and port.

This function sends a GetInfo request to the device located at ip:port. This function blocks until the operation is complete. When the operation is complete it will have enumerated all DLAPI protocol compliant devices connected to the computer via a network. It will have called:

This process takes up to 2 seconds to complete while the cameras respond via UDP over IP. Note that virtual network interfaces, and bridged adapters can eat up the UDP broadcasts destined for DLAPI devices. If your device is not discovered, check to make sure you have no network adapters that might be intercepting those broadcasts.

◆ queryNetCameras()

virtual void dl::IGateway::queryNetCameras ( )
pure virtual

Broadcast and enumerate any DLAPI compliant cameras connected to your network.

This function searches through all available UDP devices on the active network. This function blocks until the operation is complete. When the operation is complete it will have enumerated all DLAPI protocol compliant devices connected to the computer via a network. It will have called:

This process takes up to 2 seconds to complete while the cameras respond via UDP. Note that virtual network interfaces, and bridged adapters can eat up the UDP broadcasts destined for DLAPI devices. If your device is not discovered, check to make sure you have no network adapters that might be intercepting those broadcasts.

◆ queryUSBCameras()

virtual void dl::IGateway::queryUSBCameras ( )
pure virtual

Query the computer for any DLAPI compliant cameras connected via USB.

This function searches through all available USB devices connected to the computer which are not in use by another API instance. This function blocks until the operation is complete. When the operation is complete it will have enumerated all DLAPI protocol compliant devices connected to the computer via USB. It will have called:


The documentation for this class was generated from the following file:
  • C:/NightlyBuild/DL_Imaging/Aluma_Software/dlapi/src/dlapi.h