espconn_tcp.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #define espconn_manual_recv_disabled(espconn) (((espconn)->pcommon.espconn_opt & ESPCONN_MANUALRECV) != 0)
  13. #define espconn_manual_recv_enabled(espconn) (((espconn)->pcommon.espconn_opt & ESPCONN_MANUALRECV) == 0)
  14. /******************************************************************************
  15. * FunctionName : espconn_kill_oldest_pcb
  16. * Description : A oldest incoming connection has been killed.
  17. * Parameters : none
  18. * Returns : none
  19. *******************************************************************************/
  20. extern void espconn_kill_oldest_pcb(void);
  21. /******************************************************************************
  22. * FunctionName : espconn_tcp_disconnect
  23. * Description : A new incoming connection has been disconnected.
  24. * Parameters : espconn -- the espconn used to disconnect with host
  25. * Returns : none
  26. *******************************************************************************/
  27. extern void espconn_tcp_disconnect(espconn_msg *pdiscon,u8 type);
  28. /******************************************************************************
  29. * FunctionName : espconn_tcp_client
  30. * Description : Initialize the client: set up a connect PCB and bind it to
  31. * the defined port
  32. * Parameters : espconn -- the espconn used to build client
  33. * Returns : none
  34. *******************************************************************************/
  35. extern sint8 espconn_tcp_client(struct espconn* espconn);
  36. /******************************************************************************
  37. * FunctionName : espconn_tcp_server
  38. * Description : Initialize the server: set up a listening PCB and bind it to
  39. * the defined port
  40. * Parameters : espconn -- the espconn used to build server
  41. * Returns : none
  42. *******************************************************************************/
  43. extern sint8 espconn_tcp_server(struct espconn *espconn);
  44. #endif /* __CLIENT_TCP_H__ */