Solvline Eddy DKV2.1.0.3 User Manual
Page 86
Chapter 6. Library
Introduction
86
Format
Void SB_SendSerial (int handle, char *data, int length);
Parameter
handle
Handle to serial port or socket
data
Pointer to the data to be sent
length
Length of the data to be sent
Returns
None
Notice
When the transmit buffer is full, this function will retry up to 10 time in
20 msec period; it will return after transmission is completed.
SB_ReadSerial
Function
Reads data from the serial port.
Format
int SB_ReadSerial (int handle, char *data, int length, int wait_msec);
Parameter
handle
Handle to serial port.
data
Buffer pointer where the read data will be saved.
length
Size(length) of the buffer memory
wait_msec
Time the function will wait for next received data after
reading from read buffer.
Returns
0 ~ n
Size of the read data
Notice
When wait_msec is set to 0 this function will only read data from serial
receive buffer; when set larger than 0, it will read data from serial
receive buffer, wait for time specified in msec unit, and then continue
reading data from serial port as one packet.
The maximum size of the data is same as buffer’s size, i.e. length.
You can use value obtained from SB_GetDelaySerial function or value
manually calculated for wait_msec.
SB_GetMsr
Function
Reads MSR register value from serial port
Format
Char SB_GetMsr (int handle);
Parameter
handle
Handle to serial port.
Returns
Value
MSR Register 값
Bit 7 6 5 4 3 2 1 0
Bit0: CTS change
Bit1: DSR change
Bit2: RI change
Bit3: DCD change
Bit4: CTS (0:Low, 1:High)
Bit5: DSR (0:Low, 1:High)
Bit6: RI (0:Low, 1:High)
Bit7: DCD (0:Low, 1:High)
Notice