summaryrefslogtreecommitdiff
path: root/core/network.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/network.c')
-rw-r--r--core/network.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/core/network.c b/core/network.c
index 89697e76..7e3b344a 100644
--- a/core/network.c
+++ b/core/network.c
@@ -92,21 +92,21 @@ static packet_handler_callback packethandlers[256] = {0};
92 92
93void networking_registerhandler(uint8_t byte, packet_handler_callback cb) 93void networking_registerhandler(uint8_t byte, packet_handler_callback cb)
94{ 94{
95 packethandlers[byte] = cb; 95 packethandlers[byte] = cb;
96} 96}
97 97
98void networking_poll() 98void networking_poll()
99{ 99{
100 IP_Port ip_port; 100 IP_Port ip_port;
101 uint8_t data[MAX_UDP_PACKET_SIZE]; 101 uint8_t data[MAX_UDP_PACKET_SIZE];
102 uint32_t length; 102 uint32_t length;
103 103
104 while (receivepacket(&ip_port, data, &length) != -1) 104 while (receivepacket(&ip_port, data, &length) != -1)
105 { 105 {
106 if (length < 1) continue; 106 if (length < 1) continue;
107 if (!packethandlers[data[0]]) continue; 107 if (!packethandlers[data[0]]) continue;
108 packethandlers[data[0]](ip_port, data, length); 108 packethandlers[data[0]](ip_port, data, length);
109 } 109 }
110} 110}
111 111
112/* initialize networking 112/* initialize networking