summaryrefslogtreecommitdiffstats
path: root/polycom_xmit/msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'polycom_xmit/msg.c')
-rw-r--r--polycom_xmit/msg.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/polycom_xmit/msg.c b/polycom_xmit/msg.c
new file mode 100644
index 0000000..92931e4
--- /dev/null
+++ b/polycom_xmit/msg.c
@@ -0,0 +1,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);
+}