espconn_udp.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef __ESPCONN_UDP_H__
  2. #define __ESPCONN_UDP_H__
  3. #ifndef ESPCONN_UDP_DEBUG
  4. #define ESPCONN_UDP_DEBUG LWIP_DBG_OFF
  5. #endif
  6. #include "lwip/app/espconn.h"
  7. /******************************************************************************
  8. * FunctionName : espconn_udp_client
  9. * Description : Initialize the client: set up a PCB and bind it to the port
  10. * Parameters : pespconn -- the espconn used to build client
  11. * Returns : none
  12. *******************************************************************************/
  13. extern sint8 espconn_udp_client(struct espconn *pespconn);
  14. /******************************************************************************
  15. * FunctionName : espconn_udp_disconnect
  16. * Description : A new incoming connection has been disconnected.
  17. * Parameters : espconn -- the espconn used to disconnect with host
  18. * Returns : none
  19. *******************************************************************************/
  20. extern void espconn_udp_disconnect(espconn_msg *pdiscon);
  21. /******************************************************************************
  22. * FunctionName : espconn_udp_server
  23. * Description : Initialize the server: set up a PCB and bind it to the port
  24. * Parameters : pespconn -- the espconn used to build server
  25. * Returns : none
  26. *******************************************************************************/
  27. extern sint8 espconn_udp_server(struct espconn *espconn);
  28. /******************************************************************************
  29. * FunctionName : espconn_udp_sent
  30. * Description : sent data for client or server
  31. * Parameters : void *arg -- client or server to send
  32. * uint8* psent -- Data to send
  33. * uint16 length -- Length of data to send
  34. * Returns : none
  35. *******************************************************************************/
  36. extern err_t espconn_udp_sent(void *arg, uint8 *psent, uint16 length);
  37. /******************************************************************************
  38. * FunctionName : espconn_udp_sendto
  39. * Description : sent data for UDP
  40. * Parameters : void *arg -- UDP to send
  41. * uint8* psent -- Data to send
  42. * uint16 length -- Length of data to send
  43. * Returns : return espconn error code.
  44. * - ESPCONN_OK. Successful. No error occured.
  45. * - ESPCONN_MEM. Out of memory.
  46. * - ESPCONN_RTE. Could not find route to destination address.
  47. * - More errors could be returned by lower protocol layers.
  48. *******************************************************************************/
  49. extern err_t espconn_udp_sendto(void *arg, uint8 *psent, uint16 length);
  50. #endif /* __ESPCONN_UDP_H__ */