diff --git a/src/comm.cpp b/src/comm.cpp index 2c34b27..249ba9b 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -30,13 +30,16 @@ void CommunicationsController::init() { byte CommunicationsController::process(float *azimuth, float *altitude) { ArduinoOTA.handle(); - create_connection(); + + l4s = l4sServer.accept(); if (l4s) { while (l4s.connected()) { ArduinoOTA.handle(); - handle_client(); + l4s.flush(); + received = recv(); + byte resp = parseLook4Sat(azimuth, altitude); if (resp == 1) { @@ -48,11 +51,6 @@ byte CommunicationsController::process(float *azimuth, float *altitude) { return 0; } -void CommunicationsController::handleClient() { - l4s.flush(); - received = recv(); -} - byte CommunicationsController::parseLook4Sat(float* azimuth, float* altitude) { String tmp = received.substring(9); int spaceIndex = tmp.indexOf(' '); @@ -67,10 +65,6 @@ byte CommunicationsController::parseLook4Sat(float* azimuth, float* altitude) { return 0; } -void CommunicationsController::createConnection() { - l4s = l4sServer.accept(); -} - String CommunicationsController::recv() { String rec = ""; diff --git a/src/comm.h b/src/comm.h index 8cf81f3..cc30fa0 100644 --- a/src/comm.h +++ b/src/comm.h @@ -19,8 +19,6 @@ class CommunicationsController { String recv(); void initOta(); void initWifi(); - void handleClient(); - void createConnection(); public: void init();