Wattcp api functions, 1 wattcp api functions – ProSoft Technology MVI69-ADMNET User Manual

Page 78

Advertising
background image

WATTCP API Functions

MVI-ADMNET ♦ 'C' Programmable

Developer's Guide

'C' Programmable Application Development Module with Ethernet

Page 78 of 122

ProSoft Technology, Inc.

February 20, 2013

6.1

WATTCP API Functions

This API is a TCP/IP stack, which is used on ADMNET API. Parts of this
document are brought from Waterloo TCP by Erik Engelke. Each section
provides detailed programming information for each WATTCP API library
function. The calling convention for each API function is shown in 'C' format.

The API library routines are categorized according to functionality as shown in
the following table.

Function Category

Function Name

Description

Initialize Socket

sock_init

TCP/IP system initialization.

System Functionality

tcp_tick

Determine socket connection.

tcp_open &
tcp_open_fast

Generate socket session to a host
computer for TCP protocol.
tcp_open_fast will have no wait for if the
host computer is not found.

udp_open &
udp_open_fast

Generate socket session to a host
computer for UDP protocol.
udp_open_fast will have no wait for if the
host computer is not found.

resolve

Convert string IP Address into a
longword.

sock_mode

Setup socket protocol transfer mode for
the particular use (UDP or TCP).

sock_established

Check if connect has been established.

ip_timer_init

Initialize timing.

ip_timer_expired

Check if timer has been expired.

set_timeout

Set timer.

chk_timeout

Check timer if expired.

sockerr

Return ASCII error message if there is
any.

sockstate

Return ASCII message what is the
current state.

gethostid

Returned value is the IP address in host
format.

Release Socket

sock_exit

Release all the TCP/IP system initialized
by sock_init.

sock_abort

Abort a connection.

sock_close

Close a connection.

Send Socket

sock_write &
sock_fastwrite

Write data out to a port. sock_fastwrite
will have no check for data written out to
the socket.

sock_flush

Flush data out to the socket to make
sure all the data has been sent.

sock_flushnext

Call before write the data out to make
sure that after write the data out to the
socket, buffer will be flushed.

sock_puts

Put string onto the buffer.

sock_putc

Put a character onto the buffer.

Advertising