/****************************************************************************
 (c) 2004-2007 by STEMMER IMAGING GmbH

 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     $Source:$
/// \brief    GenICam Transport Layer Client Interface
/// \version  $Revision:$
/// \author   rst ( SI )
/// \date     $Date:$


#ifndef GC_TLI_CLIENT_H_
#define GC_TLI_CLIENT_H_

  #include <TLI/Platform.h>
  #include <Base/GCTypes.h>
  #include <Base/GCError.h>

  #ifdef __cplusplus
  extern "C" {
  #endif

  namespace GenICam  {
    namespace Client   {

    #define STRING_BUF_SIZE 256

    ///  The TLINFO struct is used to obtain information about a Transport Layer library

    enum  TL_INFO_CMD_LIST
    {
      TL_INFO_MANUFACTURER,           ///< STRING    Manufacturer
      TL_INFO_MODEL,                  ///< STRING    Model
      TL_INFO_VERSION,                ///< STRING    Version
      TL_INFO_TLTYPE,                 ///< STRING    Standard reference
      TL_INFO_NAME,                   ///< STRING    Filename of the TL
      TL_INFO_PATHNAME,               ///< STRING    Filename of the TL incl PATH
      TL_INFO_DISPLAYNAME,            ///< STRING    DisplayName 
    } ;        

    typedef uint32_t TL_INFO_CMD;


    // Handles  
    typedef void *      TL_HANDLE;                    ///< Transport Layer handle, obtained through the TLOpen
    typedef void *      INTERFACE_HANDLE;             ///< Interface handle, obtained through ::TLOpenInterface
    typedef void *      DEV_HANDLE;                   ///< Device Handle, obtained through the ::TLOpenDevice 
    typedef void *      DS_HANDLE;                    ///< Handle to an image stream object, obtained through CreateDatastream
    typedef void *      PORT_HANDLE;                  ///< A Porthandle is used to access the register space of a port <br>
                                                      ///  a PORT_HANDLE can be on of the following <br>
                                                      ///  \li TL_HANDLE
                                                      ///  \li INTERFACE_HANDLE
                                                      ///  \li DEVICE_HANDLE
                                                      ///  \li A hanle to a device port, obtained through ::DevGetPort
                                                      ///  \li DS_HANDLE
                                                      ///  \li 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 <br>
                                                      ///  a EVENTSRC_HANDLE can be on of the following <br>
                                                      ///  \li TL_HANDLE
                                                      ///  \li INTERFACE_HANDLE
                                                      ///  \li DEVICE_HANDLE
                                                      ///  \li A handle to a device port, obtained through ::DevGetPort
                                                      ///  \li DS_HANDLE
                                                      ///  \li BUFFER_HANDLE
    typedef void *      EVENT_HANDLE;                 ///< Event Handle  
    

    /// Information Types
    enum INFO_DATATYPE
    {
      INFO_DATATYPE_UNKNOWN = 0,                      ///< Unknown datatype
      INFO_DATATYPE_STRING,                           ///< zero terminated string, the size is including the ending  zero
      INFO_DATATYPE_STRINGLIST,                       ///< concatenated zero terminated strings, ending with an adiitional NULL
      INFO_DATATYPE_INT16,                            ///< singned 16 bit integer
      INFO_DATATYPE_UINT16,                           ///< unsingned 16 bit integer
      INFO_DATATYPE_INT32,                            ///< singned 32 bit integer
      INFO_DATATYPE_UINT32,                           ///< unsingned 32 bit integer
      INFO_DATATYPE_INT64,                            ///< singned 64 bit integer
      INFO_DATATYPE_UINT64,                           ///< unsingned64 bit integer
      INFO_DATATYPE_FLOAT64,                          ///< 64 bit float
      INFO_DATATYPE_PTR,                              ///< void pointer, size system / plattform dependent
      INFO_DATATYPE_MAC,                              ///< 6Byte MAC address, binary
      INFO_DATATYPE_BOOL8,                            ///< 8bit bool
      INFO_DATATYPE_SIZET,                            ///< size_t, size system / plattform dependent
    } ;

    /// buffer information commands used for function DSGetBufferInfo
    enum BUFFER_INFO_CMD_LIST
    {
      BUFFER_INFO_BASE,               ///< PTR          Base address of delivered buffer (void *)
      BUFFER_INFO_SIZE,               ///< SIZE_T       Buffer size in bytes 
      BUFFER_INFO_USER_PTR,           ///< PTR          Private Pointer 
      BUFFER_INFO_TIMESTAMP,          ///< UINT64_T     Timestamp 
      BUFFER_INFO_NUMBER,             ///< UINT64_T     Buffer Number as announced (uint64_t)
      BUFFER_INFO_NEW_DATA,           ///< BOOL8        Flag if Buffer contains new data since it was queued
      BUFFER_INFO_ISQUEUED,           ///< BOOL8        Flag if Buffer is queued for acquisition 
      BUFFER_INFO_PAYLOADTYPE,        ///< UINT64_T
      BUFFER_INFO_PIXELTYPE,          ///< UINT64_T
      BUFFER_INFO_WIDTH,              ///< UINT64_T
      BUFFER_INFO_HEIGHT,             ///< UINT64_T
      BUFFER_INFO_XOFFSET,            ///< UINT32_T
      BUFFER_INFO_YOFFSET,            ///< UINT32_T
      BUFFER_INFO_XPADDING,           ///< UINT32_T
      BUFFER_INFO_YPADDING,           ///< UINT32_T
      BUFFER_INFO_NUM_PACKETS_MISSING,///< UINT64_T
      BUFFER_INFO_ISINCOMPLETE,       ///< BOOL8        Flag if Buffer is in incomplete list
      BUFFER_INFO_ISACQUIERING,       ///< BOOL8        Flag if Buffer is recieving data

      BUFFER_INFO_CUSTOM_CMD = 0x10000000

    } ;

    typedef uint32_t BUFFER_INFO_CMD;

    /// Port information
    enum PORT_INFO_CMD_LIST
    {
      PORT_INFO_ACCESS_READ,                ///< BOOL8     Port has read access
      PORT_INFO_ACCESS_WRITE,               ///< BOOL8     Port has write access
      PORT_INFO_ACCESS_NA,                  ///< BOOL8     Port in not accessable
      PORT_INFO_ACCESS_NI,                  ///< BOOL8     Port is not implemented
      PORT_INFO_TLTYPE,                     ///< STRING    
      PORT_INFO_MANUFACTURER,               ///< STRING    Manufacturer of the Model this port belongs to
      PORT_INFO_MODEL,                      ///< STRING    Model this port belongs to 
      PORT_INFO_MODULE,                     ///< STRING    
      PORT_INFO_REVISION,                   ///< STRING    Revision of the port
      PORT_INFO_ID,                         ///< STRING    Id of the port as refered to in the XML file
      PORT_INFO_LITTLE_ENDIAN,              ///< BOOL8     Endianess of the port, true if port is LittleEndian
      PORT_INFO_BIG_ENDIAN                  ///< BOOL8     Endianess of the port, true if port is BigEndian
    };

    typedef uint32_t PORT_INFO_CMD;

    /// Acquisition start flags
    /// Flags used to specify special mode when starting an acquisiton 
    /// with StartAcquisition
    typedef enum 
    {
      /// So Stop Flag set
      ACQ_STOP_FLAGS_NONE = 0,  
      ACQ_STOP_FLAG_KILL = 1                  ///< Kill ongoing acquisition instead of waiting for the next image
    } ACQ_STOP_FLAGS;

    /// Acqusition wait flags
    typedef enum
    {
      /// No Wait Flag
      ACQ_WAIT_FLAGS_NONE = 0   
    } ACQ_WAIT_FLAGS;

    /// Acqusition stop flags
    typedef enum 
    {
      ACQ_START_FLAGS_NONE  = 0,       
      ACQ_START_NEXT_IMAGE  = 0x1,            ///< Deliver the image acquired after the image delivered last <br>
                                              ///< Missed images only happen if the acquisiton queue is empty and therefore no buffers available
      ACQ_START_LAST_IMAGE  = 0x2,            ///< Deliver the last complete image acquired <br>
                                              ///< This means that between the image deliverd last and the image delivered next can be a number of missed images <br>
                                              ///< Missed images happen if one processing cycle takes to long <br>
                                              ///< The positive effect is that the acquired image is not out of the loop but max one image behind
      ACQ_START_NEW_IMAGE   = 0x3             ///< Deliver the new image acquired while the wait for buffer function is called <br>
                                              ///< The positive effect is that the acquired image is not out of the loop
    } ACQ_START_FLAGS;

    /// Acqusition status inquiery commands
    typedef enum 
    {
      STREAM_INFO_CMD_NONE                                    =  0,
      
      STREAM_INFO_CMD_ISGRABBING                              =  1, ///< BOOL8    Inquire if the acquisition engine is running
      STREAM_INFO_CMD_NUMBER_OF_FRAMES_DELIVERED              =  2, ///< int64    Inquire the number of acquired frames since the last star 
      STREAM_INFO_CMD_NUMBER_OF_FRAMES_LOST_QUEUE_UNDERRUN    =  3, ///< int64    number of lost frames due to a queue under run
      STREAM_INFO_CMD_NUMBER_OF_FRAMES_ANNOUNCED              =  4, ///< int32    number of announced frames
      STREAM_INFO_CMD_NUMBER_OF_FRAMES_QUEUED                 =  5, ///< int32    number of frames queued for acquisition
      STREAM_INFO_CMD_NUMBER_OF_FRAMES_AWAIT_DELIVERY         =  6, ///< int32    number of queued await delivery
      STREAM_INFO_CMD_NUMBER_OF_FRAMES_STARTED                =  8, ///< int64    number of images started in the acquisition engine
      STREAM_INFO_CMD_PAYLOAD_SIZE                            = 15, ///< int32

      STREAM_INFO_CMD_CUSTOM_INFO                             = 0x10000000 ///< every command with an id above this is for custom TLC use
    } STREAM_INFO_CMD_LIST;

    typedef uint32_t STREAM_INFO_CMD;

    /// Acquisition Queue Types
    typedef enum
    {
      
      ACQ_QUEUE_INPUT_TO_OUTPUT                           = 0,  ///< Flush queue of frames, waiting for new data through the acquisition engine
                                                                ///  to the output queue
      ACQ_QUEUE_OUTPUT_DISCARD                            = 1,  ///< Flush queue of frames, containing new data, waiting to be delivered
      ACQ_QUEUE_ALL_TO_INPUT                              = 2,  ///< Requeue all announced frames ( including the frames awaiting deivery )
      ACQ_QUEUE_UNQUEUED_TO_INPUT                         = 3,  ///< Requeue all not queueued frames 
      ACQ_QUEUE_ALL_DISCARD                               = 4   ///< discard all queues
    } ACQ_QUEUE_TYPE;


    /// Event types used to register events with GenICam::Client::GCRegisterEvent
    typedef enum _E_DEVICE_EVENT_TYPE_T_
    {
      EVENT_NEW_BUFFER,                                   ///< New Buffer Evenet in datastream
      EVENT_GEV_EVENT_CMD,                                ///< GEV event message
      EVENT_ERROR,                                        ///< error message

      EVENT_CUSTOM_ID         = 0x10000000                ///< this is the starting event id for any custom events
    } EVENT_TYPE;


    /// Device Info commands, used by \a GenICam::TL::Client::TLGetDeviceInfo and \a GenICam::TL::Client::DevGetInfo
    typedef enum _E_DEVICE_INFO_TYPE_T_
    {
      DEVICE_INFO_ID,                                          ///< STRING      String with the ID of the Device
      DEVICE_INFO_MANUFACTURER,                                ///< STRING      String with the Manufacturer of the Device
      DEVICE_INFO_MODEL,                                       ///< STRING      String containing model name
      DEVICE_INFO_TLTYPE,                                      ///< STRING      String describing the standard
      DEVICE_INFO_IP,                                          ///< UINT32_T    IP of the device as uint32_t
      DEVICE_INFO_IP_STRING,                                   ///< STRING      String containing IP of the Device 
      DEVICE_INFO_MAC,                                         ///< STRING      MAC of the Device
      DEVICE_INFO_MAC_STRING,                                  ///< STRING      String containing MAC of the Device 
      DEVICE_INFO_SERIALNUMBER,                                ///< STRING      String containing SN of the Device 
      DEVICE_INFO_ACCESS,                                      ///< UINT32_T    containing GC_DEVICE_ACCESS_FLAGS
      DEVICE_INFO_USERNAME,                                    ///< STRING      String containing the Username of the device
      DEVICE_INFO_DISPLAYNAME,                                 ///< STRING      String containing a display name for the device ( including a unique id )   
      DEVICE_INFO_SUBNET, 
      DEVICE_INFO_GATEWAY,
      DEVICE_INFO_SUPPORT_IP_LLA,
      DEVICE_INFO_SUPPORT_IP_DHCP,
      DEVICE_INFO_SUPPORT_IP_PERSISTENT,
      DEVICE_INFO_CURRENT_IP_LLA,
      DEVICE_INFO_CURRENT_IP_DHCP,
      DEVICE_INFO_CURRENT_IP_PERSISTENT,

      DEVICE_INFO_CUSTOM_CMD = 0x10000000,

    } DEVICE_INFO_CMD_LIST;

    typedef uint32_t DEVICE_INFO_CMD;


    /// Interface Info Flags, used by GenICam::Client::TLGetInterfaceInfo
    typedef enum
    {
      INTERFACE_INFO_ID,               ///< unique interface id containing either the MAC in the 
                                       ///  form MAC->xx:xx:xx:xx:xx:xx or the IP in the form IP->xxx.xxx.xxx.xxx
                                       ///  The ID must be unique within the boundarys of one TL but it 
                                       ///  helps if it is unique across all TLs. <br>
                                       ///  It is not neccessary that the syntax of the id is according
                                       ///  to one given above. It only allows the user to identify
                                       ///  a single interface without enumerating all of them.
      INTERFACE_INFO_MAC,              ///< MAC address of the interface as array of 6 bytes
      INTERFACE_INFO_MAC_STRING,       ///< MAC address of the interface as string
      INTERFACE_INFO_DISPLAYNAME,      ///< Display name of the device ( including a unique id )

      INTERFACE_INFO_MAX_ID
    } INTERFACE_INFO_CMD_LIST;

    typedef uint32_t INTERFACE_INFO_CMD;

    /// Device access Flags, used by \a GenICam::TL::Client::TLOpenDevice
    typedef enum _E_GC_DEVICE_ACCESS_FLAGS_TYPE_T_
    {
      DEVICE_ACCESS_UNKNOWN   = 0,         ///< Unknown
      DEVICE_ACCESS_NONE      = 1,         ///< Access denied
      DEVICE_ACCESS_READONLY  = 2,         ///< Host has / can have Read Only access to the device
      DEVICE_ACCESS_CONTROL   = 3,         ///< Host has / can have Control Mode access to the device
      DEVICE_ACCESS_EXCLUSIVE = 4,         ///< Host has / can have Exclusive Mode access to the device

    } DEVICE_ACCESS_FLAGS;


    // Event info command
    typedef enum _E_EVENT_INFO_ID_T_
    {
      EVENT_NUM_ENTRYS_IN_QUEUE,            ///< UINT32_T  Number of entries in queue
      EVENT_NUM_FIRED                       ///< UINT64_T  Number of events fired on this queue
    } EVENT_INFO_CMD_LIST;

    typedef uint32_t EVENT_INFO_CMD;

    // Event data info command u
    typedef enum _E_EVENT_DATA_INFO_ID_T_
    {
      EVENT_DATA_EVENTID,                   ///< ???    GEV Event ID
      EVENT_DATA_STREAMCHANNELINDEX,        ///< ???    Stream channel index
      EVENT_DATA_BLOCKID,                   ///< ???    Block id
      EVENT_DATA_TIMESTAMP,                 ///< ???    Timestamp
      EVENT_DATA_DEVICEDATA,                ///< ???    Device Data
    } EVENT_DATA_INFO_CMD_LIST;             

    typedef uint32_t EVENT_DATA_INFO_CMD;


    ///  \addtogroup DLLInfo   TL Global Info Function
    ///  @{
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE GCInfo                  ( const char *psName, TL_INFO_CMD iInfoCmd, INFO_DATATYPE *iType, void *pInfo, size_t *piSize );
    

    ///  @}
    ///  \addtogroup PortInterface   Port Functions
    ///  @{

    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE GCReadData              ( PORT_HANDLE hPort, uint64_t iAddress, void *pBuffer, size_t *iSize);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE GCWriteData             ( PORT_HANDLE hPort, uint64_t iAddress, const void *pBuffer, size_t *iSize);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE GCGetURL                ( PORT_HANDLE hPort, char *pURL, size_t *iSize, bool bFirstURL = true );
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE GCGetPortInfo           ( PORT_HANDLE hPort, PORT_INFO_CMD iCmd, INFO_DATATYPE *iType, void *pData, size_t *iSize );


    ///  @}
    ///  \addtogroup EventSourceInterface Event Source functions
    ///  @{
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE GCRegisterEvent        ( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEvent, HANDLE hEvent, EVENT_HANDLE *pE);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE GCUnregisterEvent      ( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEvent);

    ///  @}
    ///  \addtogroup EventInterface Event handling functions
    ///  @{
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE GCGetEventData           ( EVENT_HANDLE pE, void *pBuffer, size_t *iSize);
    // Retrieve information on the specified event data
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE GCGetEventDataInfo       ( EVENT_HANDLE pE, void *pInBuffer, size_t iBufferSize, EVENT_DATA_INFO_CMD iID, INFO_DATATYPE *iType, void *pBuffer, size_t *iSize);
    // Retrieve information on the status of the eventsource
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE GCGetEventInfo           ( EVENT_HANDLE pE, EVENT_INFO_CMD iCmd, INFO_DATATYPE *iType, void *pBuffer, size_t *iSize);
    // Flush all Event currently in the queue
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE GCEventFlush             ( EVENT_HANDLE pE );

    ///  @}
    ///  \addtogroup TLError  Error handlig
    ///  @{
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE GCGetLastError          ( GC_ERROR *ErrorCode, char *pErrText, size_t *iSize);

    ///  @}
    ///  \addtogroup TLAccess  TL access functions
    ///  @{
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE TLOpen                  ( TL_HANDLE *pTL);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE TLClose                 ( TL_HANDLE hTL);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE TLInfo                  ( TL_HANDLE hTL, TL_INFO_CMD iInfoCmd, INFO_DATATYPE *iType, void *pInfo, size_t *piSize );

    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE TLGetNumInterfaces      ( TL_HANDLE hTL, uint32_t *iNumInterfaces );
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE TLGetInterfaceName      ( TL_HANDLE hTL, uint32_t iIndex,  char * psName, size_t *iSize );
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE TLOpenInterface         ( TL_HANDLE hTL, const char *sInterfaceName,  INTERFACE_HANDLE *hInterface);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE TLUpdateInterfaceList   ( TL_HANDLE hTL, bool8_t *bHasChanged );

    ///  @}
    ///  \addtogroup InterfaceAccess  Interface access functions
    ///  @{
    // obsolete
    
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE TLCloseInterface        ( INTERFACE_HANDLE hInterface);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE TLGetInterfaceInfo      ( INTERFACE_HANDLE hInterface, INTERFACE_INFO_CMD iID, INFO_DATATYPE *iType, void * psInterfaceInfo, size_t *iSize);

    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE TLGetNumDevices         ( INTERFACE_HANDLE hInterface, uint32_t *iNumDevices );
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE TLGetDeviceName         ( INTERFACE_HANDLE hInterface, uint32_t iIndex, char * psName, size_t *iSize  );
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE TLUpdateDeviceList      ( INTERFACE_HANDLE hInterface, bool* pbHasChanged );
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE TLGetDeviceInfo         ( INTERFACE_HANDLE hInterface, const char *sDevName, DEVICE_INFO_CMD iID, INFO_DATATYPE *iType, void* pInfo, size_t *iSize);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE TLOpenDevice            ( INTERFACE_HANDLE hInterface, const char *sDevName, DEVICE_ACCESS_FLAGS iOpenFlags, DEV_HANDLE *pDev );

    ///  @}
    ///  \addtogroup DeviceAccess Device access functions
    ///  @{
    
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DevGetPort              ( DEV_HANDLE hDev, PORT_HANDLE *);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DevGetNumDataStreams    ( DEV_HANDLE hDev, uint32_t *piNumChannel);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DevCreateDataStream     ( DEV_HANDLE hDev, uint32_t iChannel, DS_HANDLE *pDS);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DevGetInfo              ( DEV_HANDLE hDev, DEVICE_INFO_CMD iID, INFO_DATATYPE *iType, void* pInfo, size_t *iSize);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DevClose                ( DEV_HANDLE hDev ); 


    /// @}
    /// \addtogroup DSFunctions DataStream Functions
    /// @{
    
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DSAnnounceBuffer        ( DS_HANDLE hDS, void *pBuffer, size_t iSize, void *pPrivate, BUFFER_HANDLE *iID );
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DSFlushQueue            ( DS_HANDLE hDS, ACQ_QUEUE_TYPE QueueType);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DSStartAcquisition      ( DS_HANDLE hDS, ACQ_START_FLAGS iAcquisitionFlags = ACQ_START_FLAGS_NONE, uint64_t iNumImagesToAcquire = 0xFFFFFFFFFFFFFFFF);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DSStopAcquisition       ( DS_HANDLE hDS, ACQ_STOP_FLAGS iFlags = ACQ_STOP_FLAGS_NONE);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DSGetStreamInfo         ( DS_HANDLE hDS, STREAM_INFO_CMD iCmd, INFO_DATATYPE *iType, void *pBuffer, size_t *iSize);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DSGetBufferID           ( DS_HANDLE hDS, uint32_t iIndex, BUFFER_HANDLE *iID);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DSClose                 ( DS_HANDLE hDS );
	EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DSWaitForNextImage      ( DS_HANDLE hDS, BUFFER_HANDLE* phBuffer, uint32_t timeout );

    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DSRevokeBuffer          ( DS_HANDLE hDS, BUFFER_HANDLE iID, void **pBuffer, void **pPrivate);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DSQueueBuffer           ( DS_HANDLE hDS, BUFFER_HANDLE iID);
    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DSGetBufferInfo         ( DS_HANDLE hDS, BUFFER_HANDLE iBufferID, BUFFER_INFO_CMD Cmd, INFO_DATATYPE *iType, void *BufInfo, uint32_t *iSize );
    /// @}

    /// \addtogroup SOCustomInterfaceFunctions Custom Interface Function
    /// @{

    EXTERN_C GC_IMPORT_EXPORT  GC_ERROR      GC_CALLTYPE DevQueryCustomFeature   ( DEV_HANDLE hDev, void *pInBuf, uint32_t iInSize, void *pOutBuf, uint32_t *iOutSize);

    /// @}
    
    } // end of namespace Client
  } // end of namespace GenICam


  #ifdef __cplusplus
  }
  #endif
#endif //GC_TLI_CLIENT_H_

