espconn_tcp.h 2.3 KB

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