MeterLogger
|
#include "lwip/netif.h"
#include "lwip/inet.h"
#include "netif/etharp.h"
#include "lwip/tcp.h"
#include "lwip/ip.h"
#include "lwip/init.h"
#include "lwip/tcp_impl.h"
#include "lwip/memp.h"
#include "ets_sys.h"
#include "os_type.h"
#include "lwip/mem.h"
#include "lwip/app/espconn_tcp.h"
Go to the source code of this file.
Variables | |
espconn_msg * | plink_active |
espconn_msg * | pserver_list |
struct espconn_packet | pktinfo [2] |
struct tcp_pcb **const | tcp_pcb_lists [] |
os_event_t | espconn_TaskQueue [espconn_TaskQueueLen] |
|
static |
Definition at line 520 of file espconn_tcp.c.
References ERR_OK, espconn_client_recv(), ESPCONN_CLOSE, espconn_TaskPrio, ICACHE_FLASH_ATTR, NULL, _comon_pkt::pcb, _espconn_msg::pcommon, _espconn_msg::pespconn, SIG_ESPCONN_CLOSE, and espconn::state.
Referenced by espconn_client_recv(), and espconn_tcp_disconnect().
|
static |
Definition at line 826 of file espconn_tcp.c.
References _comon_pkt::err, ERR_OK, espconn_client_recv(), espconn_client_sent(), ESPCONN_CONNECT, espconn_keepalive_disabled, espconn_keepalive_enable, espconn_printf, espconn_tcp_set_buf_count(), ICACHE_FLASH_ATTR, ip4_addr1_16, ip4_addr2_16, ip4_addr3_16, ip4_addr4_16, _comon_pkt::local_ip, _comon_pkt::local_port, lwip_strerr, NULL, os_printf, _comon_pkt::pcb, _espconn_msg::pcommon, _espconn_msg::pespconn, _comon_pkt::remote_ip, _comon_pkt::remote_port, espconn::state, and _comon_pkt::write_flag.
Referenced by espconn_tcp_client().
|
static |
Definition at line 761 of file espconn_tcp.c.
References _comon_pkt::err, ERR_ABRT, ESPCONN_CLOSE, ESPCONN_CLSD, ESPCONN_CONN, espconn_printf, espconn_TaskPrio, ESPCONN_TIMEOUT, ICACHE_FLASH_ATTR, LWIP_UNUSED_ARG, NULL, _comon_pkt::pcb, _espconn_msg::pcommon, _espconn_msg::pespconn, SIG_ESPCONN_ERRER, espconn::state, TCP_MAXRTX, and TCP_SYNMAXRTX.
Referenced by espconn_tcp_client().
|
static |
Definition at line 613 of file espconn_tcp.c.
References ERR_OK, espconn_client_close(), ESPCONN_CONNECT, ESPCONN_READ, NULL, os_free, os_zalloc, pbuf_copy_partial(), pbuf_free(), _comon_pkt::pcb, _espconn_msg::pcommon, _espconn_msg::pespconn, espconn::recv_callback, _espconn_msg::recv_hold_flag, _espconn_msg::recv_holded_buf_Len, espconn::state, and pbuf::tot_len.
Referenced by espconn_client_close(), and espconn_client_connect().
|
static |
Definition at line 738 of file espconn_tcp.c.
References ERR_OK, espconn_tcp_finish(), ICACHE_FLASH_ATTR, _comon_pkt::packet_info, _comon_pkt::pbuf, _comon_pkt::pcb, _espconn_msg::pcommon, espconn_packet::sent_length, and _espconn_buf::tot_len.
Referenced by espconn_client_connect().
struct tcp_pcb* ICACHE_FLASH_ATTR espconn_find_current_pcb | ( | espconn_msg * | pcurrent_msg | ) |
Definition at line 185 of file espconn_tcp.c.
References ICACHE_FLASH_ATTR, _comon_pkt::local_ip, _comon_pkt::local_port, NULL, _comon_pkt::pcb, _espconn_msg::pcommon, _comon_pkt::remote_ip, and _comon_pkt::remote_port.
Referenced by espconn_tcp_disconnect_successful().
void ICACHE_FLASH_ATTR espconn_init | ( | void | ) |
Definition at line 1379 of file espconn_tcp.c.
References espconn_Task(), espconn_TaskPrio, espconn_TaskQueue, and espconn_TaskQueueLen.
|
static |
Definition at line 56 of file espconn_tcp.c.
References memp_free(), and NULL.
Referenced by espconn_kill_oldest_pcb().
void ICACHE_FLASH_ATTR espconn_kill_oldest_pcb | ( | void | ) |
Definition at line 115 of file espconn_tcp.c.
References espconn_kill_oldest(), MEMP_NUM_TCP_PCB, NULL, and tcp_pcb_lists.
Referenced by espconn_tcp_disconnect_successful(), and espconn_tcp_reconnect().
void ICACHE_FLASH_ATTR espconn_kill_pcb | ( | u16_t | port | ) |
Definition at line 150 of file espconn_tcp.c.
References memp_free(), NULL, and tcp_pcb_lists.
Referenced by espconn_tcp_client(), and espconn_tcp_delete().
sint8 ICACHE_FLASH_ATTR espconn_recv_hold | ( | struct espconn * | pespconn | ) |
Definition at line 549 of file espconn_tcp.c.
References ESPCONN_ARG, espconn_find_connection(), ESPCONN_OK, ICACHE_FLASH_ATTR, NULL, os_printf, _espconn_msg::recv_hold_flag, and _espconn_msg::recv_holded_buf_Len.
sint8 ICACHE_FLASH_ATTR espconn_recv_unhold | ( | struct espconn * | pespconn | ) |
Definition at line 574 of file espconn_tcp.c.
References ESPCONN_ARG, espconn_find_connection(), ESPCONN_OK, ESPCONN_TCP, ICACHE_FLASH_ATTR, NULL, os_printf, _comon_pkt::pcb, _espconn_msg::pcommon, _espconn_msg::recv_hold_flag, _espconn_msg::recv_holded_buf_Len, and espconn::type.
|
static |
Definition at line 950 of file espconn_tcp.c.
References ERR_OK, ESPCONN_CLOSE, espconn_server_recv(), espconn_TaskPrio, ICACHE_FLASH_ATTR, NULL, _comon_pkt::pcb, _espconn_msg::pcommon, _espconn_msg::pespconn, SIG_ESPCONN_CLOSE, and espconn::state.
Referenced by espconn_server_poll(), espconn_server_recv(), and espconn_tcp_disconnect().
|
static |
Definition at line 1079 of file espconn_tcp.c.
References ERR_OK, espconn_printf, espconn_server_close(), ICACHE_FLASH_ATTR, NULL, _comon_pkt::pcb, _espconn_msg::pcommon, _espconn_msg::pespconn, _espconn_msg::pnext, _espconn_msg::preverse, pserver_list, _comon_pkt::recv_check, and _comon_pkt::timeout.
Referenced by espconn_tcp_accept().
|
static |
Definition at line 988 of file espconn_tcp.c.
References ERR_OK, ESPCONN_CONNECT, espconn_printf, ESPCONN_READ, espconn_server_close(), ICACHE_FLASH_ATTR, NULL, os_free, os_zalloc, pbuf_copy_partial(), pbuf_free(), _comon_pkt::pcb, _espconn_msg::pcommon, _espconn_msg::pespconn, espconn::recv_callback, _comon_pkt::recv_check, _espconn_msg::recv_hold_flag, _espconn_msg::recv_holded_buf_Len, espconn::state, system_get_free_heap_size(), and pbuf::tot_len.
Referenced by espconn_server_close(), and espconn_tcp_accept().
|
static |
Definition at line 1052 of file espconn_tcp.c.
References ERR_OK, espconn_tcp_finish(), ICACHE_FLASH_ATTR, _comon_pkt::packet_info, _comon_pkt::pbuf, _comon_pkt::pcb, _espconn_msg::pcommon, _comon_pkt::recv_check, espconn_packet::sent_length, and _espconn_buf::tot_len.
Referenced by espconn_tcp_accept().
|
static |
Definition at line 388 of file espconn_tcp.c.
References espconn_list_delete(), espconn_tcp_disconnect_successful(), espconn_tcp_reconnect(), ICACHE_FLASH_ATTR, NULL, _espconn_msg::pespconn, espconn::proto, SIG_ESPCONN_CLOSE, SIG_ESPCONN_ERRER, SIG_ESPCONN_WRITE, espconn::tcp, and _esp_tcp::write_finish_fn.
Referenced by espconn_init().
|
static |
Definition at line 1199 of file espconn_tcp.c.
References _esp_tcp::connect_callback, ERR_ARG, ERR_ISCONN, ERR_MEM, ERR_OK, ESPCONN_CONNECT, espconn_copy_partial(), espconn_get_connection_info(), espconn_keepalive_disabled, espconn_keepalive_enable, espconn_list_creat(), espconn_printf, espconn_server_poll(), espconn_server_recv(), espconn_server_sent(), espconn_tcp_get_max_con_allow(), espconn_tcp_set_buf_count(), esponn_server_err(), ICACHE_FLASH_ATTR, ip4_addr1_16, ip4_addr2_16, ip4_addr3_16, ip4_addr4_16, espconn::link_cnt, LWIP_UNUSED_ARG, NULL, os_memcpy, os_zalloc, _comon_pkt::pcb, _espconn_msg::pcommon, _espconn_msg::pespconn, _espconn_msg::preverse, espconn::proto, _esp_tcp::remote_ip, _comon_pkt::remote_ip, _esp_tcp::remote_port, _comon_pkt::remote_port, espconn::state, espconn::tcp, and _comon_pkt::write_flag.
Referenced by espconn_tcp_server().
sint8 ICACHE_FLASH_ATTR espconn_tcp_client | ( | struct espconn * | espconn | ) |
Definition at line 878 of file espconn_tcp.c.
References ERR_OK, ERR_RTE, ERR_USE, espconn_client_connect(), espconn_client_err(), espconn_kill_pcb(), espconn_list_creat(), espconn_list_delete(), ESPCONN_MEM, ESPCONN_RTE, ESPCONN_WAIT, ICACHE_FLASH_ATTR, IP4_ADDR, IP_ADDR_ANY, memp_free(), NULL, os_free, os_zalloc, espconn::proto, _esp_tcp::remote_ip, espconn::state, and espconn::tcp.
Referenced by espconn_connect().
sint8 ICACHE_FLASH_ATTR espconn_tcp_delete | ( | struct espconn * | pdeletecon | ) |
Definition at line 1335 of file espconn_tcp.c.
References ERR_OK, ESPCONN_ARG, espconn_get_connection_info(), ESPCONN_INPROGRESS, espconn_kill_pcb(), espconn_list_delete(), espconn_printf, espconn::link_cnt, NULL, os_free, os_printf, _espconn_msg::pespconn, _espconn_msg::pnext, _espconn_msg::preverse, and pserver_list.
Referenced by espconn_delete().
void ICACHE_FLASH_ATTR espconn_tcp_disconnect | ( | espconn_msg * | pdiscon, |
u8 | type | ||
) |
Definition at line 498 of file espconn_tcp.c.
References espconn_client_close(), espconn_printf, espconn_server_close(), ICACHE_FLASH_ATTR, NULL, _comon_pkt::pcb, _espconn_msg::pcommon, and _espconn_msg::preverse.
Referenced by espconn_abort(), and espconn_disconnect().
|
static |
Definition at line 287 of file espconn_tcp.c.
References _esp_tcp::disconnect_callback, _comon_pkt::err, espconn_copy_partial(), espconn_find_current_pcb(), espconn_kill_oldest_pcb(), espconn_pbuf_delete(), espconn_printf, espconn_reuse_disabled, ICACHE_FLASH_ATTR, _esp_tcp::local_ip, _esp_tcp::local_port, LWIP_ASSERT, memp_free(), NULL, os_bzero, os_free, os_memcpy, _comon_pkt::packet_info, _comon_pkt::pbuf, _espconn_msg::pcommon, _espconn_msg::pespconn, pktinfo, _espconn_buf::pnext, _espconn_msg::preverse, espconn::proto, _esp_tcp::remote_ip, _esp_tcp::remote_port, and espconn::tcp.
Referenced by espconn_Task().
|
static |
Definition at line 700 of file espconn_tcp.c.
References ESPCONN_CONNECT, espconn_pbuf_delete(), espconn_tcp_write(), ICACHE_FLASH_ATTR, _espconn_buf::len, NULL, os_free, _comon_pkt::packet_info, _comon_pkt::pbuf, _espconn_msg::pcommon, _espconn_msg::pespconn, espconn::sent_callback, espconn_packet::sent_length, espconn::state, and _espconn_buf::tot_len.
Referenced by espconn_client_sent(), and espconn_server_sent().
|
static |
Definition at line 229 of file espconn_tcp.c.
References _comon_pkt::err, espconn_copy_partial(), espconn_kill_oldest_pcb(), espconn_pbuf_delete(), espconn_printf, ICACHE_FLASH_ATTR, _esp_tcp::local_ip, _esp_tcp::local_port, NULL, os_bzero, os_free, os_memcpy, _comon_pkt::packet_info, _comon_pkt::pbuf, _espconn_msg::pcommon, _espconn_msg::pespconn, pktinfo, _espconn_buf::pnext, _espconn_msg::preverse, espconn::proto, _esp_tcp::reconnect_callback, _esp_tcp::remote_ip, _esp_tcp::remote_port, and espconn::tcp.
Referenced by espconn_Task().
err_t ICACHE_FLASH_ATTR espconn_tcp_sent | ( | void * | arg, |
uint8 * | psent, | ||
uint16 | length | ||
) |
Definition at line 434 of file espconn_tcp.c.
References ERR_MEM, ERR_OK, ESPCONN_ARG, espconn_copy_disabled, espconn_printf, espconn_TaskPrio, LWIP_ASSERT, NULL, _comon_pkt::pcb, _espconn_msg::pcommon, _comon_pkt::ptail, _espconn_buf::punsent, SIG_ESPCONN_WRITE, _espconn_buf::unsent, and _comon_pkt::write_flag.
Referenced by espconn_tcp_write().
sint8 ICACHE_FLASH_ATTR espconn_tcp_server | ( | struct espconn * | espconn | ) |
Definition at line 1281 of file espconn_tcp.c.
References _espconn_msg::count_opt, espconn_list_creat(), ESPCONN_LISTEN, ESPCONN_MEM, ESPCONN_OK, espconn_tcp_accept(), IP_ADDR_ANY, _esp_tcp::local_port, memp_free(), MEMP_NUM_TCP_PCB, NULL, os_free, os_zalloc, _espconn_msg::pcommon, _espconn_msg::pespconn, _espconn_msg::preverse, espconn::proto, espconn::state, espconn::tcp, and _comon_pkt::timeout.
Referenced by espconn_accept().
err_t ICACHE_FLASH_ATTR espconn_tcp_write | ( | void * | arg | ) |
Definition at line 667 of file espconn_tcp.c.
References ERR_OK, ESPCONN_MEM, espconn_tcp_sent(), NULL, _comon_pkt::pcb, _espconn_msg::pcommon, _espconn_buf::pnext, _comon_pkt::ptail, _espconn_buf::punsent, TCP_SND_QUEUELEN, and _espconn_buf::unsent.
Referenced by espconn_sent(), and espconn_tcp_finish().
|
static |
Definition at line 1132 of file espconn_tcp.c.
References _comon_pkt::err, ERR_ABRT, ESPCONN_CLOSE, ESPCONN_CLSD, ESPCONN_CONN, espconn_TaskPrio, ESPCONN_TIMEOUT, ICACHE_FLASH_ATTR, NULL, _comon_pkt::pcb, _espconn_msg::pcommon, _espconn_msg::pespconn, SIG_ESPCONN_ERRER, espconn::state, TCP_MAXRTX, and TCP_SYNMAXRTX.
Referenced by espconn_tcp_accept().
os_event_t espconn_TaskQueue[espconn_TaskQueueLen] |
Definition at line 36 of file espconn_tcp.c.
Referenced by espconn_init().
struct espconn_packet pktinfo[2] |
Definition at line 36 of file espconn.c.
Referenced by espconn_get_packet_info(), espconn_tcp_disconnect_successful(), and espconn_tcp_reconnect().
espconn_msg* plink_active |
espconn_msg* pserver_list |
Definition at line 33 of file espconn.c.
Referenced by espconn_regist_time(), espconn_server_poll(), espconn_tcp_delete(), espconn_tcp_get_max_con_allow(), and espconn_tcp_set_max_con_allow().
struct tcp_pcb** const tcp_pcb_lists[] |
Referenced by espconn_kill_oldest_pcb(), and espconn_kill_pcb().