|
|
@ -30,13 +30,16 @@ void CommunicationsController::init() {
|
|
|
|
|
|
|
|
|
|
|
|
byte CommunicationsController::process(float *azimuth, float *altitude) {
|
|
|
|
byte CommunicationsController::process(float *azimuth, float *altitude) {
|
|
|
|
ArduinoOTA.handle();
|
|
|
|
ArduinoOTA.handle();
|
|
|
|
create_connection();
|
|
|
|
|
|
|
|
|
|
|
|
l4s = l4sServer.accept();
|
|
|
|
|
|
|
|
|
|
|
|
if (l4s) {
|
|
|
|
if (l4s) {
|
|
|
|
while (l4s.connected()) {
|
|
|
|
while (l4s.connected()) {
|
|
|
|
ArduinoOTA.handle();
|
|
|
|
ArduinoOTA.handle();
|
|
|
|
|
|
|
|
|
|
|
|
handle_client();
|
|
|
|
l4s.flush();
|
|
|
|
|
|
|
|
received = recv();
|
|
|
|
|
|
|
|
|
|
|
|
byte resp = parseLook4Sat(azimuth, altitude);
|
|
|
|
byte resp = parseLook4Sat(azimuth, altitude);
|
|
|
|
|
|
|
|
|
|
|
|
if (resp == 1) {
|
|
|
|
if (resp == 1) {
|
|
|
@ -48,11 +51,6 @@ byte CommunicationsController::process(float *azimuth, float *altitude) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CommunicationsController::handleClient() {
|
|
|
|
|
|
|
|
l4s.flush();
|
|
|
|
|
|
|
|
received = recv();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
byte CommunicationsController::parseLook4Sat(float* azimuth, float* altitude) {
|
|
|
|
byte CommunicationsController::parseLook4Sat(float* azimuth, float* altitude) {
|
|
|
|
String tmp = received.substring(9);
|
|
|
|
String tmp = received.substring(9);
|
|
|
|
int spaceIndex = tmp.indexOf(' ');
|
|
|
|
int spaceIndex = tmp.indexOf(' ');
|
|
|
@ -67,10 +65,6 @@ byte CommunicationsController::parseLook4Sat(float* azimuth, float* altitude) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CommunicationsController::createConnection() {
|
|
|
|
|
|
|
|
l4s = l4sServer.accept();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String CommunicationsController::recv() {
|
|
|
|
String CommunicationsController::recv() {
|
|
|
|
String rec = "";
|
|
|
|
String rec = "";
|
|
|
|
|
|
|
|
|
|
|
|