mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
Removed unused "socket.h" interface from WiFi library.
(that was probably an heritage from Ethernet lib)
This commit is contained in:
@ -1,7 +1,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#include "utility/wl_definitions.h"
|
#include "utility/wl_definitions.h"
|
||||||
#include "utility/wl_types.h"
|
#include "utility/wl_types.h"
|
||||||
#include "utility/socket.h"
|
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "utility/debug.h"
|
#include "utility/debug.h"
|
||||||
}
|
}
|
||||||
|
@ -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_ */
|
|
@ -1,7 +1,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#include "utility/wl_definitions.h"
|
#include "utility/wl_definitions.h"
|
||||||
#include "utility/wl_types.h"
|
#include "utility/wl_types.h"
|
||||||
#include "utility/socket.h"
|
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "utility/debug.h"
|
#include "utility/debug.h"
|
||||||
}
|
}
|
||||||
|
@ -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_ */
|
|
@ -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;}
|
|
@ -22,6 +22,8 @@
|
|||||||
#define WL_NETWORKS_LIST_MAXNUM 10
|
#define WL_NETWORKS_LIST_MAXNUM 10
|
||||||
// Maxmium number of socket
|
// Maxmium number of socket
|
||||||
#define MAX_SOCK_NUM 4
|
#define MAX_SOCK_NUM 4
|
||||||
|
// Socket not available constant
|
||||||
|
#define SOCK_NOT_AVAIL 255
|
||||||
// Default state value for Wifi state field
|
// Default state value for Wifi state field
|
||||||
#define NA_STATE -1
|
#define NA_STATE -1
|
||||||
//Maximum number of attempts to establish wifi connection
|
//Maximum number of attempts to establish wifi connection
|
||||||
|
Reference in New Issue
Block a user