#include "project.h" static struct espconn udp; void ICACHE_FLASH_ATTR msg_send (uint32_t v) { char buf[32]; size_t len; len = os_sprintf (buf, "%x\r\n", v); udp.proto.udp->remote_port = 29153; udp.proto.udp->remote_ip[0] = 255; udp.proto.udp->remote_ip[1] = 255; udp.proto.udp->remote_ip[2] = 255; udp.proto.udp->remote_ip[3] = 255; espconn_sent (&udp, buf, len); } void ICACHE_FLASH_ATTR msg_init (void) { udp.type = ESPCONN_UDP; udp.proto.udp = (esp_udp *) os_zalloc (sizeof (esp_udp)); udp.proto.udp->local_port = 29153; espconn_create (&udp); }