All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ClSerial.h File Reference

Exported C functions as defined by the Camera Link standard v1.1. More...

Include dependency graph for ClSerial.h:

Go to the source code of this file.

Macros

#define CLSERIALCC   __attribute__((cdecl))
 
#define CLSERIALEXPORT   USER_EXTERN_C __attribute__((visibility("default")))
 
#define USER_EXTERN_C
 

Functions

CLSERIALEXPORT CLINT32 CLSERIALCC clFlushPort (hSerRef serialRef)
 This function will discard any bytes that are available in the input buffer. More...
 
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 window. More...
 
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 of the Camera Link specifications with which the specified .dll complies. More...
 
CLSERIALEXPORT CLINT32 CLSERIALCC clGetNumBytesAvail (hSerRef serialRef, CLUINT32 *numBytes)
 This function will output how many bytes have are available at the port specified by serialRef. More...
 
CLSERIALEXPORT CLINT32 CLSERIALCC clGetNumSerialPorts (CLUINT32 *numSerialPorts)
 This function returns the number of serial ports in your system from a specified manufacturer. Use this number to determine the number of times you should loop through the clGetSerialPortIdentifier function. More...
 
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, including the NULL termination character. On CL_ERR_BUFFER_TOO_SMALL, this parameter contains the size of the buffer needed to write the data text. More...
 
CLSERIALEXPORT CLINT32 CLSERIALCC clGetSupportedBaudRates (hSerRef serialRef, CLUINT32 *baudRates)
 This function returns the valid baud rates of the current interface. More...
 
CLSERIALEXPORT void CLSERIALCC clSerialClose (hSerRef serialRef)
 This function closes the serial device and cleans up the resources associated with serialRef. Upon return, serialRef is no longer usable. More...
 
CLSERIALEXPORT CLINT32 CLSERIALCC clSerialInit (CLUINT32 serialIndex, hSerRef *serialRefPtr)
 This function initializes the device referred to by serialIndex and returns a pointer to an internal serial reference structure. More...
 
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 return when numBytes are available at the serial port or when the serialTimeout period has passed.
More...
 
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. More...
 
CLSERIALEXPORT CLINT32 CLSERIALCC clSetBaudRate (hSerRef serialRef, CLUINT32 baudRate)
 This function sets the baud rate for the serial port of the selected device. Use clGetSupportedBaudRate to determine supported baud rates. More...
 

Detailed Description

Exported C functions as defined by the Camera Link standard v1.1.

Definition in file ClSerial.h.

Macro Definition Documentation

◆ CLSERIALCC

#define CLSERIALCC   __attribute__((cdecl))

Definition at line 64 of file ClSerial.h.

◆ CLSERIALEXPORT

#define CLSERIALEXPORT   USER_EXTERN_C __attribute__((visibility("default")))

Definition at line 54 of file ClSerial.h.

◆ USER_EXTERN_C

#define USER_EXTERN_C

Definition at line 41 of file ClSerial.h.

Function Documentation

◆ clFlushPort()

CLSERIALEXPORT CLINT32 CLSERIALCC clFlushPort ( hSerRef  serialRef)

This function will discard any bytes that are available in the input buffer.

Returns
At completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_INVALID_REFERENCE
Parameters
serialRefThe value obtained by the clSerialInit function that describes the port to be flushed.

◆ 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 window.

Note: clGetErrorText first looks for the error code in CCTserial.dll. If the error code is not found in CCTserial.dll, it is not a standard Camera Link error. clGetErrorText then passes the error code to the manufacturer-specific .dll, which returns the manufacturer-specific error text.

Returns
On completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_BUFFER_TOO_SMALL CL_ERR_ERROR_NOT_FOUND into the buffer, including the NULL-termination character. This value should be the size in bytes of the error text buffer passed in. On CL_ERR__BUFFER_TOO_SMALL, contains the size of the buffer needed to write the error text.
Parameters
errorCodeThe error code used to find the appropriate error text. An error code is returned by every function in this library.
errorTextA caller-allocated buffer which contains the NULL-terminated error text on function return.
errorTextSizeOn success, contains the number of bytes written

◆ 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 of the Camera Link specifications with which the specified .dll complies.

Returns
At completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_BUFFER_TOO_SMALL CL_ERR_FUNCTION_NOT_FOUND CL_ERR_INVALID_INDEX
Parameters
ManufacturerNameA pointer to a user-allocated buffer into which the function copies the manufacturer name. The returned name is NULL-terminated. In the case that the .dll conforms to the October 2000 spec, this parameter will contain the file name of the .dll rather than the manufacturer name.
bufferSizeAs an input, this value should be the size of the buffer that is passed. On successful return, this parameter contains the number of bytes written into the buffer, including the NULL termination character. On CL_ERR_BUFFER_TOO_SMALL, this parameter contains the size of the buffer needed to write the data text.
versionThe version of the Camera Link Specifications with which this .dll complies.

