beautypg.com

Solvline PB2xxxUG User Manual

Page 82

background image

U_check_dcd

Check

Signal

Description The function detects a change of DCD signal in MSR (Modem status

register) of serial file descriptor.

Synopsis

int U_check_dcd (int fd)

Parameters fd

: Serial file descriptor

Returns

0

: If DCD signal status is OFF

1

: If DCD signal status is ON

U_check_type

Check

Serial

Type

Description The function detects a serial interface from serial file descriptor.

Synopsis

int U_check_type (int fd)

Parameters fd

: Serial file descriptor

Returns

0

: If serial interface is RS-232

1

: If serial interface is RS-422

2

: If serial interface is RS-485

U_connect

TCP

Connect

Description This function is used to create a connection to a established connection-

based (stream) foreign association. It blocks, up to the specified timeout
interval.

Synopsis

int U_connect (char *dest_ip, int dest_socket, int timeout)

Parameters dest_ip

: Pointer to the peer IP address to connect

dest_socket

: Socket port number

Timeout

: A maximum interval to wait for the connection in second

Returns

-1

: On failure

1~n

: A descriptor that references the socket if successful

82