From fe71239fc0d1e65e06ba9dcf2fb35239bff21466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C5=ABnas=20Ma=C5=BEeikis?= Date: Tue, 21 May 2019 20:01:08 +0300 Subject: Protocol: moved udp code out of main. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An effor was made to increase modularity of device code. It was a partial success. IP adress, communications port, and wifi login details had to be made static and visible in main. Time is scarce and I am not about to push this further. Signed-off-by: Ramūnas Mažeikis --- include/udp.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 include/udp.h (limited to 'include/udp.h') diff --git a/include/udp.h b/include/udp.h new file mode 100755 index 0000000..358e585 --- /dev/null +++ b/include/udp.h @@ -0,0 +1,16 @@ +#ifndef DEVICE_UDP_H +#define DEVICE_UDP_H + +#include +#include + +static const int com_port = 6996; +IPAddress ip; /* Daemon IP */ +WiFiUDP Udp; + +extern void discover_client(const int port); +extern void udp_init_packet(IPAddress ip, const int port); +extern void udp_push(const void * const data, const size_t size); +extern int udp_flush(void); + +#endif /* DEVICE_UDP_H */ \ No newline at end of file -- cgit v1.2.3