mirror of
https://github.com/okalachev/flix.git
synced 2025-07-29 12:28:59 +00:00
Make sending udp packets much faster
Turns out parsing IP address string is very slow
This commit is contained in:
parent
e6e4db0c4f
commit
a93e046117
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
#define WIFI_SSID "flix"
|
#define WIFI_SSID "flix"
|
||||||
#define WIFI_PASSWORD "flixwifi"
|
#define WIFI_PASSWORD "flixwifi"
|
||||||
#define WIFI_UDP_IP "255.255.255.255"
|
|
||||||
#define WIFI_UDP_PORT 14550
|
#define WIFI_UDP_PORT 14550
|
||||||
|
|
||||||
WiFiUDP udp;
|
WiFiUDP udp;
|
||||||
@ -23,7 +22,7 @@ void setupWiFi() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void sendWiFi(const uint8_t *buf, int len) {
|
void sendWiFi(const uint8_t *buf, int len) {
|
||||||
udp.beginPacket(WIFI_UDP_IP, WIFI_UDP_PORT);
|
udp.beginPacket(WiFi.softAPBroadcastIP(), WIFI_UDP_PORT);
|
||||||
udp.write(buf, len);
|
udp.write(buf, len);
|
||||||
udp.endPacket();
|
udp.endPacket();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user