ioLibrary for Cortex M series
|
Socket Driver Source File - For w5500. More...
#include "common/common.h"
Go to the source code of this file.
Macros | |
#define | TIMEOUT_CLOSE_WAIT 200 |
#define | TIMEOUT_CLOSE_WAIT 200 |
Functions | |
uint8_t | incr_windowfull_retry_cnt (uint8_t s) |
void | init_windowfull_retry_cnt (uint8_t s) |
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) |
Variables | |
uint8_t | windowfull_retry_cnt [8] |
Socket Driver Source File - For w5500.
Definition in file socket.c.
#define TIMEOUT_CLOSE_WAIT 200 |
#define TIMEOUT_CLOSE_WAIT 200 |
uint8_t incr_windowfull_retry_cnt | ( | uint8_t | s) |
Definition at line 598 of file socket.c.
References windowfull_retry_cnt.
Referenced by TCPReSendNB().
void init_windowfull_retry_cnt | ( | uint8_t | s) |
Definition at line 603 of file socket.c.
References windowfull_retry_cnt.
Referenced by TCPSendNB().
int8_t TCPServerOpen | ( | uint8_t | s, |
uint16_t | port | ||
) |
Definition at line 25 of file socket.c.
References _WIZCHIP_SOCK_NUM_, DBG, DBGA, ERRA, getSn_CR(), getSn_MR(), getSn_SR(), RET_OK, setSn_CR(), setSn_MR(), setSn_PORT(), Sn_CR_LISTEN, Sn_CR_OPEN, Sn_MR_TCP, SOCK_INIT, SOCKERR_NOT_TCP, SOCKERR_WRONG_STATUS, and TCPClose().
Referenced by loopback_tcps().
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 | ||
) |
Definition at line 69 of file socket.c.
References _WIZCHIP_SOCK_NUM_, DBG, DBGA, ERR, ERRA, getSIPR(), getSn_CR(), getSn_SR(), getSUBR(), RET_OK, setSn_CR(), setSn_DIPR(), setSn_DPORT(), setSn_MR(), setSn_PORT(), Sn_CR_CONNECT, Sn_CR_OPEN, Sn_MR_TCP, SOCKERR_NOT_TCP, SOCKERR_NULL_SRC_IP, SOCKERR_WRONG_ARG, and TCPClose().
Referenced by TCPClientOpen().
int8_t TCPConnChk | ( | uint8_t | s) |
Definition at line 125 of file socket.c.
References _WIZCHIP_SOCK_NUM_, ERRA, getSn_IR(), getSn_SR(), RET_OK, setSn_IR(), Sn_IR_TIMEOUT, SOCK_ESTABLISHED, SOCKERR_BUSY, SOCKERR_NOT_TCP, and SOCKERR_TIME_OUT.
Referenced by sockwatch_run(), and TCPClientOpen().
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) |
Definition at line 165 of file socket.c.
References DBG, RET_OK, SOCKERR_BUSY, TCPCloseCHK(), and TCPCloseNB().
Referenced by loopback_tcpc(), loopback_tcps(), loopback_udp(), TCPCltOpenNB(), TCPSendCHK(), and TCPServerOpen().
int8_t TCPCloseNB | ( | uint8_t | s) |
Definition at line 180 of file socket.c.
References _WIZCHIP_SOCK_NUM_, DBG, ERRA, getSn_CR(), getSn_SR(), RET_OK, setSn_CR(), Sn_CR_DISCON, SOCK_CLOSED, SOCKERR_NOT_TCP, and SOCKERR_WRONG_STATUS.
Referenced by TCPClose().
int8_t TCPCloseCHK | ( | uint8_t | s) |
Definition at line 196 of file socket.c.
References _WIZCHIP_SOCK_NUM_, DBG, ERRA, getSn_CR(), getSn_SR(), RET_OK, setSn_CR(), setSn_IR(), Sn_CR_CLOSE, SOCK_CLOSED, and SOCKERR_NOT_TCP.
Referenced by sockwatch_run(), and TCPClose().
int8_t TCPClsRcvCHK | ( | uint8_t | s) |
Definition at line 217 of file socket.c.
References _WIZCHIP_SOCK_NUM_, ERRA, getSn_CR(), getSn_SR(), RET_OK, setSn_CR(), setSn_IR(), Sn_CR_CLOSE, SOCK_CLOSE_WAIT, SOCK_CLOSED, SOCKERR_BUSY, and SOCKERR_NOT_TCP.
Referenced by sockwatch_run().
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 | ||
) |
Definition at line 257 of file socket.c.
References _WIZCHIP_SOCK_NUM_, DBG, ERR, ERRA, getSn_CR(), getSn_MR(), getSn_SR(), getSn_TX_RD(), getSn_TxMAX(), GetSocketTxFreeBufferSize(), init_windowfull_retry_cnt(), RET_OK, setSn_CR(), Sn_CR_SEND, Sn_MR_TCP, SOCK_CLOSE_WAIT, SOCK_CLOSED, SOCK_ESTABLISHED, SOCK_FIN_WAIT, SOCKERR_BUSY, SOCKERR_CLOSED, SOCKERR_FIN_WAIT, SOCKERR_NOT_ESTABLISHED, SOCKERR_NOT_TCP, SOCKERR_WRONG_ARG, and wiz_send_data().
Referenced by TCPSend().
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) |
Definition at line 307 of file socket.c.
References _WIZCHIP_SOCK_NUM_, DBG, ERRA, getSn_CR(), getSn_MR(), getSn_SR(), getSn_TX_RD(), incr_windowfull_retry_cnt(), RET_OK, setSn_CR(), Sn_CR_SEND, Sn_MR_TCP, SOCK_CLOSE_WAIT, SOCK_CLOSED, SOCK_ESTABLISHED, SOCK_FIN_WAIT, SOCKERR_BUSY, SOCKERR_CLOSED, SOCKERR_FIN_WAIT, SOCKERR_NOT_ESTABLISHED, SOCKERR_NOT_TCP, SOCKERR_WINDOW_FULL, WINDOWFULL_MAX_RETRY_NUM, WINDOWFULL_WAIT_TIME, wizpf_get_systick(), and wizpf_tick_elapse().
Referenced by TCPReSend().
int32_t TCPSendCHK | ( | uint8_t | s) |
Definition at line 336 of file socket.c.
References DBG, getSn_IR(), getSn_SR(), getSn_TX_RD(), setSn_IR(), Sn_IR_SENDOK, SOCK_CLOSED, SOCKERR_BUSY, SOCKERR_CLOSED, and TCPClose().
Referenced by sockwatch_run(), TCPReSend(), and TCPSend().
int32_t TCPRecv | ( | uint8_t | s, |
int8_t * | buf, | ||
uint16_t | len | ||
) |
Definition at line 354 of file socket.c.
References _WIZCHIP_SOCK_NUM_, ERR, ERRA, getSn_CR(), getSn_MR(), getSn_SR(), GetSocketRxRecvBufferSize(), setSn_CR(), Sn_CR_RECV, Sn_MR_TCP, SOCK_CLOSE_WAIT, SOCK_CLOSED, SOCK_ESTABLISHED, SOCKERR_CLOSE_WAIT, SOCKERR_CLOSED, SOCKERR_NOT_ESTABLISHED, SOCKERR_NOT_TCP, SOCKERR_WRONG_ARG, and wiz_recv_data().
Referenced by loopback_tcpc(), and loopback_tcps().
int8_t UDPOpen | ( | uint8_t | s, |
uint16_t | port | ||
) |
Definition at line 385 of file socket.c.
References _WIZCHIP_SOCK_NUM_, DBG, DBGA, ERRA, getSn_CR(), getSn_MR(), getSn_SR(), RET_OK, setSn_CR(), setSn_MR(), setSn_PORT(), Sn_CR_OPEN, Sn_MR_UDP, SOCKERR_NOT_UDP, and UDPClose().
Referenced by loopback_udp().
int8_t UDPClose | ( | uint8_t | s) |
Definition at line 410 of file socket.c.
References _WIZCHIP_SOCK_NUM_, DBG, ERRA, getSn_CR(), RET_OK, setSn_CR(), setSn_IR(), Sn_CR_CLOSE, and SOCKERR_NOT_UDP.
Referenced by loopback_tcpc(), loopback_tcps(), loopback_udp(), and UDPOpen().
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 | ||
) |
Definition at line 439 of file socket.c.
References _WIZCHIP_SOCK_NUM_, DBG, DBGA, ERR, ERRA, getSIPR(), getSn_CR(), getSn_MR(), getSn_SR(), getSn_TxMAX(), getSUBR(), setSn_CR(), setSn_DIPR(), setSn_DPORT(), Sn_CR_SEND, Sn_MR_UDP, SOCK_CLOSED, SOCK_UDP, SOCKERR_CLOSED, SOCKERR_NOT_UDP, SOCKERR_NULL_SRC_IP, SOCKERR_WRONG_ARG, and wiz_send_data().
Referenced by UDPSend().
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 | ||
) |
Definition at line 509 of file socket.c.
References _WIZCHIP_SOCK_NUM_, DBG, DBGA, ERR, ERRA, getSn_CR(), getSn_MR(), getSn_SR(), GetSocketRxRecvBufferSize(), setSn_CR(), Sn_CR_RECV, Sn_MR_MACRAW, Sn_MR_UDP, SOCK_CLOSED, SOCK_UDP, SOCKERR_CLOSED, SOCKERR_NOT_SPECIFIED, SOCKERR_NOT_UDP, SOCKERR_WRONG_ARG, wiz_recv_data(), and wiz_recv_ignore().
Referenced by loopback_udp().
uint8_t windowfull_retry_cnt[8] |
Definition at line 20 of file socket.c.
Referenced by incr_windowfull_retry_cnt(), and init_windowfull_retry_cnt().