mirror of
https://github.com/okalachev/flix.git
synced 2025-07-27 09:39:33 +00:00
Send mavlink udp packets in unicast after connected
Tests and research show this is more efficient way of sending telemetry
This commit is contained in:
parent
b143c2f1b3
commit
31d6636754
@ -19,11 +19,12 @@ void setupWiFi() {
|
|||||||
print("Setup Wi-Fi\n");
|
print("Setup Wi-Fi\n");
|
||||||
WiFi.softAP(WIFI_SSID, WIFI_PASSWORD);
|
WiFi.softAP(WIFI_SSID, WIFI_PASSWORD);
|
||||||
udp.begin(WIFI_UDP_PORT);
|
udp.begin(WIFI_UDP_PORT);
|
||||||
|
udp.beginPacket("255.255.255.255", WIFI_UDP_PORT); // broadcast packets until connected
|
||||||
}
|
}
|
||||||
|
|
||||||
void sendWiFi(const uint8_t *buf, int len) {
|
void sendWiFi(const uint8_t *buf, int len) {
|
||||||
if (WiFi.softAPIP() == IPAddress(0, 0, 0, 0) && WiFi.status() != WL_CONNECTED) return;
|
if (WiFi.softAPIP() == IPAddress(0, 0, 0, 0) && WiFi.status() != WL_CONNECTED) return;
|
||||||
udp.beginPacket(WiFi.softAPBroadcastIP(), WIFI_UDP_PORT);
|
udp.beginPacket();
|
||||||
udp.write(buf, len);
|
udp.write(buf, len);
|
||||||
udp.endPacket();
|
udp.endPacket();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user