espconn_tcp.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef __ESPCONN_TCP_H__
  2. #define __ESPCONN_TCP_H__
  3. #ifndef ESPCONN_TCP_DEBUG
  4. #define ESPCONN_TCP_DEBUG LWIP_DBG_OFF
  5. #endif
  6. #include "lwip/app/espconn.h"
  7. #ifndef ESPCONN_TCP_TIMER
  8. #define ESPCONN_TCP_TIMER 40
  9. #endif
  10. #define espconn_keepalive_enable(pcb) ((pcb)->so_options |= SOF_KEEPALIVE)
  11. #define espconn_keepalive_disable(pcb) ((pcb)->so_options &= ~SOF_KEEPALIVE)
  12. /******************************************************************************
  13. * FunctionName : espconn_kill_oldest_pcb
  14. * Description : A oldest incoming connection has been killed.
  15. * Parameters : none
  16. * Returns : none
  17. *******************************************************************************/
  18. extern void espconn_kill_oldest_pcb(void);
  19. /******************************************************************************
  20. * FunctionName : espconn_tcp_disconnect
  21. * Description : A new incoming connection has been disconnected.
  22. * Parameters : espconn -- the espconn used to disconnect with host
  23. * Returns : none
  24. *******************************************************************************/
  25. extern void espconn_tcp_disconnect(espconn_msg *pdiscon,u8 type);
  26. /******************************************************************************
  27. * FunctionName : espconn_tcp_client
  28. * Description : Initialize the client: set up a connect PCB and bind it to
  29. * the defined port
  30. * Parameters : espconn -- the espconn used to build client
  31. * Returns : none
  32. *******************************************************************************/
  33. extern sint8 espconn_tcp_client(struct espconn* espconn);
  34. /******************************************************************************
  35. * FunctionName : espconn_tcp_server
  36. * Description : Initialize the server: set up a listening PCB and bind it to
  37. * the defined port
  38. * Parameters : espconn -- the espconn used to build server
  39. * Returns : none
  40. *******************************************************************************/
  41. extern sint8 espconn_tcp_server(struct espconn *espconn);
  42. #endif /* __CLIENT_TCP_H__ */