BSD style socket API for W5500.

Dependencies:   W5500

Fork of Ethernet by Raphael Kwon

Embed: (wiki syntax)

« Back to documentation index

socket.h File Reference

socket.h File Reference

SOCKET APIs Header file. More...

Go to the source code of this file.

Enumerations

enum  sockint_kind {
  SIK_CONNECTED = (1 << 0), SIK_DISCONNECTED = (1 << 1), SIK_RECEIVED = (1 << 2), SIK_TIMEOUT = (1 << 3),
  SIK_SENT = (1 << 4), SIK_ALL = 0x1F
}
 

The kind of Socket Interrupt.

More...
enum  ctlsock_type {
  CS_SET_IOMODE, CS_GET_IOMODE, CS_GET_MAXTXBUF, CS_GET_MAXRXBUF,
  CS_CLR_INTERRUPT, CS_GET_INTERRUPT, CS_SET_INTMASK, CS_GET_INTMASK
}
 

The type of ctlsocket().

More...
enum  sockopt_type {
  SO_FLAG, SO_TTL, SO_TOS, SO_MSS,
  SO_DESTIP, SO_DESTPORT, SO_KEEPALIVESEND, SO_KEEPALIVEAUTO,
  SO_SENDBUF, SO_RECVBUF, SO_STATUS, SO_REMAINSIZE
}
 

The type of socket option in setsockopt() or getsockopt()

More...

Functions

int8_t socket (uint8_t sn, uint8_t protocol, uint16_t port, uint8_t flag)
 Open a socket.
int8_t close (uint8_t sn)
 Close a socket.
int8_t listen (uint8_t sn)
 Listen to a connection request from a client.
int8_t connect (uint8_t sn, uint8_t *addr, uint16_t port)
 Try to connect a server.
int8_t disconnect (uint8_t sn)
 Try to disconnect a connection socket.
int32_t send (uint8_t sn, uint8_t *buf, uint16_t len)
 Send data to the connected peer in TCP socket.
int32_t recv (uint8_t sn, uint8_t *buf, uint16_t len)
 Receive data from the connected peer.
int32_t sendto (uint8_t sn, uint8_t *buf, uint16_t len, uint8_t *addr, uint16_t port)
 Sends datagram to the peer with destination IP address and port number passed as parameter.
int32_t recvfrom (uint8_t sn, uint8_t *buf, uint16_t len, uint8_t *addr, uint16_t *port, uint8_t *packinfo)
 Receive datagram of UDP or MACRAW.
int8_t ctlsocket (uint8_t sn, ctlsock_type cstype, void *arg)
 Control socket.
int8_t setsockopt (uint8_t sn, sockopt_type sotype, void *arg)
 set socket options
int8_t getsockopt (uint8_t sn, sockopt_type sotype, void *arg)
 get socket options

Detailed Description

SOCKET APIs Header file.

SOCKET APIs like as berkeley socket api.

Version:
1.0.0
Date:
2013/10/01
Revision history
<2013/10/01> 1st Release
Author:
MidnightCow

Copyright (c) 2013, WIZnet Co., LTD. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file socket.h.