blob: 92931e421caabac1a3c638d80d2499a4fd7ed426 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#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);
}
|