ioLibrary for Cortex M series
Macros | Functions
socket.h File Reference

Socket Driver Header File - Common. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WINDOWFULL_MAX_RETRY_NUM   3
 
#define WINDOWFULL_WAIT_TIME   1000
 
#define SOCKSTAT_CLOSED   -1
 
#define SOCKSTAT_INIT   0
 
#define SOCKSTAT_LISTEN   1
 
#define SOCKSTAT_SYNSENT   2
 
#define SOCKSTAT_SYNRECV   3
 
#define SOCKSTAT_ESTABLISHED   4
 
#define SOCKSTAT_FIN_WAIT   5
 
#define SOCKSTAT_CLOSING   6
 
#define SOCKSTAT_TIME_WAIT   7
 
#define SOCKSTAT_CLOSE_WAIT   8
 
#define SOCKSTAT_LAST_ACK   9
 
#define SOCKSTAT_UDP   10
 
#define SOCKERR_BUSY   -1
 
#define SOCKERR_NOT_TCP   -2
 
#define SOCKERR_NOT_UDP   -3
 
#define SOCKERR_WRONG_ARG   -4
 
#define SOCKERR_WRONG_STATUS   -5
 
#define SOCKERR_CLOSED   -6
 
#define SOCKERR_CLOSE_WAIT   -7
 
#define SOCKERR_FIN_WAIT   -8
 
#define SOCKERR_NOT_ESTABLISHED   -9
 
#define SOCKERR_WINDOW_FULL   -10
 
#define SOCKERR_TIME_OUT   -11
 
#define SOCKERR_NULL_SRC_IP   -12
 
#define SOCKERR_BUF_NOT_ENOUGH   -13
 
#define SOCKERR_NOT_SPECIFIED   -14
 

Functions

int8_t TCPServerOpen (uint8_t s, uint16_t port)
 
int8_t TCPClientOpen (uint8_t s, uint16_t sport, uint8_t *dip, uint16_t dport)
 
int8_t TCPCltOpenNB (uint8_t s, uint16_t sport, uint8_t *dip, uint16_t dport)
 
int8_t TCPConnChk (uint8_t s)
 
int8_t TCPDisconnect (uint8_t s)
 
int8_t TCPClose (uint8_t s)
 
int8_t TCPCloseNB (uint8_t s)
 
int8_t TCPCloseCHK (uint8_t s)
 
int8_t TCPClsRcvCHK (uint8_t s)
 
int32_t TCPSend (uint8_t s, const int8_t *buf, uint16_t len)
 
int8_t TCPSendNB (uint8_t s, const int8_t *buf, uint16_t len)
 
int32_t TCPReSend (uint8_t s)
 
int8_t TCPReSendNB (uint8_t s)
 
int32_t TCPSendCHK (uint8_t s)
 
int32_t TCPRecv (uint8_t s, int8_t *buf, uint16_t len)
 
int8_t UDPOpen (uint8_t s, uint16_t port)
 
int8_t UDPClose (uint8_t s)
 
int32_t UDPSend (uint8_t s, const int8_t *buf, uint16_t len, uint8_t *addr, uint16_t port)
 
int32_t UDPSendNB (uint8_t s, const int8_t *buf, uint16_t len, uint8_t *addr, uint16_t port)
 
int8_t UDPSendCHK (uint8_t s)
 
int32_t UDPRecv (uint8_t s, int8_t *buf, uint16_t len, uint8_t *addr, uint16_t *port)
 

Detailed Description

Socket Driver Header File - Common.

Version
1.1
Date
2013/02/22
Revision
2013/02/22 - 1.0 Release 2013/07/09 - 1.1 Network control part was devided
Author
modified by Mike Jeong

Copyright (C) 2013 WIZnet. All rights reserved.

Definition in file socket.h.

Macro Definition Documentation

#define WINDOWFULL_MAX_RETRY_NUM   3

Definition at line 17 of file socket.h.

Referenced by TCPReSendNB().

#define WINDOWFULL_WAIT_TIME   1000

Definition at line 18 of file socket.h.

Referenced by TCPReSendNB().

#define SOCKSTAT_CLOSED   -1

Definition at line 21 of file socket.h.

Referenced by GetTCPSocketStatus(), and GetUDPSocketStatus().

#define SOCKSTAT_INIT   0

Definition at line 22 of file socket.h.

Referenced by GetTCPSocketStatus().

#define SOCKSTAT_LISTEN   1

Definition at line 23 of file socket.h.

Referenced by GetTCPSocketStatus().

#define SOCKSTAT_SYNSENT   2

Definition at line 24 of file socket.h.

Referenced by GetTCPSocketStatus().

#define SOCKSTAT_SYNRECV   3

Definition at line 25 of file socket.h.

Referenced by GetTCPSocketStatus().

#define SOCKSTAT_ESTABLISHED   4

Definition at line 26 of file socket.h.

Referenced by GetTCPSocketStatus().

#define SOCKSTAT_FIN_WAIT   5

Definition at line 27 of file socket.h.

Referenced by GetTCPSocketStatus().

#define SOCKSTAT_CLOSING   6

Definition at line 28 of file socket.h.

Referenced by GetTCPSocketStatus().

#define SOCKSTAT_TIME_WAIT   7

Definition at line 29 of file socket.h.

Referenced by GetTCPSocketStatus().

#define SOCKSTAT_CLOSE_WAIT   8

Definition at line 30 of file socket.h.

Referenced by GetTCPSocketStatus(), loopback_tcpc(), and loopback_tcps().