◆ 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.

Returns
At completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_INVALID_REFERENCE CL_ERR_FUNCTION_NOT_FOUND
Parameters
serialRefThe value obtained by the clSerialInit function.
numBytesThe number of bytes currently available to be read from the port.

◆ clGetNumSerialPorts()

CLSERIALEXPORT CLINT32 CLSERIALCC clGetNumSerialPorts ( CLUINT32 numSerialPorts)

This function returns the number of serial ports in your system from a specified manufacturer. Use this number to determine the number of times you should loop through the clGetSerialPortIdentifier function.

Returns
At completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_FUNCTION_NOT_FOUND CL_ERR_MANU_DOES_NOT_EXIST that you can access with the current .dll.
Parameters
numSerialPortsThe number of serial ports in your system

◆ 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, including the NULL termination character. On CL_ERR_BUFFER_TOO_SMALL, this parameter contains the size of the buffer needed to write the data text.

Parameters
serialIndexA zero-based index value. The valid range for serialIndex is 0 to n-1, where n is the value of numSerialPorts, as returned by clGetNumManuSerialPorts.
PortIDManufacturer-specific identifier for the serial port. In the case that the manufacturer .dll conforms to the October 2000 specification, on return this parameter will be "Port #n" where n is a unique index for the port.
bufferSizeAs an input, this value should be the size of the buffer that

◆ clGetSupportedBaudRates()

CLSERIALEXPORT CLINT32 CLSERIALCC clGetSupportedBaudRates ( hSerRef  serialRef,
CLUINT32 baudRates 
)

This function returns the valid baud rates of the current interface.

Returns
At completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_INVALID_REFERENCE CL_ERR_FUNCTION_NOT_FOUND as described by serialRefPtr. See Table B-2 of the Camera Link documentation for more information on constants.
Parameters
serialRefPoints to a value that contains, on a successful call, a pointer to the vendor-specific reference to the current session.
baudRatesBit-field that describes all supported baud rates of the serial port

◆ clSerialClose()

CLSERIALEXPORT void CLSERIALCC clSerialClose ( hSerRef  serialRef)

This function closes the serial device and cleans up the resources associated with serialRef. Upon return, serialRef is no longer usable.

Parameters
serialRefThe value obtained from the clSerialInit function for clean up.

◆ 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 serial reference structure.

Returns
On completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_PORT_IN_USE CL_ERR_INVALID_INDEX a pointer to the vendor-specific reference to the current session.
Parameters
serialIndexA zero-based index value. For n serial devices in your system supported by this library, serialIndex has a range of 0 to(n-1). The order of the serial devices is vendor specific.
serialRefPtrPoints to a value that contains, on a successful call,

◆ 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 return when numBytes are available at the serial port or when the serialTimeout period has passed.

Upon success, numBytes are copied into buffer. In the case of any error, including CL_ERR_TIMEOUT, no data is copied into buffer.

Returns
On completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_TIMEOUT CL_ERR_INVALID_REFERENCE
Parameters
serialRefThe value obtained from the clSerialInit function.
bufferPoints to a user-allocated buffer. Upon a successful call, buffer contains the data read from the serial device. Upon failure, this buffer is not affected. Caller should ensure that buffer is at least numBytes in size.
bufferSizeThis is the number of bytes requested by the caller.
serialTimeOutIndicates the timeout in milliseconds.

◆ 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.

Returns
On completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_INVALID_REFERENCE CL_ERR_TIMEOUT
Parameters
serialRefThe value obtained from the clSerialInit function.
bufferContains data to write to the serial device.
bufferSizeContains the buffer size indicating the number of bytes to be written. Upon a successful call, bufferSize contains the number of bytes written to the serial device.
serialTimeOutIndicates the timeout in milliseconds.

◆ clSetBaudRate()

CLSERIALEXPORT CLINT32 CLSERIALCC clSetBaudRate ( hSerRef  serialRef,
CLUINT32  baudRate 
)

This function sets the baud rate for the serial port of the selected device. Use clGetSupportedBaudRate to determine supported baud rates.

Returns
On completion, this function returns one of the following status codes: CL_ERR_NO_ERR CL_ERR_INVALID_REFERENCE CL_ERR_BAUD_RATE_NOT_SUPPORTED values represented by the CL_BAUDRATE constants in table B-2. By default, the baud rate for serial communication is 9600.
Parameters
serialRefThe value obtained from the clSerialInit function.
baudRateThe baud rate you want to use. This parameter expects the


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