34 typedef void *espconn_handle;
88 #define ESPCONN_MEM -1
89 #define ESPCONN_TIMEOUT -3
90 #define ESPCONN_RTE -4
91 #define ESPCONN_INPROGRESS -5
92 #define ESPCONN_MAXNUM -7
94 #define ESPCONN_ABRT -8
95 #define ESPCONN_RST -9
96 #define ESPCONN_CLSD -10
97 #define ESPCONN_CONN -11
99 #define ESPCONN_ARG -12
100 #define ESPCONN_IF -14
101 #define ESPCONN_ISCONN -15
147 typedef void (* espconn_sent_callback)(
void *arg);
void(* espconn_recv_callback)(void *arg, char *pdata, unsigned short len)
Definition: espconn.h:146
sint8 espconn_regist_sentcb(struct espconn *espconn, espconn_sent_callback sent_cb)
Register data sent callback which will be called back when data are successfully sent.
void(* espconn_connect_callback)(void *arg)
Connect callback.
Definition: espconn.h:59
Definition: espconn.h:106
espconn_connect_callback connect_callback
Definition: espconn.h:126
Definition: espconn.h:132
sint8 espconn_tcp_set_max_con(uint8 num)
Set the maximum number of how many TCP connection is allowed.
sint8 espconn_recv_unhold(struct espconn *pespconn)
Unblock TCP receiving data (i.e. undo espconn_recv_hold).
void espconn_dns_setserver(char numdns, ip_addr_t *dnsserver)
Set default DNS server. Two DNS server is allowed to be set.
sint8 espconn_create(struct espconn *espconn)
Create UDP transmission.
int local_port
Definition: espconn.h:134
sint8 espconn_regist_recvcb(struct espconn *espconn, espconn_recv_callback recv_cb)
register data receive function which will be called back when data are received.
sint8 espconn_disconnect(struct espconn *espconn)
Disconnect a TCP connection.
Definition: espconn.h:175
sint8 espconn_tcp_get_max_con_allow(struct espconn *espconn)
Get the maximum number of TCP clients which are allowed to connect to ESP8266 TCP server...
sint8 espconn_igmp_join(ip_addr_t *host_ip, ip_addr_t *multicast_ip)
Join a multicast group.
sint8 espconn_regist_disconcb(struct espconn *espconn, espconn_connect_callback discon_cb)
Register disconnection function which will be called back under successful TCP disconnection.
Definition: espconn.h:173
Definition: espconn.h:116
sint8 espconn_regist_reconcb(struct espconn *espconn, espconn_reconnect_callback recon_cb)
Register reconnect callback.
espconn_sent_callback sent_callback
Definition: espconn.h:158
uint8 local_ip[4]
Definition: espconn.h:124
Definition: espconn.h:118
Definition: espconn.h:139
void * reserve
Definition: espconn.h:160
sint16 espconn_sendto(struct espconn *espconn, uint8 *psent, uint16 length)
Send UDP data.
Definition: espconn.h:107
int remote_port
Definition: espconn.h:141
enum espconn_type type
Definition: espconn.h:151
Definition: espconn.h:165
Definition: espconn.h:164
void(* espconn_reconnect_callback)(void *arg, sint8 err)
Reconnect callback.
Definition: espconn.h:83
sint8 espconn_regist_connectcb(struct espconn *espconn, espconn_connect_callback connect_cb)
Register connection function which will be called back under successful TCP connection.
sint8 espconn_send(struct espconn *espconn, uint8 *psent, uint16 length)
Send data through network.
Definition: espconn.h:168
espconn_reconnect_callback reconnect_callback
Definition: espconn.h:127
espconn_option
Definition: espconn.h:163
Definition: espconn.h:114
sint8 espconn_set_opt(struct espconn *espconn, uint8 opt)
Set option of TCP connection.
Definition: espconn.h:169
espconn_type
Definition: espconn.h:104
espconn_recv_callback recv_callback
Definition: espconn.h:157
Definition: espconn.h:121
espconn_connect_callback write_finish_fn
Definition: espconn.h:129
sint8 espconn_accept(struct espconn *espconn)
Creates a TCP server (i.e. accepts connections).
uint8 remote_ip[4]
Definition: espconn.h:142
Definition: espconn.h:105
sint8 espconn_regist_write_finish(struct espconn *espconn, espconn_connect_callback write_finish_fn)
Register a callback which will be called when all sending TCP data is completely write into write-buf...
void(* dns_found_callback)(const char *name, ip_addr_t *ipaddr, void *callback_arg)
Callback which is invoked when a hostname is found.
Definition: espconn.h:606
Definition: espconn.h:174
Definition: espconn.h:115
Definition: espconn.h:112
uint8 remote_ip[4]
Definition: espconn.h:136
sint8 espconn_sent(struct espconn *espconn, uint8 *psent, uint16 length)
Send data through network.
sint8 espconn_regist_time(struct espconn *espconn, uint32 interval, uint8 type_flag)
Register timeout interval of ESP8266 TCP server.
int remote_port
Definition: espconn.h:133
Definition: espconn.h:113
uint8 remote_ip[4]
Definition: espconn.h:125
sint8 espconn_get_keepalive(struct espconn *espconn, uint8 level, void *optarg)
Get configuration of TCP keep alive.
enum espconn_state state
Definition: espconn.h:152
Definition: espconn.h:166
Definition: espconn.h:150
espconn_connect_callback disconnect_callback
Definition: espconn.h:128
sint8 espconn_connect(struct espconn *espconn)
Connect to a TCP server (ESP8266 acting as TCP client).
uint8 espconn_tcp_get_max_con(void)
Get maximum number of how many TCP connections are allowed.
Definition: espconn.h:167
uint8 local_ip[4]
Definition: espconn.h:135
int local_port
Definition: espconn.h:123
Definition: espconn.h:117
sint8 espconn_igmp_leave(ip_addr_t *host_ip, ip_addr_t *multicast_ip)
Leave a multicast group.
uint32 espconn_port(void)
Get an available port for network.
int remote_port
Definition: espconn.h:122
sint8 espconn_clear_opt(struct espconn *espconn, uint8 opt)
Clear option of TCP connection.
void espconn_init(void)
espconn initialization.
sint8 espconn_set_keepalive(struct espconn *espconn, uint8 level, void *optarg)
Set configuration of TCP keep alive.
espconn_state
Definition: espconn.h:111
uint8 link_cnt
Definition: espconn.h:159
sint8 espconn_get_connection_info(struct espconn *pespconn, remot_info **pcon_info, uint8 typeflags)
Get the information about a TCP connection or UDP transmission.
sint8 espconn_recv_hold(struct espconn *pespconn)
Puts in a request to block the TCP receive function.
sint8 espconn_tcp_set_max_con_allow(struct espconn *espconn, uint8 num)
Set the maximum number of TCP clients allowed to connect to ESP8266 TCP server.
espconn_level
Definition: espconn.h:172
sint8 espconn_delete(struct espconn *espconn)
Delete a transmission.
err_t espconn_gethostbyname(struct espconn *pespconn, const char *hostname, ip_addr_t *addr, dns_found_callback found)
DNS function.
enum espconn_state state
Definition: espconn.h:140