Skip to content

Commit

Permalink
Revert "Cherry pick pull request #2444 to 3.x.x (#2506)" (#2510)
Browse files Browse the repository at this point in the history
* Revert "Cherry pick pull request #2444 to 3.x.x (#2506)"

This reverts commit ace9269.

* Fix build because an update to an unmanaged dependency broke the build
  • Loading branch information
pkendall64 committed Dec 21, 2023
1 parent be164a9 commit 2d98919
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 260 deletions.
43 changes: 0 additions & 43 deletions src/lib/WIFI/devWIFI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@
#include "WebContent.h"

#include "config.h"

#if defined(TARGET_TX)

#include "wifiJoystick.h"

extern TxConfig config;
extern void setButtonColors(uint8_t b1, uint8_t b2);
#else
Expand Down Expand Up @@ -654,10 +650,6 @@ static void WebUploadResponseHandler(AsyncWebServerRequest *request) {
static void WebUploadDataHandler(AsyncWebServerRequest *request, const String& filename, size_t index, uint8_t *data, size_t len, bool final) {
force_update = force_update || request->hasArg("force");
if (index == 0) {
#ifdef HAS_WIFI_JOYSTICK
WifiJoystick::StopJoystickService();
#endif

size_t filesize = request->header("X-FileSize").toInt();
DBGLN("Update: '%s' size %u", filename.c_str(), filesize);
#if defined(PLATFORM_ESP8266)
Expand Down Expand Up @@ -723,24 +715,6 @@ static void WebUploadForceUpdateHandler(AsyncWebServerRequest *request) {
}
}

#ifdef HAS_WIFI_JOYSTICK
static void WebUdpControl(AsyncWebServerRequest *request)
{
const String &action = request->arg("action");
if (action.equals("joystick_begin"))
{
WifiJoystick::StartSending(request->client()->remoteIP(),
request->arg("interval").toInt(), request->arg("channels").toInt());
request->send(200, "text/plain", "ok");
}
else if (action.equals("joystick_end"))
{
WifiJoystick::StopSending();
request->send(200, "text/plain", "ok");
}
}
#endif

static size_t firmwareOffset = 0;
static size_t getFirmwareChunk(uint8_t *data, size_t len, size_t pos)
{
Expand Down Expand Up @@ -938,12 +912,6 @@ static void startMDNS()
MDNS.addServiceTxt("http", "tcp", "type", "rx");
#endif
#endif

#ifdef HAS_WIFI_JOYSTICK
MDNS.addService("elrs", "udp", JOYSTICK_PORT);
MDNS.addServiceTxt("elrs", "udp", "device", (const char *)device_name);
MDNS.addServiceTxt("elrs", "udp", "version", String(JOYSTICK_VERSION).c_str());
#endif
}

static void startServices()
Expand Down Expand Up @@ -999,9 +967,6 @@ static void startServices()
server.on("/options.json", HTTP_GET, getFile);
server.on("/reboot", HandleReboot);
server.on("/reset", HandleReset);
#ifdef HAS_WIFI_JOYSTICK
server.on("/udpcontrol", HTTP_POST, WebUdpControl);
#endif

server.addHandler(new AsyncCallbackJsonWebHandler("/config", UpdateConfiguration));
server.addHandler(new AsyncCallbackJsonWebHandler("/options.json", UpdateSettings));
Expand All @@ -1019,10 +984,6 @@ static void startServices()

startMDNS();

#ifdef HAS_WIFI_JOYSTICK
WifiJoystick::StartJoystickService();
#endif

servicesStarted = true;
DBGLN("HTTPUpdateServer ready! Open http://%s.local in your browser", wifi_hostname);
#if defined(USE_MSP_WIFI) && defined(TARGET_RX)
Expand Down Expand Up @@ -1111,10 +1072,6 @@ static void HandleWebUpdate()
#if defined(PLATFORM_ESP8266)
MDNS.update();
#endif

#ifdef HAS_WIFI_JOYSTICK
WifiJoystick::Loop(now);
#endif
}
}

Expand Down
147 changes: 0 additions & 147 deletions src/lib/WIFI/wifiJoystick.cpp

This file was deleted.

70 changes: 0 additions & 70 deletions src/lib/WIFI/wifiJoystick.h

This file was deleted.

2 changes: 2 additions & 0 deletions src/targets/common.ini
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ build_src_filter = ${common_env_data.build_src_filter} -<ESP8266*.*> -<STM32*.*>
lib_deps =
makuna/NeoPixelBus @ 2.7.0
ottowinter/ESPAsyncWebServer-esphome @ 3.0.0
esphome/AsyncTCP-esphome @ 2.0.1 # use specific version - an update to this library breaks the build
lemmingdev/ESP32-BLE-Gamepad @ 0.5.2
h2zero/NimBLE-Arduino @ 1.4.1
bblanchon/ArduinoJson @ 6.19.4
Expand Down Expand Up @@ -84,6 +85,7 @@ build_src_filter = ${common_env_data.build_src_filter} -<ESP8266*.*> -<STM32*.*>
lib_deps =
makuna/NeoPixelBus @ 2.7.0
ottowinter/ESPAsyncWebServer-esphome @ 3.0.0
esphome/AsyncTCP-esphome @ 2.0.1 # use specific version - an update to this library breaks the build
bblanchon/ArduinoJson @ 6.19.4
roboticsbrno/ServoESP32 @ 1.0.3
dlloydev/ESP32 ESP32S2 AnalogWrite @ 3.0.3
Expand Down

0 comments on commit 2d98919

Please sign in to comment.