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 
154 clpInitLib( clp_logger_t logger,
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
CLP_LOG_NOTSET
@ CLP_LOG_NOTSET
Definition: CLProtocol.h:126
CLP_LOG_WARN
@ CLP_LOG_WARN
Definition: CLProtocol.h:122
CLP_DEVICE_SUPPORTED_BAUDERATES
@ CLP_DEVICE_SUPPORTED_BAUDERATES
A 32-bit value that contains the baudrate used to communicate with the device. This parameter expects...
Definition: CLProtocol.h:110
clpGetXMLIDs
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.
clpInitLib
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.
CLP_PARAMS
CLP_PARAMS
Types of parameters to be accessed by clpGetParam/clpSetParam.
Definition: CLProtocol.h:94
CLP_LOG_ERROR
@ CLP_LOG_ERROR
Definition: CLProtocol.h:121
clpGetXMLDescription
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.
clpLogCallback_t::logger
clp_logger_t logger
Must be set to 0xeb6e1ca9.
Definition: CLProtocol.h:89
clpIsParamSupported
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpIsParamSupported(CLP_PARAMS param)
This function is call know if a parameter is supported by a CLProtocol.
CLINT8
char CLINT8
Definition: ClSerialTypes.h:126
clpGetParam
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.
CLUINT32
unsigned int CLUINT32
Definition: ClSerialTypes.h:105
CLP_DEVICE_BAUDERATE
@ CLP_DEVICE_BAUDERATE
A 32-bit value that contains a signal to stop all running ProbeDevice.
Definition: CLProtocol.h:106
CLP_STOP_PROBE_DEVICE
@ CLP_STOP_PROBE_DEVICE
A 32-bit value that contains a clpLogCallback_t pointer to the logger function.
Definition: CLProtocol.h:103
clpSetParam
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
#define CLPROTOCOLEXPORT
Definition: CLProtocol.h:63
CLINT64
__int64 CLINT64
Definition: ClSerialTypes.h:116
CLP_LOG_CALLBACK
@ CLP_LOG_CALLBACK
A 32-bit value that contains the current log level. This parameter expects a value represented by the...
Definition: CLProtocol.h:101
clpWriteRegister
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...
clpCloseLib
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpCloseLib(void)
This function is call to close the library before unloading.
clpReadRegister
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...
clpGetErrorText
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...
clpProbeDevice
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.
clpGetCLProtocolVersion
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetCLProtocolVersion(CLUINT32 *pVersionMajor, CLUINT32 *pVersionMinor)
This function returns the version of the CLProtocol interface version.
CLP_LOG_FATAL
@ CLP_LOG_FATAL
Definition: CLProtocol.h:118
CLP_LOG_CRIT
@ CLP_LOG_CRIT
Definition: CLProtocol.h:120
GENAPI_NAMESPACE::Address
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT int64_t Address
Definition: IPort.h:57
clpGetShortDeviceIDTemplates
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetShortDeviceIDTemplates(CLINT8 *pShortDeviceTemplates, CLUINT32 *pBufferSize)
This function returns a list of short device templates coded into a single string.
clpLogCallback_t::id
CLUINT32 id
Definition: CLProtocol.h:88
CLP_LOG_ALERT
@ CLP_LOG_ALERT
Definition: CLProtocol.h:119
USER_EXTERN_C_START
#define USER_EXTERN_C_START
Definition: CLProtocol.h:46
clpGetEventData
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpGetEventData(const CLUINT32 Cookie, CLINT8 *pBuffer, CLUINT32 *pBufferSize)
This function is call to get a possible event by a CLProtocol.
CLP_LOG_NOTICE
@ CLP_LOG_NOTICE
Definition: CLProtocol.h:123
CLP_LOG_LEVEL_VALUE
CLP_LOG_LEVEL_VALUE
Definition: CLProtocol.h:116
clp_logger_t
void(CLPROTOCOL * clp_logger_t)(CLINT32 level, const char *stringFormat, va_list argptr)
Definition: CLProtocol.h:84
CLINT32
int CLINT32
Definition: ClSerialTypes.h:100
CLP_LOG_DEBUG
@ CLP_LOG_DEBUG
Definition: CLProtocol.h:125
USER_EXTERN_C_END
#define USER_EXTERN_C_END
Definition: CLProtocol.h:47
ClSerialTypes.h
types and constants as used by the Camera Link's API definition
ISerial
Abstract interface used by the CLProtocol driver to use a serial port.
Definition: ISerial.h:42
CLP_LOG_LEVEL
@ CLP_LOG_LEVEL
Definition: CLProtocol.h:97
CLP_LOG_INFO
@ CLP_LOG_INFO
Definition: CLProtocol.h:124
clpLogCallback_t
USER_EXTERN_C_START struct clpLogCallback_t clpLogCallback_t
BOOL8
char BOOL8
Definition: ClSerialTypes.h:131
clpContinueWriteRegister
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....
clpLogCallback_t
Definition: CLProtocol.h:86
CLPROTOCOL
#define CLPROTOCOL
Definition: CLProtocol.h:73
clpDisconnect
CLPROTOCOLEXPORT CLINT32 CLPROTOCOL clpDisconnect(const CLUINT32 Cookie)
This function disconnects the DLL from the device.


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Dec 4 2024 03:10:11