CLProtocol.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // (c) 2008 by Basler Vision Technologies
3 // Section: Vision Components
4 // Project: GenApi
5 // Author: Fritz Dierks
6 // $Header$
7 //
8 // License: This file is published under the license of the EMVA GenICam Standard Group.
9 // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
10 // If for some reason you are missing this file please contact the EMVA or visit the website
11 // (http://www.genicam.org) for a full copy.
12 //
13 // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
14 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
17 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23 // POSSIBILITY OF SUCH DAMAGE.
24 //-----------------------------------------------------------------------------
29 #ifndef CLPROTOCOL_CLPROTOCOL_H
30 #define CLPROTOCOL_CLPROTOCOL_H
31 
33 
34 #include <stdarg.h>
35 
36 //==============================================================================
37 // Macros
38 //==============================================================================
39 
40 #if (defined(__cplusplus) || defined(__cplusplus__))
41  #define USER_EXTERN_C extern "C"
42  #define USER_EXTERN_C_START extern "C" {
43  #define USER_EXTERN_C_END }
44 #else
45  #define USER_EXTERN_C
46  #define USER_EXTERN_C_START
47  #define USER_EXTERN_C_END
48 #endif
49 
50 #ifdef CLPROTOCOL_EXPORTS
51  #if defined(_WIN32)
52  #define CLPROTOCOLEXPORT USER_EXTERN_C __declspec(dllexport)
53  #define CLPROTOCOL_DECL __declspec(dllexport)
54  #else
55  #define CLPROTOCOLEXPORT USER_EXTERN_C __attribute__((visibility("default")))
56  #define CLPROTOCOL_DECL __attribute__((visibility("default")))
57  #endif
58 #else
59  #if defined(_WIN32)
60  #define CLPROTOCOLEXPORT USER_EXTERN_C __declspec(dllimport)
61  #define CLPROTOCOL_DECL __declspec(dllimport)
62  #else
63  #define CLPROTOCOLEXPORT USER_EXTERN_C __attribute__((visibility("default")))
64  #define CLPROTOCOL_DECL __attribute__((visibility("default")))
65  #endif
66 #endif
67 
68 #ifndef CLPROTOCOL
69  #if defined(_WIN32)
70  #define CLPROTOCOL __cdecl
71  #else
72  #if !defined(__x86_64) && !defined(__arm__) && !defined(__aarch64__) && !defined(VXWORKS)
73  #define CLPROTOCOL __attribute__((cdecl))
74  #else
75  #define CLPROTOCOL /* use default calling convention */
76  #endif
77  #endif
78 #endif
79 
80 //==============================================================================
81 // Types and Enums
82 //==============================================================================
83 
84 typedef void (CLPROTOCOL *clp_logger_t)( CLINT32 level, const char* stringFormat, va_list argptr);
86  typedef struct clpLogCallback_t
87  {
92 
95 {
96 // Global parameters that do not use the Cookie when called.
98 
102 
104 
105  // Device related parameters that require a valid cookie to execute properly.
107 
111 };
115 
117 {
127 };
128 
129 //==============================================================================
130 // Exported Functions
131 //==============================================================================
132 
133 class ISerial;
134 
137 
140 
155  CLP_LOG_LEVEL_VALUE logLevel);
156 
164 clpCloseLib( void );
165 
193 CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetShortDeviceIDTemplates ( CLINT8* pShortDeviceTemplates, CLUINT32* pBufferSize );
194 
238 CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpProbeDevice( ISerial *pSerial, const CLINT8* pDeviceIDTemplate, CLINT8* pDeviceID, CLUINT32 *pBufferSize, CLUINT32 *pCookie, const CLUINT32 TimeOut );
239 
240 
281 CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetXMLIDs ( ISerial *pSerial, const CLUINT32 Cookie, CLINT8* pXMLIDs, CLUINT32* pBufferSize, const CLUINT32 TimeOut );
282 
319 clpGetXMLDescription( ISerial *pSerial, const CLUINT32 Cookie, const CLINT8* pXMLID, CLINT8* pXMLBuffer, CLUINT32* pBufferSize, const CLUINT32 TimeOut );
320 
352 clpReadRegister(ISerial *pSerial, const CLUINT32 Cookie, const CLINT64 Address, CLINT8* pBuffer, const CLINT64 BufferSize, const CLUINT32 TimeOut );
353 
387 clpWriteRegister(ISerial *pSerial, const CLUINT32 Cookie, const CLINT64 Address, const CLINT8* pBuffer, const CLINT64 BufferSize, const CLUINT32 TimeOut );
388 
413 clpContinueWriteRegister(ISerial *pSerial, const CLUINT32 Cookie, const BOOL8 ContinueWaiting, const CLUINT32 TimeOut );
414 
445 clpGetErrorText( CLINT32 errorCode, CLINT8* errorText, CLUINT32* errorTextSize, const CLUINT32 Cookie = 0);
446 
460 clpDisconnect( const CLUINT32 Cookie );
461 
474 clpGetCLProtocolVersion( CLUINT32 *pVersionMajor, CLUINT32 *pVersionMinor );
475 
496 clpGetParam( ISerial *pSerial, CLP_PARAMS param, const CLUINT32 Cookie, CLINT8* pBuffer, const CLINT64 BufferSize, const CLUINT32 TimeOut);
497 
517 clpSetParam( ISerial *pSerial, CLP_PARAMS param, const CLUINT32 Cookie, const CLINT8* pBuffer, const CLINT64 BufferSize, const CLUINT32 TimeOut);
518 
530 
555 clpGetEventData(const CLUINT32 Cookie, CLINT8* pBuffer, CLUINT32* pBufferSize);
556  // CLProtocolInterface // PublicInterfaces
559 
560 
561 
562 #endif // CLPROTOCOL_CLPROTOCOL_H
A 32-bit value that contains a clpLogCallback_t pointer to the logger function.
Definition: CLProtocol.h:103
#define USER_EXTERN_C_START
Definition: CLProtocol.h:46
clp_logger_t logger
Must be set to 0xeb6e1ca9.
Definition: CLProtocol.h:89
char BOOL8
void(CLPROTOCOL * clp_logger_t)(CLINT32 level, const char *stringFormat, va_list argptr)
Definition: CLProtocol.h:84
unsigned int CLUINT32
#define CLPROTOCOL
Definition: CLProtocol.h:73
A 32-bit value that contains the baudrate used to communicate with the device. This parameter expects...
Definition: CLProtocol.h:110
USER_EXTERN_C_START struct clpLogCallback_t clpLogCallback_t
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetParam(ISerial *pSerial, CLP_PARAMS param, const CLUINT32 Cookie, CLINT8 *pBuffer, const CLINT64 BufferSize, const CLUINT32 TimeOut)
This function is call to read a CLProtocol parameter value.
CLP_PARAMS
Types of parameters to be accessed by clpGetParam/clpSetParam.
Definition: CLProtocol.h:94
A 32-bit value that contains the current log level. This parameter expects a value represented by the...
Definition: CLProtocol.h:101
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpSetParam(ISerial *pSerial, CLP_PARAMS param, const CLUINT32 Cookie, const CLINT8 *pBuffer, const CLINT64 BufferSize, const CLUINT32 TimeOut)
This function is call to change a CLProtocol parameter value.
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpProbeDevice(ISerial *pSerial, const CLINT8 *pDeviceIDTemplate, CLINT8 *pDeviceID, CLUINT32 *pBufferSize, CLUINT32 *pCookie, const CLUINT32 TimeOut)
Connects and identifies the device and returns a DeviceID.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT int64_t Address
Definition: IPort.h:57
char CLINT8
types and constants as used by the Camera Link&#39;s API definition
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpInitLib(clp_logger_t logger, CLP_LOG_LEVEL_VALUE logLevel)
This function is call to initialize the library after it is loaded.
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetErrorText(CLINT32 errorCode, CLINT8 *errorText, CLUINT32 *errorTextSize, const CLUINT32 Cookie=0)
This function converts an error code to error text for display in a dialog box or in a standard I/O w...
Abstract interface used by the CLProtocol driver to use a serial port.
Definition: ISerial.h:42
__int64 CLINT64
A 32-bit value that contains a signal to stop all running ProbeDevice.
Definition: CLProtocol.h:106
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpContinueWriteRegister(ISerial *pSerial, const CLUINT32 Cookie, const BOOL8 ContinueWaiting, const CLUINT32 TimeOut)
Calling This function is called after a write function returned CL_ERR_PENDING_WRITE. It either issues another wait for write cycle or cancels the write action.
CLP_LOG_LEVEL_VALUE
Definition: CLProtocol.h:116
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpIsParamSupported(CLP_PARAMS param)
This function is call know if a parameter is supported by a CLProtocol.
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpDisconnect(const CLUINT32 Cookie)
This function disconnects the DLL from the device.
#define USER_EXTERN_C_END
Definition: CLProtocol.h:47
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpCloseLib(void)
This function is call to close the library before unloading.
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetShortDeviceIDTemplates(CLINT8 *pShortDeviceTemplates, CLUINT32 *pBufferSize)
This function returns a list of short device templates coded into a single string.
int CLINT32
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetEventData(const CLUINT32 Cookie, CLINT8 *pBuffer, CLUINT32 *pBufferSize)
This function is call to get a possible event by a CLProtocol.
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetXMLDescription(ISerial *pSerial, const CLUINT32 Cookie, const CLINT8 *pXMLID, CLINT8 *pXMLBuffer, CLUINT32 *pBufferSize, const CLUINT32 TimeOut)
This function retrieves an XML file from the camera if possible.
#define CLPROTOCOLEXPORT
Definition: CLProtocol.h:63
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetCLProtocolVersion(CLUINT32 *pVersionMajor, CLUINT32 *pVersionMinor)
This function returns the version of the CLProtocol interface version.
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpWriteRegister(ISerial *pSerial, const CLUINT32 Cookie, const CLINT64 Address, const CLINT8 *pBuffer, const CLINT64 BufferSize, const CLUINT32 TimeOut)
This function writes numBytes to the serial device referred to by serialRef. clSerialRead will return...
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetXMLIDs(ISerial *pSerial, const CLUINT32 Cookie, CLINT8 *pXMLIDs, CLUINT32 *pBufferSize, const CLUINT32 TimeOut)
This function returns a list of XML IDs coded into a single string.
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpReadRegister(ISerial *pSerial, const CLUINT32 Cookie, const CLINT64 Address, CLINT8 *pBuffer, const CLINT64 BufferSize, const CLUINT32 TimeOut)
This function reads numBytes from the serial device referred to by serialRef. clSerialRead will retur...


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Sun Jun 18 2023 02:43:55