1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Removed unused "socket.h" interface from WiFi library.

(that was probably an heritage from Ethernet lib)
This commit is contained in:
Cristian Maglie 2013-12-10 17:38:07 +01:00
parent d920b7b67c
commit 9d48b52312
6 changed files with 2 additions and 90 deletions

View File

@ -1,7 +1,6 @@
extern "C" {
#include "utility/wl_definitions.h"
#include "utility/wl_types.h"
#include "utility/socket.h"
#include "string.h"
#include "utility/debug.h"
}

View File

@ -1,34 +0,0 @@
/*
*
@file socket.h
@brief define function of socket API
*
*/
#ifndef _SOCKET_H_
#define _SOCKET_H_
#define TCP_SOCKET 1
#define UDP_SOCKET 2
#define RAW_SOCKET 3
#define SOCK_NOT_AVAIL 255
#include "utility/wl_definitions.h"
typedef uint16_t SOCKET;
extern SOCKET socket(uint8_t protocol); // Opens a socket(TCP or UDP or IP_RAW mode)
extern void close(SOCKET s); // Close socket
extern uint8_t connect(SOCKET s, uint8_t * addr, uint16_t port); // Establish TCP connection (Active connection)
extern void disconnect(SOCKET s); // disconnect the connection
extern uint8_t listen(SOCKET s); // Establish TCP connection (Passive connection)
extern uint16_t send(SOCKET s, const uint8_t * buf, uint16_t len); // Send data (TCP)
extern uint16_t recv(SOCKET s, uint8_t * buf, uint16_t len); // Receive data (TCP)
extern uint16_t sendto(SOCKET s, const uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t port); // Send data (UDP/IP RAW)
extern uint16_t recvfrom(SOCKET s, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t *port); // Receive data (UDP/IP RAW)
extern uint16_t igmpsend(SOCKET s, const uint8_t * buf, uint16_t len);
#endif
/* _SOCKET_H_ */

View File

@ -1,7 +1,6 @@
extern "C" {
#include "utility/wl_definitions.h"
#include "utility/wl_types.h"
#include "utility/socket.h"
#include "string.h"
#include "utility/debug.h"
}

View File

@ -1,34 +0,0 @@
/*
*
@file socket.h
@brief define function of socket API
*
*/
#ifndef _SOCKET_H_
#define _SOCKET_H_
#define TCP_SOCKET 1
#define UDP_SOCKET 2
#define RAW_SOCKET 3
#define SOCK_NOT_AVAIL 255
#include "utility/wl_definitions.h"
typedef uint16_t SOCKET;
extern SOCKET socket(uint8_t protocol); // Opens a socket(TCP or UDP or IP_RAW mode)
extern void close(SOCKET s); // Close socket
extern uint8_t connect(SOCKET s, uint8_t * addr, uint16_t port); // Establish TCP connection (Active connection)
extern void disconnect(SOCKET s); // disconnect the connection
extern uint8_t listen(SOCKET s); // Establish TCP connection (Passive connection)
extern uint16_t send(SOCKET s, const uint8_t * buf, uint16_t len); // Send data (TCP)
extern uint16_t recv(SOCKET s, uint8_t * buf, uint16_t len); // Receive data (TCP)
extern uint16_t sendto(SOCKET s, const uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t port); // Send data (UDP/IP RAW)
extern uint16_t recvfrom(SOCKET s, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t *port); // Receive data (UDP/IP RAW)
extern uint16_t igmpsend(SOCKET s, const uint8_t * buf, uint16_t len);
#endif
/* _SOCKET_H_ */

View File

@ -1,20 +0,0 @@
/*
*
@file socket.c
@brief define function of socket API
*
*/
#include <inttypes.h>
#include "utility/socket.h"
SOCKET socket(uint8_t protocol) {return 0;} // Opens a socket(TCP or UDP or IP_RAW mode)
void close(SOCKET s) {} // Close socket
uint8_t connect(SOCKET s, uint8_t * addr, uint16_t port) {return 0;} // Establish TCP connection (Active connection)
void disconnect(SOCKET s) {} // disconnect the connection
uint8_t listen(SOCKET s) { return 0;} // Establish TCP connection (Passive connection)
uint16_t send(SOCKET s, const uint8_t * buf, uint16_t len) { return 0;} // Send data (TCP)
uint16_t recv(SOCKET s, uint8_t * buf, uint16_t len) {return 0;} // Receive data (TCP)
uint16_t sendto(SOCKET s, const uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t port) {return 0;} // Send data (UDP/IP RAW)
uint16_t recvfrom(SOCKET s, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t *port) {return 0;} // Receive data (UDP/IP RAW)
uint16_t igmpsend(SOCKET s, const uint8_t * buf, uint16_t len) {return 0;}

View File

@ -22,6 +22,8 @@
#define WL_NETWORKS_LIST_MAXNUM 10
// Maxmium number of socket
#define MAX_SOCK_NUM 4
// Socket not available constant
#define SOCK_NOT_AVAIL 255
// Default state value for Wifi state field
#define NA_STATE -1
//Maximum number of attempts to establish wifi connection