All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ClSerial.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_CLSERIAL_H
30 #define CLPROTOCOL_CLSERIAL_H
31 
33 
34 //==============================================================================
35 // Macros
36 //==============================================================================
37 
38 #if (defined(__cplusplus) || defined(__cplusplus__))
39  #define USER_EXTERN_C extern "C"
40 #else
41  #define USER_EXTERN_C
42 #endif
43 
44 #ifdef CLSERIAL_EXPORTS
45  #if defined(_WIN32)
46  #define CLSERIALEXPORT USER_EXTERN_C __declspec(dllexport)
47  #else
48  #define CLSERIALEXPORT USER_EXTERN_C __attribute__((visibility("default")))
49  #endif
50 #else
51  #if defined(_WIN32)
52  #define CLSERIALEXPORT USER_EXTERN_C __declspec(dllimport)
53  #else
54  #define CLSERIALEXPORT USER_EXTERN_C __attribute__((visibility("default")))
55  #endif
56 #endif
57 
58 #ifndef CLSERIALCC
59  // Note that the CLAllSerial.dll uses __stdcall instead of __cdecl
60  #if defined(_WIN32)
61  #define CLSERIALCC __cdecl
62  #else
63  #if !defined(__x86_64) && !defined(__arm__) && !defined(__aarch64__) && !defined(VXWORKS)
64  #define CLSERIALCC __attribute__((cdecl))
65  #else
66  #define CLSERIALCC /* use default calling convention */
67  #endif
68  #endif
69 #endif
70 
71 //==============================================================================
72 // exported functions
73 //==============================================================================
74 
77 
80 
81 
94  CLINT8* ManufacturerName,
99  CLUINT32* bufferSize,
105  CLUINT32* version
107  );
108 
120  CLUINT32 serialIndex,
121  hSerRef* serialRefPtr
125  );
126 
142  hSerRef serialRef,
143  CLINT8* buffer,
144  CLUINT32* bufferSize,
148  CLUINT32 serialTimeOut
149  );
150 
160  hSerRef serialRef,
161  CLINT8* buffer,
162  CLUINT32* bufferSize,
163  CLUINT32 serialTimeOut
167  );
168 
175  hSerRef serialRef
176  );
177 
178 
190  CLUINT32* numSerialPorts
191  );
192 
193 /*
194 \brief This function returns a manufacturer-specific identifier for each serial port in your system.
195 \return At completion, this function returns one of the following status codes:
196  CL_ERR_NO_ERR
197  CL_BUFFER_TOO_SMALL
198  CL_ERR_FUNCTION_NOT_FOUND
199  CL_ERR_INVALID_INDEX
200 */
203  CLUINT32 serialIndex,
204  CLINT8* PortID,
207  CLUINT32 *bufferSize
211  );
212 
226  hSerRef serialRef,
227  CLUINT32 *numBytes
228  );
229 
237 clFlushPort(
238  hSerRef serialRef
239  );
240 
250  hSerRef serialRef,
251  CLUINT32 *baudRates
253  );
254 
266  hSerRef serialRef,
267  CLUINT32 baudRate
268  );
269 
286  CLINT32 errorCode,
287  CLINT8* errorText,
289  CLUINT32* errorTextSize
291  );
292 
296  // CLSerialInterface // PublicInterfaces
299 
300 
301 //==============================================================================
302 // helper functions
303 //==============================================================================
304 
305 
306 #endif // CLPROTOCOL_CLSERIAL_H
307 
clGetSerialPortIdentifier
CLSERIALEXPORT CLINT32 CLSERIALCC clGetSerialPortIdentifier(CLUINT32 serialIndex, CLINT8 *PortID, CLUINT32 *bufferSize)
is passed. On successful return, this parameter contains the number of bytes written into the buffer,...
clGetManufacturerInfo
CLSERIALEXPORT CLINT32 CLSERIALCC clGetManufacturerInfo(CLINT8 *ManufacturerName, CLUINT32 *bufferSize, CLUINT32 *version)
This function returns the name of the manufacturer represented by the index parameter and the version...
clSerialWrite
CLSERIALEXPORT CLINT32 CLSERIALCC clSerialWrite(hSerRef serialRef, CLINT8 *buffer, CLUINT32 *bufferSize, CLUINT32 serialTimeOut)
This function writes the data in the buffer to the serial device referenced by serialRef.
CLINT8
char CLINT8
Definition: ClSerialTypes.h:126
CLUINT32
unsigned int CLUINT32
Definition: ClSerialTypes.h:105
clFlushPort
CLSERIALEXPORT CLINT32 CLSERIALCC clFlushPort(hSerRef serialRef)
This function will discard any bytes that are available in the input buffer.
clGetErrorText
CLSERIALEXPORT CLINT32 CLSERIALCC clGetErrorText(CLINT32 errorCode, CLINT8 *errorText, CLUINT32 *errorTextSize)
This function converts an error code to error text for display in a dialog box or in a standard I/O w...
clGetSupportedBaudRates
CLSERIALEXPORT CLINT32 CLSERIALCC clGetSupportedBaudRates(hSerRef serialRef, CLUINT32 *baudRates)
This function returns the valid baud rates of the current interface.
CLSERIALCC
#define CLSERIALCC
Definition: ClSerial.h:64
clSerialRead
CLSERIALEXPORT CLINT32 CLSERIALCC clSerialRead(hSerRef serialRef, CLINT8 *buffer, CLUINT32 *bufferSize, CLUINT32 serialTimeOut)
This function reads numBytes from the serial device referred to by serialRef. clSerialRead will retur...
hSerRef
void * hSerRef
Definition: ClSerialTypes.h:95
clSerialInit
CLSERIALEXPORT CLINT32 CLSERIALCC clSerialInit(CLUINT32 serialIndex, hSerRef *serialRefPtr)
This function initializes the device referred to by serialIndex and returns a pointer to an internal ...
CLINT32
int CLINT32
Definition: ClSerialTypes.h:100
clGetNumSerialPorts
CLSERIALEXPORT CLINT32 CLSERIALCC clGetNumSerialPorts(CLUINT32 *numSerialPorts)
This function returns the number of serial ports in your system from a specified manufacturer....
ClSerialTypes.h
types and constants as used by the Camera Link's API definition
CLSERIALEXPORT
#define CLSERIALEXPORT
Definition: ClSerial.h:54
clSerialClose
CLSERIALEXPORT void CLSERIALCC clSerialClose(hSerRef serialRef)
This function closes the serial device and cleans up the resources associated with serialRef....
clGetNumBytesAvail
CLSERIALEXPORT CLINT32 CLSERIALCC clGetNumBytesAvail(hSerRef serialRef, CLUINT32 *numBytes)
This function will output how many bytes have are available at the port specified by serialRef.
clSetBaudRate
CLSERIALEXPORT CLINT32 CLSERIALCC clSetBaudRate(hSerRef serialRef, CLUINT32 baudRate)
This function sets the baud rate for the serial port of the selected device. Use clGetSupportedBaudRa...


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