Socket APIs
|
SOCKET APIs Implements file. More...
#include "socket.h"
Go to the source code of this file.
Macros | |
#define | SOCK_ANY_PORT_NUM 0xC000 |
#define | CHECK_SOCKNUM() |
#define | CHECK_SOCKMODE(mode) |
#define | CHECK_SOCKINIT() |
#define | CHECK_SOCKDATA() |
Functions | |
int8_t | socket (uint8_t sn, uint8_t protocol, uint16_t port, uint8_t flag) |
Open a socket. More... | |
int8_t | close (uint8_t sn) |
Close a socket. More... | |
int8_t | listen (uint8_t sn) |
Listen to a connection request from a client. More... | |
int8_t | connect (uint8_t sn, uint8_t *addr, uint16_t port) |
Try to connect a server. More... | |
int8_t | disconnect (uint8_t sn) |
Try to disconnect a connection socket. More... | |
int32_t | send (uint8_t sn, uint8_t *buf, uint16_t len) |
Send data to the connected peer in TCP socket. More... | |
int32_t | recv (uint8_t sn, uint8_t *buf, uint16_t len) |
Receive data from the connected peer. More... | |
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. More... | |
int32_t | recvfrom (uint8_t sn, uint8_t *buf, uint16_t len, uint8_t *addr, uint16_t *port) |
Receive datagram of UDP or MACRAW. More... | |
int8_t | ctlsocket (uint8_t sn, ctlsock_type cstype, void *arg) |
Control socket. More... | |
int8_t | setsockopt (uint8_t sn, sockopt_type sotype, void *arg) |
set socket options More... | |
int8_t | getsockopt (uint8_t sn, sockopt_type sotype, void *arg) |
get socket options More... | |
Variables | |
uint8_t | sock_pack_info [_WIZCHIP_SOCK_NUM_] = {0,} |
Detailed Description
SOCKET APIs Implements file.
SOCKET APIs like as Berkeley Socket APIs.
- Version
- 1.0.3
- Date
- 2013/10/21
- Revision history
- <2015/02/05> Notice The version history is not updated after this point. Download the latest version directly from GitHub. Please visit the our GitHub repository for ioLibrary. >> https://github.com/Wiznet/ioLibrary_Driver <2014/05/01> V1.0.3. Refer to M20140501
- Implicit type casting -> Explicit type casting.
- replace 0x01 with PACK_REMAINED in recvfrom()
- Validation a destination ip in connect() & sendto(): It occurs a fatal error on converting unint32 address if uint8* addr parameter is not aligned by 4byte address. Copy 4 byte addr value into temporary uint32 variable and then compares it. <2013/12/20> V1.0.2 Refer to M20131220 Remove Warning. <2013/11/04> V1.0.1 2nd Release. Refer to "20131104". In sendto(), Add to clear timeout interrupt status (Sn_IR_TIMEOUT) <2013/10/21> 1st Release
- Author
- MidnightCow
- Copyright
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.c.
Macro Definition Documentation
#define CHECK_SOCKNUM | ( | ) |
Definition at line 83 of file socket.c.
Referenced by close(), connect(), ctlsocket(), disconnect(), getsockopt(), listen(), recv(), recvfrom(), send(), sendto(), setsockopt(), and socket().
#define CHECK_SOCKMODE | ( | mode | ) |
Definition at line 88 of file socket.c.
Referenced by connect(), disconnect(), getsockopt(), listen(), recv(), send(), and setsockopt().
#define CHECK_SOCKINIT | ( | ) |
#define CHECK_SOCKDATA | ( | ) |
Definition at line 98 of file socket.c.
Referenced by recv(), recvfrom(), send(), and sendto().
Variable Documentation
uint8_t sock_pack_info[_WIZCHIP_SOCK_NUM_] = {0,} |
Definition at line 70 of file socket.c.
Referenced by close(), getsockopt(), recv(), recvfrom(), and socket().
Generated on Wed May 4 2016 16:43:59 for Socket APIs by 1.8.9.1