Exported C functions as defined by the Camera Link standard v1.1. More...
#include <CLProtocol/ClSerialTypes.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... | |
Exported C functions as defined by the Camera Link standard v1.1.
Definition in file ClSerial.h.
#define CLSERIALCC __attribute__((cdecl)) |
Definition at line 64 of file ClSerial.h.
#define CLSERIALEXPORT USER_EXTERN_C __attribute__((visibility("default"))) |
Definition at line 54 of file ClSerial.h.
#define USER_EXTERN_C |
Definition at line 41 of file ClSerial.h.
CLSERIALEXPORT CLINT32 CLSERIALCC clFlushPort | ( | hSerRef | serialRef | ) |
This function will discard any bytes that are available in the input buffer.
serialRef | The value obtained by the clSerialInit function that describes the port to be flushed. |
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.
errorCode | The error code used to find the appropriate error text. An error code is returned by every function in this library. |
errorText | A caller-allocated buffer which contains the NULL-terminated error text on function return. |
errorTextSize | On success, contains the number of bytes written |
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.
ManufacturerName | A 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. |
bufferSize | As 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. |
version | The version of the Camera Link Specifications with which this .dll complies. |
CLSERIALEXPORT CLINT32 CLSERIALCC clGetNumBytesAvail | ( | hSerRef | serialRef, |
CLUINT32 * | numBytes | ||
) |
This function will output how many bytes have are available at the port specified by serialRef.
serialRef | The value obtained by the clSerialInit function. |
numBytes | The number of bytes currently available to be read from the port. |
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.
numSerialPorts | The number of serial ports in your system |
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.
serialIndex | A 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. |
PortID | Manufacturer-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. |
bufferSize | As an input, this value should be the size of the buffer that |
CLSERIALEXPORT CLINT32 CLSERIALCC clGetSupportedBaudRates | ( | hSerRef | serialRef, |
CLUINT32 * | baudRates | ||
) |
This function returns the valid baud rates of the current interface.
serialRef | Points to a value that contains, on a successful call, a pointer to the vendor-specific reference to the current session. |
baudRates | Bit-field that describes all supported baud rates of the serial port |
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.
serialRef | The value obtained from the clSerialInit function for clean up. |
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.
serialIndex | A 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. |
serialRefPtr | Points to a value that contains, on a successful call, |
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.
serialRef | The value obtained from the clSerialInit function. |
buffer | Points 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. |
bufferSize | This is the number of bytes requested by the caller. |
serialTimeOut | Indicates the timeout in milliseconds. |
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.
serialRef | The value obtained from the clSerialInit function. |
buffer | Contains data to write to the serial device. |
bufferSize | Contains 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. |
serialTimeOut | Indicates the timeout in milliseconds. |
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.
serialRef | The value obtained from the clSerialInit function. |
baudRate | The baud rate you want to use. This parameter expects the |