clser.h Source File

clser.h
Go to the documentation of this file.
1
14#ifndef _SISOCLSER
15#define _SISOCLSER
16
17#define CL_OK 0
18#define CL_ERR_NO_ERR 0
19#define CL_ERR_BUFFER_TOO_SMALL -10001
20#define CL_ERR_MANU_DOES_NOT_EXIST -10002
21#define CL_ERR_PORT_IN_USE -10003
22#define CL_ERR_TIMEOUT -10004
23#define CL_ERR_INVALID_INDEX -10005
24#define CL_ERR_INVALID_REFERENCE -10006
25#define CL_ERR_ERROR_NOT_FOUND -10007
26#define CL_ERR_BAUD_RATE_NOT_SUPPORTED -10008
27#define CL_ERR_OUT_OF_MEMORY -10009
28#define CL_ERR_INVALID_ARG -10097
29#define CL_ERR_UNABLE_TO_LOAD_DLL -10098
30#define CL_ERR_FUNCTION_NOT_FOUND -10099
32#define CL_BAUDRATE_9600 1
33#define CL_BAUDRATE_19200 2
34#define CL_BAUDRATE_38400 4
35#define CL_BAUDRATE_57600 8
36#define CL_BAUDRATE_115200 16
37#define CL_BAUDRATE_230400 32
38#define CL_BAUDRATE_460800 64
39#define CL_BAUDRATE_921600 128
40
41#define CL_DLL_VERSION_NO_VERSION 1
42#define CL_DLL_VERSION_1_0 2
43#define CL_DLL_VERSION_1_1 3
45#define SISO_CL_EXT_PORT_FEATURE_CONFIG 1
46#define SISO_CL_EXT_PORT_CONFIG_INVERT_TX 0x0001
47#define SISO_CL_EXT_PORT_CONFIG_INVERT_RX 0x0002
48#define SISO_CL_EXT_PORT_CONFIG_PARITY_ON 0x0004
49#define SISO_CL_EXT_PORT_CONFIG_LOOPBACK_MODE 0x0008
50#define SISO_CL_EXT_PORT_CONFIG_SETUP_TX_RISING_EDGE 0x0010
51#define SISO_CL_EXT_PORT_CONFIG_SAMPLE_RX_FALLING_EDGE 0x0020
53#define SISO_CL_EXT_PORT_FEATURE_FIFO_DEPTH 2
55#ifdef __cplusplus
56extern "C" {
57#endif
58
75int clSerialInit(unsigned int serialIndex, void **serialRefPtr);
76
96int clSerialRead(void *serialRef, char *buffer, unsigned int *numBytes, unsigned int serialTimeout);
97
118int clSerialWrite(void *serialRef, char *buffer, unsigned int *bufferSize, unsigned int serialTimeout);
119
128void clSerialClose(void *serialRef);
129
147int clGetManufacturerInfo(char *manufacturerName, unsigned int *bufferSize, unsigned int *version);
148
156int clGetNumSerialPorts(unsigned int *numSerialPorts);
157
191int clGetSerialPortIdentifier(unsigned int serialIndex,char* portID,unsigned int* bufferSize);
192
203int clGetNumBytesAvail(void *serialRef, unsigned int *numBytes);
204
211int clFlushPort(void* serialRef);
212
225int clGetSupportedBaudRates(void *serialRef, unsigned int *baudRates);
226
243int clSetBaudRate(void *serialRef, unsigned int baudRate);
244
257int clSetParity(void *serialRef, unsigned int parityOn);
258
259
277int clSetPortFeature(void *serialRef, unsigned int feature, unsigned int value);
278
279
300int clSetFlowControlMode(void *serialRef, void *secondRef, unsigned int flowControl);
301
302
319int clGetErrorText(int errorCode,char *errorText,unsigned int* errorTextSize);
320
321#ifdef __cplusplus
322}
323#endif
324
325#endif
int clSerialWrite(void *serialRef, char *buffer, unsigned int *bufferSize, unsigned int serialTimeout)
This function writes the data in the buffer to the serial device referenced by serialRef....
int clFlushPort(void *serialRef)
This function discards any bytes that are available in the input buffer. .
int clGetNumBytesAvail(void *serialRef, unsigned int *numBytes)
This function outputs the number of bytes that are received at the port specified by serialRef but ar...
int clGetSerialPortIdentifier(unsigned int serialIndex, char *portID, unsigned int *bufferSize)
This function returns a manufacturer-specific identifier for each serial port in your system....
int clSetBaudRate(void *serialRef, unsigned int baudRate)
This function sets the baud rate for the serial port of the selected device. .
void clSerialClose(void *serialRef)
This function closes the serial device and cleans up the resources associated with serialRef....
int clSetPortFeature(void *serialRef, unsigned int feature, unsigned int value)
This function allows to activate different enhanced settings. .
int clSetFlowControlMode(void *serialRef, void *secondRef, unsigned int flowControl)
This function allows to enable asymmetric RTS/CTS hardware flow control. .
int clGetNumSerialPorts(unsigned int *numSerialPorts)
This function returns the number of serial ports in your system from a specific manufacturer....
int clSerialRead(void *serialRef, char *buffer, unsigned int *numBytes, unsigned int serialTimeout)
This function reads numBytes from the serial device referred to by serialRef. .
int clGetManufacturerInfo(char *manufacturerName, unsigned int *bufferSize, unsigned int *version)
This function returns the name of the frame grabber manufacturer who created the DLL and the version ...
int clSetParity(void *serialRef, unsigned int parityOn)
This function sets the parity for the serial port of the selected device. .
int clGetSupportedBaudRates(void *serialRef, unsigned int *baudRates)
This function returns the valid baud rates of the current interface. .
int clGetErrorText(int errorCode, char *errorText, unsigned int *errorTextSize)
This function converts an error code to error text for display in a dialog box or in a standard I/O w...
int clSerialInit(unsigned int serialIndex, void **serialRefPtr)
This function initializes the device referred to by serialIndex and returns a pointer to an internal ...