diff --git a/esp32_marauder/CommandLine.h b/esp32_marauder/CommandLine.h index 0e0159dfd..1f32f8fb7 100644 --- a/esp32_marauder/CommandLine.h +++ b/esp32_marauder/CommandLine.h @@ -97,7 +97,7 @@ const char PROGMEM HELP_SETTINGS_CMD[] = "settings [-s enable/disable> const char PROGMEM HELP_LS_CMD[] = "ls "; const char PROGMEM HELP_LED_CMD[] = "led -s /-p "; const char PROGMEM HELP_GPS_DATA_CMD[] = "gpsdata"; -const char PROGMEM HELP_GPS_CMD[] = "gps [-g] "; +const char PROGMEM HELP_GPS_CMD[] = "gps [-g] [-n] "; const char PROGMEM HELP_NMEA_CMD[] = "nmea"; // WiFi sniff/scan diff --git a/esp32_marauder/GpsInterface.h b/esp32_marauder/GpsInterface.h index af3c5d9a1..bb6a636ea 100644 --- a/esp32_marauder/GpsInterface.h +++ b/esp32_marauder/GpsInterface.h @@ -3,6 +3,7 @@ #include #include +#include #include "configs.h" diff --git a/esp32_marauder/MenuFunctions.cpp b/esp32_marauder/MenuFunctions.cpp index 6569c2fd6..391023adf 100644 --- a/esp32_marauder/MenuFunctions.cpp +++ b/esp32_marauder/MenuFunctions.cpp @@ -500,7 +500,8 @@ void MenuFunctions::main(uint32_t currentTime) (wifi_scan_obj.currentScanMode == OTA_UPDATE) || (wifi_scan_obj.currentScanMode == ESP_UPDATE) || (wifi_scan_obj.currentScanMode == SHOW_INFO) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_GPS_DATA)) { + (wifi_scan_obj.currentScanMode == WIFI_SCAN_GPS_DATA) || + (wifi_scan_obj.currentScanMode == WIFI_SCAN_GPS_NMEA)) { if (wifi_scan_obj.orient_display) { this->orientDisplay(); wifi_scan_obj.orient_display = false; @@ -558,7 +559,8 @@ void MenuFunctions::main(uint32_t currentTime) (wifi_scan_obj.currentScanMode != OTA_UPDATE) && (wifi_scan_obj.currentScanMode != ESP_UPDATE) && (wifi_scan_obj.currentScanMode != SHOW_INFO) && - (wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_DATA)) + (wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_DATA) && + (wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_NMEA)) { // Stop the current scan if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_PROBE) || @@ -618,7 +620,8 @@ void MenuFunctions::main(uint32_t currentTime) (wifi_scan_obj.currentScanMode != OTA_UPDATE) && (wifi_scan_obj.currentScanMode != ESP_UPDATE) && (wifi_scan_obj.currentScanMode != SHOW_INFO) && - (wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_DATA)) + (wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_DATA) && + (wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_NMEA)) { // Stop the current scan if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_PROBE) || @@ -1668,6 +1671,12 @@ void MenuFunctions::RunSetup() wifi_scan_obj.StartScan(WIFI_SCAN_GPS_DATA, TFT_CYAN); }); + this->addNodes(&deviceMenu, "NMEA Stream", TFT_ORANGE, NULL, GPS_MENU, [this]() { + wifi_scan_obj.currentScanMode = WIFI_SCAN_GPS_NMEA; + this->changeMenu(&gpsInfoMenu); + wifi_scan_obj.StartScan(WIFI_SCAN_GPS_NMEA, TFT_ORANGE); + }); + // GPS Info Menu gpsInfoMenu.parentMenu = &deviceMenu; this->addNodes(&gpsInfoMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() { diff --git a/esp32_marauder/WiFiScan.cpp b/esp32_marauder/WiFiScan.cpp index 66870c855..dbaf17c66 100644 --- a/esp32_marauder/WiFiScan.cpp +++ b/esp32_marauder/WiFiScan.cpp @@ -1188,6 +1188,22 @@ void WiFiScan::RunGPSNmea() { if(nmea_sentence != "" && nmea_sentence != old_nmea_sentence){ old_nmea_sentence=nmea_sentence; Serial.println(nmea_sentence); + #ifdef HAS_SCREEN + // Get screen position ready + display_obj.tft.setTextWrap(true); + display_obj.tft.setFreeFont(NULL); + display_obj.tft.setCursor(0, SCREEN_HEIGHT / 3); + display_obj.tft.setTextSize(1); + display_obj.tft.setTextColor(TFT_CYAN); + + // Clean up screen first + display_obj.tft.fillRect(0, (SCREEN_HEIGHT / 3) - 6, SCREEN_WIDTH, SCREEN_HEIGHT - ((SCREEN_HEIGHT / 3) - 6), TFT_BLACK); + + display_obj.tft.setCursor(0, SCREEN_HEIGHT / 3); + + display_obj.tft.print(nmea_sentence); + display_obj.tft.setTextWrap(false); + #endif } }