diff --git a/src/GenTL_v1_5.h b/src/GenTL_v1_5.h deleted file mode 100644 index 5b26a20e6..000000000 --- a/src/GenTL_v1_5.h +++ /dev/null @@ -1,793 +0,0 @@ -/**************************************************************************** -(c) 2004-2015 by GenICam GenTL Subcommittee - -License: This file is published under the license of the EMVA GenICam Standard Group. -A text file describing the legal terms is included in your installation as 'license.txt'. -If for some reason you are missing this file please contact the EMVA or visit the website -(http://www.genicam.org) for a full copy. - -THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -******************************************************************************/ - -/* \file GenTL.h - * \brief GenICam Transport Layer Client Interface - * \version 1.5 - * \author GenTL Subcommittee - * \date 2015 - * - * \par Version history - * \li Version 0.1.0 First official version from the meeting in Pilsen - * \li Version 0.1.1 rst (SI) 0.4.160 - * - added _E_INTERFACE_INFO_CMD_LIST_T_ enum name - * - added _E_DEVICE_ACCCESS_STATUS_TYPE_T_ to be used - * with the /a IFGetDeviceInfo and DevGetInfo - * - rename of the enum value DEVICE_INFO_ACCESSMODE to - * DEVICE_INFO_ACCESS_STATUS which now refers to - * _E_DEVICE_ACCCESS_STATUS_TYPE_T_ - * - added Timeout parameter to update interface list and - * device list. - * \li Version 0.1.2 - change datatype of timeout parameter of - * TLUpdateInterfaceList and IFUpdateDeviceList to - * uint64_t to match with the timeout in the event object. - * - changed all enums to have a typedef to uint32_t - * with them to allow custom ids - * - changed type of string constants to be char * instead - * of gcstring - * \li Version 0.1.3 rst (SI), cbi (IDS) 0.4.163 - * - adjusted parameter names to be closer aligned with - * the standard text - * - changed typedefs for enums from uint32_t to int32_t - * - removed default parameter - * - added parameter name to DevGetPort function - * \li Version 0.1.4 jb (LV) - * - fixes to align the file with standard text - * - make the file self-contained, independent on GenApi - * \li Version 0.1.5 rst (SI) cbi (IDS) jb (LV) tho (MVTec) - * - Adjust it for Linux - * - Cosmetics - * \li Version 1.0 rst (SI) cbi (IDS) jb (LV) tho (MVTec) - * - Adjust for Standard 1.0 - * - Make it plain C compliant - * - Cosmetics - * \li Version 1.2 rst (SI) jb (LV) tho (MVTec) - * - Adjust for Standard 1.2 - * - adjust packing - * - Cosmetics - * \li Version 1.3 (Stemmer, Leutron, Matrix Vision, MVTec, MathWorks) - * - Adjust for Standard 1.3 - * - added chunk handling - * - added Mac OS X - * - Cosmetics - * \li Version 1.3.1 (MathWorks) - * - Spelling corrections in comments - * \li Version 1.4 GenTL Subcommittee - * \li Version 1.5 GenTL Subcommittee - * - Changed namespace to GenTL - * - Changes for GenTL 1.5, Please refer to the GenTL spec - * for a list of changes. - */ - - -#ifndef GC_TLI_CLIENT_H_ -#define GC_TLI_CLIENT_H_ 1 - -#ifndef GC_USER_DEFINED_TYPES -/* The types should be the same as defined in GCTypes.h from GenApi. But in - * case you do not have this header the necessary types are defined here. */ -# if defined(_WIN32) -# if defined(_MSC_VER) && _MSC_VER >= 1600 /* VS2010 provides stdint.h */ -# include -# elif defined(__MINGW32__) || defined(__MINGW64__) -# include -# elif !defined _STDINT_H && !defined _STDINT - /* stdint.h is usually not available under Windows */ - typedef unsigned char uint8_t; - typedef __int32 int32_t; - typedef unsigned __int32 uint32_t; - typedef unsigned __int64 uint64_t; -# endif -# else -# include -# endif - -# ifdef __cplusplus - typedef bool bool8_t; -# else - typedef uint8_t bool8_t; -# endif -#endif /* GC_DEFINE_TYPES */ - -#include - - -/* Function declaration modifiers */ -#if defined (_WIN32) -# ifndef GCTLI_NO_DECLSPEC_STATEMENTS -# ifdef GCTLIDLL -# define GC_IMPORT_EXPORT __declspec(dllexport) -# else -# define GC_IMPORT_EXPORT __declspec(dllimport) -# endif -# else -# define GC_IMPORT_EXPORT -# endif /* # ifndef GCTLI_NO_DECLSPEC_STATEMENTS */ -# if defined (_M_IX86) || defined (__i386__) -# define GC_CALLTYPE __stdcall -# else -# define GC_CALLTYPE /* default */ -# endif -# ifndef EXTERN_C -# define EXTERN_C extern "C" -# endif - -#elif defined (__GNUC__) && (__GNUC__ >= 4) && (defined (__linux__) || defined (__APPLE__)) -# define GC_IMPORT_EXPORT __attribute__((visibility("default"))) -# if defined (__i386__) -# define GC_CALLTYPE __attribute__((stdcall)) -# else -# define GC_CALLTYPE /* default */ -# endif -# ifndef EXTERN_C -# define EXTERN_C extern "C" -# endif - -#else -# error Unknown platform, file needs adaption -#endif - -#ifdef __cplusplus -extern "C" { - namespace GenTL { -#endif - - /* Errors */ - enum GC_ERROR_LIST - { - GC_ERR_SUCCESS = 0, - GC_ERR_ERROR = -1001, - GC_ERR_NOT_INITIALIZED = -1002, - GC_ERR_NOT_IMPLEMENTED = -1003, - GC_ERR_RESOURCE_IN_USE = -1004, - GC_ERR_ACCESS_DENIED = -1005, - GC_ERR_INVALID_HANDLE = -1006, - GC_ERR_INVALID_ID = -1007, - GC_ERR_NO_DATA = -1008, - GC_ERR_INVALID_PARAMETER = -1009, - GC_ERR_IO = -1010, - GC_ERR_TIMEOUT = -1011, - GC_ERR_ABORT = -1012, /* GenTL v1.1 */ - GC_ERR_INVALID_BUFFER = -1013, /* GenTL v1.1 */ - GC_ERR_NOT_AVAILABLE = -1014, /* GenTL v1.2 */ - GC_ERR_INVALID_ADDRESS = -1015, /* GenTL v1.3 */ - GC_ERR_BUFFER_TOO_SMALL = -1016, /* GenTL v1.4 */ - GC_ERR_INVALID_INDEX = -1017, /* GenTL v1.4 */ - GC_ERR_PARSING_CHUNK_DATA = -1018, /* GenTL v1.4 */ - GC_ERR_INVALID_VALUE = -1019, /* GenTL v1.4 */ - GC_ERR_RESOURCE_EXHAUSTED = -1020, /* GenTL v1.4 */ - GC_ERR_OUT_OF_MEMORY = -1021, /* GenTL v1.4 */ - GC_ERR_BUSY = -1022, /* GenTL v1.5 */ - - GC_ERR_CUSTOM_ID = -10000 - }; - typedef int32_t GC_ERROR; - -# ifndef GC_GENTL_HEADER_VERSION - -# define GenTLMajorVersion 1 /* defines the major version of the GenICam GenTL standard version this header is based on */ -# define GenTLMinorVersion 5 /* defines the minor version of the GenICam GenTL standard version this header is based on */ -# define GenTLSubMinorVersion 0 /* defines the sub minor version of the GenICam GenTL standard version this header is based on */ - -# define GC_GENTL_HEADER_VERSION_CODE(major,minor,subminor) (((major)<<24)+((minor)<<16)+(subminor)) -# define GC_GENTL_HEADER_VERSION GC_GENTL_HEADER_VERSION_CODE(GenTLMajorVersion,GenTLMinorVersion,GenTLSubMinorVersion) - -# endif /* GC_GENTL_HEADER_VERSION */ - -# ifndef GC_GENTL_DONT_USE_TYPE_DEFINITIONS -# define TLTypeMixedName "Mixed" /* Type to use for several supported technologies */ -# define TLTypeCustomName "Custom" /* Type to use for custom technologies */ -# define TLTypeGEVName "GEV" /* Type to use for GigE Vision technology */ -# define TLTypeCLName "CL" /* Type to use for Camera Link technology */ -# define TLTypeIIDCName "IIDC" /* Type to use for IIDC 1394 technology */ -# define TLTypeUVCName "UVC" /* Type to use for USB video class devices */ -# define TLTypeCXPName "CXP" /* Type to use for CoaXPress, V1.3 */ -# define TLTypeCLHSName "CLHS" /* Type to use for Camera Link HS, V1.3 */ -# define TLTypeU3VName "U3V" /* Type to use for USB3 Vision Standard, V1.4 */ -# define TLTypeETHERNETName "Ethernet" /* Type to use for Ethernet devices, V1.3 */ -# define TLTypePCIName "PCI" /* Type to use for PCI/PCIe devices, V1.3 */ -# endif /* GC_GENTL_DONT_USE_TYPE_DEFINITIONS */ - -# ifndef GC_GENTL_DONT_USE_MODULE_NAMES -# define TLSystemModuleName "TLSystem" /* Name to identify a system module */ -# define TLInterfaceModuleName "TLInterface" /* Name to identify a interface module */ -# define TLDeviceModuleName "TLDevice" /* Name to identify a device module */ -# define TLDataStreamModuleName "TLDataStream" /* Name to identify a data stream module */ -# define TLBufferModuleName "TLBuffer" /* Name to identify a buffer module */ -# define TLRemoteDeviceModuleName "Device" /* Name to identify a remote device module */ -# endif /* GC_GENTL_DONT_USE_MODULE_NAMES */ - - /* Handles */ - typedef void * TL_HANDLE; /* Transport Layer handle, obtained through the TLOpen */ - typedef void * IF_HANDLE; /* Interface handle, obtained through ::TLOpenInterface */ - typedef void * DEV_HANDLE; /* Device Handle, obtained through the ::IFOpenDevice */ - typedef void * DS_HANDLE; /* Handle to an image stream object, obtained through DevOpenDataStream */ - typedef void * PORT_HANDLE; /* A Port handle is used to access the register space of a port */ - /* a PORT_HANDLE can be one of the following TL_HANDLE, IF_HANDLE, */ - /* DEV_HANDLE, handle to a device port, obtained through ::DevGetPort, */ - /* DS_HANDLE, BUFFER_HANDLE */ - - typedef void * BUFFER_HANDLE; /* BufferHandle, obtained through the ::DSAnnounceBuffer function */ - typedef void * EVENTSRC_HANDLE; /* A Event source handle is used to register a OS Event and to retrieve a GenTL event handle */ - /* a EVENTSRC_HANDLE can be on of the following TL_HANDLE, */ - /* IF_HANDLE, DEV_HANDLE, A handle to a device port, obtained through ::DevGetPort */ - /* DS_HANDLE, BUFFER_HANDLE */ - typedef void * EVENT_HANDLE; /* Event Handle */ - -# define GENTL_INVALID_HANDLE NULL /* Invalid handle value, V1.4 */ -# define GENTL_INFINITE 0xFFFFFFFFFFFFFFFFULL /* Infinite value to be used in various function calls, V1.4 */ - - /* Defines the data type possible for the various Info functions. */ - enum INFO_DATATYPE_LIST - { - INFO_DATATYPE_UNKNOWN = 0, /* Unknown data type */ - INFO_DATATYPE_STRING = 1, /* NULL-terminated C string (ASCII encoded). */ - INFO_DATATYPE_STRINGLIST = 2, /* Concatenated INFO_DATATYPE_STRING list. End of list is signaled with an additional NULL. */ - INFO_DATATYPE_INT16 = 3, /* Signed 16 bit integer. */ - INFO_DATATYPE_UINT16 = 4, /* Unsigned 16 bit integer */ - INFO_DATATYPE_INT32 = 5, /* Signed 32 bit integer */ - INFO_DATATYPE_UINT32 = 6, /* Unsigned 32 bit integer */ - INFO_DATATYPE_INT64 = 7, /* Signed 64 bit integer */ - INFO_DATATYPE_UINT64 = 8, /* Unsigned 64 bit integer */ - INFO_DATATYPE_FLOAT64 = 9, /* Signed 64 bit floating point number. */ - INFO_DATATYPE_PTR = 10, /* Pointer type (void*). Size is platform dependent (32 bit on 32 bit platforms). */ - INFO_DATATYPE_BOOL8 = 11, /* Boolean value occupying 8 bit. 0 for false and anything for true. */ - INFO_DATATYPE_SIZET = 12, /* Platform dependent unsigned integer (32 bit on 32 bit platforms). */ - INFO_DATATYPE_BUFFER = 13, /* Like a INFO_DATATYPE_STRING but with arbitrary data and no NULL termination. */ - INFO_DATATYPE_PTRDIFF = 14, /* Platform dependent signed integer (32 bit on 32 bit platforms). GenTL v1.3 */ - - INFO_DATATYPE_CUSTOM_ID = 1000 /* Starting value for custom IDs. */ - }; - typedef int32_t INFO_DATATYPE; - - /* Defines char encoding schemes used by the producer, GenTL v1.4 */ - enum TL_CHAR_ENCODING_LIST - { - TL_CHAR_ENCODING_ASCII = 0, - TL_CHAR_ENCODING_UTF8 = 1 - }; - typedef int32_t TL_CHAR_ENCODING; /* GenTL v1.4 */ - - /* System module information commands for the GenICam::TL::Client::TLGetInfo and GenICam::TL::Client::GCGetInfo functions. */ - enum TL_INFO_CMD_LIST - { - TL_INFO_ID = 0, /* STRING Transport layer ID. */ - TL_INFO_VENDOR = 1, /* STRING Transport layer vendor name. */ - TL_INFO_MODEL = 2, /* STRING Transport layer model name. */ - TL_INFO_VERSION = 3, /* STRING Transport layer version. */ - TL_INFO_TLTYPE = 4, /* STRING Transport layer technology that is supported. */ - TL_INFO_NAME = 5, /* STRING File name including extension of the library. */ - TL_INFO_PATHNAME = 6, /* STRING Full path including file name and extension of the library. */ - TL_INFO_DISPLAYNAME = 7, /* STRING User readable name of the device. If this is not defined in the device this should be VENDOR MODEL (ID). */ - TL_INFO_CHAR_ENCODING = 8, /* INT32 Reporting the char encoding used by this Producer, GenTL v1.4 */ - TL_INFO_GENTL_VER_MAJOR = 9, /* UINT32 Major number of the GenTL spec this producer complies with, GenTL v1.5 */ - TL_INFO_GENTL_VER_MINOR = 10, /* UINT32 Minor number of the GenTL spec this producer complies with, GenTL v1.5 */ - TL_INFO_CUSTOM_ID = 1000 /* Starting value for custom IDs. */ - }; - typedef int32_t TL_INFO_CMD; - - /* This enumeration defines commands to retrieve information with the GenICam::TL::Client::IFGetInfo function from the Interface module. */ - enum INTERFACE_INFO_CMD_LIST - { - INTERFACE_INFO_ID = 0, /* STRING Unique ID of the interface. */ - INTERFACE_INFO_DISPLAYNAME = 1, /* STRING User readable name of the interface. */ - INTERFACE_INFO_TLTYPE = 2, /* STRING Transport layer technology that is supported. */ - - INTERFACE_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t INTERFACE_INFO_CMD; - - /* This enumeration defines flags of how a device is to be opened with the GenICam::TL::Client::IFOpenDevice function. */ - enum DEVICE_ACCESS_FLAGS_LIST - { - DEVICE_ACCESS_UNKNOWN = 0, /* Not used in a command. Can be used to initialize a variable to query that information. */ - DEVICE_ACCESS_NONE = 1, /* This either means that the device is not open because it was not opened before or the access to it was denied. */ - DEVICE_ACCESS_READONLY = 2, /* Open the device read only. All Port functions can only read from the device. */ - DEVICE_ACCESS_CONTROL = 3, /* Open the device in a way that other hosts/processes can have read only access to the device. Device access level is read/write for this process. */ - DEVICE_ACCESS_EXCLUSIVE = 4, /* Open the device in a way that only this host/process can have access to the device. Device access level is read/write for this process. */ - - DEVICE_ACCESS_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t DEVICE_ACCESS_FLAGS; - - /* This enumeration defines values for the accessibility of the device to be returned in the GenICam::TL::Client::DevGetInfo function on a device handle. */ - enum DEVICE_ACCESS_STATUS_LIST - { - DEVICE_ACCESS_STATUS_UNKNOWN = 0, /* The device accessibility is not known. */ - DEVICE_ACCESS_STATUS_READWRITE = 1, /* The device is available for read/write access. */ - DEVICE_ACCESS_STATUS_READONLY = 2, /* The device is available for read only access. */ - DEVICE_ACCESS_STATUS_NOACCESS = 3, /* The device is not accessible. */ - DEVICE_ACCESS_STATUS_BUSY = 4, /* The device has already been opened by another process/host. GenTL v1.5 */ - DEVICE_ACCESS_STATUS_OPEN_READWRITE = 5, /* The device has already been opened by this process. GenTL v1.5 */ - DEVICE_ACCESS_STATUS_OPEN_READONLY = 6, /* The device has already been opened by this process. GenTL v1.5 */ - - DEVICE_ACCESS_STATUS_CUSTOM_ID = 1000 /* Starting value for custom IDs. */ - }; - typedef int32_t DEVICE_ACCESS_STATUS; - - /* This enumeration defines commands to retrieve information with the GenICam::TL::Client::DevGetInfo function on a device handle. */ - enum DEVICE_INFO_CMD_LIST - { - DEVICE_INFO_ID = 0, /* STRING Unique ID of the device. */ - DEVICE_INFO_VENDOR = 1, /* STRING Device vendor name. */ - DEVICE_INFO_MODEL = 2, /* STRING Device model name. */ - DEVICE_INFO_TLTYPE = 3, /* STRING Transport layer technology that is supported. */ - DEVICE_INFO_DISPLAYNAME = 4, /* STRING String containing a display name for the device ( including a unique id ) */ - DEVICE_INFO_ACCESS_STATUS = 5, /* INT32 Gets the access mode the GenTL Producer has on the opened device. (DEVICE_ACCESS_STATUS enumeration value). */ - DEVICE_INFO_USER_DEFINED_NAME = 6, /* STRING String containing the user defined name, GenTL v1.4 */ - DEVICE_INFO_SERIAL_NUMBER = 7, /* STRING String containing the device's serial number, GenTL v1.4 */ - DEVICE_INFO_VERSION = 8, /* STRING String containing the device version, GenTL v1.4 */ - DEVICE_INFO_TIMESTAMP_FREQUENCY = 9, /* UINT64 Tick-frequency of the time stamp clock, GenTL v1.4 */ - - DEVICE_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t DEVICE_INFO_CMD; - - /* This enumeration defines special stop flags for the acquisition engine. The function used is GenICam::TL::Client::DSStopAcquisition. */ - enum ACQ_STOP_FLAGS_LIST - { - ACQ_STOP_FLAGS_DEFAULT = 0, /* Stop the acquisition engine when the currently running tasks like filling a buffer are completed (default behavior). */ - ACQ_STOP_FLAGS_KILL = 1, /* Stop the acquisition engine immediately and leave buffers currently being filled in the Input Buffer Pool. */ - - ACQ_STOP_FLAGS_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t ACQ_STOP_FLAGS; - - /* This enumeration defines special start flags for the acquisition engine. The function used is GenICam::TL::Client::DSStartAcquisition. */ - enum ACQ_START_FLAGS_LIST - { - ACQ_START_FLAGS_DEFAULT = 0, /* Default behavior. */ - - ACQ_START_FLAGS_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t ACQ_START_FLAGS; - - /* This enumeration commands from which to which queue/pool buffers are flushed with the GenICam::TL::Client::DSFlushQueue function. */ - enum ACQ_QUEUE_TYPE_LIST - { - ACQ_QUEUE_INPUT_TO_OUTPUT = 0, /* Flushes the input pool to the output queue and if necessary adds entries in the New Buffer event data queue. */ - ACQ_QUEUE_OUTPUT_DISCARD = 1, /* Discards all buffers in the output queue and if necessary remove the entries from the event data queue. */ - ACQ_QUEUE_ALL_TO_INPUT = 2, /* Puts all buffers in the input pool. Even those in the output queue and discard entries in the event data queue. */ - ACQ_QUEUE_UNQUEUED_TO_INPUT = 3, /* Puts all buffers that are not in the input pool or the output queue in the input pool. */ - ACQ_QUEUE_ALL_DISCARD = 4, /* Discards all buffers in the input pool and output queue. */ - - ACQ_QUEUE_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t ACQ_QUEUE_TYPE; - - /* This enumeration defines commands to retrieve information with the GenICam::TL::Client::DSGetInfo function on a data stream handle */ - enum STREAM_INFO_CMD_LIST - { - STREAM_INFO_ID = 0, /* STRING Unique ID of the data stream. */ - STREAM_INFO_NUM_DELIVERED = 1, /* UINT64 Number of delivered buffers since last acquisition start. */ - STREAM_INFO_NUM_UNDERRUN = 2, /* UINT64 Number of lost buffers due to queue underrun. */ - STREAM_INFO_NUM_ANNOUNCED = 3, /* SIZET Number of announced buffers. */ - STREAM_INFO_NUM_QUEUED = 4, /* SIZET Number of buffers in the input pool. */ - STREAM_INFO_NUM_AWAIT_DELIVERY = 5, /* SIZET Number of buffers in the output queue. */ - STREAM_INFO_NUM_STARTED = 6, /* UINT64 Number of buffers started in the acquisition engine. */ - STREAM_INFO_PAYLOAD_SIZE = 7, /* SIZET Size of the expected data in bytes. */ - STREAM_INFO_IS_GRABBING = 8, /* BOOL8 Flag indicating whether the acquisition engine is started or not. */ - STREAM_INFO_DEFINES_PAYLOADSIZE = 9, /* BOOL8 Flag that indicated that this data stream defines a payload size independent from the remote device. */ - STREAM_INFO_TLTYPE = 10, /* STRING Transport layer technology that is supported. */ - STREAM_INFO_NUM_CHUNKS_MAX = 11, /* SIZET Max number of chunks in a buffer, if known. GenTL v1.3 */ - STREAM_INFO_BUF_ANNOUNCE_MIN = 12, /* SIZET Min number of buffers to announce before acq can start, if known. GenTL v1.3 */ - STREAM_INFO_BUF_ALIGNMENT = 13, /* SIZET Buffer alignment in bytes. GenTL v1.3 */ - - STREAM_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t STREAM_INFO_CMD; - - /* This enumeration defines commands to retrieve information with the GenICam::TL::Client::DSGetBufferInfo function on a buffer handle. */ - enum BUFFER_INFO_CMD_LIST - { - BUFFER_INFO_BASE = 0, /* PTR Base address of the buffer memory. */ - BUFFER_INFO_SIZE = 1, /* SIZET Size of the buffer in bytes. */ - BUFFER_INFO_USER_PTR = 2, /* PTR Private data pointer of the GenTL Consumer. */ - BUFFER_INFO_TIMESTAMP = 3, /* UINT64 Timestamp the buffer was acquired. */ - BUFFER_INFO_NEW_DATA = 4, /* BOOL8 Flag to indicate that the buffer contains new data since the last call. */ - BUFFER_INFO_IS_QUEUED = 5, /* BOOL8 Flag to indicate if the buffer is in the input pool or output queue. */ - BUFFER_INFO_IS_ACQUIRING = 6, /* BOOL8 Flag to indicate that the buffer is currently being filled with data. */ - BUFFER_INFO_IS_INCOMPLETE = 7, /* BOOL8 Flag to indicate that a buffer was filled but an error occurred during that process. */ - BUFFER_INFO_TLTYPE = 8, /* STRING Transport layer technology that is supported. */ - BUFFER_INFO_SIZE_FILLED = 9, /* SIZET Number of bytes written into the buffer last time it has been filled. This value is reset to 0 when the buffer is placed into the Input Buffer Pool. */ - BUFFER_INFO_WIDTH = 10, /* SIZET GenTL v1.2 */ - BUFFER_INFO_HEIGHT = 11, /* SIZET GenTL v1.2 */ - BUFFER_INFO_XOFFSET = 12, /* SIZET GenTL v1.2 */ - BUFFER_INFO_YOFFSET = 13, /* SIZET GenTL v1.2 */ - BUFFER_INFO_XPADDING = 14, /* SIZET GenTL v1.2 */ - BUFFER_INFO_YPADDING = 15, /* SIZET GenTL v1.2 */ - BUFFER_INFO_FRAMEID = 16, /* UINT64 GenTL v1.2 */ - BUFFER_INFO_IMAGEPRESENT = 17, /* BOOL8 GenTL v1.2 */ - BUFFER_INFO_IMAGEOFFSET = 18, /* SIZET GenTL v1.2 */ - BUFFER_INFO_PAYLOADTYPE = 19, /* SIZET GenTL v1.2 */ - BUFFER_INFO_PIXELFORMAT = 20, /* UINT64 GenTL v1.2 */ - BUFFER_INFO_PIXELFORMAT_NAMESPACE = 21, /* UINT64 GenTL v1.2 */ - BUFFER_INFO_DELIVERED_IMAGEHEIGHT = 22, /* SIZET GenTL v1.2 */ - BUFFER_INFO_DELIVERED_CHUNKPAYLOADSIZE = 23, /* SIZET GenTL v1.2 */ - BUFFER_INFO_CHUNKLAYOUTID = 24, /* UINT64 GenTL v1.2 */ - BUFFER_INFO_FILENAME = 25, /* STRING GenTL v1.2 */ - BUFFER_INFO_PIXEL_ENDIANNESS = 26, /* INT32 GenTL v1.4 */ - BUFFER_INFO_DATA_SIZE = 27, /* SIZET GenTL v1.4 */ - BUFFER_INFO_TIMESTAMP_NS = 28, /* UINT64 GenTL v1.4 */ - BUFFER_INFO_DATA_LARGER_THAN_BUFFER = 29, /* BOOL8 GenTL v1.4 */ - BUFFER_INFO_CONTAINS_CHUNKDATA = 30, /* BOOL8 GenTL v1.4 */ - - BUFFER_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t BUFFER_INFO_CMD; - - /* This enumeration defines commands to retrieve information about individual data parts in a multi-part buffer - using the GenICam::TL::Client::DSGetBufferPartInfo function. Introduced in GenTL v1.5. */ - enum BUFFER_PART_INFO_CMD_LIST - { - BUFFER_PART_INFO_BASE = 0, /* PTR Base address of the buffer part memory. */ - BUFFER_PART_INFO_DATA_SIZE = 1, /* SIZET Size of the buffer part in bytes. */ - BUFFER_PART_INFO_DATA_TYPE = 2, /* SIZET Type of the data in given part (PARTDATATYPE_ID enumeration value). */ - BUFFER_PART_INFO_DATA_FORMAT = 3, /* UINT64 Format of individual items (such as pixels) in the buffer part. */ - BUFFER_PART_INFO_DATA_FORMAT_NAMESPACE = 4, /* UINT64 Allows interpretation of BUFFER_PART_INFO_DATA_FORMAT (PIXELFORMAT_NAMESPACE_ID enumeration value). */ - BUFFER_PART_INFO_WIDTH = 5, /* SIZET Width of data in the buffer part in pixels. */ - BUFFER_PART_INFO_HEIGHT = 6, /* SIZET Expected height of data in the buffer part in pixels . */ - BUFFER_PART_INFO_XOFFSET = 7, /* SIZET Horizontal offset of data in the buffer part in pixels. */ - BUFFER_PART_INFO_YOFFSET = 8, /* SIZET Vertical offset of data in the buffer part in pixels. */ - BUFFER_PART_INFO_XPADDING = 9, /* SIZET Horizontal padding of data in the buffer part in pixels. */ - BUFFER_PART_INFO_SOURCE_ID = 10, /* UINT64 Identifier allowing to group data parts belonging to the same source. */ - BUFFER_PART_INFO_DELIVERED_IMAGEHEIGHT = 11, /* SIZET Height of the data currently in the buffer part in pixels*/ - BUFFER_PART_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t BUFFER_PART_INFO_CMD; /* GenTL v1.5 */ - - /* Enumeration of TLType dependent payload types. Introduced in GenTL v1.2 */ - enum PAYLOADTYPE_INFO_IDS - { - PAYLOAD_TYPE_UNKNOWN = 0, /* GenTL v1.2 */ - PAYLOAD_TYPE_IMAGE = 1, /* GenTL v1.2 */ - PAYLOAD_TYPE_RAW_DATA = 2, /* GenTL v1.2 */ - PAYLOAD_TYPE_FILE = 3, /* GenTL v1.2 */ - PAYLOAD_TYPE_CHUNK_DATA = 4, /* GenTL v1.2, Deprecated in GenTL 1.5*/ - PAYLOAD_TYPE_JPEG = 5, /* GenTL v1.4 */ - PAYLOAD_TYPE_JPEG2000 = 6, /* GenTL v1.4 */ - PAYLOAD_TYPE_H264 = 7, /* GenTL v1.4 */ - PAYLOAD_TYPE_CHUNK_ONLY = 8, /* GenTL v1.4 */ - PAYLOAD_TYPE_DEVICE_SPECIFIC = 9, /* GenTL v1.4 */ - PAYLOAD_TYPE_MULTI_PART = 10, /* GenTL v1.5 */ - - PAYLOAD_TYPE_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t PAYLOADTYPE_INFO_ID; - - /* Enumeration of TLType dependent pixel format namespaces introduced GenTL v1.2 */ - enum PIXELFORMAT_NAMESPACE_IDS - { - PIXELFORMAT_NAMESPACE_UNKNOWN = 0, /* GenTL v1.2 */ - PIXELFORMAT_NAMESPACE_GEV = 1, /* GenTL v1.2 */ - PIXELFORMAT_NAMESPACE_IIDC = 2, /* GenTL v1.2 */ - PIXELFORMAT_NAMESPACE_PFNC_16BIT = 3, /* GenTL v1.4 */ - PIXELFORMAT_NAMESPACE_PFNC_32BIT = 4, /* GenTL v1.4 */ - - PIXELFORMAT_NAMESPACE_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t PIXELFORMAT_NAMESPACE_ID; /* GenTL v1.2 */ - - /* Enumeration of pixel endianness values. Introduced in GenTL v1.4 */ - enum PIXELENDIANNESS_IDS - { - PIXELENDIANNESS_UNKNOWN = 0, /* Unknown pixel endianness. GenTL v1.4 */ - PIXELENDIANNESS_LITTLE = 1, /* Little endian pixel data. GenTL v1.4 */ - PIXELENDIANNESS_BIG = 2 /* Big endian pixel data. GenTL v1.4 */ - }; - typedef int32_t PIXELENDIANNESS_ID; /* GenTL v1.4*/ - - /* Enumeration describing which data type is present in given buffer part. Introduced in GenTL v1.5 */ - enum PARTDATATYPE_IDS - { - PART_DATATYPE_UNKNOWN = 0, /* Unknown data type */ - PART_DATATYPE_2D_IMAGE = 1, /* Color or monochrome 2D image. */ - PART_DATATYPE_2D_PLANE_BIPLANAR = 2, /* Single color plane of a planar 2D image consisting of 2 planes. */ - PART_DATATYPE_2D_PLANE_TRIPLANAR = 3, /* Single color plane of a planar 2D image consisting of 3 planes. */ - PART_DATATYPE_2D_PLANE_QUADPLANAR = 4, /* Single color plane of a planar 2D image consisting of 4 planes. */ - PART_DATATYPE_3D_IMAGE = 5, /* 3D image (pixel coordinates). */ - PART_DATATYPE_3D_PLANE_BIPLANAR = 6, /* Single plane of a planar 3D image consisting of 2 planes. */ - PART_DATATYPE_3D_PLANE_TRIPLANAR = 7, /* Single plane of a planar 3D image consisting of 3 planes. */ - PART_DATATYPE_3D_PLANE_QUADPLANAR = 8, /* Single plane of a planar 3D image consisting of 4 planes. */ - PART_DATATYPE_CONFIDENCE_MAP = 9, /* Confidence of the individual pixel values. */ - - PART_DATATYPE_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t PARTDATATYPE_ID; /* GenTL v1.5*/ - - /* This enumeration defines commands to retrieve information with the GenICam::TL::Client::GCGetPortInfo function on a module or remote device handle. */ - enum PORT_INFO_CMD_LIST - { - PORT_INFO_ID = 0, /* STRING Unique ID of the port. */ - PORT_INFO_VENDOR = 1, /* STRING Port vendor name. */ - PORT_INFO_MODEL = 2, /* STRING Port model name. */ - PORT_INFO_TLTYPE = 3, /* STRING Transport layer technology that is supported. */ - PORT_INFO_MODULE = 4, /* STRING GenTL Module the port refers to. */ - PORT_INFO_LITTLE_ENDIAN = 5, /* BOOL8 Flag indicating that the port data is little endian. */ - PORT_INFO_BIG_ENDIAN = 6, /* BOOL8 Flag indicating that the port data is big endian. */ - PORT_INFO_ACCESS_READ = 7, /* BOOL8 Port has read access. */ - PORT_INFO_ACCESS_WRITE = 8, /* BOOL8 Port has write access. */ - PORT_INFO_ACCESS_NA = 9, /* BOOL8 Port is not accessible. */ - PORT_INFO_ACCESS_NI = 10, /* BOOL8 Port is not implemented. */ - PORT_INFO_VERSION = 11, /* STRING Version of the port. */ - PORT_INFO_PORTNAME = 12, /* STRING Name of the port as referenced in the XML description. */ - - PORT_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t PORT_INFO_CMD; - - /* This enumeration defines enum values returned by the URL_INFO_SCHEME command. - introduced in GenTL v1.5 */ - enum URL_SCHEME_IDS - { - URL_SCHEME_LOCAL = 0, /* The XML can be read from the local register map */ - URL_SCHEME_HTTP = 1, /* The XML can be downloaded from a http server */ - URL_SCHEME_FILE = 2, /* The XML can be read from the local hard drive */ - - URL_SCHEME_CUSTOM_ID = 1000 /* Starting value for custom scheme locations */ - }; - typedef int32_t URL_SCHEME_ID; - - /* This enumeration defines commands to retrieve information with the GenICam::TL::Client::GCGetPortURLInfo - function on a module or remote device handle. Introduced in GenTL v1.1 */ - enum URL_INFO_CMD_LIST - { - URL_INFO_URL = 0, /* STRING URL as defined in chapter 4.1.2 GenTL v1.1 */ - URL_INFO_SCHEMA_VER_MAJOR = 1, /* INT32 Major version of the schema this URL refers to. GenTL v1.1 */ - URL_INFO_SCHEMA_VER_MINOR = 2, /* INT32 Minor version of the schema this URL refers to. GenTL v1.1 */ - URL_INFO_FILE_VER_MAJOR = 3, /* INT32 Major version of the XML-file this URL refers to. GenTL v1.1 */ - URL_INFO_FILE_VER_MINOR = 4, /* INT32 Minor version of the XML-file this URL refers to. GenTL v1.1 */ - URL_INFO_FILE_VER_SUBMINOR = 5, /* INT32 Subminor version of the XML-file this URL refers to. GenTL v1.1 */ - URL_INFO_FILE_SHA1_HASH = 6, /* BUFFER 160-bit SHA1 Hash code of XML-file. GenTL v1.4 */ - URL_INFO_FILE_REGISTER_ADDRESS = 7, /* UINT64 Register address in the device's register map. GenTL v1.5 */ - URL_INFO_FILE_SIZE = 8, /* UINT64 File size in bytes. GenTL v1.5 */ - URL_INFO_SCHEME = 9, /* INT32 Scheme of the URL as defined in URL_SCHEME_IDS. GenTL v1.5 */ - URL_INFO_FILENAME = 10, /* STRING File name if the scheme of the URL is file. GenTL v1.5 */ - - URL_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t URL_INFO_CMD; /* GenTL v1.1 */ - - /* Known event types that can be registered on certain modules with the GenICam::TL::Client::GCRegisterEvent function. */ - enum EVENT_TYPE_LIST - { - EVENT_ERROR = 0, /* Notification on module errors. */ - EVENT_NEW_BUFFER = 1, /* Notification on newly filled buffers. */ - EVENT_FEATURE_INVALIDATE = 2, /* Notification if a feature was changed by the GenTL Producer library and thus needs to be invalidated in the GenICam GenApi instance using the module. */ - EVENT_FEATURE_CHANGE = 3, /* Notification if the GenTL Producer library wants to manually set a feature in the GenICam GenApi instance using the module. */ - EVENT_REMOTE_DEVICE = 4, /* Notification if the GenTL Producer wants to inform the GenICam GenApi instance of the remote device that a GenApi compatible event was fired. */ - EVENT_MODULE = 5, /* Notification if the GenTL Producer wants to inform the GenICam GenApi instance of the module that a GenApi compatible event was fired. GenTL v1.4 */ - - EVENT_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t EVENT_TYPE; - - /* Event info command */ - enum EVENT_INFO_CMD_LIST - { - EVENT_EVENT_TYPE = 0, /* INT32 The event type of the event handle (EVENT_TYPE enum value). */ - EVENT_NUM_IN_QUEUE = 1, /* SIZET Number of events in the event data queue. */ - EVENT_NUM_FIRED = 2, /* UINT64 Number of events that were fired since the creation of the module. */ - EVENT_SIZE_MAX = 3, /* SIZET Max size of data carried with an event in bytes. GenTL v1.2 */ - EVENT_INFO_DATA_SIZE_MAX = 4, /* SIZET Max size of data provided through EventGetDataInfo in bytes. GenTL v1.2 */ - - EVENT_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t EVENT_INFO_CMD; - - /* Event data info command */ - enum EVENT_DATA_INFO_CMD_LIST - { - EVENT_DATA_ID = 0, /* Event specific Unique Event ID (String or Number)*/ - EVENT_DATA_VALUE = 1, /* Event specific Data */ - EVENT_DATA_NUMID = 2, /* UINT64 Numeric representation of the unique Event ID, GenTL v1.3. */ - - EVENT_DATA_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t EVENT_DATA_INFO_CMD; - - /* Structure of the data returned from a signaled "New Buffer" event. */ -# pragma pack (push, 1) - typedef struct S_EVENT_NEW_BUFFER - { - BUFFER_HANDLE BufferHandle; /* Buffer handle which contains new data. */ - void* pUserPointer; /* User pointer provided at announcement of the buffer. */ - } EVENT_NEW_BUFFER_DATA; -# pragma pack (pop) - - /* Structure to be use with GCWritePortStacked and GCReadPortStacked. */ -# pragma pack (push, 1) - typedef struct S_PORT_REGISTER_STACK_ENTRY - { - uint64_t Address; /* Address of the register. */ - void* pBuffer; /* Pointer to the buffer containing the data. */ - size_t Size; /* Number of bytes to read write. */ - } PORT_REGISTER_STACK_ENTRY; -# pragma pack (pop) - -# pragma pack (push, 1) - /* Structure carrying information about a single chunk in the buffer, V1.3 */ - typedef struct S_SINGLE_CHUNK_DATA - { - uint64_t ChunkID; /* Numeric representation of ChunkID */ - ptrdiff_t ChunkOffset; /* Chunk offset in the buffer */ - size_t ChunkLength; /* Size of the chunk data */ - } SINGLE_CHUNK_DATA; -# pragma pack (pop) - - - /* C API Interface Functions */ -# define GC_API GC_IMPORT_EXPORT GC_ERROR GC_CALLTYPE - GC_API GCGetInfo ( TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - GC_API GCGetLastError ( GC_ERROR *piErrorCode, char *sErrText, size_t *piSize ); - - GC_API GCInitLib ( void ); - GC_API GCCloseLib ( void ); - - GC_API GCReadPort ( PORT_HANDLE hPort, uint64_t iAddress, void *pBuffer, size_t *piSize ); - GC_API GCWritePort ( PORT_HANDLE hPort, uint64_t iAddress, const void *pBuffer, size_t *piSize ); - GC_API GCGetPortURL ( PORT_HANDLE hPort, char *sURL, size_t *piSize ); - - GC_API GCGetPortInfo ( PORT_HANDLE hPort, PORT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - GC_API GCRegisterEvent ( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID, EVENT_HANDLE *phEvent ); - GC_API GCUnregisterEvent ( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID ); - - GC_API EventGetData ( EVENT_HANDLE hEvent, void *pBuffer, size_t *piSize, uint64_t iTimeout ); - GC_API EventGetDataInfo ( EVENT_HANDLE hEvent, const void *pInBuffer, size_t iInSize, EVENT_DATA_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pOutBuffer, size_t *piOutSize ); - GC_API EventGetInfo ( EVENT_HANDLE hEvent, EVENT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API EventFlush ( EVENT_HANDLE hEvent ); - GC_API EventKill ( EVENT_HANDLE hEvent ); - - GC_API TLOpen ( TL_HANDLE *phTL ); - GC_API TLClose ( TL_HANDLE hTL ); - GC_API TLGetInfo ( TL_HANDLE hTL, TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - GC_API TLGetNumInterfaces ( TL_HANDLE hTL, uint32_t *piNumIfaces ); - GC_API TLGetInterfaceID ( TL_HANDLE hTL, uint32_t iIndex, char *sID, size_t *piSize ); - GC_API TLGetInterfaceInfo ( TL_HANDLE hTL, const char *sIfaceID, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API TLOpenInterface ( TL_HANDLE hTL, const char *sIfaceID, IF_HANDLE *phIface ); - GC_API TLUpdateInterfaceList ( TL_HANDLE hTL, bool8_t *pbChanged, uint64_t iTimeout ); - - GC_API IFClose ( IF_HANDLE hIface ); - GC_API IFGetInfo ( IF_HANDLE hIface, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - GC_API IFGetNumDevices ( IF_HANDLE hIface, uint32_t *piNumDevices ); - GC_API IFGetDeviceID ( IF_HANDLE hIface, uint32_t iIndex, char *sIDeviceID, size_t *piSize ); - GC_API IFUpdateDeviceList ( IF_HANDLE hIface, bool8_t *pbChanged, uint64_t iTimeout ); - GC_API IFGetDeviceInfo ( IF_HANDLE hIface, const char *sDeviceID, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API IFOpenDevice ( IF_HANDLE hIface, const char *sDeviceID, DEVICE_ACCESS_FLAGS iOpenFlags, DEV_HANDLE *phDevice ); - - GC_API DevGetPort ( DEV_HANDLE hDevice, PORT_HANDLE *phRemoteDevice ); - GC_API DevGetNumDataStreams ( DEV_HANDLE hDevice, uint32_t *piNumDataStreams ); - GC_API DevGetDataStreamID ( DEV_HANDLE hDevice, uint32_t iIndex, char *sDataStreamID, size_t *piSize ); - GC_API DevOpenDataStream ( DEV_HANDLE hDevice, const char *sDataStreamID, DS_HANDLE *phDataStream ); - GC_API DevGetInfo ( DEV_HANDLE hDevice, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API DevClose ( DEV_HANDLE hDevice ); - - GC_API DSAnnounceBuffer ( DS_HANDLE hDataStream, void *pBuffer, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer ); - GC_API DSAllocAndAnnounceBuffer( DS_HANDLE hDataStream, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer ); - GC_API DSFlushQueue ( DS_HANDLE hDataStream, ACQ_QUEUE_TYPE iOperation ); - GC_API DSStartAcquisition ( DS_HANDLE hDataStream, ACQ_START_FLAGS iStartFlags, uint64_t iNumToAcquire ); - GC_API DSStopAcquisition ( DS_HANDLE hDataStream, ACQ_STOP_FLAGS iStopFlags ); - GC_API DSGetInfo ( DS_HANDLE hDataStream, STREAM_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API DSGetBufferID ( DS_HANDLE hDataStream, uint32_t iIndex, BUFFER_HANDLE *phBuffer ); - GC_API DSClose ( DS_HANDLE hDataStream ); - - GC_API DSRevokeBuffer ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, void **pBuffer, void **pPrivate ); - GC_API DSQueueBuffer ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer ); - GC_API DSGetBufferInfo ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, BUFFER_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - /* GenTL v1.1 */ - GC_API GCGetNumPortURLs ( PORT_HANDLE hPort, uint32_t *piNumURLs ); - GC_API GCGetPortURLInfo ( PORT_HANDLE hPort, uint32_t iURLIndex, URL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API GCReadPortStacked ( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries ); - GC_API GCWritePortStacked ( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries ); - - /* GenTL v1.3 */ - GC_API DSGetBufferChunkData ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, SINGLE_CHUNK_DATA *pChunkData, size_t *piNumChunks ); - - /* GenTL v1.4 */ - GC_API IFGetParentTL ( IF_HANDLE hIface, TL_HANDLE *phSystem ); - GC_API DevGetParentIF ( DEV_HANDLE hDevice, IF_HANDLE *phIface ); - GC_API DSGetParentDev ( DS_HANDLE hDataStream, DEV_HANDLE *phDevice ); - - /* GenTL v1.5 */ - GC_API DSGetNumBufferParts ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumParts ); - GC_API DSGetBufferPartInfo ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iPartIndex, BUFFER_PART_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - /* typedefs for dynamic loading */ -# define GC_API_P(function) typedef GC_ERROR( GC_CALLTYPE *function ) - GC_API_P(PGCGetInfo )( TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PGCGetLastError )( GC_ERROR *piErrorCode, char *sErrText, size_t *piSize ); - GC_API_P(PGCInitLib )( void ); - GC_API_P(PGCCloseLib )( void ); - GC_API_P(PGCReadPort )( PORT_HANDLE hPort, uint64_t iAddress, void *pBuffer, size_t *piSize ); - GC_API_P(PGCWritePort )( PORT_HANDLE hPort, uint64_t iAddress, const void *pBuffer, size_t *piSize ); - GC_API_P(PGCGetPortURL )( PORT_HANDLE hPort, char *sURL, size_t *piSize ); - GC_API_P(PGCGetPortInfo )( PORT_HANDLE hPort, PORT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - GC_API_P(PGCRegisterEvent )( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID, EVENT_HANDLE *phEvent ); - GC_API_P(PGCUnregisterEvent )( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID ); - GC_API_P(PEventGetData )( EVENT_HANDLE hEvent, void *pBuffer, size_t *piSize, uint64_t iTimeout ); - GC_API_P(PEventGetDataInfo )( EVENT_HANDLE hEvent, const void *pInBuffer, size_t iInSize, EVENT_DATA_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pOutBuffer, size_t *piOutSize ); - GC_API_P(PEventGetInfo )( EVENT_HANDLE hEvent, EVENT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PEventFlush )( EVENT_HANDLE hEvent ); - GC_API_P(PEventKill )( EVENT_HANDLE hEvent ); - GC_API_P(PTLOpen )( TL_HANDLE *phTL ); - GC_API_P(PTLClose )( TL_HANDLE hTL ); - GC_API_P(PTLGetInfo )( TL_HANDLE hTL, TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PTLGetNumInterfaces )( TL_HANDLE hTL, uint32_t *piNumIfaces ); - GC_API_P(PTLGetInterfaceID )( TL_HANDLE hTL, uint32_t iIndex, char *sID, size_t *piSize ); - GC_API_P(PTLGetInterfaceInfo )( TL_HANDLE hTL, const char *sIfaceID, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PTLOpenInterface )( TL_HANDLE hTL, const char *sIfaceID, IF_HANDLE *phIface ); - GC_API_P(PTLUpdateInterfaceList )( TL_HANDLE hTL, bool8_t *pbChanged, uint64_t iTimeout ); - GC_API_P(PIFClose )( IF_HANDLE hIface ); - GC_API_P(PIFGetInfo )( IF_HANDLE hIface, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PIFGetNumDevices )( IF_HANDLE hIface, uint32_t *piNumDevices ); - GC_API_P(PIFGetDeviceID )( IF_HANDLE hIface, uint32_t iIndex, char *sIDeviceID, size_t *piSize ); - GC_API_P(PIFUpdateDeviceList )( IF_HANDLE hIface, bool8_t *pbChanged, uint64_t iTimeout ); - GC_API_P(PIFGetDeviceInfo )( IF_HANDLE hIface, const char *sDeviceID, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PIFOpenDevice )( IF_HANDLE hIface, const char *sDeviceID, DEVICE_ACCESS_FLAGS iOpenFlags, DEV_HANDLE *phDevice ); - - GC_API_P(PDevGetPort )( DEV_HANDLE hDevice, PORT_HANDLE *phRemoteDevice ); - GC_API_P(PDevGetNumDataStreams )( DEV_HANDLE hDevice, uint32_t *piNumDataStreams ); - GC_API_P(PDevGetDataStreamID )( DEV_HANDLE hDevice, uint32_t iIndex, char *sDataStreamID, size_t *piSize ); - GC_API_P(PDevOpenDataStream )( DEV_HANDLE hDevice, const char *sDataStreamID, DS_HANDLE *phDataStream ); - GC_API_P(PDevGetInfo )( DEV_HANDLE hDevice, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PDevClose )( DEV_HANDLE hDevice ); - - GC_API_P(PDSAnnounceBuffer )( DS_HANDLE hDataStream, void *pBuffer, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer ); - GC_API_P(PDSAllocAndAnnounceBuffer)( DS_HANDLE hDataStream, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer ); - GC_API_P(PDSFlushQueue )( DS_HANDLE hDataStream, ACQ_QUEUE_TYPE iOperation ); - GC_API_P(PDSStartAcquisition )( DS_HANDLE hDataStream, ACQ_START_FLAGS iStartFlags, uint64_t iNumToAcquire ); - GC_API_P(PDSStopAcquisition )( DS_HANDLE hDataStream, ACQ_STOP_FLAGS iStopFlags ); - GC_API_P(PDSGetInfo )( DS_HANDLE hDataStream, STREAM_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PDSGetBufferID )( DS_HANDLE hDataStream, uint32_t iIndex, BUFFER_HANDLE *phBuffer ); - GC_API_P(PDSClose )( DS_HANDLE hDataStream ); - GC_API_P(PDSRevokeBuffer )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, void **pBuffer, void **pPrivate ); - GC_API_P(PDSQueueBuffer )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer ); - GC_API_P(PDSGetBufferInfo )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, BUFFER_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - /* GenTL v1.1 */ - GC_API_P(PGCGetNumPortURLs )( PORT_HANDLE hPort, uint32_t *iNumURLs ); - GC_API_P(PGCGetPortURLInfo )( PORT_HANDLE hPort, uint32_t iURLIndex, URL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PGCReadPortStacked )( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries ); - GC_API_P(PGCWritePortStacked )( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries ); - - /* GenTL v1.3 */ - GC_API_P(PDSGetBufferChunkData )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, SINGLE_CHUNK_DATA *pChunkData, size_t *piNumChunks ); - - /* GenTL v1.4 */ - GC_API_P(PIFGetParentTL )( IF_HANDLE hIface, TL_HANDLE *phSystem ); - GC_API_P(PDevGetParentIF )( DEV_HANDLE hDevice, IF_HANDLE *phIface ); - GC_API_P(PDSGetParentDev )( DS_HANDLE hDataStream, DEV_HANDLE *phDevice ); - - /* GenTL v1.5 */ - GC_API_P(PDSGetNumBufferParts )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumParts ); - GC_API_P(PDSGetBufferPartInfo )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iPartIndex, BUFFER_PART_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); -#ifdef __cplusplus - } /* end of namespace GenTL */ -} /* end of extern "C" */ -#endif -#endif /* GC_TLI_CLIENT_H_ */ diff --git a/src/arvfakeinterface.c b/src/arvfakeinterface.c index 4176bb759..6ca6785d2 100644 --- a/src/arvfakeinterface.c +++ b/src/arvfakeinterface.c @@ -72,10 +72,10 @@ arv_fake_interface_update_device_list (ArvInterface *interface, GArray *device_i } static ArvDevice * -arv_fake_interface_open_device (ArvInterface *interface, const char *device_id, GError **error) +arv_fake_interface_open_device (ArvInterface *interface, const char *key, GError **error) { - if (g_strcmp0 (device_id, ARV_FAKE_DEVICE_ID) == 0 || - g_strcmp0 (device_id, ARV_FAKE_PHYSICAL_ID) == 0) + if (g_strcmp0 (key, ARV_FAKE_DEVICE_ID) == 0 || + g_strcmp0 (key, ARV_FAKE_PHYSICAL_ID) == 0) return arv_fake_device_new ("1", error); return NULL; diff --git a/src/arvgentldevice.c b/src/arvgentldevice.c index 46c5a6a0d..43e11a8a3 100644 --- a/src/arvgentldevice.c +++ b/src/arvgentldevice.c @@ -395,7 +395,7 @@ _load_genicam (ArvGenTLDevice *gentl_device, size_t *size, char **url, GError * g_string_free (string, TRUE); } - if (g_str_has_suffix (path, ".zip")) { + if (arv_ascii_has_suffix_case_insensitive (path, ".zip")) { ArvZip *zip; const GSList *zip_files; diff --git a/src/arvgentlinterface.c b/src/arvgentlinterface.c index 194ae8e2d..2b8c3a362 100644 --- a/src/arvgentlinterface.c +++ b/src/arvgentlinterface.c @@ -24,7 +24,7 @@ * SECTION: arvgentlinterface * @short_description: GenTL interface */ -#include +#include #include #include #include @@ -38,22 +38,25 @@ /* ArvGenTLnterface implementation */ typedef struct { + ArvGenTLSystem *system; + char *interface; + + char *guid; char *id; - char *name; - char *full_name; + char *vendor_serial; + char *vendor_alias_serial; char *vendor; char *model; char *serial_nbr; - ArvGenTLSystem *system; - char *interface; volatile gint ref_count; } ArvGenTLInterfaceDeviceInfos; static ArvGenTLInterfaceDeviceInfos * arv_gentl_interface_device_infos_new (ArvGenTLSystem *system, + const char *tl_vendor, const char *interface, - const char *id, + const char *guid, const char *vendor, const char *model, const char *serial_nbr) @@ -62,7 +65,7 @@ arv_gentl_interface_device_infos_new (ArvGenTLSystem *system, g_return_val_if_fail (system != NULL, NULL); g_return_val_if_fail (interface != NULL, NULL); - g_return_val_if_fail (id != NULL, NULL); + g_return_val_if_fail (guid != NULL, NULL); g_return_val_if_fail (vendor != NULL, NULL); g_return_val_if_fail (model != NULL, NULL); g_return_val_if_fail (serial_nbr != NULL, NULL); @@ -70,17 +73,18 @@ arv_gentl_interface_device_infos_new (ArvGenTLSystem *system, infos = g_new (ArvGenTLInterfaceDeviceInfos, 1); infos->system = system; infos->interface = g_strdup(interface); - infos->id = g_strdup(id); - infos->name = g_strdup_printf ("%s-%s", arv_vendor_alias_lookup (vendor), serial_nbr); - infos->full_name = g_strdup_printf ("%s-%s", vendor, serial_nbr); + infos->guid = g_strdup (guid); + infos->id = g_strdup_printf ("%s-%s-%s-%s", tl_vendor, vendor, model, serial_nbr); + infos->vendor_alias_serial = g_strdup_printf ("%s-%s-%s", tl_vendor, arv_vendor_alias_lookup (vendor), serial_nbr); + infos->vendor_serial = g_strdup_printf ("%s-%s-%s", tl_vendor, vendor, serial_nbr); infos->vendor = g_strdup (vendor); infos->model = g_strdup (model); infos->serial_nbr = g_strdup (serial_nbr); infos->ref_count = 1; arv_str_strip (infos->id, ARV_DEVICE_NAME_ILLEGAL_CHARACTERS, ARV_DEVICE_NAME_REPLACEMENT_CHARACTER); - arv_str_strip (infos->name, ARV_DEVICE_NAME_ILLEGAL_CHARACTERS, ARV_DEVICE_NAME_REPLACEMENT_CHARACTER); - arv_str_strip (infos->full_name, ARV_DEVICE_NAME_ILLEGAL_CHARACTERS, ARV_DEVICE_NAME_REPLACEMENT_CHARACTER); + arv_str_strip (infos->vendor_serial, ARV_DEVICE_NAME_ILLEGAL_CHARACTERS, ARV_DEVICE_NAME_REPLACEMENT_CHARACTER); + arv_str_strip (infos->vendor_alias_serial, ARV_DEVICE_NAME_ILLEGAL_CHARACTERS, ARV_DEVICE_NAME_REPLACEMENT_CHARACTER); return infos; } @@ -105,9 +109,10 @@ arv_gentl_interface_device_infos_unref (ArvGenTLInterfaceDeviceInfos *infos) if (g_atomic_int_dec_and_test (&infos->ref_count)) { infos->system = NULL; g_clear_pointer (&infos->interface, g_free); + g_clear_pointer (&infos->guid, g_free); g_clear_pointer (&infos->id, g_free); - g_clear_pointer (&infos->name, g_free); - g_clear_pointer (&infos->full_name, g_free); + g_clear_pointer (&infos->vendor_serial, g_free); + g_clear_pointer (&infos->vendor_alias_serial, g_free); g_clear_pointer (&infos->vendor, g_free); g_clear_pointer (&infos->model, g_free); g_clear_pointer (&infos->serial_nbr, g_free); @@ -132,6 +137,24 @@ struct _ArvGenTLInterfaceClass { G_DEFINE_TYPE_WITH_CODE (ArvGenTLInterface, arv_gentl_interface, ARV_TYPE_INTERFACE, G_ADD_PRIVATE (ArvGenTLInterface)) +static char * +_gentl_get_tl_info_str (ArvGenTLModule *gentl, TL_HANDLE handle, TL_INFO_CMD info_cmd) +{ + GC_ERROR error; + INFO_DATATYPE type; + size_t size; + char *value = NULL; + + error = gentl->TLGetInfo (handle, info_cmd, &type, NULL, &size); + if (error == GC_ERR_SUCCESS) { + value = g_malloc0(size); + gentl->TLGetInfo (handle, info_cmd, &type, value, &size); + } else { + arv_warning_interface("_gentl_get_tl_info_str: error %d", error); + } + return value; +} + static char * _gentl_get_info_str(GC_ERROR(*func)(void*, const char *, int32_t, int32_t*, void*, size_t*), void *interface, const char *device, BUFFER_INFO_CMD info_cmd) @@ -224,12 +247,14 @@ _discover (ArvGenTLInterface *gentl_interface, GArray *device_ids) /* Iterate over all devices of a GenTL interface */ for (uint32_t j=0; jIFGetDeviceID, interface_handle, j); + tl_vendor = _gentl_get_tl_info_str(gentl, system_handle, TL_INFO_VENDOR); + id = _gentl_get_info_str(gentl->IFGetDeviceInfo, interface_handle, device_id, DEVICE_INFO_ID); model = _gentl_get_info_str(gentl->IFGetDeviceInfo, @@ -239,26 +264,34 @@ _discover (ArvGenTLInterface *gentl_interface, GArray *device_ids) serial_nbr = _gentl_get_info_str(gentl->IFGetDeviceInfo, interface_handle, device_id, DEVICE_INFO_SERIAL_NUMBER); - arv_info_interface ("Device: %s", device_id); - arv_info_interface (" ID: %s", id); - arv_info_interface (" VENDOR: %s", vendor); - arv_info_interface (" MODEL: %s", model); - arv_info_interface (" S/N: %s", serial_nbr); - - device_info = arv_gentl_interface_device_infos_new(gentl_system, interface_id, id, + device_infos = arv_gentl_interface_device_infos_new(gentl_system, tl_vendor, interface_id, id, vendor, model, serial_nbr); - g_hash_table_replace(priv->devices, device_info->id, - arv_gentl_interface_device_infos_ref(device_info)); + arv_info_interface ("[GentTLInterface::discovery] Device '%s' found", + device_infos->id); + + g_hash_table_replace(priv->devices, device_infos->id, + arv_gentl_interface_device_infos_ref(device_infos)); + arv_info_interface (" %s", device_infos->id); + g_hash_table_replace (priv->devices, device_infos->vendor_serial, + arv_gentl_interface_device_infos_ref (device_infos)); + arv_info_interface (" %s", device_infos->vendor_serial); + g_hash_table_replace (priv->devices, device_infos->vendor_alias_serial, + arv_gentl_interface_device_infos_ref (device_infos)); + arv_info_interface (" %s", device_infos->vendor_alias_serial); + g_hash_table_replace (priv->devices, device_infos->guid, + arv_gentl_interface_device_infos_ref (device_infos)); + arv_info_interface (" %s", device_infos->guid); if (device_ids) { ids = g_new0 (ArvInterfaceDeviceIds, 1); - ids->device = id; + ids->device = g_strdup (device_infos->id); ids->model = model; ids->vendor = vendor; ids->serial_nbr = serial_nbr; ids->address = g_strdup(interface_type); ids->protocol = arv_protocol_from_transport_layer_type (interface_type); g_array_append_val (device_ids, ids); + g_free (id); } else { g_free(id); g_free(model); @@ -266,7 +299,8 @@ _discover (ArvGenTLInterface *gentl_interface, GArray *device_ids) g_free(serial_nbr); } g_clear_pointer(&device_id, g_free); - arv_gentl_interface_device_infos_unref(device_info); + + arv_gentl_interface_device_infos_unref(device_infos); } arv_gentl_system_close_interface_handle(gentl_system, interface_id); @@ -288,20 +322,20 @@ arv_gentl_interface_update_device_list (ArvInterface *interface, GArray *device_ } static ArvDevice * -arv_gentl_interface_open_device (ArvInterface *interface, const char *device_id, GError **error) +arv_gentl_interface_open_device (ArvInterface *interface, const char *key, GError **error) { ArvGenTLInterfacePrivate *priv = arv_gentl_interface_get_instance_private(ARV_GENTL_INTERFACE (interface)); ArvDevice *device = NULL; ArvGenTLInterfaceDeviceInfos *device_infos = NULL; - if (device_id == NULL) { + if (key == NULL) { GList *device_list; device_list = g_hash_table_get_values (priv->devices); device_infos = device_list != NULL ? device_list->data : NULL; g_list_free (device_list); } else - device_infos = g_hash_table_lookup (priv->devices, device_id); + device_infos = g_hash_table_lookup (priv->devices, key); /* Refresh devices if the requested device is in the cache. */ if (device_infos == NULL) { @@ -309,17 +343,16 @@ arv_gentl_interface_open_device (ArvInterface *interface, const char *device_id, _discover(ARV_GENTL_INTERFACE(interface), NULL); - if (device_id == NULL) { + if (key == NULL) { device_list = g_hash_table_get_values (priv->devices); device_infos = device_list != NULL ? device_list->data : NULL; g_list_free (device_list); } else - device_infos = g_hash_table_lookup (priv->devices, device_id); + device_infos = g_hash_table_lookup (priv->devices, key); } if (device_infos) - device = arv_gentl_device_new (device_infos->system, device_infos->interface, - device_infos->id, error); + device = arv_gentl_device_new (device_infos->system, device_infos->interface, device_infos->guid, error); return device; } diff --git a/src/arvgentlinterfaceprivate.h b/src/arvgentlinterfaceprivate.h index bb0be15e7..1043453c2 100644 --- a/src/arvgentlinterfaceprivate.h +++ b/src/arvgentlinterfaceprivate.h @@ -29,8 +29,7 @@ #include #include - -#include +#include G_BEGIN_DECLS diff --git a/src/arvgentlprivate.h b/src/arvgentlprivate.h new file mode 100644 index 000000000..e3bf231b0 --- /dev/null +++ b/src/arvgentlprivate.h @@ -0,0 +1,619 @@ +/* Aravis - Digital camera library + * + * Copyright © 2009-2026 Emmanuel Pacaud + * + * SPDX-License-Identifier: LGPL-2.1-or-later + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see . + * + * Author: Emmanuel Pacaud + */ + +#ifndef ARV_GENTL_H +#define ARV_GENTL_H + +#include +#include +#include + +G_BEGIN_DECLS + +#define GENTL_INVALID_HANDLE NULL +#define GENTL_INFINITE 0xFFFFFFFFFFFFFFFFULL + +typedef int8_t bool8_t; + +typedef int32_t GC_ERROR; +enum { + GC_ERR_SUCCESS = 0, + GC_ERR_ERROR = -1001, + GC_ERR_NOT_INITIALIZED = -1002, + GC_ERR_NOT_IMPLEMENTED = -1003, + GC_ERR_RESOURCE_IN_USE = -1004, + GC_ERR_ACCESS_DENIED = -1005, + GC_ERR_INVALID_HANDLE = -1006, + GC_ERR_INVALID_ID = -1007, + GC_ERR_NO_DATA = -1008, + GC_ERR_INVALID_PARAMETER = -1009, + GC_ERR_IO = -1010, + GC_ERR_TIMEOUT = -1011, + GC_ERR_ABORT = -1012, + GC_ERR_INVALID_BUFFER = -1013, + GC_ERR_NOT_AVAILABLE = -1014, + GC_ERR_INVALID_ADDRESS = -1015, + GC_ERR_BUFFER_TOO_SMALL = -1016, + GC_ERR_INVALID_INDEX = -1017, + GC_ERR_PARSING_CHUNK_DATA = -1018, + GC_ERR_INVALID_VALUE = -1019, + GC_ERR_RESOURCE_EXHAUSTED = -1020, + GC_ERR_OUT_OF_MEMORY = -1021, + GC_ERR_BUSY = -1022, + GC_ERR_AMBIGUOUS = -1023, + GC_ERR_CUSTOM_ID = -10000 +}; + +typedef int32_t TL_CHAR_ENCODING; +enum +{ + TL_CHAR_ENCODING_ASCII = 0, + TL_CHAR_ENCODING_UTF8 = 1 +}; + +typedef int32_t TL_INFO_CMD; +enum { + TL_INFO_ID = 0, + TL_INFO_VENDOR = 1, + TL_INFO_MODEL = 2, + TL_INFO_VERSION = 3, + TL_INFO_TLTYPE = 4, + TL_INFO_NAME = 5, + TL_INFO_PATHNAME = 6, + TL_INFO_DISPLAYNAME = 7, + TL_INFO_CHAR_ENCODING = 8, + TL_INFO_GENTL_VER_MAJOR = 9, + TL_INFO_GENTL_VER_MINOR = 10, + TL_INFO_CUSTOM_ID = 1000 +} ; + + +typedef int32_t INFO_DATATYPE; +enum { + INFO_DATATYPE_UNKNOWN = 0, + INFO_DATATYPE_STRING = 1, + INFO_DATATYPE_STRINGLIST = 2, + INFO_DATATYPE_INT16 = 3, + INFO_DATATYPE_UINT16 = 4, + INFO_DATATYPE_INT32 = 5, + INFO_DATATYPE_UINT32 = 6, + INFO_DATATYPE_INT64 = 7, + INFO_DATATYPE_UINT64 = 8, + INFO_DATATYPE_FLOAT64 = 9, + INFO_DATATYPE_PTR = 10, + INFO_DATATYPE_BOOL8 = 11, + INFO_DATATYPE_SIZET = 12, + INFO_DATATYPE_BUFFER = 13, + INFO_DATATYPE_PTRDIFF = 14, + INFO_DATATYPE_CUSTOM_ID = 1000 +}; + +typedef int32_t INTERFACE_INFO_CMD; +enum { + INTERFACE_INFO_ID = 0, + INTERFACE_INFO_DISPLAYNAME = 1, + INTERFACE_INFO_TLTYPE = 2, + INTERFACE_INFO_CUSTOM_ID = 1000 +}; + +typedef int32_t DEVICE_INFO_CMD; +enum { + DEVICE_INFO_ID = 0, + DEVICE_INFO_VENDOR = 1, + DEVICE_INFO_MODEL = 2, + DEVICE_INFO_TLTYPE = 3, + DEVICE_INFO_DISPLAYNAME = 4, + DEVICE_INFO_ACCESS_STATUS = 5, + DEVICE_INFO_USER_DEFINED_NAME = 6, + DEVICE_INFO_SERIAL_NUMBER = 7, + DEVICE_INFO_VERSION = 8, + DEVICE_INFO_TIMESTAMP_FREQUENCY = 9, + DEVICE_INFO_CUSTOM_ID = 1000 +}; + +typedef int32_t DEVICE_ACCESS_FLAGS; +enum { + DEVICE_ACCESS_UNKNOWN = 0, + DEVICE_ACCESS_NONE = 1, + DEVICE_ACCESS_READONLY = 2, + DEVICE_ACCESS_CONTROL = 3, + DEVICE_ACCESS_EXCLUSIVE = 4, + DEVICE_ACCESS_CUSTOM_ID = 1000 +}; + +typedef int32_t DEVICE_ACCESS_STATUS; +enum { + DEVICE_ACCESS_STATUS_UNKNOWN = 0, + DEVICE_ACCESS_STATUS_READWRITE = 1, + DEVICE_ACCESS_STATUS_READONLY = 2, + DEVICE_ACCESS_STATUS_NOACCESS = 3, + DEVICE_ACCESS_STATUS_BUSY = 4, + DEVICE_ACCESS_STATUS_OPEN_READWRITE = 5, + DEVICE_ACCESS_STATUS_OPEN_READONLY = 6, + DEVICE_ACCESS_STATUS_CUSTOM_ID = 1000 +}; + +typedef int32_t ACQ_QUEUE_TYPE; +enum { + ACQ_QUEUE_INPUT_TO_OUTPUT = 0, + ACQ_QUEUE_OUTPUT_DISCARD = 1, + ACQ_QUEUE_ALL_TO_INPUT = 2, + ACQ_QUEUE_UNQUEUED_TO_INPUT = 3, + ACQ_QUEUE_ALL_DISCARD = 4, + ACQ_QUEUE_CUSTOM_ID = 1000 +}; + +typedef int32_t BUFFER_INFO_CMD; +enum { + BUFFER_INFO_BASE = 0, + BUFFER_INFO_SIZE = 1, + BUFFER_INFO_USER_PTR = 2, + BUFFER_INFO_TIMESTAMP = 3, + BUFFER_INFO_NEW_DATA = 4, + BUFFER_INFO_IS_QUEUED = 5, + BUFFER_INFO_IS_ACQUIRING = 6, + BUFFER_INFO_IS_INCOMPLETE = 7, + BUFFER_INFO_TLTYPE = 8, + BUFFER_INFO_SIZE_FILLED = 9, + BUFFER_INFO_WIDTH = 10, + BUFFER_INFO_HEIGHT = 11, + BUFFER_INFO_XOFFSET = 12, + BUFFER_INFO_YOFFSET = 13, + BUFFER_INFO_XPADDING = 14, + BUFFER_INFO_YPADDING = 15, + BUFFER_INFO_FRAMEID = 16, + BUFFER_INFO_IMAGEPRESENT = 17, + BUFFER_INFO_IMAGEOFFSET = 18, + BUFFER_INFO_PAYLOADTYPE = 19, + BUFFER_INFO_PIXELFORMAT = 20, + BUFFER_INFO_PIXELFORMAT_NAMESPACE = 21, + BUFFER_INFO_DELIVERED_IMAGEHEIGHT = 22, + BUFFER_INFO_DELIVERED_CHUNKPAYLOADSIZE = 23, + BUFFER_INFO_CHUNKLAYOUTID = 24, + BUFFER_INFO_FILENAME = 25, + BUFFER_INFO_PIXEL_ENDIANNESS = 26, + BUFFER_INFO_DATA_SIZE = 27, + BUFFER_INFO_TIMESTAMP_NS = 28, + BUFFER_INFO_DATA_LARGER_THAN_BUFFER = 29, + BUFFER_INFO_CONTAINS_CHUNKDATA = 30, + BUFFER_INFO_IS_COMPOSITE = 31, + BUFFER_INFO_CUSTOM_ID = 1000 +}; + +typedef int32_t PAYLOADTYPE_INFO_ID; +enum PAYLOADTYPE_INFO_IDS +{ + PAYLOAD_TYPE_UNKNOWN = 0, + PAYLOAD_TYPE_IMAGE = 1, + PAYLOAD_TYPE_RAW_DATA = 2, + PAYLOAD_TYPE_FILE = 3, + PAYLOAD_TYPE_CHUNK_DATA = 4, + PAYLOAD_TYPE_JPEG = 5, + PAYLOAD_TYPE_JPEG2000 = 6, + PAYLOAD_TYPE_H264 = 7, + PAYLOAD_TYPE_CHUNK_ONLY = 8, + PAYLOAD_TYPE_DEVICE_SPECIFIC = 9, + PAYLOAD_TYPE_MULTI_PART = 10, + PAYLOAD_TYPE_GENDC = 11, + PAYLOAD_TYPE_CUSTOM_ID = 1000 +}; + +typedef int32_t STREAM_INFO_CMD; +enum { + STREAM_INFO_ID = 0, + STREAM_INFO_NUM_DELIVERED = 1, + STREAM_INFO_NUM_UNDERRUN = 2, + STREAM_INFO_NUM_ANNOUNCED = 3, + STREAM_INFO_NUM_QUEUED = 4, + STREAM_INFO_NUM_AWAIT_DELIVERY = 5, + STREAM_INFO_NUM_STARTED = 6, + STREAM_INFO_PAYLOAD_SIZE = 7, + STREAM_INFO_IS_GRABBING = 8, + STREAM_INFO_DEFINES_PAYLOADSIZE = 9, + STREAM_INFO_TLTYPE = 10, + STREAM_INFO_NUM_CHUNKS_MAX = 11, + STREAM_INFO_BUF_ANNOUNCE_MIN = 12, + STREAM_INFO_BUF_ALIGNMENT = 13, + STREAM_INFO_FLOW_TABLE = 14, + STREAM_INFO_GENDC_PREFETCH_DESCRIPTOR = 15, + STREAM_INFO_CUSTOM_ID = 1000 +}; + +typedef int32_t ACQ_START_FLAGS; +enum { + ACQ_START_FLAGS_DEFAULT = 0, + ACQ_START_FLAGS_CUSTOM_ID = 1000 +}; + +typedef int32_t ACQ_STOP_FLAGS; +enum { + ACQ_STOP_FLAGS_DEFAULT = 0, + ACQ_STOP_FLAGS_KILL = 1, + ACQ_STOP_FLAGS_CUSTOM_ID = 1000 +}; + +typedef int32_t BUFFER_PART_INFO_CMD; +enum { + BUFFER_PART_INFO_BASE = 0, + BUFFER_PART_INFO_DATA_SIZE = 1, + BUFFER_PART_INFO_DATA_TYPE = 2, + BUFFER_PART_INFO_DATA_FORMAT = 3, + BUFFER_PART_INFO_DATA_FORMAT_NAMESPACE = 4, + BUFFER_PART_INFO_WIDTH = 5, + BUFFER_PART_INFO_HEIGHT = 6, + BUFFER_PART_INFO_XOFFSET = 7, + BUFFER_PART_INFO_YOFFSET = 8, + BUFFER_PART_INFO_XPADDING = 9, + BUFFER_PART_INFO_SOURCE_ID = 10, + BUFFER_PART_INFO_DELIVERED_IMAGEHEIGHT = 11, + BUFFER_PART_INFO_REGION_ID = 12, + BUFFER_PART_INFO_DATA_PURPOSE_ID = 13, + BUFFER_PART_INFO_CUSTOM_ID = 1000 +}; + +typedef int32_t FLOW_INFO_CMD; +enum { + FLOW_INFO_SIZE = 0, + FLOW_INFO_CUSTOM_ID = 1000 +}; + +typedef int32_t SEGMENT_INFO_CMD; +enum { + SEGMENT_INFO_BASE = 0, + SEGMENT_INFO_SIZE = 1, + SEGMENT_INFO_IS_INCOMPLETE = 2, + SEGMENT_INFO_SIZE_FILLED = 3, + SEGMENT_INFO_DATA_SIZE = 4, + SEGMENT_INFO_CUSTOM_ID = 1000 +}; + +typedef int32_t PORT_INFO_CMD; +enum { + PORT_INFO_ID = 0, + PORT_INFO_VENDOR = 1, + PORT_INFO_MODEL = 2, + PORT_INFO_TLTYPE = 3, + PORT_INFO_MODULE = 4, + PORT_INFO_LITTLE_ENDIAN = 5, + PORT_INFO_BIG_ENDIAN = 6, + PORT_INFO_ACCESS_READ = 7, + PORT_INFO_ACCESS_WRITE = 8, + PORT_INFO_ACCESS_NA = 9, + PORT_INFO_ACCESS_NI = 10, + PORT_INFO_VERSION = 11, + PORT_INFO_PORTNAME = 12, + PORT_INFO_CUSTOM_ID = 1000 +}; + +typedef int32_t URL_INFO_CMD; +enum { + URL_INFO_URL = 0, + URL_INFO_SCHEMA_VER_MAJOR = 1, + URL_INFO_SCHEMA_VER_MINOR = 2, + URL_INFO_FILE_VER_MAJOR = 3, + URL_INFO_FILE_VER_MINOR = 4, + URL_INFO_FILE_VER_SUBMINOR = 5, + URL_INFO_FILE_SHA1_HASH = 6, + URL_INFO_FILE_REGISTER_ADDRESS = 7, + URL_INFO_FILE_SIZE = 8, + URL_INFO_SCHEME = 9, + URL_INFO_FILENAME = 10, + URL_INFO_CUSTOM_ID = 1000 +}; + +typedef int32_t EVENT_DATA_INFO_CMD; +enum { + EVENT_DATA_ID = 0, + EVENT_DATA_VALUE = 1, + EVENT_DATA_NUMID = 2, + EVENT_DATA_CUSTOM_ID = 1000 +}; + +typedef int32_t EVENT_INFO_CMD; +enum { + EVENT_EVENT_TYPE = 0, + EVENT_NUM_IN_QUEUE = 1, + EVENT_NUM_FIRED = 2, + EVENT_SIZE_MAX = 3, + EVENT_INFO_DATA_SIZE_MAX = 4, + EVENT_INFO_CUSTOM_ID = 1000 +}; + +typedef int32_t EVENT_TYPE; +enum { + EVENT_ERROR = 0, + EVENT_NEW_BUFFER = 1, + EVENT_FEATURE_INVALIDATE = 2, + EVENT_FEATURE_CHANGE = 3, + EVENT_REMOTE_DEVICE = 4, + EVENT_MODULE = 5, + EVENT_CUSTOM_ID = 1000 +}; + +typedef void * TL_HANDLE; +typedef void * IF_HANDLE; +typedef void * DEV_HANDLE; +typedef void * PORT_HANDLE; +typedef void * DS_HANDLE; +typedef void * BUFFER_HANDLE; +typedef void * EVENT_HANDLE; +typedef void * EVENTSRC_HANDLE; + +#pragma pack(push,1) + +typedef struct { + uint64_t ChunkID; + ptrdiff_t ChunkOffset; + size_t ChunkLength; +} SINGLE_CHUNK_DATA; + +typedef struct { + BUFFER_INFO_CMD iInfoCmd; + INFO_DATATYPE iType; + void *puffer; + size_t iSize; + GC_ERROR iResult; +} DS_BUFFER_INFO_STACKED; + +typedef struct { + uint32_t iPartIndex; + BUFFER_PART_INFO_CMD iInfoCmd; + INFO_DATATYPE iType; + GC_ERROR iResult; + void *pBuffer; + size_t iSize; +} DS_BUFFER_PART_INFO_STACKED; + +typedef struct { + BUFFER_HANDLE BufferHandle; + void *UserPointer; +} EVENT_NEW_BUFFER_DATA; + +typedef struct { + uint64_t Address; + void *Buffer; + size_t Size; +} PORT_REGISTER_STACK_ENTRY; + +#pragma pack(pop) + +ARV_API GC_ERROR GCCloseLib (void); +ARV_API GC_ERROR GCGetInfo (TL_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); +ARV_API GC_ERROR GCGetLastError (GC_ERROR *piErrorCode, char *sErrorText, size_t *piSize); +ARV_API GC_ERROR GCInitLib (void); + +ARV_API GC_ERROR TLClose (TL_HANDLE hSystem); +ARV_API GC_ERROR TLGetInfo (TL_HANDLE hSystem, TL_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +ARV_API GC_ERROR TLGetInterfaceID (TL_HANDLE hSystem, uint32_t iIndex, + char *sIfaceID, size_t *piSize ); +ARV_API GC_ERROR TLGetInterfaceInfo (TL_HANDLE hSystem, const char *sIfaceID, + INTERFACE_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +ARV_API GC_ERROR TLGetNumInterfaces (TL_HANDLE hSystem, uint32_t *piNumIfaces); +ARV_API GC_ERROR TLOpen (TL_HANDLE *phSystem); +ARV_API GC_ERROR TLOpenInterface (TL_HANDLE hSystem, const char * sIfaceID, IF_HANDLE *phIface); +ARV_API GC_ERROR TLUpdateInterfaceList (TL_HANDLE hSystem, bool8_t *pbChanged, uint64_t iTimeout); + +ARV_API GC_ERROR IFClose (IF_HANDLE hIface); +ARV_API GC_ERROR IFGetInfo (IF_HANDLE hIface, INTERFACE_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t * piSize); +ARV_API GC_ERROR IFGetDeviceID (IF_HANDLE hIface, uint32_t iIndex, + char *sDeviceID, size_t *piSize ); +ARV_API GC_ERROR IFGetDeviceInfo (IF_HANDLE hIface, const char *sDeviceID, + DEVICE_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +ARV_API GC_ERROR IFGetNumDevices (IF_HANDLE hIface, uint32_t *piNumDevices); +ARV_API GC_ERROR IFOpenDevice (IF_HANDLE hIface, const char * sDeviceID, + DEVICE_ACCESS_FLAGS iOpenFlag, DEV_HANDLE *phDevice); +ARV_API GC_ERROR IFUpdateDeviceList (IF_HANDLE hIface, bool8_t *pbChanged, uint64_t iTimeout); +ARV_API GC_ERROR IFGetParentTL (IF_HANDLE hIface, TL_HANDLE *phSystem); + +ARV_API GC_ERROR DevClose (DEV_HANDLE hDevice); +ARV_API GC_ERROR DevGetInfo (DEV_HANDLE hDevice, DEVICE_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +ARV_API GC_ERROR DevGetDataStreamID (DEV_HANDLE hDevice, uint32_t iIndex, + char *sDataStreamID, size_t *piSize); +ARV_API GC_ERROR DevGetNumDataStreams (DEV_HANDLE hDevice, uint32_t *piNumDataStreams); +ARV_API GC_ERROR DevGetPort (DEV_HANDLE hDevice, PORT_HANDLE *phRemoteDev); +ARV_API GC_ERROR DevOpenDataStream (DEV_HANDLE hDevice, const char *sDataStreamID, + DS_HANDLE *phDataStream ); +ARV_API GC_ERROR DevGetParentIF (DEV_HANDLE hDevice, IF_HANDLE *phIface); + +ARV_API GC_ERROR DSAllocAndAnnounceBuffer (DS_HANDLE hDataStream, size_t iBufferSize, + void *pPrivate, BUFFER_HANDLE *phBuffer); +ARV_API GC_ERROR DSAnnounceBuffer (DS_HANDLE hDataStream, void *pBuffer, + size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer); +ARV_API GC_ERROR DSAnnounceCompositeBuffer (DS_HANDLE hDataStream, size_t iNumSegments, void ** ppSegments, + size_t *piSizes, void *pPrivate, BUFFER_HANDLE *phBuffer); +ARV_API GC_ERROR DSClose (DS_HANDLE hDataStream); +ARV_API GC_ERROR DSFlushQueue (DS_HANDLE hDataStream, ACQ_QUEUE_TYPE iOperation); +ARV_API GC_ERROR DSGetBufferID (DS_HANDLE hDataStream, uint32_t iIndex, BUFFER_HANDLE *phBuffer); +ARV_API GC_ERROR DSGetBufferInfo (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, + BUFFER_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +ARV_API GC_ERROR DSGetInfo (DS_HANDLE hDataStream, STREAM_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +ARV_API GC_ERROR DSQueueBuffer (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer); +ARV_API GC_ERROR DSRevokeBuffer (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, + void **ppBuffer, void **ppPrivate); +ARV_API GC_ERROR DSStartAcquisition (DS_HANDLE hDataStream, ACQ_START_FLAGS iStartFlags, + uint64_t iNumToAcquire); +ARV_API GC_ERROR DSStopAcquisition (DS_HANDLE hDataStream, ACQ_STOP_FLAGS iStopFlags); +ARV_API GC_ERROR DSGetBufferChunkData (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, + SINGLE_CHUNK_DATA *pChunkData, size_t *piNumChunks); +ARV_API GC_ERROR DSGetParentDev (DS_HANDLE hDataStream, DEV_HANDLE *phDevice); +ARV_API GC_ERROR DSGetNumBufferParts (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumParts); +ARV_API GC_ERROR DSGetBufferPartInfo (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iPartIndex, + BUFFER_PART_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +ARV_API GC_ERROR DSGetBufferInfoStacked (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, + DS_BUFFER_INFO_STACKED *pInfoStacked, size_t iNumInfos); +ARV_API GC_ERROR DSGetBufferPartInfoStacked (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, + DS_BUFFER_PART_INFO_STACKED *pInfoStacked, size_t iNumInfos); +ARV_API GC_ERROR DSGetNumFlows (DS_HANDLE hDataStream, uint32_t *piNumFlows); +ARV_API GC_ERROR DSGetFlowInfo (DS_HANDLE hDataStream, uint32_t iFlowIndex, + FLOW_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +ARV_API GC_ERROR DSGetNumBufferSegments (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, + uint32_t *piNumSegments); +ARV_API GC_ERROR DSGetBufferSegmentInfo (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, + uint32_t iSegmentIndex, SEGMENT_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); + +ARV_API GC_ERROR GCGetPortInfo (PORT_HANDLE hPort, PORT_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +ARV_API GC_ERROR GCGetPortURL (PORT_HANDLE hPort, char *sURL, size_t *piSize); +ARV_API GC_ERROR GCGetNumPortURLs (PORT_HANDLE hPort, uint32_t *piNumURLs); +ARV_API GC_ERROR GCGetPortURLInfo (PORT_HANDLE hPort, uint32_t iURLIndex, URL_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +ARV_API GC_ERROR GCReadPort (PORT_HANDLE hPort, uint64_t iAddress, void *pBuffer, size_t *piSize); +ARV_API GC_ERROR GCWritePort (PORT_HANDLE hPort, uint64_t iAddress, const void *pBuffer, size_t *piSize); +ARV_API GC_ERROR GCWritePortStacked (PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, + size_t * piNumEntries); +ARV_API GC_ERROR GCReadPortStacked (PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, + size_t * piNumEntries); + +ARV_API GC_ERROR EventFlush (EVENT_HANDLE hEvent); +ARV_API GC_ERROR EventGetData (EVENT_HANDLE hEvent, void *pBuffer, size_t *piSize, uint64_t iTimeout); +ARV_API GC_ERROR EventGetDataInfo (EVENT_HANDLE hEvent, const void *pInBuffer, size_t iInSize, + EVENT_DATA_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pOutBuffer, size_t *piOutSize); +ARV_API GC_ERROR EventGetInfo (EVENT_HANDLE hEvent, EVENT_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +ARV_API GC_ERROR EventKill (EVENT_HANDLE hEvent); +ARV_API GC_ERROR GCRegisterEvent (EVENTSRC_HANDLE hModule, EVENT_TYPE iEventID, EVENT_HANDLE *phEvent); +ARV_API GC_ERROR GCUnregisterEvent (EVENTSRC_HANDLE hModule, EVENT_TYPE iEventID); + +typedef GC_ERROR (*PGCCloseLib) (void); +typedef GC_ERROR (*PGCGetInfo) (TL_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); +typedef GC_ERROR (*PGCGetLastError) (GC_ERROR *piErrorCode, char *sErrorText, size_t *piSize); +typedef GC_ERROR (*PGCInitLib) (void); + +typedef GC_ERROR (*PTLClose) (TL_HANDLE hSystem); +typedef GC_ERROR (*PTLGetInfo) (TL_HANDLE hSystem, TL_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +typedef GC_ERROR (*PTLGetInterfaceID) (TL_HANDLE hSystem, uint32_t iIndex, + char *sIfaceID, size_t *piSize ); +typedef GC_ERROR (*PTLGetInterfaceInfo) (TL_HANDLE hSystem, const char *sIfaceID, + INTERFACE_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +typedef GC_ERROR (*PTLGetNumInterfaces) (TL_HANDLE hSystem, uint32_t *piNumIfaces); +typedef GC_ERROR (*PTLOpen) (TL_HANDLE *phSystem); +typedef GC_ERROR (*PTLOpenInterface) (TL_HANDLE hSystem, const char * sIfaceID, IF_HANDLE *phIface); +typedef GC_ERROR (*PTLUpdateInterfaceList) (TL_HANDLE hSystem, bool8_t *pbChanged, uint64_t iTimeout); + +typedef GC_ERROR (*PIFClose) (IF_HANDLE hIface); +typedef GC_ERROR (*PIFGetInfo) (IF_HANDLE hIface, INTERFACE_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t * piSize); +typedef GC_ERROR (*PIFGetDeviceID) (IF_HANDLE hIface, uint32_t iIndex, + char *sDeviceID, size_t *piSize ); +typedef GC_ERROR (*PIFGetDeviceInfo) (IF_HANDLE hIface, const char *sDeviceID, + DEVICE_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +typedef GC_ERROR (*PIFGetNumDevices) (IF_HANDLE hIface, uint32_t *piNumDevices); +typedef GC_ERROR (*PIFOpenDevice) (IF_HANDLE hIface, const char * sDeviceID, + DEVICE_ACCESS_FLAGS iOpenFlag, DEV_HANDLE *phDevice); +typedef GC_ERROR (*PIFUpdateDeviceList) (IF_HANDLE hIface, bool8_t *pbChanged, uint64_t iTimeout); +typedef GC_ERROR (*PIFGetParentTL) (IF_HANDLE hIface, TL_HANDLE *phSystem); + +typedef GC_ERROR (*PDevClose) (DEV_HANDLE hDevice); +typedef GC_ERROR (*PDevGetInfo) (DEV_HANDLE hDevice, DEVICE_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +typedef GC_ERROR (*PDevGetDataStreamID) (DEV_HANDLE hDevice, uint32_t iIndex, + char *sDataStreamID, size_t *piSize); +typedef GC_ERROR (*PDevGetNumDataStreams) (DEV_HANDLE hDevice, uint32_t *piNumDataStreams); +typedef GC_ERROR (*PDevGetPort) (DEV_HANDLE hDevice, PORT_HANDLE *phRemoteDev); +typedef GC_ERROR (*PDevOpenDataStream) (DEV_HANDLE hDevice, const char *sDataStreamID, + DS_HANDLE *phDataStream ); +typedef GC_ERROR (*PDevGetParentIF) (DEV_HANDLE hDevice, IF_HANDLE *phIface); + +typedef GC_ERROR (*PDSAllocAndAnnounceBuffer) (DS_HANDLE hDataStream, size_t iBufferSize, + void *pPrivate, BUFFER_HANDLE *phBuffer); +typedef GC_ERROR (*PDSAnnounceBuffer) (DS_HANDLE hDataStream, void *pBuffer, + size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer); +typedef GC_ERROR (*PDSAnnounceCompositeBuffer) (DS_HANDLE hDataStream, size_t iNumSegments, void ** ppSegments, + size_t *piSizes, void *pPrivate, BUFFER_HANDLE *phBuffer); +typedef GC_ERROR (*PDSClose) (DS_HANDLE hDataStream); +typedef GC_ERROR (*PDSFlushQueue) (DS_HANDLE hDataStream, ACQ_QUEUE_TYPE iOperation); +typedef GC_ERROR (*PDSGetBufferID) (DS_HANDLE hDataStream, uint32_t iIndex, BUFFER_HANDLE *phBuffer); +typedef GC_ERROR (*PDSGetBufferInfo) (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, + BUFFER_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +typedef GC_ERROR (*PDSGetInfo) (DS_HANDLE hDataStream, STREAM_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +typedef GC_ERROR (*PDSQueueBuffer) (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer); +typedef GC_ERROR (*PDSRevokeBuffer) (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, + void **ppBuffer, void **ppPrivate); +typedef GC_ERROR (*PDSStartAcquisition) (DS_HANDLE hDataStream, ACQ_START_FLAGS iStartFlags, + uint64_t iNumToAcquire); +typedef GC_ERROR (*PDSStopAcquisition) (DS_HANDLE hDataStream, ACQ_STOP_FLAGS iStopFlags); +typedef GC_ERROR (*PDSGetBufferChunkData) (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, + SINGLE_CHUNK_DATA *pChunkData, size_t *piNumChunks); +typedef GC_ERROR (*PDSGetParentDev) (DS_HANDLE hDataStream, DEV_HANDLE *phDevice); +typedef GC_ERROR (*PDSGetNumBufferParts) (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumParts); +typedef GC_ERROR (*PDSGetBufferPartInfo) (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iPartIndex, + BUFFER_PART_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +typedef GC_ERROR (*PDSGetBufferInfoStacked) (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, + DS_BUFFER_INFO_STACKED *pInfoStacked, size_t iNumInfos); +typedef GC_ERROR (*PDSGetBufferPartInfoStacked) (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, + DS_BUFFER_PART_INFO_STACKED *pInfoStacked, size_t iNumInfos); +typedef GC_ERROR (*PDSGetNumFlows) (DS_HANDLE hDataStream, uint32_t *piNumFlows); +typedef GC_ERROR (*PDSGetFlowInfo) (DS_HANDLE hDataStream, uint32_t iFlowIndex, + FLOW_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +typedef GC_ERROR (*PDSGetNumBufferSegments) (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, + uint32_t *piNumSegments); +typedef GC_ERROR (*PDSGetBufferSegmentInfo) (DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, + uint32_t iSegmentIndex, SEGMENT_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); + +typedef GC_ERROR (*PGCGetPortInfo) (PORT_HANDLE hPort, PORT_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +typedef GC_ERROR (*PGCGetPortURL) (PORT_HANDLE hPort, char *sURL, size_t *piSize); +typedef GC_ERROR (*PGCGetNumPortURLs) (PORT_HANDLE hPort, uint32_t *piNumURLs); +typedef GC_ERROR (*PGCGetPortURLInfo) (PORT_HANDLE hPort, uint32_t iURLIndex, URL_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +typedef GC_ERROR (*PGCReadPort) (PORT_HANDLE hPort, uint64_t iAddress, void *pBuffer, size_t *piSize); +typedef GC_ERROR (*PGCWritePort) (PORT_HANDLE hPort, uint64_t iAddress, const void *pBuffer, size_t *piSize); +typedef GC_ERROR (*PGCWritePortStacked) (PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, + size_t * piNumEntries); +typedef GC_ERROR (*PGCReadPortStacked) (PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, + size_t * piNumEntries); + +typedef GC_ERROR (*PEventFlush) (EVENT_HANDLE hEvent); +typedef GC_ERROR (*PEventGetData) (EVENT_HANDLE hEvent, void *pBuffer, size_t *piSize, uint64_t iTimeout); +typedef GC_ERROR (*PEventGetDataInfo) (EVENT_HANDLE hEvent, const void *pInBuffer, size_t iInSize, + EVENT_DATA_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pOutBuffer, size_t *piOutSize); +typedef GC_ERROR (*PEventGetInfo) (EVENT_HANDLE hEvent, EVENT_INFO_CMD iInfoCmd, + INFO_DATATYPE *piType, void *pBuffer, size_t *piSize); +typedef GC_ERROR (*PEventKill) (EVENT_HANDLE hEvent); +typedef GC_ERROR (*PGCRegisterEvent) (EVENTSRC_HANDLE hModule, EVENT_TYPE iEventID, EVENT_HANDLE *phEvent); +typedef GC_ERROR (*PGCUnregisterEvent) (EVENTSRC_HANDLE hModule, EVENT_TYPE iEventID); + +G_END_DECLS + +#endif diff --git a/src/arvgentlsystemprivate.h b/src/arvgentlsystemprivate.h index 568415fb9..d9b8ea919 100644 --- a/src/arvgentlsystemprivate.h +++ b/src/arvgentlsystemprivate.h @@ -28,7 +28,7 @@ #endif #include -#include +#include G_BEGIN_DECLS diff --git a/src/arvgvdevice.c b/src/arvgvdevice.c index da3d38353..870e59dfc 100644 --- a/src/arvgvdevice.c +++ b/src/arvgvdevice.c @@ -1320,7 +1320,7 @@ _load_genicam (ArvGvDevice *gv_device, guint32 address, size_t *size, char **ur g_string_free (string, TRUE); } - if (g_str_has_suffix (path, ".zip")) { + if (arv_ascii_has_suffix_case_insensitive (path, ".zip")) { ArvZip *zip; const GSList *zip_files; diff --git a/src/arvgvinterface.c b/src/arvgvinterface.c index a2cf84500..1fc4f3715 100644 --- a/src/arvgvinterface.c +++ b/src/arvgvinterface.c @@ -443,28 +443,41 @@ _discover (GHashTable *devices, const char *device_id, gboolean allow_broadcast_ if (devices != NULL) { if (device_infos->id != NULL && - device_infos->id[0] != '\0') + device_infos->id[0] != '\0') { g_hash_table_replace (devices, device_infos->id, arv_gv_interface_device_infos_ref (device_infos)); + arv_info_interface (" %s", device_infos->id); + } if (device_infos->user_id != NULL && - device_infos->user_id[0] != '\0') + device_infos->user_id[0] != '\0') { g_hash_table_replace (devices, device_infos->user_id, arv_gv_interface_device_infos_ref (device_infos)); + arv_info_interface (" %s", + device_infos->user_id); + } if (device_infos->vendor_serial != NULL && - device_infos->vendor_serial[0] != '\0') + device_infos->vendor_serial[0] != '\0') { g_hash_table_replace (devices, device_infos->vendor_serial, arv_gv_interface_device_infos_ref (device_infos)); + arv_info_interface (" %s", + device_infos->vendor_serial); + } if (device_infos->vendor_alias_serial != NULL && - device_infos->vendor_alias_serial[0] != '\0') + device_infos->vendor_alias_serial[0] != '\0') { g_hash_table_replace (devices, device_infos->vendor_alias_serial, arv_gv_interface_device_infos_ref (device_infos)); + arv_info_interface (" %s", + device_infos->vendor_alias_serial); + } g_hash_table_replace (devices, device_infos->mac, arv_gv_interface_device_infos_ref (device_infos)); + arv_info_interface (" %s", + device_infos->mac); } else { if (device_id == NULL || g_strcmp0 (device_infos->id, device_id) == 0 || @@ -667,7 +680,7 @@ arv_gv_interface_camera_locate (ArvGvInterface *gv_interface, GInetAddress *devi } static ArvDevice * -_open_device (ArvInterface *interface, GHashTable *devices, const char *device_id, GError **error) +_open_device (ArvInterface *interface, GHashTable *devices, const char *key, GError **error) { ArvGvInterface *gv_interface; ArvDevice *device = NULL; @@ -676,29 +689,29 @@ _open_device (ArvInterface *interface, GHashTable *devices, const char *device_i gv_interface = ARV_GV_INTERFACE (interface); - if (device_id == NULL) { + if (key == NULL) { GList *device_list; device_list = g_hash_table_get_values (devices); device_infos = device_list != NULL ? device_list->data : NULL; g_list_free (device_list); } else - device_infos = g_hash_table_lookup (devices, device_id); + device_infos = g_hash_table_lookup (devices, key); if (device_infos == NULL) { struct addrinfo hints; struct addrinfo *servinfo, *endpoint; - if (device_id == NULL) + if (key == NULL) return NULL; - /* Try if device_id is a hostname/IP address */ + /* Try if key is a hostname/IP address */ memset(&hints, 0, sizeof (hints)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_DGRAM; - if (getaddrinfo(device_id, "3956", &hints, &servinfo) != 0) { + if (getaddrinfo(key, "3956", &hints, &servinfo) != 0) { return NULL; } @@ -728,7 +741,7 @@ _open_device (ArvInterface *interface, GHashTable *devices, const char *device_i if (device == NULL) g_set_error (error, ARV_DEVICE_ERROR, ARV_DEVICE_ERROR_NOT_FOUND, - "Can't connect to device at address '%s'", device_id); + "Can't connect to device at address '%s'", key); return device; } @@ -741,7 +754,7 @@ _open_device (ArvInterface *interface, GHashTable *devices, const char *device_i } static ArvDevice * -arv_gv_interface_open_device (ArvInterface *interface, const char *device_id, GError **error) +arv_gv_interface_open_device (ArvInterface *interface, const char *key, GError **error) { ArvDevice *device; ArvGvInterfaceDeviceInfos *device_infos; @@ -749,7 +762,7 @@ arv_gv_interface_open_device (ArvInterface *interface, const char *device_id, GE GError *local_error = NULL; int flags; - device = _open_device (interface, ARV_GV_INTERFACE (interface)->priv->devices, device_id, &local_error); + device = _open_device (interface, ARV_GV_INTERFACE (interface)->priv->devices, key, &local_error); if (ARV_IS_DEVICE (device) || local_error != NULL) { if (local_error != NULL) g_propagate_error (error, local_error); @@ -758,7 +771,7 @@ arv_gv_interface_open_device (ArvInterface *interface, const char *device_id, GE flags = arv_interface_get_flags (interface); discovery_interface = arv_gv_interface_dup_discovery_interface_name(); - device_infos = _discover (NULL, device_id, flags & ARV_GVCP_DISCOVERY_PACKET_FLAGS_ALLOW_BROADCAST_ACK, + device_infos = _discover (NULL, key, flags & ARV_GVCP_DISCOVERY_PACKET_FLAGS_ALLOW_BROADCAST_ACK, discovery_interface); g_free (discovery_interface); diff --git a/src/arvinterface.c b/src/arvinterface.c index d40b42d20..1a3f667e3 100644 --- a/src/arvinterface.c +++ b/src/arvinterface.c @@ -372,11 +372,11 @@ arv_interface_get_device_protocol (ArvInterface *iface, unsigned int index) /** * arv_interface_open_device: * @iface: a #ArvInterface - * @device_id: (allow-none): device unique id + * @key: (allow-none): device search key * @error: a #GError placeholder, %NULL to ignore * * Creates a new #ArvDevice object corresponding to the given device id string. - * The first available device is returned if @device_id is %NULL. + * The first available device is returned if @key is %NULL. * * Returns: (transfer full): a new #ArvDevice * @@ -384,11 +384,11 @@ arv_interface_get_device_protocol (ArvInterface *iface, unsigned int index) */ ArvDevice * -arv_interface_open_device (ArvInterface *iface, const char *device_id, GError **error) +arv_interface_open_device (ArvInterface *iface, const char *key, GError **error) { g_return_val_if_fail (ARV_IS_INTERFACE (iface), NULL); - return ARV_INTERFACE_GET_CLASS (iface)->open_device (iface, device_id, error); + return ARV_INTERFACE_GET_CLASS (iface)->open_device (iface, key, error); } static void diff --git a/src/arvinterface.h b/src/arvinterface.h index eccb3beff..efb664690 100644 --- a/src/arvinterface.h +++ b/src/arvinterface.h @@ -40,7 +40,7 @@ struct _ArvInterfaceClass { GObjectClass parent_class; void (*update_device_list) (ArvInterface *iface, GArray *device_ids); - ArvDevice * (*open_device) (ArvInterface *iface, const char *device_id, GError **error); + ArvDevice * (*open_device) (ArvInterface *iface, const char *key, GError **error); }; ARV_API void arv_interface_update_device_list (ArvInterface *iface); @@ -53,7 +53,7 @@ ARV_API const char * arv_interface_get_device_manufacturer_info (ArvInterface *i ARV_API const char * arv_interface_get_device_model (ArvInterface *iface, unsigned int index); ARV_API const char * arv_interface_get_device_serial_nbr (ArvInterface *iface, unsigned int index); ARV_API const char * arv_interface_get_device_protocol (ArvInterface *iface, unsigned int index); -ARV_API ArvDevice * arv_interface_open_device (ArvInterface *iface, const char *device_id, +ARV_API ArvDevice * arv_interface_open_device (ArvInterface *iface, const char *key, GError **error); G_END_DECLS diff --git a/src/arvmisc.c b/src/arvmisc.c index fb04c6640..2e3b45a70 100644 --- a/src/arvmisc.c +++ b/src/arvmisc.c @@ -761,7 +761,7 @@ ArvGstCapsInfos arv_gst_caps_infos[] = { "video/x-bayer, format=(string)bggr10le", "video/x-bayer", "bggr10le", }, - + /* 10-bit Bayer packed (legacy and PFNC — viewer unpacks to 16-bit) */ { ARV_PIXEL_FORMAT_BAYER_GR_10_PACKED, @@ -1245,17 +1245,17 @@ static struct { const char *protocol; const char *transport_layer_type; } arv_protocols[] = { - { "GigEVision", TLTypeGEVName}, - { "USB3Vision", TLTypeU3VName}, - { "CameraLink", TLTypeCLName}, - { "IIDC1394", TLTypeIIDCName}, - { "USBVideoClass", TLTypeUVCName}, - { "CoaXPress", TLTypeCXPName}, - { "CameraLinkHS", TLTypeCLHSName}, - { "GenericEthernet", TLTypeETHERNETName}, - { "PCIExpress", TLTypePCIName}, - { "Mixed", TLTypeMixedName}, - { "Custom", TLTypeCustomName}, + { "GigEVision", "GEV"}, + { "USB3Vision", "U3V"}, + { "CameraLink", "CL"}, + { "IIDC1394", "IIDC"}, + { "USBVideoClass", "UVC"}, + { "CoaXPress", "CXP"}, + { "CameraLinkHS", "CLHS"}, + { "GenericEthernet", "Ethernet"}, + { "PCIExpress", "PCI"}, + { "Mixed", "Mixed"}, + { "Custom", "Custom"}, }; const char * diff --git a/src/arvmiscprivate.h b/src/arvmiscprivate.h index 42b5d8596..f82244802 100644 --- a/src/arvmiscprivate.h +++ b/src/arvmiscprivate.h @@ -25,7 +25,7 @@ #include #include -#include +#include typedef struct _ArvHistogram ArvHistogram; diff --git a/src/arvstr.c b/src/arvstr.c index 748e5c0ff..5f938c32a 100644 --- a/src/arvstr.c +++ b/src/arvstr.c @@ -302,3 +302,33 @@ arv_g_string_append_hex_dump (GString *string, const void *data, size_t size) g_string_append (string, "\n"); } } + +/** + * arv_ascii_has_suffix_case_insensitive: + * @str: a string to check + * @suffix: the suffix to look for + * + * Checks whether @str ends with @suffix, ignoring ASCII case. + * + * Returns: %TRUE if @str has @suffix as a case-insensitive suffix + * + * Since: 0.10 + */ + +gboolean +arv_ascii_has_suffix_case_insensitive (const char *str, const char *suffix) +{ + size_t str_len; + size_t suffix_len; + + g_return_val_if_fail (str != NULL, FALSE); + g_return_val_if_fail (suffix != NULL, FALSE); + + str_len = strlen (str); + suffix_len = strlen (suffix); + + if (str_len < suffix_len) + return FALSE; + + return g_ascii_strcasecmp (str + str_len - suffix_len, suffix) == 0; +} diff --git a/src/arvstr.h b/src/arvstr.h index dcaf387ad..b887f4152 100644 --- a/src/arvstr.h +++ b/src/arvstr.h @@ -75,7 +75,9 @@ arv_str_skip_colon_and_spaces (char **str) (*str)++; } -ARV_API void arv_g_string_append_hex_dump (GString *string, const void *data, size_t size); +ARV_API void arv_g_string_append_hex_dump (GString *string, const void *data, size_t size); + +ARV_API gboolean arv_ascii_has_suffix_case_insensitive (const char *str, const char *suffix); G_END_DECLS diff --git a/src/arvuvinterface.c b/src/arvuvinterface.c index 549ea1adf..b1bf786f7 100644 --- a/src/arvuvinterface.c +++ b/src/arvuvinterface.c @@ -37,13 +37,13 @@ /* ArvUvInterface implementation */ typedef struct { + char *guid; char *id; - char *name; - char *full_name; + char *vendor_serial; + char *vendor_alias_serial; char *manufacturer; char *product; char *serial_nbr; - char *guid; volatile gint ref_count; } ArvUvInterfaceDeviceInfos; @@ -62,18 +62,18 @@ arv_uv_interface_device_infos_new (const char *manufacturer, g_return_val_if_fail (guid != NULL, NULL); infos = g_new (ArvUvInterfaceDeviceInfos, 1); - infos->id = g_strdup_printf ("%s-%s-%s", manufacturer, guid, serial_nbr); + infos->id = g_strdup_printf ("%s-%s-%s", manufacturer, product, serial_nbr); infos->manufacturer = g_strdup (manufacturer); - infos->name = g_strdup_printf ("%s-%s", arv_vendor_alias_lookup (manufacturer), serial_nbr); - infos->full_name = g_strdup_printf ("%s-%s", manufacturer, serial_nbr); + infos->vendor_alias_serial = g_strdup_printf ("%s-%s", arv_vendor_alias_lookup (manufacturer), serial_nbr); + infos->vendor_serial = g_strdup_printf ("%s-%s", manufacturer, serial_nbr); infos->product = g_strdup (product); infos->serial_nbr = g_strdup (serial_nbr); infos->guid = g_strdup (guid); infos->ref_count = 1; arv_str_strip (infos->id, ARV_DEVICE_NAME_ILLEGAL_CHARACTERS, ARV_DEVICE_NAME_REPLACEMENT_CHARACTER); - arv_str_strip (infos->name, ARV_DEVICE_NAME_ILLEGAL_CHARACTERS, ARV_DEVICE_NAME_REPLACEMENT_CHARACTER); - arv_str_strip (infos->full_name, ARV_DEVICE_NAME_ILLEGAL_CHARACTERS, ARV_DEVICE_NAME_REPLACEMENT_CHARACTER); + arv_str_strip (infos->vendor_serial, ARV_DEVICE_NAME_ILLEGAL_CHARACTERS, ARV_DEVICE_NAME_REPLACEMENT_CHARACTER); + arv_str_strip (infos->vendor_alias_serial, ARV_DEVICE_NAME_ILLEGAL_CHARACTERS, ARV_DEVICE_NAME_REPLACEMENT_CHARACTER); return infos; } @@ -97,8 +97,8 @@ arv_uv_interface_device_infos_unref (ArvUvInterfaceDeviceInfos *infos) if (g_atomic_int_dec_and_test (&infos->ref_count)) { g_clear_pointer (&infos->id, g_free); - g_clear_pointer (&infos->name, g_free); - g_clear_pointer (&infos->full_name, g_free); + g_clear_pointer (&infos->vendor_serial, g_free); + g_clear_pointer (&infos->vendor_alias_serial, g_free); g_clear_pointer (&infos->manufacturer, g_free); g_clear_pointer (&infos->product, g_free); g_clear_pointer (&infos->serial_nbr, g_free); @@ -173,6 +173,9 @@ _usb_device_to_device_ids (ArvUvInterface *uv_interface, libusb_device *device) gboolean control_protocol_found; gboolean data_protocol_found; int guid_index = -1; + int vendor_name_index = -1; + int model_name_index = -1; + int serial_number_index = -1; int result, i, j; result = libusb_get_device_descriptor (device, &desc); @@ -198,17 +201,31 @@ _usb_device_to_device_ids (ArvUvInterface *uv_interface, libusb_device *device) interdesc->bInterfaceSubClass == ARV_UV_INTERFACE_INTERFACE_SUBCLASS) { if (interdesc->bInterfaceProtocol == ARV_UV_INTERFACE_CONTROL_PROTOCOL) { control_protocol_found = TRUE; - if (interdesc->extra && - interdesc->extra_length >= ARV_UV_INTERFACE_GUID_INDEX_OFFSET + sizeof(unsigned char)) { - guid_index = (int) (*(interdesc->extra + ARV_UV_INTERFACE_GUID_INDEX_OFFSET)); - } - } - if (interdesc->bInterfaceProtocol == ARV_UV_INTERFACE_DATA_PROTOCOL) - data_protocol_found = TRUE; - } - } - } - libusb_free_config_descriptor (config); + if (interdesc->extra) { + if (interdesc->extra_length >= + ARV_UV_INTERFACE_GUID_INDEX_OFFSET + sizeof(unsigned char)) + guid_index = (int) (*(interdesc->extra + + ARV_UV_INTERFACE_GUID_INDEX_OFFSET)); + if (interdesc->extra_length >= + ARV_UV_INTERFACE_VENDOR_NAME_INDEX_OFFSET + sizeof(unsigned char)) + vendor_name_index = (int) (*(interdesc->extra + + ARV_UV_INTERFACE_VENDOR_NAME_INDEX_OFFSET)); + if (interdesc->extra_length >= + ARV_UV_INTERFACE_MODEL_NAME_INDEX_OFFSET + sizeof(unsigned char)) + model_name_index = (int) (*(interdesc->extra + + ARV_UV_INTERFACE_MODEL_NAME_INDEX_OFFSET)); + if (interdesc->extra_length >= + ARV_UV_INTERFACE_SERIAL_NUMBER_INDEX_OFFSET + sizeof(unsigned char)) + serial_number_index = (int) (*(interdesc->extra + + ARV_UV_INTERFACE_SERIAL_NUMBER_INDEX_OFFSET)); + } + } + if (interdesc->bInterfaceProtocol == ARV_UV_INTERFACE_DATA_PROTOCOL) + data_protocol_found = TRUE; + } + } + } + libusb_free_config_descriptor (config); if (!control_protocol_found || !data_protocol_found) return NULL; @@ -229,30 +246,50 @@ _usb_device_to_device_ids (ArvUvInterface *uv_interface, libusb_device *device) serial_nbr = g_malloc0 (256); guid = g_malloc0 (256); - index = desc.iManufacturer; + index = guid_index; if (index > 0) - libusb_get_string_descriptor_ascii (device_handle, index, manufacturer, 256); - index = desc.iProduct; + libusb_get_string_descriptor_ascii (device_handle, index, guid, 256); + index = vendor_name_index; if (index > 0) + libusb_get_string_descriptor_ascii (device_handle, index, manufacturer, 256); + else { + index = desc.iManufacturer; + libusb_get_string_descriptor_ascii (device_handle, index, manufacturer, 256); + } + index = model_name_index; + if (index > 0) libusb_get_string_descriptor_ascii (device_handle, index, product, 256); - index = desc.iSerialNumber; - if (index > 0) + else { + index = desc.iProduct; + if (index > 0) + libusb_get_string_descriptor_ascii (device_handle, index, product, 256); + } + index = serial_number_index; + if (index > 0) libusb_get_string_descriptor_ascii (device_handle, index, serial_nbr, 256); - index = guid_index; - if (index > 0) - libusb_get_string_descriptor_ascii (device_handle, index, guid, 256); + else { + index = desc.iSerialNumber; + if (index > 0) + libusb_get_string_descriptor_ascii (device_handle, index, serial_nbr, 256); + } device_infos = arv_uv_interface_device_infos_new ((char *) manufacturer, (char *) product, (char *) serial_nbr, (char *) guid); - g_hash_table_replace (uv_interface->priv->devices, device_infos->id, - arv_uv_interface_device_infos_ref (device_infos)); - g_hash_table_replace (uv_interface->priv->devices, device_infos->name, - arv_uv_interface_device_infos_ref (device_infos)); - g_hash_table_replace (uv_interface->priv->devices, device_infos->full_name, - arv_uv_interface_device_infos_ref (device_infos)); - g_hash_table_replace (uv_interface->priv->devices, device_infos->guid, - arv_uv_interface_device_infos_ref (device_infos)); - arv_uv_interface_device_infos_unref (device_infos); + arv_info_interface ("[UvInterface::discovery] Device '%s' found", + device_infos->id); + g_hash_table_replace (uv_interface->priv->devices, device_infos->id, + arv_uv_interface_device_infos_ref (device_infos)); + arv_info_interface (" %s", device_infos->id); + g_hash_table_replace (uv_interface->priv->devices, device_infos->vendor_serial, + arv_uv_interface_device_infos_ref (device_infos)); + arv_info_interface (" %s", device_infos->vendor_serial); + g_hash_table_replace (uv_interface->priv->devices, device_infos->vendor_alias_serial, + arv_uv_interface_device_infos_ref (device_infos)); + arv_info_interface (" %s", device_infos->vendor_alias_serial); + g_hash_table_replace (uv_interface->priv->devices, device_infos->guid, + arv_uv_interface_device_infos_ref (device_infos)); + arv_info_interface (" %s", device_infos->guid); + arv_uv_interface_device_infos_unref (device_infos); device_ids->device = g_strdup (device_infos->id); device_ids->physical = g_strdup (device_infos->guid); @@ -335,21 +372,21 @@ arv_uv_interface_update_device_list (ArvInterface *interface, GArray *device_ids } static ArvDevice * -_open_device (ArvInterface *interface, const char *device_id, GError **error) +_open_device (ArvInterface *interface, const char *key, GError **error) { ArvUvInterface *uv_interface; ArvUvInterfaceDeviceInfos *device_infos; uv_interface = ARV_UV_INTERFACE (interface); - if (device_id == NULL) { + if (key == NULL) { GList *device_list; device_list = g_hash_table_get_values (uv_interface->priv->devices); device_infos = device_list != NULL ? device_list->data : NULL; g_list_free (device_list); } else - device_infos = g_hash_table_lookup (uv_interface->priv->devices, device_id); + device_infos = g_hash_table_lookup (uv_interface->priv->devices, key); if (device_infos == NULL) return NULL; @@ -358,12 +395,12 @@ _open_device (ArvInterface *interface, const char *device_id, GError **error) } static ArvDevice * -arv_uv_interface_open_device (ArvInterface *interface, const char *device_id, GError **error) +arv_uv_interface_open_device (ArvInterface *interface, const char *key, GError **error) { ArvDevice *device; GError *local_error = NULL; - device = _open_device (interface, device_id, error); + device = _open_device (interface, key, error); if (ARV_IS_DEVICE (device) || local_error != NULL) { if (local_error != NULL) g_propagate_error (error, local_error); @@ -372,7 +409,7 @@ arv_uv_interface_open_device (ArvInterface *interface, const char *device_id, GE _discover (ARV_UV_INTERFACE (interface), NULL); - return _open_device (interface, device_id, error); + return _open_device (interface, key, error); } static ArvInterface *arv_uv_interface = NULL; diff --git a/src/arvuvinterfaceprivate.h b/src/arvuvinterfaceprivate.h index c921d9804..caf5162dc 100644 --- a/src/arvuvinterfaceprivate.h +++ b/src/arvuvinterfaceprivate.h @@ -39,6 +39,10 @@ #define ARV_UV_INTERFACE_EVENT_PROTOCOL 0x01 #define ARV_UV_INTERFACE_DATA_PROTOCOL 0x02 #define ARV_UV_INTERFACE_GUID_INDEX_OFFSET 11 +#define ARV_UV_INTERFACE_VENDOR_NAME_INDEX_OFFSET 12 +#define ARV_UV_INTERFACE_MODEL_NAME_INDEX_OFFSET 13 +#define ARV_UV_INTERFACE_FAMILY_NAME_INDEX_OFFSET 14 +#define ARV_UV_INTERFACE_SERIAL_NUMBER_INDEX_OFFSET 17 G_BEGIN_DECLS diff --git a/src/gentl/GenTL_v1_6.h b/src/gentl/GenTL_v1_6.h deleted file mode 100644 index 140c340db..000000000 --- a/src/gentl/GenTL_v1_6.h +++ /dev/null @@ -1,866 +0,0 @@ -/**************************************************************************** -(c) 2004-2019 by GenICam GenTL Subcommittee - -License: This file is published under the license of the EMVA GenICam Standard Group. -A text file describing the legal terms is included in your installation as 'license.txt'. -If for some reason you are missing this file please contact the EMVA or visit the website -(http://www.genicam.org) for a full copy. - -THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -******************************************************************************/ - -/* \file GenTL.h - * \brief GenICam Transport Layer Client Interface - * \version 1.6 - * \author GenTL Subcommittee - * \date 2019 - * - * \par Version history - * \li Version 0.1.0 First official version from the meeting in Pilsen - * \li Version 0.1.1 rst (SI) 0.4.160 - * - added _E_INTERFACE_INFO_CMD_LIST_T_ enum name - * - added _E_DEVICE_ACCCESS_STATUS_TYPE_T_ to be used - * with the /a IFGetDeviceInfo and DevGetInfo - * - rename of the enum value DEVICE_INFO_ACCESSMODE to - * DEVICE_INFO_ACCESS_STATUS which now refers to - * _E_DEVICE_ACCCESS_STATUS_TYPE_T_ - * - added Timeout parameter to update interface list and - * device list. - * \li Version 0.1.2 - change datatype of timeout parameter of - * TLUpdateInterfaceList and IFUpdateDeviceList to - * uint64_t to match with the timeout in the event object. - * - changed all enums to have a typedef to uint32_t - * with them to allow custom ids - * - changed type of string constants to be char * instead - * of gcstring - * \li Version 0.1.3 rst (SI), cbi (IDS) 0.4.163 - * - adjusted parameter names to be closer aligned with - * the standard text - * - changed typedefs for enums from uint32_t to int32_t - * - removed default parameter - * - added parameter name to DevGetPort function - * \li Version 0.1.4 jb (LV) - * - fixes to align the file with standard text - * - make the file self-contained, independent on GenApi - * \li Version 0.1.5 rst (SI) cbi (IDS) jb (LV) tho (MVTec) - * - Adjust it for Linux - * - Cosmetics - * \li Version 1.0 rst (SI) cbi (IDS) jb (LV) tho (MVTec) - * - Adjust for Standard 1.0 - * - Make it plain C compliant - * - Cosmetics - * \li Version 1.2 rst (SI) jb (LV) tho (MVTec) - * - Adjust for Standard 1.2 - * - adjust packing - * - Cosmetics - * \li Version 1.3 (Stemmer, Leutron, Matrix Vision, MVTec, MathWorks) - * - Adjust for Standard 1.3 - * - added chunk handling - * - added Mac OS X - * - Cosmetics - * \li Version 1.3.1 (MathWorks) - * - Spelling corrections in comments - * \li Version 1.4 GenTL Subcommittee - * \li Version 1.5 GenTL Subcommittee - * - Changed namespace to GenTL - * - Changes for GenTL 1.5, Please refer to the GenTL spec - * for a list of changes. - * \li Version 1.6 GenTL Subcommittee - * - Changes for GenTL 1.6, Please refer to the GenTL spec - * for a list of changes. - */ - - -#ifndef GC_TLI_CLIENT_H_ -#define GC_TLI_CLIENT_H_ 1 - -#ifndef GC_USER_DEFINED_TYPES -/* The types should be the same as defined in GCTypes.h from GenApi. But in - * case you do not have this header the necessary types are defined here. */ -# if defined(_WIN32) -# if defined(_MSC_VER) && _MSC_VER >= 1600 /* VS2010 provides stdint.h */ -# include -# elif !defined _STDINT_H && !defined _STDINT - /* stdint.h is usually not available under Windows */ - typedef unsigned char uint8_t; - typedef __int32 int32_t; - typedef unsigned __int32 uint32_t; - typedef unsigned __int64 uint64_t; -# endif -# else -# include -# endif - -# ifdef __cplusplus - typedef bool bool8_t; -# else - typedef uint8_t bool8_t; -# endif -#endif /* GC_DEFINE_TYPES */ - -#include - - -/* Function declaration modifiers */ -#if defined (_WIN32) -# ifndef GCTLI_NO_DECLSPEC_STATEMENTS -# ifdef GCTLIDLL -# define GC_IMPORT_EXPORT __declspec(dllexport) -# else -# define GC_IMPORT_EXPORT __declspec(dllimport) -# endif -# else -# define GC_IMPORT_EXPORT -# endif /* # ifndef GCTLI_NO_DECLSPEC_STATEMENTS */ -# if defined (_M_IX86) || defined (__i386__) -# define GC_CALLTYPE __stdcall -# else -# define GC_CALLTYPE /* default */ -# endif -# ifndef EXTERN_C -# define EXTERN_C extern "C" -# endif - -#elif defined (__GNUC__) && (__GNUC__ >= 4) && (defined (__linux__) || defined (__APPLE__)) -# define GC_IMPORT_EXPORT __attribute__((visibility("default"))) -# if defined (__i386__) -# define GC_CALLTYPE __attribute__((stdcall)) -# else -# define GC_CALLTYPE /* default */ -# endif -# ifndef EXTERN_C -# define EXTERN_C extern "C" -# endif - -#else -# error Unknown platform, file needs adaption -#endif - -#ifdef __cplusplus -extern "C" { - namespace GenTL { -#endif - - /* Errors */ - enum GC_ERROR_LIST - { - GC_ERR_SUCCESS = 0, - GC_ERR_ERROR = -1001, - GC_ERR_NOT_INITIALIZED = -1002, - GC_ERR_NOT_IMPLEMENTED = -1003, - GC_ERR_RESOURCE_IN_USE = -1004, - GC_ERR_ACCESS_DENIED = -1005, - GC_ERR_INVALID_HANDLE = -1006, - GC_ERR_INVALID_ID = -1007, - GC_ERR_NO_DATA = -1008, - GC_ERR_INVALID_PARAMETER = -1009, - GC_ERR_IO = -1010, - GC_ERR_TIMEOUT = -1011, - GC_ERR_ABORT = -1012, /* GenTL v1.1 */ - GC_ERR_INVALID_BUFFER = -1013, /* GenTL v1.1 */ - GC_ERR_NOT_AVAILABLE = -1014, /* GenTL v1.2 */ - GC_ERR_INVALID_ADDRESS = -1015, /* GenTL v1.3 */ - GC_ERR_BUFFER_TOO_SMALL = -1016, /* GenTL v1.4 */ - GC_ERR_INVALID_INDEX = -1017, /* GenTL v1.4 */ - GC_ERR_PARSING_CHUNK_DATA = -1018, /* GenTL v1.4 */ - GC_ERR_INVALID_VALUE = -1019, /* GenTL v1.4 */ - GC_ERR_RESOURCE_EXHAUSTED = -1020, /* GenTL v1.4 */ - GC_ERR_OUT_OF_MEMORY = -1021, /* GenTL v1.4 */ - GC_ERR_BUSY = -1022, /* GenTL v1.5 */ - GC_ERR_AMBIGUOUS = -1023, /* GenTL v1.6 */ - - GC_ERR_CUSTOM_ID = -10000 - }; - typedef int32_t GC_ERROR; - -# ifndef GC_GENTL_HEADER_VERSION - -# define GenTLMajorVersion 1 /* defines the major version of the GenICam GenTL standard version this header is based on */ -# define GenTLMinorVersion 6 /* defines the minor version of the GenICam GenTL standard version this header is based on */ -# define GenTLSubMinorVersion 0 /* defines the sub minor version of the GenICam GenTL standard version this header is based on */ - -# define GC_GENTL_HEADER_VERSION_CODE(major,minor,subminor) (((major)<<24)+((minor)<<16)+(subminor)) -# define GC_GENTL_HEADER_VERSION GC_GENTL_HEADER_VERSION_CODE(GenTLMajorVersion,GenTLMinorVersion,GenTLSubMinorVersion) - -# endif /* GC_GENTL_HEADER_VERSION */ - -# ifndef GC_GENTL_DONT_USE_TYPE_DEFINITIONS -# define TLTypeMixedName "Mixed" /* Type to use for several supported technologies */ -# define TLTypeCustomName "Custom" /* Type to use for custom technologies */ -# define TLTypeGEVName "GEV" /* Type to use for GigE Vision technology */ -# define TLTypeCLName "CL" /* Type to use for Camera Link technology */ -# define TLTypeIIDCName "IIDC" /* Type to use for IIDC 1394 technology */ -# define TLTypeUVCName "UVC" /* Type to use for USB video class devices */ -# define TLTypeCXPName "CXP" /* Type to use for CoaXPress, V1.3 */ -# define TLTypeCLHSName "CLHS" /* Type to use for Camera Link HS, V1.3 */ -# define TLTypeU3VName "U3V" /* Type to use for USB3 Vision Standard, V1.4 */ -# define TLTypeETHERNETName "Ethernet" /* Type to use for Ethernet devices, V1.3 */ -# define TLTypePCIName "PCI" /* Type to use for PCI/PCIe devices, V1.3 */ -# endif /* GC_GENTL_DONT_USE_TYPE_DEFINITIONS */ - -# ifndef GC_GENTL_DONT_USE_MODULE_NAMES -# define TLSystemModuleName "TLSystem" /* Name to identify a system module */ -# define TLInterfaceModuleName "TLInterface" /* Name to identify a interface module */ -# define TLDeviceModuleName "TLDevice" /* Name to identify a device module */ -# define TLDataStreamModuleName "TLDataStream" /* Name to identify a data stream module */ -# define TLBufferModuleName "TLBuffer" /* Name to identify a buffer module */ -# define TLRemoteDeviceModuleName "Device" /* Name to identify a remote device module */ -# endif /* GC_GENTL_DONT_USE_MODULE_NAMES */ - - /* Handles */ - typedef void * TL_HANDLE; /* Transport Layer handle, obtained through the TLOpen */ - typedef void * IF_HANDLE; /* Interface handle, obtained through ::TLOpenInterface */ - typedef void * DEV_HANDLE; /* Device handle, obtained through the ::IFOpenDevice */ - typedef void * DS_HANDLE; /* Handle to an data stream object, obtained through DevOpenDataStream */ - typedef void * PORT_HANDLE; /* A Port handle is used to access the register space of a port */ - /* a PORT_HANDLE can be one of the following TL_HANDLE, IF_HANDLE, */ - /* DEV_HANDLE, handle to a device port, obtained through ::DevGetPort, */ - /* DS_HANDLE, BUFFER_HANDLE */ - - typedef void * BUFFER_HANDLE; /* Buffer handle, obtained through the ::DSAnnounceBuffer or related function */ - typedef void * EVENTSRC_HANDLE; /* A Event source handle is used to register a OS Event and to retrieve a GenTL event handle */ - /* a EVENTSRC_HANDLE can be on of the following TL_HANDLE, */ - /* IF_HANDLE, DEV_HANDLE, DS_HANDLE, BUFFER_HANDLE */ - typedef void * EVENT_HANDLE; /* Event handle, obtained through the ::GCRegisterEvent */ - -# define GENTL_INVALID_HANDLE NULL /* Invalid handle value, V1.4 */ -# define GENTL_INFINITE 0xFFFFFFFFFFFFFFFFULL /* Infinite value to be used in various function calls, V1.4 */ - - /* Defines the data type possible for the various Info functions. */ - enum INFO_DATATYPE_LIST - { - INFO_DATATYPE_UNKNOWN = 0, /* Unknown data type */ - INFO_DATATYPE_STRING = 1, /* NULL-terminated C string (ASCII encoded). */ - INFO_DATATYPE_STRINGLIST = 2, /* Concatenated INFO_DATATYPE_STRING list. End of list is signaled with an additional NULL. */ - INFO_DATATYPE_INT16 = 3, /* Signed 16 bit integer. */ - INFO_DATATYPE_UINT16 = 4, /* Unsigned 16 bit integer */ - INFO_DATATYPE_INT32 = 5, /* Signed 32 bit integer */ - INFO_DATATYPE_UINT32 = 6, /* Unsigned 32 bit integer */ - INFO_DATATYPE_INT64 = 7, /* Signed 64 bit integer */ - INFO_DATATYPE_UINT64 = 8, /* Unsigned 64 bit integer */ - INFO_DATATYPE_FLOAT64 = 9, /* Signed 64 bit floating point number. */ - INFO_DATATYPE_PTR = 10, /* Pointer type (void*). Size is platform dependent (32 bit on 32 bit platforms). */ - INFO_DATATYPE_BOOL8 = 11, /* Boolean value occupying 8 bit. 0 for false and anything for true. */ - INFO_DATATYPE_SIZET = 12, /* Platform dependent unsigned integer (32 bit on 32 bit platforms). */ - INFO_DATATYPE_BUFFER = 13, /* Like a INFO_DATATYPE_STRING but with arbitrary data and no NULL termination. */ - INFO_DATATYPE_PTRDIFF = 14, /* Platform dependent signed integer (32 bit on 32 bit platforms). GenTL v1.3 */ - - INFO_DATATYPE_CUSTOM_ID = 1000 /* Starting value for custom IDs. */ - }; - typedef int32_t INFO_DATATYPE; - - /* Defines char encoding schemes used by the producer, GenTL v1.4 */ - enum TL_CHAR_ENCODING_LIST - { - TL_CHAR_ENCODING_ASCII = 0, - TL_CHAR_ENCODING_UTF8 = 1 - }; - typedef int32_t TL_CHAR_ENCODING; /* GenTL v1.4 */ - - /* System module information commands for the GenTL::TLGetInfo and GenTL::GCGetInfo functions. */ - enum TL_INFO_CMD_LIST - { - TL_INFO_ID = 0, /* STRING Transport layer ID. */ - TL_INFO_VENDOR = 1, /* STRING Transport layer vendor name. */ - TL_INFO_MODEL = 2, /* STRING Transport layer model name. */ - TL_INFO_VERSION = 3, /* STRING Transport layer version. */ - TL_INFO_TLTYPE = 4, /* STRING Transport layer technology that is supported. */ - TL_INFO_NAME = 5, /* STRING File name including extension of the library. */ - TL_INFO_PATHNAME = 6, /* STRING Full path including file name and extension of the library. */ - TL_INFO_DISPLAYNAME = 7, /* STRING User readable name of the device. If this is not defined in the device this should be VENDOR MODEL (ID). */ - TL_INFO_CHAR_ENCODING = 8, /* INT32 Reporting the char encoding used by this Producer, GenTL v1.4 */ - TL_INFO_GENTL_VER_MAJOR = 9, /* UINT32 Major number of the GenTL spec this producer complies with, GenTL v1.5 */ - TL_INFO_GENTL_VER_MINOR = 10, /* UINT32 Minor number of the GenTL spec this producer complies with, GenTL v1.5 */ - TL_INFO_CUSTOM_ID = 1000 /* Starting value for custom IDs. */ - }; - typedef int32_t TL_INFO_CMD; - - /* This enumeration defines commands to retrieve information with the GenTL::IFGetInfo function from the Interface module. */ - enum INTERFACE_INFO_CMD_LIST - { - INTERFACE_INFO_ID = 0, /* STRING Unique ID of the interface. */ - INTERFACE_INFO_DISPLAYNAME = 1, /* STRING User readable name of the interface. */ - INTERFACE_INFO_TLTYPE = 2, /* STRING Transport layer technology that is supported. */ - INTERFACE_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t INTERFACE_INFO_CMD; - - /* This enumeration defines flags of how a device is to be opened with the GenTL::IFOpenDevice function. */ - enum DEVICE_ACCESS_FLAGS_LIST - { - DEVICE_ACCESS_UNKNOWN = 0, /* Not used in a command. Can be used to initialize a variable to query that information. */ - DEVICE_ACCESS_NONE = 1, /* This either means that the device is not open because it was not opened before or the access to it was denied. */ - DEVICE_ACCESS_READONLY = 2, /* Open the device read only. All Port functions can only read from the device. */ - DEVICE_ACCESS_CONTROL = 3, /* Open the device in a way that other hosts/processes can have read only access to the device. Device access level is read/write for this process. */ - DEVICE_ACCESS_EXCLUSIVE = 4, /* Open the device in a way that only this host/process can have access to the device. Device access level is read/write for this process. */ - - DEVICE_ACCESS_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t DEVICE_ACCESS_FLAGS; - - /* This enumeration defines values for the accessibility of the device to be returned in the GenTL::DevGetInfo function on a device handle. */ - enum DEVICE_ACCESS_STATUS_LIST - { - DEVICE_ACCESS_STATUS_UNKNOWN = 0, /* The device accessibility is not known. */ - DEVICE_ACCESS_STATUS_READWRITE = 1, /* The device is available for read/write access. */ - DEVICE_ACCESS_STATUS_READONLY = 2, /* The device is available for read only access. */ - DEVICE_ACCESS_STATUS_NOACCESS = 3, /* The device is not accessible. */ - DEVICE_ACCESS_STATUS_BUSY = 4, /* The device has already been opened by another process/host. GenTL v1.5 */ - DEVICE_ACCESS_STATUS_OPEN_READWRITE = 5, /* The device has already been opened by this process. GenTL v1.5 */ - DEVICE_ACCESS_STATUS_OPEN_READONLY = 6, /* The device has already been opened by this process. GenTL v1.5 */ - - DEVICE_ACCESS_STATUS_CUSTOM_ID = 1000 /* Starting value for custom IDs. */ - }; - typedef int32_t DEVICE_ACCESS_STATUS; - - /* This enumeration defines commands to retrieve information with the GenTL::DevGetInfo function on a device handle. */ - enum DEVICE_INFO_CMD_LIST - { - DEVICE_INFO_ID = 0, /* STRING Unique ID of the device. */ - DEVICE_INFO_VENDOR = 1, /* STRING Device vendor name. */ - DEVICE_INFO_MODEL = 2, /* STRING Device model name. */ - DEVICE_INFO_TLTYPE = 3, /* STRING Transport layer technology that is supported. */ - DEVICE_INFO_DISPLAYNAME = 4, /* STRING String containing a display name for the device ( including a unique id ) */ - DEVICE_INFO_ACCESS_STATUS = 5, /* INT32 Gets the access mode the GenTL Producer has on the opened device. (DEVICE_ACCESS_STATUS enumeration value). */ - DEVICE_INFO_USER_DEFINED_NAME = 6, /* STRING String containing the user defined name, GenTL v1.4 */ - DEVICE_INFO_SERIAL_NUMBER = 7, /* STRING String containing the device's serial number, GenTL v1.4 */ - DEVICE_INFO_VERSION = 8, /* STRING String containing the device version, GenTL v1.4 */ - DEVICE_INFO_TIMESTAMP_FREQUENCY = 9, /* UINT64 Tick-frequency of the time stamp clock, GenTL v1.4 */ - - DEVICE_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t DEVICE_INFO_CMD; - - /* This enumeration defines special stop flags for the acquisition engine. The function used is GenTL::DSStopAcquisition. */ - enum ACQ_STOP_FLAGS_LIST - { - ACQ_STOP_FLAGS_DEFAULT = 0, /* Stop the acquisition engine when the currently running tasks like filling a buffer are completed (default behavior). */ - ACQ_STOP_FLAGS_KILL = 1, /* Stop the acquisition engine immediately and leave buffers currently being filled in the Input Buffer Pool. */ - - ACQ_STOP_FLAGS_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t ACQ_STOP_FLAGS; - - /* This enumeration defines special start flags for the acquisition engine. The function used is GenTL::DSStartAcquisition. */ - enum ACQ_START_FLAGS_LIST - { - ACQ_START_FLAGS_DEFAULT = 0, /* Default behavior. */ - - ACQ_START_FLAGS_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t ACQ_START_FLAGS; - - /* This enumeration commands from which to which queue/pool buffers are flushed with the GenTL::DSFlushQueue function. */ - enum ACQ_QUEUE_TYPE_LIST - { - ACQ_QUEUE_INPUT_TO_OUTPUT = 0, /* Flushes the input pool to the output queue and if necessary adds entries in the New Buffer event data queue. */ - ACQ_QUEUE_OUTPUT_DISCARD = 1, /* Discards all buffers in the output queue and if necessary remove the entries from the event data queue. */ - ACQ_QUEUE_ALL_TO_INPUT = 2, /* Puts all buffers in the input pool. Even those in the output queue and discard entries in the event data queue. */ - ACQ_QUEUE_UNQUEUED_TO_INPUT = 3, /* Puts all buffers that are not in the input pool or the output queue in the input pool. */ - ACQ_QUEUE_ALL_DISCARD = 4, /* Discards all buffers in the input pool and output queue. */ - - ACQ_QUEUE_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t ACQ_QUEUE_TYPE; - - /* This enumeration defines commands to retrieve information with the GenTL::DSGetInfo function on a data stream handle */ - enum STREAM_INFO_CMD_LIST - { - STREAM_INFO_ID = 0, /* STRING Unique ID of the data stream. */ - STREAM_INFO_NUM_DELIVERED = 1, /* UINT64 Number of delivered buffers since last acquisition start. */ - STREAM_INFO_NUM_UNDERRUN = 2, /* UINT64 Number of lost buffers due to queue underrun. */ - STREAM_INFO_NUM_ANNOUNCED = 3, /* SIZET Number of announced buffers. */ - STREAM_INFO_NUM_QUEUED = 4, /* SIZET Number of buffers in the input pool. */ - STREAM_INFO_NUM_AWAIT_DELIVERY = 5, /* SIZET Number of buffers in the output queue. */ - STREAM_INFO_NUM_STARTED = 6, /* UINT64 Number of buffers started in the acquisition engine. */ - STREAM_INFO_PAYLOAD_SIZE = 7, /* SIZET Size of the expected data in bytes. */ - STREAM_INFO_IS_GRABBING = 8, /* BOOL8 Flag indicating whether the acquisition engine is started or not. */ - STREAM_INFO_DEFINES_PAYLOADSIZE = 9, /* BOOL8 Flag that indicated that this data stream defines a payload size independent from the remote device. */ - STREAM_INFO_TLTYPE = 10, /* STRING Transport layer technology that is supported. */ - STREAM_INFO_NUM_CHUNKS_MAX = 11, /* SIZET Max number of chunks in a buffer, if known. GenTL v1.3 */ - STREAM_INFO_BUF_ANNOUNCE_MIN = 12, /* SIZET Min number of buffers to announce before acq can start, if known. GenTL v1.3 */ - STREAM_INFO_BUF_ALIGNMENT = 13, /* SIZET Buffer alignment in bytes. GenTL v1.3 */ - STREAM_INFO_FLOW_TABLE = 14, /* BUFFER Flow mapping table in GenDC format. GenTL v1.6 */ - STREAM_INFO_GENDC_PREFETCH_DESCRIPTOR = 15, /* BUFFER Prefetch version of GenDC descriptor. GenTL v1.6 */ - - STREAM_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t STREAM_INFO_CMD; - - /* This enumeration defines commands to retrieve information with the GenTL::DSGetBufferInfo function on a buffer handle. */ - enum BUFFER_INFO_CMD_LIST - { - BUFFER_INFO_BASE = 0, /* PTR Base address of the buffer memory. */ - BUFFER_INFO_SIZE = 1, /* SIZET Size of the buffer in bytes. */ - BUFFER_INFO_USER_PTR = 2, /* PTR Private data pointer of the GenTL Consumer. */ - BUFFER_INFO_TIMESTAMP = 3, /* UINT64 Timestamp the buffer was acquired. */ - BUFFER_INFO_NEW_DATA = 4, /* BOOL8 Flag to indicate that the buffer contains new data since the last call. */ - BUFFER_INFO_IS_QUEUED = 5, /* BOOL8 Flag to indicate if the buffer is in the input pool or output queue. */ - BUFFER_INFO_IS_ACQUIRING = 6, /* BOOL8 Flag to indicate that the buffer is currently being filled with data. */ - BUFFER_INFO_IS_INCOMPLETE = 7, /* BOOL8 Flag to indicate that a buffer was filled but an error occurred during that process. */ - BUFFER_INFO_TLTYPE = 8, /* STRING Transport layer technology that is supported. */ - BUFFER_INFO_SIZE_FILLED = 9, /* SIZET Number of bytes written into the buffer last time it has been filled. This value is reset to 0 when the buffer is placed into the Input Buffer Pool. */ - BUFFER_INFO_WIDTH = 10, /* SIZET GenTL v1.2 */ - BUFFER_INFO_HEIGHT = 11, /* SIZET GenTL v1.2 */ - BUFFER_INFO_XOFFSET = 12, /* SIZET GenTL v1.2 */ - BUFFER_INFO_YOFFSET = 13, /* SIZET GenTL v1.2 */ - BUFFER_INFO_XPADDING = 14, /* SIZET GenTL v1.2 */ - BUFFER_INFO_YPADDING = 15, /* SIZET GenTL v1.2 */ - BUFFER_INFO_FRAMEID = 16, /* UINT64 GenTL v1.2 */ - BUFFER_INFO_IMAGEPRESENT = 17, /* BOOL8 GenTL v1.2 */ - BUFFER_INFO_IMAGEOFFSET = 18, /* SIZET GenTL v1.2 */ - BUFFER_INFO_PAYLOADTYPE = 19, /* SIZET GenTL v1.2 */ - BUFFER_INFO_PIXELFORMAT = 20, /* UINT64 GenTL v1.2 */ - BUFFER_INFO_PIXELFORMAT_NAMESPACE = 21, /* UINT64 GenTL v1.2 */ - BUFFER_INFO_DELIVERED_IMAGEHEIGHT = 22, /* SIZET GenTL v1.2 */ - BUFFER_INFO_DELIVERED_CHUNKPAYLOADSIZE = 23, /* SIZET GenTL v1.2 */ - BUFFER_INFO_CHUNKLAYOUTID = 24, /* UINT64 GenTL v1.2 */ - BUFFER_INFO_FILENAME = 25, /* STRING GenTL v1.2 */ - BUFFER_INFO_PIXEL_ENDIANNESS = 26, /* INT32 GenTL v1.4 */ - BUFFER_INFO_DATA_SIZE = 27, /* SIZET GenTL v1.4 */ - BUFFER_INFO_TIMESTAMP_NS = 28, /* UINT64 GenTL v1.4 */ - BUFFER_INFO_DATA_LARGER_THAN_BUFFER = 29, /* BOOL8 GenTL v1.4 */ - BUFFER_INFO_CONTAINS_CHUNKDATA = 30, /* BOOL8 GenTL v1.4 */ - BUFFER_INFO_IS_COMPOSITE = 31, /* BOOL8 GenTL v1.6 */ - - BUFFER_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t BUFFER_INFO_CMD; - - /* This enumeration defines commands to retrieve information about individual data parts in a multi-part buffer - using the GenTL::DSGetBufferPartInfo function. Introduced in GenTL v1.5. */ - enum BUFFER_PART_INFO_CMD_LIST - { - BUFFER_PART_INFO_BASE = 0, /* PTR Base address of the buffer part memory. */ - BUFFER_PART_INFO_DATA_SIZE = 1, /* SIZET Size of the buffer part in bytes. */ - BUFFER_PART_INFO_DATA_TYPE = 2, /* SIZET Type of the data in given part (PARTDATATYPE_ID enumeration value). */ - BUFFER_PART_INFO_DATA_FORMAT = 3, /* UINT64 Format of individual items (such as pixels) in the buffer part. */ - BUFFER_PART_INFO_DATA_FORMAT_NAMESPACE = 4, /* UINT64 Allows interpretation of BUFFER_PART_INFO_DATA_FORMAT (PIXELFORMAT_NAMESPACE_ID enumeration value). */ - BUFFER_PART_INFO_WIDTH = 5, /* SIZET Width of data in the buffer part in pixels. */ - BUFFER_PART_INFO_HEIGHT = 6, /* SIZET Expected height of data in the buffer part in pixels . */ - BUFFER_PART_INFO_XOFFSET = 7, /* SIZET Horizontal offset of data in the buffer part in pixels. */ - BUFFER_PART_INFO_YOFFSET = 8, /* SIZET Vertical offset of data in the buffer part in pixels. */ - BUFFER_PART_INFO_XPADDING = 9, /* SIZET Horizontal padding of data in the buffer part in pixels. */ - BUFFER_PART_INFO_SOURCE_ID = 10, /* UINT64 Identifier allowing to group data parts belonging to the same source. */ - BUFFER_PART_INFO_DELIVERED_IMAGEHEIGHT = 11, /* SIZET Height of the data currently in the buffer part in pixels*/ - BUFFER_PART_INFO_REGION_ID = 12, /* UINT64 Identifier allowing to group data parts belonging to the same region. GenTL v1.6 */ - BUFFER_PART_INFO_DATA_PURPOSE_ID = 13, /* UINT64 Identifier allowing to group data parts having the same purpose. GenTL v1.6 */ - BUFFER_PART_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t BUFFER_PART_INFO_CMD; /* GenTL v1.5 */ - - /* Enumeration of TLType dependent payload types. Introduced in GenTL v1.2 */ - enum PAYLOADTYPE_INFO_IDS - { - PAYLOAD_TYPE_UNKNOWN = 0, /* GenTL v1.2 */ - PAYLOAD_TYPE_IMAGE = 1, /* GenTL v1.2 */ - PAYLOAD_TYPE_RAW_DATA = 2, /* GenTL v1.2 */ - PAYLOAD_TYPE_FILE = 3, /* GenTL v1.2 */ - PAYLOAD_TYPE_CHUNK_DATA = 4, /* GenTL v1.2, Deprecated in GenTL 1.5*/ - PAYLOAD_TYPE_JPEG = 5, /* GenTL v1.4 */ - PAYLOAD_TYPE_JPEG2000 = 6, /* GenTL v1.4 */ - PAYLOAD_TYPE_H264 = 7, /* GenTL v1.4 */ - PAYLOAD_TYPE_CHUNK_ONLY = 8, /* GenTL v1.4 */ - PAYLOAD_TYPE_DEVICE_SPECIFIC = 9, /* GenTL v1.4 */ - PAYLOAD_TYPE_MULTI_PART = 10, /* GenTL v1.5 */ - PAYLOAD_TYPE_GENDC = 11, /* GenTL v1.6 */ - - PAYLOAD_TYPE_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t PAYLOADTYPE_INFO_ID; - - /* Enumeration of TLType dependent pixel format namespaces introduced GenTL v1.2 */ - enum PIXELFORMAT_NAMESPACE_IDS - { - PIXELFORMAT_NAMESPACE_UNKNOWN = 0, /* GenTL v1.2 */ - PIXELFORMAT_NAMESPACE_GEV = 1, /* GenTL v1.2 */ - PIXELFORMAT_NAMESPACE_IIDC = 2, /* GenTL v1.2 */ - PIXELFORMAT_NAMESPACE_PFNC_16BIT = 3, /* GenTL v1.4 */ - PIXELFORMAT_NAMESPACE_PFNC_32BIT = 4, /* GenTL v1.4 */ - - PIXELFORMAT_NAMESPACE_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t PIXELFORMAT_NAMESPACE_ID; /* GenTL v1.2 */ - - /* Enumeration of pixel endianness values. Introduced in GenTL v1.4 */ - enum PIXELENDIANNESS_IDS - { - PIXELENDIANNESS_UNKNOWN = 0, /* Unknown pixel endianness. GenTL v1.4 */ - PIXELENDIANNESS_LITTLE = 1, /* Little endian pixel data. GenTL v1.4 */ - PIXELENDIANNESS_BIG = 2 /* Big endian pixel data. GenTL v1.4 */ - }; - typedef int32_t PIXELENDIANNESS_ID; /* GenTL v1.4*/ - - /* Enumeration describing which data type is present in given buffer part. Introduced in GenTL v1.5 */ - enum PARTDATATYPE_IDS - { - PART_DATATYPE_UNKNOWN = 0, /* Unknown data type */ - PART_DATATYPE_2D_IMAGE = 1, /* Color or monochrome 2D image. */ - PART_DATATYPE_2D_PLANE_BIPLANAR = 2, /* Single color plane of a planar 2D image consisting of 2 planes. */ - PART_DATATYPE_2D_PLANE_TRIPLANAR = 3, /* Single color plane of a planar 2D image consisting of 3 planes. */ - PART_DATATYPE_2D_PLANE_QUADPLANAR = 4, /* Single color plane of a planar 2D image consisting of 4 planes. */ - PART_DATATYPE_3D_IMAGE = 5, /* 3D image (pixel coordinates). */ - PART_DATATYPE_3D_PLANE_BIPLANAR = 6, /* Single plane of a planar 3D image consisting of 2 planes. */ - PART_DATATYPE_3D_PLANE_TRIPLANAR = 7, /* Single plane of a planar 3D image consisting of 3 planes. */ - PART_DATATYPE_3D_PLANE_QUADPLANAR = 8, /* Single plane of a planar 3D image consisting of 4 planes. */ - PART_DATATYPE_CONFIDENCE_MAP = 9, /* Confidence of the individual pixel values. */ - PART_DATATYPE_JPEG = 10, /* JPEG compressed data. GenTL v1.6 */ - PART_DATATYPE_JPEG2000 = 11, /* JPEG 2000 compressed data. GenTL v1.6 */ - - PART_DATATYPE_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t PARTDATATYPE_ID; /* GenTL v1.5*/ - - /* This enumeration defines commands to retrieve information with the GenTL::GCGetPortInfo function on a module or remote device handle. */ - enum PORT_INFO_CMD_LIST - { - PORT_INFO_ID = 0, /* STRING Unique ID of the port. */ - PORT_INFO_VENDOR = 1, /* STRING Port vendor name. */ - PORT_INFO_MODEL = 2, /* STRING Port model name. */ - PORT_INFO_TLTYPE = 3, /* STRING Transport layer technology that is supported. */ - PORT_INFO_MODULE = 4, /* STRING GenTL Module the port refers to. */ - PORT_INFO_LITTLE_ENDIAN = 5, /* BOOL8 Flag indicating that the port data is little endian. */ - PORT_INFO_BIG_ENDIAN = 6, /* BOOL8 Flag indicating that the port data is big endian. */ - PORT_INFO_ACCESS_READ = 7, /* BOOL8 Port has read access. */ - PORT_INFO_ACCESS_WRITE = 8, /* BOOL8 Port has write access. */ - PORT_INFO_ACCESS_NA = 9, /* BOOL8 Port is not accessible. */ - PORT_INFO_ACCESS_NI = 10, /* BOOL8 Port is not implemented. */ - PORT_INFO_VERSION = 11, /* STRING Version of the port. */ - PORT_INFO_PORTNAME = 12, /* STRING Name of the port as referenced in the XML description. */ - - PORT_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t PORT_INFO_CMD; - - /* This enumeration defines enum values returned by the URL_INFO_SCHEME command. - introduced in GenTL v1.5 */ - enum URL_SCHEME_IDS - { - URL_SCHEME_LOCAL = 0, /* The XML can be read from the local register map */ - URL_SCHEME_HTTP = 1, /* The XML can be downloaded from a http server */ - URL_SCHEME_FILE = 2, /* The XML can be read from the local hard drive */ - - URL_SCHEME_CUSTOM_ID = 1000 /* Starting value for custom scheme locations */ - }; - typedef int32_t URL_SCHEME_ID; - - /* This enumeration defines commands to retrieve information with the GenTL::GCGetPortURLInfo - function on a module or remote device handle. Introduced in GenTL v1.1 */ - enum URL_INFO_CMD_LIST - { - URL_INFO_URL = 0, /* STRING URL as defined in chapter 4.1.2 GenTL v1.1 */ - URL_INFO_SCHEMA_VER_MAJOR = 1, /* INT32 Major version of the schema this URL refers to. GenTL v1.1 */ - URL_INFO_SCHEMA_VER_MINOR = 2, /* INT32 Minor version of the schema this URL refers to. GenTL v1.1 */ - URL_INFO_FILE_VER_MAJOR = 3, /* INT32 Major version of the XML-file this URL refers to. GenTL v1.1 */ - URL_INFO_FILE_VER_MINOR = 4, /* INT32 Minor version of the XML-file this URL refers to. GenTL v1.1 */ - URL_INFO_FILE_VER_SUBMINOR = 5, /* INT32 Subminor version of the XML-file this URL refers to. GenTL v1.1 */ - URL_INFO_FILE_SHA1_HASH = 6, /* BUFFER 160-bit SHA1 Hash code of XML-file. GenTL v1.4 */ - URL_INFO_FILE_REGISTER_ADDRESS = 7, /* UINT64 Register address in the device's register map. GenTL v1.5 */ - URL_INFO_FILE_SIZE = 8, /* UINT64 File size in bytes. GenTL v1.5 */ - URL_INFO_SCHEME = 9, /* INT32 Scheme of the URL as defined in URL_SCHEME_IDS. GenTL v1.5 */ - URL_INFO_FILENAME = 10, /* STRING File name if the scheme of the URL is file. GenTL v1.5 */ - - URL_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t URL_INFO_CMD; /* GenTL v1.1 */ - - /* Known event types that can be registered on certain modules with the GenTL::GCRegisterEvent function. */ - enum EVENT_TYPE_LIST - { - EVENT_ERROR = 0, /* Notification on module errors. */ - EVENT_NEW_BUFFER = 1, /* Notification on newly filled buffers. */ - EVENT_FEATURE_INVALIDATE = 2, /* Notification if a feature was changed by the GenTL Producer library and thus needs to be invalidated in the GenICam GenApi instance using the module. */ - EVENT_FEATURE_CHANGE = 3, /* Notification if the GenTL Producer library wants to manually set a feature in the GenICam GenApi instance using the module. */ - EVENT_REMOTE_DEVICE = 4, /* Notification if the GenTL Producer wants to inform the GenICam GenApi instance of the remote device that a GenApi compatible event was fired. */ - EVENT_MODULE = 5, /* Notification if the GenTL Producer wants to inform the GenICam GenApi instance of the module that a GenApi compatible event was fired. GenTL v1.4 */ - - EVENT_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t EVENT_TYPE; - - /* Event info command */ - enum EVENT_INFO_CMD_LIST - { - EVENT_EVENT_TYPE = 0, /* INT32 The event type of the event handle (EVENT_TYPE enum value). */ - EVENT_NUM_IN_QUEUE = 1, /* SIZET Number of events in the event data queue. */ - EVENT_NUM_FIRED = 2, /* UINT64 Number of events that were fired since the creation of the module. */ - EVENT_SIZE_MAX = 3, /* SIZET Max size of data carried with an event in bytes. GenTL v1.2 */ - EVENT_INFO_DATA_SIZE_MAX = 4, /* SIZET Max size of data provided through EventGetDataInfo in bytes. GenTL v1.2 */ - - EVENT_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t EVENT_INFO_CMD; - - /* Event data info command */ - enum EVENT_DATA_INFO_CMD_LIST - { - EVENT_DATA_ID = 0, /* Event specific Unique Event ID (String or Number)*/ - EVENT_DATA_VALUE = 1, /* Event specific Data */ - EVENT_DATA_NUMID = 2, /* UINT64 Numeric representation of the unique Event ID, GenTL v1.3. */ - - EVENT_DATA_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t EVENT_DATA_INFO_CMD; - - /* This enumeration defines commands to retrieve information about individual data stream flows - using the GenTL::DSGetFlowInfo function. Introduced in GenTL v1.6. */ - enum FLOW_INFO_CMD_LIST - { - FLOW_INFO_SIZE = 0, /* SIZET Size of the flow in bytes. */ - FLOW_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t FLOW_INFO_CMD; /* GenTL v1.6 */ - - /* This enumeration defines commands to retrieve information about composite buffer segments - using the GenTL::DSGetBufferSegmentInfo function. Introduced in GenTL v1.6. */ - enum SEGMENT_INFO_CMD_LIST - { - SEGMENT_INFO_BASE = 0, /* PTR Based address of the buffer segment memory. */ - SEGMENT_INFO_SIZE = 1, /* SIZET Size of the buffer segment in bytes. */ - SEGMENT_INFO_IS_INCOMPLETE = 2, /* BOOL8 Flag to indicate that an error occured while filling the segment. */ - SEGMENT_INFO_SIZE_FILLED = 3, /* SIZET Number of bytes written into the buffer last time it has been filled. */ - SEGMENT_INFO_DATA_SIZE = 4, /* SIZET Size of the data intended to be written to the buffer last time it has been filled. */ - SEGMENT_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */ - }; - typedef int32_t SEGMENT_INFO_CMD; /* GenTL v1.6 */ - - /* Structure of the data returned from a signaled "New Buffer" event. */ -# pragma pack (push, 1) - typedef struct S_EVENT_NEW_BUFFER - { - BUFFER_HANDLE BufferHandle; /* Buffer handle which contains new data. */ - void* pUserPointer; /* User pointer provided at announcement of the buffer. */ - } EVENT_NEW_BUFFER_DATA; -# pragma pack (pop) - - /* Structure to be use with GCWritePortStacked and GCReadPortStacked. */ -# pragma pack (push, 1) - typedef struct S_PORT_REGISTER_STACK_ENTRY - { - uint64_t Address; /* Address of the register. */ - void* pBuffer; /* Pointer to the buffer containing the data. */ - size_t Size; /* Number of bytes to read write. */ - } PORT_REGISTER_STACK_ENTRY; -# pragma pack (pop) - -# pragma pack (push, 1) - /* Structure carrying information about a single chunk in the buffer. Introduced in GenTL v1.3. */ - typedef struct S_SINGLE_CHUNK_DATA - { - uint64_t ChunkID; /* Numeric representation of ChunkID */ - ptrdiff_t ChunkOffset; /* Chunk offset in the buffer */ - size_t ChunkLength; /* Size of the chunk data */ - } SINGLE_CHUNK_DATA; -# pragma pack (pop) - -# pragma pack (push, 1) - /* Structure carrying information about a buffer info within a stacked request. Introduced in GenTL v1.6. */ - typedef struct S_DS_BUFFER_INFO_STACKED - { - BUFFER_INFO_CMD iInfoCmd; /* Queried buffer info */ - INFO_DATATYPE iType; /* The info's data type */ - void* pBuffer; /* Pointer to buffer to hold the info data */ - size_t iSize; /* Size of the info buffer (in) and the actual info data (out) */ - GC_ERROR iResult; /* Result of the buffer info queury */ - } DS_BUFFER_INFO_STACKED; -# pragma pack (pop) - -# pragma pack (push, 1) - /* Structure carrying information about a buffer part info within a stacked request. Introduced in GenTL v1.6. */ - typedef struct S_DS_BUFFER_PART_INFO_STACKED - { - uint32_t iPartIndex; /* Index of buffer part to query */ - BUFFER_PART_INFO_CMD iInfoCmd; /* Queried buffer part info */ - GC_ERROR iResult; /* Result of the buffer info queury */ - INFO_DATATYPE iType; /* The info's data type */ - void* pBuffer; /* Pointer to buffer to hold the info data */ - size_t iSize; /* Size of the info buffer (in) and the actual info data (out) */ - } DS_BUFFER_PART_INFO_STACKED; -# pragma pack (pop) - - - /* C API Interface Functions */ -# define GC_API GC_IMPORT_EXPORT GC_ERROR GC_CALLTYPE - GC_API GCGetInfo ( TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - GC_API GCGetLastError ( GC_ERROR *piErrorCode, char *sErrText, size_t *piSize ); - - GC_API GCInitLib ( void ); - GC_API GCCloseLib ( void ); - - GC_API GCReadPort ( PORT_HANDLE hPort, uint64_t iAddress, void *pBuffer, size_t *piSize ); - GC_API GCWritePort ( PORT_HANDLE hPort, uint64_t iAddress, const void *pBuffer, size_t *piSize ); - GC_API GCGetPortURL ( PORT_HANDLE hPort, char *sURL, size_t *piSize ); - - GC_API GCGetPortInfo ( PORT_HANDLE hPort, PORT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - GC_API GCRegisterEvent ( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID, EVENT_HANDLE *phEvent ); - GC_API GCUnregisterEvent ( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID ); - - GC_API EventGetData ( EVENT_HANDLE hEvent, void *pBuffer, size_t *piSize, uint64_t iTimeout ); - GC_API EventGetDataInfo ( EVENT_HANDLE hEvent, const void *pInBuffer, size_t iInSize, EVENT_DATA_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pOutBuffer, size_t *piOutSize ); - GC_API EventGetInfo ( EVENT_HANDLE hEvent, EVENT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API EventFlush ( EVENT_HANDLE hEvent ); - GC_API EventKill ( EVENT_HANDLE hEvent ); - - GC_API TLOpen ( TL_HANDLE *phTL ); - GC_API TLClose ( TL_HANDLE hTL ); - GC_API TLGetInfo ( TL_HANDLE hTL, TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - GC_API TLGetNumInterfaces ( TL_HANDLE hTL, uint32_t *piNumIfaces ); - GC_API TLGetInterfaceID ( TL_HANDLE hTL, uint32_t iIndex, char *sID, size_t *piSize ); - GC_API TLGetInterfaceInfo ( TL_HANDLE hTL, const char *sIfaceID, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API TLOpenInterface ( TL_HANDLE hTL, const char *sIfaceID, IF_HANDLE *phIface ); - GC_API TLUpdateInterfaceList ( TL_HANDLE hTL, bool8_t *pbChanged, uint64_t iTimeout ); - - GC_API IFClose ( IF_HANDLE hIface ); - GC_API IFGetInfo ( IF_HANDLE hIface, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - GC_API IFGetNumDevices ( IF_HANDLE hIface, uint32_t *piNumDevices ); - GC_API IFGetDeviceID ( IF_HANDLE hIface, uint32_t iIndex, char *sIDeviceID, size_t *piSize ); - GC_API IFUpdateDeviceList ( IF_HANDLE hIface, bool8_t *pbChanged, uint64_t iTimeout ); - GC_API IFGetDeviceInfo ( IF_HANDLE hIface, const char *sDeviceID, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API IFOpenDevice ( IF_HANDLE hIface, const char *sDeviceID, DEVICE_ACCESS_FLAGS iOpenFlag, DEV_HANDLE *phDevice ); - - GC_API DevGetPort ( DEV_HANDLE hDevice, PORT_HANDLE *phRemoteDevice ); - GC_API DevGetNumDataStreams ( DEV_HANDLE hDevice, uint32_t *piNumDataStreams ); - GC_API DevGetDataStreamID ( DEV_HANDLE hDevice, uint32_t iIndex, char *sDataStreamID, size_t *piSize ); - GC_API DevOpenDataStream ( DEV_HANDLE hDevice, const char *sDataStreamID, DS_HANDLE *phDataStream ); - GC_API DevGetInfo ( DEV_HANDLE hDevice, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API DevClose ( DEV_HANDLE hDevice ); - - GC_API DSAnnounceBuffer ( DS_HANDLE hDataStream, void *pBuffer, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer ); - GC_API DSAllocAndAnnounceBuffer( DS_HANDLE hDataStream, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer ); - GC_API DSFlushQueue ( DS_HANDLE hDataStream, ACQ_QUEUE_TYPE iOperation ); - GC_API DSStartAcquisition ( DS_HANDLE hDataStream, ACQ_START_FLAGS iStartFlags, uint64_t iNumToAcquire ); - GC_API DSStopAcquisition ( DS_HANDLE hDataStream, ACQ_STOP_FLAGS iStopFlags ); - GC_API DSGetInfo ( DS_HANDLE hDataStream, STREAM_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API DSGetBufferID ( DS_HANDLE hDataStream, uint32_t iIndex, BUFFER_HANDLE *phBuffer ); - GC_API DSClose ( DS_HANDLE hDataStream ); - - GC_API DSRevokeBuffer ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, void **pBuffer, void **pPrivate ); - GC_API DSQueueBuffer ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer ); - GC_API DSGetBufferInfo ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, BUFFER_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - /* GenTL v1.1 */ - GC_API GCGetNumPortURLs ( PORT_HANDLE hPort, uint32_t *piNumURLs ); - GC_API GCGetPortURLInfo ( PORT_HANDLE hPort, uint32_t iURLIndex, URL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API GCReadPortStacked ( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries ); - GC_API GCWritePortStacked ( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries ); - - /* GenTL v1.3 */ - GC_API DSGetBufferChunkData ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, SINGLE_CHUNK_DATA *pChunkData, size_t *piNumChunks ); - - /* GenTL v1.4 */ - GC_API IFGetParentTL ( IF_HANDLE hIface, TL_HANDLE *phSystem ); - GC_API DevGetParentIF ( DEV_HANDLE hDevice, IF_HANDLE *phIface ); - GC_API DSGetParentDev ( DS_HANDLE hDataStream, DEV_HANDLE *phDevice ); - - /* GenTL v1.5 */ - GC_API DSGetNumBufferParts ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumParts ); - GC_API DSGetBufferPartInfo ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iPartIndex, BUFFER_PART_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - /* GenTL v1.6 */ - GC_API DSAnnounceCompositeBuffer ( DS_HANDLE hDataStream, size_t iNumSegments, void **ppSegments, size_t *piSizes, void *pPrivate, BUFFER_HANDLE *phBuffer ); - GC_API DSGetBufferInfoStacked ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, DS_BUFFER_INFO_STACKED *pInfoStacked, size_t iNumInfos ); - GC_API DSGetBufferPartInfoStacked( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, DS_BUFFER_PART_INFO_STACKED *pInfoStacked, size_t iNumInfos ); - GC_API DSGetNumFlows ( DS_HANDLE hDataStream, uint32_t *piNumFlows ); - GC_API DSGetFlowInfo ( DS_HANDLE hDataStream, uint32_t iFlowIndex, FLOW_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API DSGetNumBufferSegments ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumSegments ); - GC_API DSGetBufferSegmentInfo ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iSegmentIndex, SEGMENT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - /* typedefs for dynamic loading */ -# define GC_API_P(function) typedef GC_ERROR( GC_CALLTYPE *function ) - GC_API_P(PGCGetInfo )( TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PGCGetLastError )( GC_ERROR *piErrorCode, char *sErrText, size_t *piSize ); - GC_API_P(PGCInitLib )( void ); - GC_API_P(PGCCloseLib )( void ); - GC_API_P(PGCReadPort )( PORT_HANDLE hPort, uint64_t iAddress, void *pBuffer, size_t *piSize ); - GC_API_P(PGCWritePort )( PORT_HANDLE hPort, uint64_t iAddress, const void *pBuffer, size_t *piSize ); - GC_API_P(PGCGetPortURL )( PORT_HANDLE hPort, char *sURL, size_t *piSize ); - GC_API_P(PGCGetPortInfo )( PORT_HANDLE hPort, PORT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - GC_API_P(PGCRegisterEvent )( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID, EVENT_HANDLE *phEvent ); - GC_API_P(PGCUnregisterEvent )( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID ); - GC_API_P(PEventGetData )( EVENT_HANDLE hEvent, void *pBuffer, size_t *piSize, uint64_t iTimeout ); - GC_API_P(PEventGetDataInfo )( EVENT_HANDLE hEvent, const void *pInBuffer, size_t iInSize, EVENT_DATA_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pOutBuffer, size_t *piOutSize ); - GC_API_P(PEventGetInfo )( EVENT_HANDLE hEvent, EVENT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PEventFlush )( EVENT_HANDLE hEvent ); - GC_API_P(PEventKill )( EVENT_HANDLE hEvent ); - GC_API_P(PTLOpen )( TL_HANDLE *phTL ); - GC_API_P(PTLClose )( TL_HANDLE hTL ); - GC_API_P(PTLGetInfo )( TL_HANDLE hTL, TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PTLGetNumInterfaces )( TL_HANDLE hTL, uint32_t *piNumIfaces ); - GC_API_P(PTLGetInterfaceID )( TL_HANDLE hTL, uint32_t iIndex, char *sID, size_t *piSize ); - GC_API_P(PTLGetInterfaceInfo )( TL_HANDLE hTL, const char *sIfaceID, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PTLOpenInterface )( TL_HANDLE hTL, const char *sIfaceID, IF_HANDLE *phIface ); - GC_API_P(PTLUpdateInterfaceList )( TL_HANDLE hTL, bool8_t *pbChanged, uint64_t iTimeout ); - GC_API_P(PIFClose )( IF_HANDLE hIface ); - GC_API_P(PIFGetInfo )( IF_HANDLE hIface, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PIFGetNumDevices )( IF_HANDLE hIface, uint32_t *piNumDevices ); - GC_API_P(PIFGetDeviceID )( IF_HANDLE hIface, uint32_t iIndex, char *sIDeviceID, size_t *piSize ); - GC_API_P(PIFUpdateDeviceList )( IF_HANDLE hIface, bool8_t *pbChanged, uint64_t iTimeout ); - GC_API_P(PIFGetDeviceInfo )( IF_HANDLE hIface, const char *sDeviceID, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PIFOpenDevice )( IF_HANDLE hIface, const char *sDeviceID, DEVICE_ACCESS_FLAGS iOpenFlag, DEV_HANDLE *phDevice ); - - GC_API_P(PDevGetPort )( DEV_HANDLE hDevice, PORT_HANDLE *phRemoteDevice ); - GC_API_P(PDevGetNumDataStreams )( DEV_HANDLE hDevice, uint32_t *piNumDataStreams ); - GC_API_P(PDevGetDataStreamID )( DEV_HANDLE hDevice, uint32_t iIndex, char *sDataStreamID, size_t *piSize ); - GC_API_P(PDevOpenDataStream )( DEV_HANDLE hDevice, const char *sDataStreamID, DS_HANDLE *phDataStream ); - GC_API_P(PDevGetInfo )( DEV_HANDLE hDevice, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PDevClose )( DEV_HANDLE hDevice ); - - GC_API_P(PDSAnnounceBuffer )( DS_HANDLE hDataStream, void *pBuffer, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer ); - GC_API_P(PDSAllocAndAnnounceBuffer)( DS_HANDLE hDataStream, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer ); - GC_API_P(PDSFlushQueue )( DS_HANDLE hDataStream, ACQ_QUEUE_TYPE iOperation ); - GC_API_P(PDSStartAcquisition )( DS_HANDLE hDataStream, ACQ_START_FLAGS iStartFlags, uint64_t iNumToAcquire ); - GC_API_P(PDSStopAcquisition )( DS_HANDLE hDataStream, ACQ_STOP_FLAGS iStopFlags ); - GC_API_P(PDSGetInfo )( DS_HANDLE hDataStream, STREAM_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PDSGetBufferID )( DS_HANDLE hDataStream, uint32_t iIndex, BUFFER_HANDLE *phBuffer ); - GC_API_P(PDSClose )( DS_HANDLE hDataStream ); - GC_API_P(PDSRevokeBuffer )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, void **pBuffer, void **pPrivate ); - GC_API_P(PDSQueueBuffer )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer ); - GC_API_P(PDSGetBufferInfo )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, BUFFER_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - /* GenTL v1.1 */ - GC_API_P(PGCGetNumPortURLs )( PORT_HANDLE hPort, uint32_t *iNumURLs ); - GC_API_P(PGCGetPortURLInfo )( PORT_HANDLE hPort, uint32_t iURLIndex, URL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PGCReadPortStacked )( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries ); - GC_API_P(PGCWritePortStacked )( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries ); - - /* GenTL v1.3 */ - GC_API_P(PDSGetBufferChunkData )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, SINGLE_CHUNK_DATA *pChunkData, size_t *piNumChunks ); - - /* GenTL v1.4 */ - GC_API_P(PIFGetParentTL )( IF_HANDLE hIface, TL_HANDLE *phSystem ); - GC_API_P(PDevGetParentIF )( DEV_HANDLE hDevice, IF_HANDLE *phIface ); - GC_API_P(PDSGetParentDev )( DS_HANDLE hDataStream, DEV_HANDLE *phDevice ); - - /* GenTL v1.5 */ - GC_API_P(PDSGetNumBufferParts )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumParts ); - GC_API_P(PDSGetBufferPartInfo )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iPartIndex, BUFFER_PART_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - - /* GenTL v1.6 */ - GC_API_P(PDSAnnounceCompositeBuffer)( DS_HANDLE hDataStream, size_t iNumSegments, void **ppSegments, size_t *piSizes, void *pPrivate, BUFFER_HANDLE *phBuffer ); - GC_API_P(PDSGetBufferInfoStacked )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, DS_BUFFER_INFO_STACKED *pInfoStacked, size_t iNumInfos ); - GC_API_P(PDSGetBufferPartInfoStacked)( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, DS_BUFFER_PART_INFO_STACKED *pInfoStacked, size_t iNumInfos ); - GC_API_P(PDSGetNumFlows )( DS_HANDLE hDataStream, uint32_t *piNumFlows ); - GC_API_P(PDSGetFlowInfo )( DS_HANDLE hDataStream, uint32_t iFlowIndex, FLOW_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); - GC_API_P(PDSGetNumBufferSegments )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumSegments ); - GC_API_P(PDSGetBufferSegmentInfo )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iSegmentIndex, SEGMENT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ); -#ifdef __cplusplus - } /* end of namespace GenTL */ -} /* end of extern "C" */ -#endif -#endif /* GC_TLI_CLIENT_H_ */ diff --git a/src/gentl/dev.c b/src/gentl/dev.c index 188183c1f..c69778e87 100644 --- a/src/gentl/dev.c +++ b/src/gentl/dev.c @@ -45,7 +45,7 @@ gentl_to_buf__cam_string (DEV_HANDLE hDevice, const char* (*func)(ArvCamera*,GEr return gentl_to_buf(INFO_DATATYPE_STRING,pBuffer,n,piSize,piType); }; -GC_API +GC_ERROR DevGetPort (DEV_HANDLE hDevice, PORT_HANDLE *phRemoteDevice) { _DEV_CHECK_HANDLE; @@ -56,7 +56,7 @@ DevGetPort (DEV_HANDLE hDevice, PORT_HANDLE *phRemoteDevice) return GC_ERR_SUCCESS; } -GC_API +GC_ERROR DevGetNumDataStreams (DEV_HANDLE hDevice, uint32_t *piNumDataStreams) { GError* err; @@ -84,7 +84,7 @@ DevGetNumDataStreams (DEV_HANDLE hDevice, uint32_t *piNumDataStreams) return GC_ERR_SUCCESS; } -GC_API +GC_ERROR DevGetDataStreamID (DEV_HANDLE hDevice, uint32_t iIndex, char *sDataStreamID, size_t *piSize) { GError* err = NULL; @@ -111,13 +111,13 @@ DevGetDataStreamID (DEV_HANDLE hDevice, uint32_t iIndex, char *sDataStreamID, si return gentl_to_buf(INFO_DATATYPE_STRING,sDataStreamID,buf,piSize,NULL); } -GC_API +GC_ERROR DevOpenDataStream (DEV_HANDLE hDevice, const char *sDataStreamID, DS_HANDLE *phDataStream) { GENTL_NYI; } -GC_API +GC_ERROR DevGetInfo ( DEV_HANDLE hDevice, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ) { _DEV_CHECK_HANDLE; @@ -131,7 +131,7 @@ DevGetInfo ( DEV_HANDLE hDevice, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType } } -GC_API +GC_ERROR DevClose (DEV_HANDLE hDevice) { GENTL_NYI; @@ -139,7 +139,7 @@ DevClose (DEV_HANDLE hDevice) /* GenTL v1.4 */ -GC_API +GC_ERROR DevGetParentIF (DEV_HANDLE hDevice, IF_HANDLE *phIface) { GENTL_NYI; diff --git a/src/gentl/ds.c b/src/gentl/ds.c index 8d19b868d..c89f1818d 100644 --- a/src/gentl/ds.c +++ b/src/gentl/ds.c @@ -22,30 +22,3 @@ #include "private.h" -GC_API DSAnnounceBuffer ( DS_HANDLE hDataStream, void *pBuffer, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer ){ GENTL_NYI; } -GC_API DSAllocAndAnnounceBuffer( DS_HANDLE hDataStream, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer ){ GENTL_NYI; } -GC_API DSFlushQueue ( DS_HANDLE hDataStream, ACQ_QUEUE_TYPE iOperation ){ GENTL_NYI; } -GC_API DSStartAcquisition ( DS_HANDLE hDataStream, ACQ_START_FLAGS iStartFlags, uint64_t iNumToAcquire ){ GENTL_NYI; } -GC_API DSStopAcquisition ( DS_HANDLE hDataStream, ACQ_STOP_FLAGS iStopFlags ){ GENTL_NYI; } -GC_API DSGetInfo ( DS_HANDLE hDataStream, STREAM_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ){ GENTL_NYI; } -GC_API DSGetBufferID ( DS_HANDLE hDataStream, uint32_t iIndex, BUFFER_HANDLE *phBuffer ){ GENTL_NYI; } -GC_API DSClose ( DS_HANDLE hDataStream ){ GENTL_NYI; } -GC_API DSRevokeBuffer ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, void **pBuffer, void **pPrivate ){ GENTL_NYI; } -GC_API DSQueueBuffer ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer ){ GENTL_NYI; } -GC_API DSGetBufferInfo ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, BUFFER_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ){ GENTL_NYI; } -/* GenTL v1.3 */ -GC_API DSGetBufferChunkData ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, SINGLE_CHUNK_DATA *pChunkData, size_t *piNumChunks ){ GENTL_NYI; } -/* GenTL v1.4 */ -GC_API DSGetParentDev ( DS_HANDLE hDataStream, DEV_HANDLE *phDevice ){ GENTL_NYI; } -/* GenTL v1.5 */ -GC_API DSGetNumBufferParts ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumParts ){ GENTL_NYI; } -GC_API DSGetBufferPartInfo ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iPartIndex, BUFFER_PART_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ){ GENTL_NYI; } -/* GenTL v1.6 */ -GC_API DSAnnounceCompositeBuffer ( DS_HANDLE hDataStream, size_t iNumSegments, void **ppSegments, size_t *piSizes, void *pPrivate, BUFFER_HANDLE *phBuffer ){ GENTL_NYI; } -GC_API DSGetBufferInfoStacked ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, DS_BUFFER_INFO_STACKED *pInfoStacked, size_t iNumInfos ){ GENTL_NYI; } -GC_API DSGetBufferPartInfoStacked( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, DS_BUFFER_PART_INFO_STACKED *pInfoStacked, size_t iNumInfos ){ GENTL_NYI; } -GC_API DSGetNumFlows ( DS_HANDLE hDataStream, uint32_t *piNumFlows ){ GENTL_NYI; } -GC_API DSGetFlowInfo ( DS_HANDLE hDataStream, uint32_t iFlowIndex, FLOW_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ){ GENTL_NYI; } -GC_API DSGetNumBufferSegments ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumSegments ){ GENTL_NYI; } -GC_API DSGetBufferSegmentInfo ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iSegmentIndex, SEGMENT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ){ GENTL_NYI; } - diff --git a/src/gentl/event.c b/src/gentl/event.c index 6d95a7f50..c89f1818d 100644 --- a/src/gentl/event.c +++ b/src/gentl/event.c @@ -22,9 +22,3 @@ #include "private.h" -GC_API EventGetData ( EVENT_HANDLE hEvent, void *pBuffer, size_t *piSize, uint64_t iTimeout ){ GENTL_NYI; } -GC_API EventGetDataInfo ( EVENT_HANDLE hEvent, const void *pInBuffer, size_t iInSize, EVENT_DATA_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pOutBuffer, size_t *piOutSize ){ GENTL_NYI; } -GC_API EventGetInfo ( EVENT_HANDLE hEvent, EVENT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize ){ GENTL_NYI; } -GC_API EventFlush ( EVENT_HANDLE hEvent ){ GENTL_NYI; } -GC_API EventKill ( EVENT_HANDLE hEvent ){ GENTL_NYI; } - diff --git a/src/gentl/gc.c b/src/gentl/gc.c index b171e5184..b60703de5 100644 --- a/src/gentl/gc.c +++ b/src/gentl/gc.c @@ -51,7 +51,7 @@ const char _XML_IF[]= #define _GC_CHECK_HANDLE { GENTL_ENSURE_INIT; if(hPort==NULL) return GC_ERR_INVALID_HANDLE; } -GC_API +GC_ERROR GCGetInfo (TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize) { arv_trace_gentl("%s (iInfoCmd=%d)",__FUNCTION__,iInfoCmd); @@ -95,7 +95,7 @@ GCGetInfo (TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *p } } -GC_API +GC_ERROR GCGetLastError (GC_ERROR *piErrorCode, char *sErrText, size_t *piSize) { if(piSize == NULL) @@ -115,14 +115,14 @@ GCGetLastError (GC_ERROR *piErrorCode, char *sErrText, size_t *piSize) return gentl_to_buf(INFO_DATATYPE_STRING,sErrText,gentl_err->message,piSize,NULL); } -GC_API +GC_ERROR GCInitLib (void) { arv_trace_gentl(__FUNCTION__); return gentl_init(); } -GC_API +GC_ERROR GCCloseLib (void) { arv_trace_gentl(__FUNCTION__); @@ -130,7 +130,7 @@ GCCloseLib (void) } -GC_API +GC_ERROR GCReadPort (PORT_HANDLE hPort, uint64_t iAddress, void *pBuffer, size_t *piSize ) { arv_trace_gentl ("%s (hPort=%s[%p],iAddress=%#lx,pBuffer=%p,piSize=%ld)", @@ -159,19 +159,19 @@ GCReadPort (PORT_HANDLE hPort, uint64_t iAddress, void *pBuffer, size_t *piSize #endif } -GC_API +GC_ERROR GCWritePort (PORT_HANDLE hPort, uint64_t iAddress, const void *pBuffer, size_t *piSize ) { GENTL_NYI; } -GC_API +GC_ERROR GCGetPortURL ( PORT_HANDLE hPort, char *sURL, size_t *piSize ) { GENTL_NYI; } -GC_API +GC_ERROR GCGetPortInfo (PORT_HANDLE hPort, PORT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize) { arv_trace_gentl("%s (hPort=%s[%p],iInfoCmd=%d,pBuffer=%p)",__FUNCTION__,G_OBJECT_TYPE_NAME(hPort),hPort,iInfoCmd,pBuffer); @@ -224,7 +224,7 @@ GCGetPortInfo (PORT_HANDLE hPort, PORT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, GENTL_NYI_DETAIL("only TL/IF/DEV ports implemented (hPort=%s[%p])",G_OBJECT_TYPE_NAME(hPort),hPort); } -GC_API +GC_ERROR GCRegisterEvent (EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID, EVENT_HANDLE *phEvent) { arv_trace_gentl("%s (hEventSrc=%s[%p],iEventID=%d,phEvent=%p)", @@ -232,14 +232,14 @@ GCRegisterEvent (EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID, EVENT_HANDLE *p GENTL_NYI_DETAIL("hEventSrc=%s[%p]",G_OBJECT_TYPE_NAME(hEventSrc),hEventSrc); } -GC_API +GC_ERROR GCUnregisterEvent (EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID) { GENTL_NYI; } /* GenTL v1.1 */ -GC_API +GC_ERROR GCGetNumPortURLs (PORT_HANDLE hPort, uint32_t *piNumURLs) { if(hPort==NULL) @@ -269,7 +269,7 @@ GCGetNumPortURLs (PORT_HANDLE hPort, uint32_t *piNumURLs) return GC_ERR_SUCCESS; } -GC_API +GC_ERROR GCGetPortURLInfo (PORT_HANDLE hPort, uint32_t iURLIndex, URL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize) { @@ -392,13 +392,13 @@ GCGetPortURLInfo (PORT_HANDLE hPort, uint32_t iURLIndex, URL_INFO_CMD iInfoCmd, } -GC_API +GC_ERROR GCReadPortStacked (PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries) { GENTL_NYI; } -GC_API +GC_ERROR GCWritePortStacked ( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries) { GENTL_NYI; diff --git a/src/gentl/if.c b/src/gentl/if.c index c6a40ac35..5b36d913f 100644 --- a/src/gentl/if.c +++ b/src/gentl/if.c @@ -26,7 +26,7 @@ #define _IF_CHECK_HANDLE GENTL_ENSURE_INIT; if(hIface==NULL || !(ARV_IS_INTERFACE(hIface))) return GC_ERR_INVALID_HANDLE; -GC_API +GC_ERROR IFClose (IF_HANDLE hIface) { _IF_CHECK_HANDLE; @@ -36,7 +36,7 @@ IFClose (IF_HANDLE hIface) return GC_ERR_SUCCESS; } -GC_API +GC_ERROR IFGetInfo (IF_HANDLE hIface, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize) { _IF_CHECK_HANDLE; @@ -53,7 +53,7 @@ IFGetInfo (IF_HANDLE hIface, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, } } -GC_API +GC_ERROR IFGetNumDevices (IF_HANDLE hIface, uint32_t *piNumDevices) { _IF_CHECK_HANDLE; @@ -69,7 +69,7 @@ IFGetNumDevices (IF_HANDLE hIface, uint32_t *piNumDevices) return GC_ERR_SUCCESS; } -GC_API +GC_ERROR IFGetDeviceID (IF_HANDLE hIface, uint32_t iIndex, char *sIDeviceID, size_t *piSize) { _IF_CHECK_HANDLE; @@ -79,7 +79,7 @@ IFGetDeviceID (IF_HANDLE hIface, uint32_t iIndex, char *sIDeviceID, size_t *piSi return gentl_to_buf(INFO_DATATYPE_STRING,sIDeviceID,arv_interface_get_device_id(hIface,iIndex),piSize,NULL); } -GC_API +GC_ERROR IFUpdateDeviceList (IF_HANDLE hIface, bool8_t *pbChanged, uint64_t iTimeout) { _IF_CHECK_HANDLE; @@ -94,7 +94,7 @@ IFUpdateDeviceList (IF_HANDLE hIface, bool8_t *pbChanged, uint64_t iTimeout) return GC_ERR_SUCCESS; } -GC_API +GC_ERROR IFGetDeviceInfo (IF_HANDLE hIface, const char *sDeviceID, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize) { @@ -156,7 +156,7 @@ IFGetDeviceInfo (IF_HANDLE hIface, const char *sDeviceID, DEVICE_INFO_CMD iInfoC } } -GC_API +GC_ERROR IFOpenDevice (IF_HANDLE hIface, const char *sDeviceID, DEVICE_ACCESS_FLAGS iOpenFlag, DEV_HANDLE *phDevice) { ArvCamera* cam; @@ -174,7 +174,7 @@ IFOpenDevice (IF_HANDLE hIface, const char *sDeviceID, DEVICE_ACCESS_FLAGS iOpen } /* GenTL v1.4 */ -GC_API +GC_ERROR IFGetParentTL (IF_HANDLE hIface, TL_HANDLE *phSystem) { GENTL_NYI; diff --git a/src/gentl/private.h b/src/gentl/private.h index 8af62aad8..0d61cf564 100644 --- a/src/gentl/private.h +++ b/src/gentl/private.h @@ -23,20 +23,13 @@ #ifndef ARV_GENTL_PRIVATE_H #define ARV_GENTL_PRIVATE_H -/* -MinGW needs prior to GenTL_v1_6.h for uint64_t and others; -since GenTL_v1_6.h may not be modified as per license, include here instead. -*/ -#include - -#include"GenTL_v1_6.h" - -#include +#include +#include /* logging macros */ -#include +#include /* Routine for copying anything into buffer. Implementation in private-buf.c diff --git a/src/gentl/tl.c b/src/gentl/tl.c index b6b4b5687..549faea84 100644 --- a/src/gentl/tl.c +++ b/src/gentl/tl.c @@ -27,7 +27,7 @@ #define _TL_CHECK_HANDLE { GENTL_ENSURE_INIT; if(hTL==NULL || !ARV_IS_TRANSPORT_LAYER(hTL)) return GC_ERR_INVALID_HANDLE; if(gentl_transport_layer==NULL) return GC_ERR_NOT_INITIALIZED; } -GC_API +GC_ERROR TLOpen (TL_HANDLE *phTL) { arv_trace_gentl(__FUNCTION__); @@ -46,7 +46,7 @@ TLOpen (TL_HANDLE *phTL) return GC_ERR_SUCCESS; } -GC_API +GC_ERROR TLClose (TL_HANDLE hTL) { arv_trace_gentl("%s (phTL=%s[%p])",__FUNCTION__,G_OBJECT_TYPE_NAME(hTL),hTL); @@ -58,13 +58,13 @@ TLClose (TL_HANDLE hTL) return GC_ERR_SUCCESS; } -GC_API +GC_ERROR TLGetInfo (TL_HANDLE hTL, TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize) { GENTL_NYI; } -GC_API +GC_ERROR TLGetNumInterfaces (TL_HANDLE hTL, uint32_t *piNumIfaces) { arv_trace_gentl("%s (hTL=%s[%p])",__FUNCTION__,G_OBJECT_TYPE_NAME(hTL),hTL); @@ -79,7 +79,7 @@ TLGetNumInterfaces (TL_HANDLE hTL, uint32_t *piNumIfaces) return GC_ERR_SUCCESS; } -GC_API +GC_ERROR TLGetInterfaceID (TL_HANDLE hTL, uint32_t iIndex, char *sID, size_t *piSize) { arv_trace_gentl("%s (hTL=%s[%p],iIndex=%d,sID=%p,piSize=%p)",__FUNCTION__,G_OBJECT_TYPE_NAME(hTL),hTL,iIndex,sID,piSize); @@ -91,7 +91,7 @@ TLGetInterfaceID (TL_HANDLE hTL, uint32_t iIndex, char *sID, size_t *piSize) return gentl_to_buf(INFO_DATATYPE_STRING,sID,arv_get_interface_id(iIndex),piSize,NULL); } -GC_API +GC_ERROR TLGetInterfaceInfo (TL_HANDLE hTL, const char *sIfaceID, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize) { @@ -115,7 +115,7 @@ TLGetInterfaceInfo (TL_HANDLE hTL, const char *sIfaceID, INTERFACE_INFO_CMD iInf } } -GC_API +GC_ERROR TLOpenInterface (TL_HANDLE hTL, const char *sIfaceID, IF_HANDLE *phIface) { ArvInterface* iface; @@ -137,7 +137,7 @@ TLOpenInterface (TL_HANDLE hTL, const char *sIfaceID, IF_HANDLE *phIface) return GC_ERR_SUCCESS; } -GC_API +GC_ERROR TLUpdateInterfaceList (TL_HANDLE hTL, bool8_t *pbChanged, uint64_t iTimeout) { arv_trace_gentl("%s (hTL=%s[%p], pbChanged=%p, iTimeout=%ld)",__FUNCTION__,G_OBJECT_TYPE_NAME(hTL),hTL,pbChanged,iTimeout); diff --git a/src/meson.build b/src/meson.build index 885b11067..f8a298dd3 100644 --- a/src/meson.build +++ b/src/meson.build @@ -188,6 +188,7 @@ library_private_headers = [ 'arvgvinterfaceprivate.h', 'arvgvspprivate.h', 'arvgvstreamprivate.h', + 'arvgentlprivate.h', 'arvgentlsystemprivate.h', 'arvgentlinterfaceprivate.h', 'arvgentldeviceprivate.h',