Solvline Eddy DK Ver 2.20 User Manual

Page 51

Advertising
background image

Chapter 6. Library

6-8

Function

Send data to the serial port.

Format

Void SB_SendSerial (int handle, char *data, int length);

Parameter

handle

Handle which opened serial port or socket

data

Pointer of 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 which opened the serial port.

data

Buffer pointer where the read data will be saved.

length

Size(length) of the buffer memory

wait_msec

Time it will wait for next data reception from reading
receive 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 which opened the 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)

Advertising