#define SOCKSTAT_LAST_ACK   9

Definition at line 31 of file socket.h.

Referenced by GetTCPSocketStatus().

#define SOCKSTAT_UDP   10

Definition at line 32 of file socket.h.

Referenced by GetUDPSocketStatus().

#define SOCKERR_BUSY   -1
#define SOCKERR_NOT_TCP   -2
#define SOCKERR_NOT_UDP   -3

Definition at line 36 of file socket.h.

Referenced by GetUDPSocketStatus(), loopback_udp(), UDPClose(), UDPOpen(), UDPRecv(), and UDPSendNB().

#define SOCKERR_WRONG_ARG   -4

Definition at line 37 of file socket.h.

Referenced by TCPCltOpenNB(), TCPRecv(), TCPSendNB(), UDPRecv(), and UDPSendNB().

#define SOCKERR_WRONG_STATUS   -5

Definition at line 38 of file socket.h.

Referenced by GetTCPSocketStatus(), GetUDPSocketStatus(), TCPCloseNB(), and TCPServerOpen().

#define SOCKERR_CLOSED   -6
#define SOCKERR_CLOSE_WAIT   -7

Definition at line 40 of file socket.h.

Referenced by TCPRecv().

#define SOCKERR_FIN_WAIT   -8

Definition at line 41 of file socket.h.

Referenced by TCPReSendNB(), and TCPSendNB().

#define SOCKERR_NOT_ESTABLISHED   -9

Definition at line 42 of file socket.h.

Referenced by TCPRecv(), TCPReSendNB(), and TCPSendNB().

#define SOCKERR_WINDOW_FULL   -10

Definition at line 43 of file socket.h.

Referenced by loopback_tcpc(), loopback_tcps(), and TCPReSendNB().

#define SOCKERR_TIME_OUT   -11

Definition at line 44 of file socket.h.

Referenced by loopback_udp(), TCPConnChk(), and UDPSendCHK().

#define SOCKERR_NULL_SRC_IP   -12

Definition at line 45 of file socket.h.

Referenced by TCPCltOpenNB(), and UDPSendNB().

#define SOCKERR_BUF_NOT_ENOUGH   -13

Definition at line 46 of file socket.h.

#define SOCKERR_NOT_SPECIFIED   -14

Definition at line 47 of file socket.h.

Referenced by UDPRecv().

Function Documentation

int8_t TCPServerOpen ( uint8_t  s,
uint16_t  port 
)
int8_t TCPClientOpen ( uint8_t  s,
uint16_t  sport,
uint8_t *  dip,
uint16_t  dport 
)

Definition at line 54 of file socket.c.

References DBG, RET_OK, SOCKERR_BUSY, TCPCltOpenNB(), and TCPConnChk().

Referenced by loopback_tcpc().

int8_t TCPCltOpenNB ( uint8_t  s,
uint16_t  sport,
uint8_t *  dip,
uint16_t  dport 
)
int8_t TCPConnChk ( uint8_t  s)
int8_t TCPDisconnect ( uint8_t  s)

Definition at line 149 of file socket.c.

References _WIZCHIP_SOCK_NUM_, DBG, ERR, ERRA, getSn_CR(), RET_NOK, RET_OK, setSn_CR(), Sn_CR_DISCON, and SOCKERR_NOT_TCP.

int8_t TCPClose ( uint8_t  s)
int8_t TCPCloseNB ( uint8_t  s)
int8_t TCPCloseCHK ( uint8_t  s)
int8_t TCPClsRcvCHK ( uint8_t  s)
int32_t TCPSend ( uint8_t  s,
const int8_t *  buf,
uint16_t  len 
)

Definition at line 239 of file socket.c.

References RET_OK, SOCKERR_BUSY, TCPSendCHK(), and TCPSendNB().

Referenced by loopback_tcpc(), and loopback_tcps().

int8_t TCPSendNB ( uint8_t  s,
const int8_t *  buf,
uint16_t  len 
)
int32_t TCPReSend ( uint8_t  s)

Definition at line 289 of file socket.c.

References RET_OK, SOCKERR_BUSY, TCPReSendNB(), and TCPSendCHK().

Referenced by loopback_tcpc(), and loopback_tcps().

int8_t TCPReSendNB ( uint8_t  s)
int32_t TCPSendCHK ( uint8_t  s)
int32_t TCPRecv ( uint8_t  s,
int8_t *  buf,
uint16_t  len 
)
int8_t UDPOpen ( uint8_t  s,
uint16_t  port 
)
int8_t UDPClose ( uint8_t  s)
int32_t UDPSend ( uint8_t  s,
const int8_t *  buf,
uint16_t  len,
uint8_t *  addr,
uint16_t  port 
)

Definition at line 424 of file socket.c.

References RET_OK, SOCKERR_BUSY, UDPSendCHK(), and UDPSendNB().

Referenced by loopback_udp().

int32_t UDPSendNB ( uint8_t  s,
const int8_t *  buf,
uint16_t  len,
uint8_t *  addr,
uint16_t  port 
)
int8_t UDPSendCHK ( uint8_t  s)

Definition at line 491 of file socket.c.

References DBG, getSn_IR(), RET_OK, setSn_IR(), Sn_IR_SENDOK, Sn_IR_TIMEOUT, SOCKERR_BUSY, and SOCKERR_TIME_OUT.

Referenced by sockwatch_run(), and UDPSend().

int32_t UDPRecv ( uint8_t  s,
int8_t *  buf,
uint16_t  len,
uint8_t *  addr,
uint16_t *  port 
)