mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-22 23:26:45 -08:00
fixup preprocessor directives
This commit is contained in:
@@ -270,13 +270,16 @@ void CommandLine::runCommand(String input) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
// ls command
|
// ls command
|
||||||
#ifdef HAS_SD
|
|
||||||
else if (cmd_args.get(0) == LS_CMD) {
|
else if (cmd_args.get(0) == LS_CMD) {
|
||||||
if (cmd_args.size() > 1)
|
#ifdef HAS_SD
|
||||||
sd_obj.listDir(cmd_args.get(1));
|
if (cmd_args.size() > 1)
|
||||||
else
|
sd_obj.listDir(cmd_args.get(1));
|
||||||
Serial.println("You did not provide a dir to list");
|
else
|
||||||
}
|
Serial.println("You did not provide a dir to list");
|
||||||
|
#else
|
||||||
|
Serial.println("SD support disabled, cannot use command");
|
||||||
|
return;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Channel command
|
// Channel command
|
||||||
@@ -666,16 +669,21 @@ void CommandLine::runCommand(String input) {
|
|||||||
}
|
}
|
||||||
// Update via SD
|
// Update via SD
|
||||||
else if (sd_sw != -1) {
|
else if (sd_sw != -1) {
|
||||||
#ifndef WRITE_PACKETS_SERIAL
|
#ifdef HAS_SD
|
||||||
if (!sd_obj.supported) {
|
#ifndef WRITE_PACKETS_SERIAL
|
||||||
Serial.println("SD card is not connected. Cannot perform SD Update");
|
if (!sd_obj.supported) {
|
||||||
return;
|
Serial.println("SD card is not connected. Cannot perform SD Update");
|
||||||
}
|
return;
|
||||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
}
|
||||||
sd_obj.runUpdate();
|
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||||
#else
|
sd_obj.runUpdate();
|
||||||
Serial.println("SD card not initialized. Cannot perform SD Update");
|
#else
|
||||||
#endif
|
Serial.println("SD card not initialized. Cannot perform SD Update");
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
Serial.println("SD card support disabled. Cannot perform SD Update");
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#ifdef HAS_SD
|
#include "SDInterface.h"
|
||||||
|
#include "lang_var.h"
|
||||||
|
|
||||||
#include "SDInterface.h"
|
bool SDInterface::initSD() {
|
||||||
#include "lang_var.h"
|
#ifdef HAS_SD
|
||||||
|
|
||||||
bool SDInterface::initSD() {
|
|
||||||
String display_string = "";
|
String display_string = "";
|
||||||
|
|
||||||
#ifdef KIT
|
#ifdef KIT
|
||||||
@@ -68,191 +67,194 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDInterface::listDir(String str_dir){
|
#else
|
||||||
if (this->supported) {
|
Serial.println("SD support disabled, skipping init");
|
||||||
File dir = SD.open(str_dir);
|
return false;
|
||||||
while (true)
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void SDInterface::listDir(String str_dir){
|
||||||
|
if (this->supported) {
|
||||||
|
File dir = SD.open(str_dir);
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
File entry = dir.openNextFile();
|
||||||
|
if (! entry)
|
||||||
{
|
{
|
||||||
File entry = dir.openNextFile();
|
break;
|
||||||
if (! entry)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
//for (uint8_t i = 0; i < numTabs; i++)
|
|
||||||
//{
|
|
||||||
// Serial.print('\t');
|
|
||||||
//}
|
|
||||||
Serial.print(entry.name());
|
|
||||||
Serial.print("\t");
|
|
||||||
Serial.println(entry.size());
|
|
||||||
entry.close();
|
|
||||||
}
|
}
|
||||||
|
//for (uint8_t i = 0; i < numTabs; i++)
|
||||||
|
//{
|
||||||
|
// Serial.print('\t');
|
||||||
|
//}
|
||||||
|
Serial.print(entry.name());
|
||||||
|
Serial.print("\t");
|
||||||
|
Serial.println(entry.size());
|
||||||
|
entry.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SDInterface::addPacket(uint8_t* buf, uint32_t len) {
|
void SDInterface::addPacket(uint8_t* buf, uint32_t len) {
|
||||||
if ((this->supported) && (this->do_save)) {
|
if ((this->supported) && (this->do_save)) {
|
||||||
buffer_obj.addPacket(buf, len);
|
buffer_obj.addPacket(buf, len);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SDInterface::openCapture(String file_name) {
|
void SDInterface::openCapture(String file_name) {
|
||||||
bool save_pcap = settings_obj.loadSetting<bool>("SavePCAP");
|
bool save_pcap = settings_obj.loadSetting<bool>("SavePCAP");
|
||||||
if ((this->supported) && (save_pcap)) {
|
if ((this->supported) && (save_pcap)) {
|
||||||
buffer_obj.createPcapFile(&SD, file_name);
|
buffer_obj.createPcapFile(&SD, file_name);
|
||||||
buffer_obj.open();
|
buffer_obj.open();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SDInterface::runUpdate() {
|
void SDInterface::runUpdate() {
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
display_obj.tft.setTextWrap(false);
|
display_obj.tft.setTextWrap(false);
|
||||||
display_obj.tft.setFreeFont(NULL);
|
display_obj.tft.setFreeFont(NULL);
|
||||||
display_obj.tft.setCursor(0, 100);
|
display_obj.tft.setCursor(0, 100);
|
||||||
display_obj.tft.setTextSize(1);
|
display_obj.tft.setTextSize(1);
|
||||||
display_obj.tft.setTextColor(TFT_WHITE);
|
display_obj.tft.setTextColor(TFT_WHITE);
|
||||||
|
|
||||||
display_obj.tft.println(F(text15));
|
display_obj.tft.println(F(text15));
|
||||||
#endif
|
#endif
|
||||||
File updateBin = SD.open("/update.bin");
|
File updateBin = SD.open("/update.bin");
|
||||||
if (updateBin) {
|
if (updateBin) {
|
||||||
if(updateBin.isDirectory()){
|
if(updateBin.isDirectory()){
|
||||||
#ifdef HAS_SCREEN
|
|
||||||
display_obj.tft.setTextColor(TFT_RED);
|
|
||||||
display_obj.tft.println(F(text_table2[0]));
|
|
||||||
#endif
|
|
||||||
Serial.println(F("Error, could not find \"update.bin\""));
|
|
||||||
#ifdef HAS_SCREEN
|
|
||||||
display_obj.tft.setTextColor(TFT_WHITE);
|
|
||||||
#endif
|
|
||||||
updateBin.close();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t updateSize = updateBin.size();
|
|
||||||
|
|
||||||
if (updateSize > 0) {
|
|
||||||
#ifdef HAS_SCREEN
|
|
||||||
display_obj.tft.println(F(text_table2[1]));
|
|
||||||
#endif
|
|
||||||
Serial.println(F("Starting update over SD. Please wait..."));
|
|
||||||
this->performUpdate(updateBin, updateSize);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
#ifdef HAS_SCREEN
|
|
||||||
display_obj.tft.setTextColor(TFT_RED);
|
|
||||||
display_obj.tft.println(F(text_table2[2]));
|
|
||||||
#endif
|
|
||||||
Serial.println(F("Error, file is empty"));
|
|
||||||
#ifdef HAS_SCREEN
|
|
||||||
display_obj.tft.setTextColor(TFT_WHITE);
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
updateBin.close();
|
|
||||||
|
|
||||||
// whe finished remove the binary from sd card to indicate end of the process
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
display_obj.tft.println(F(text_table2[3]));
|
display_obj.tft.setTextColor(TFT_RED);
|
||||||
|
display_obj.tft.println(F(text_table2[0]));
|
||||||
#endif
|
#endif
|
||||||
Serial.println(F("rebooting..."));
|
Serial.println(F("Error, could not find \"update.bin\""));
|
||||||
//SD.remove("/update.bin");
|
#ifdef HAS_SCREEN
|
||||||
delay(1000);
|
display_obj.tft.setTextColor(TFT_WHITE);
|
||||||
ESP.restart();
|
#endif
|
||||||
|
updateBin.close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t updateSize = updateBin.size();
|
||||||
|
|
||||||
|
if (updateSize > 0) {
|
||||||
|
#ifdef HAS_SCREEN
|
||||||
|
display_obj.tft.println(F(text_table2[1]));
|
||||||
|
#endif
|
||||||
|
Serial.println(F("Starting update over SD. Please wait..."));
|
||||||
|
this->performUpdate(updateBin, updateSize);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
display_obj.tft.setTextColor(TFT_RED);
|
display_obj.tft.setTextColor(TFT_RED);
|
||||||
display_obj.tft.println(F(text_table2[4]));
|
display_obj.tft.println(F(text_table2[2]));
|
||||||
#endif
|
#endif
|
||||||
Serial.println(F("Could not load update.bin from sd root"));
|
Serial.println(F("Error, file is empty"));
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
display_obj.tft.setTextColor(TFT_WHITE);
|
display_obj.tft.setTextColor(TFT_WHITE);
|
||||||
#endif
|
#endif
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void SDInterface::performUpdate(Stream &updateSource, size_t updateSize) {
|
updateBin.close();
|
||||||
if (Update.begin(updateSize)) {
|
|
||||||
#ifdef HAS_SCREEN
|
|
||||||
display_obj.tft.println(text_table2[5] + String(updateSize));
|
|
||||||
display_obj.tft.println(F(text_table2[6]));
|
|
||||||
#endif
|
|
||||||
size_t written = Update.writeStream(updateSource);
|
|
||||||
if (written == updateSize) {
|
|
||||||
#ifdef HAS_SCREEN
|
|
||||||
display_obj.tft.println(text_table2[7] + String(written) + text_table2[10]);
|
|
||||||
#endif
|
|
||||||
Serial.println("Written : " + String(written) + " successfully");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
#ifdef HAS_SCREEN
|
|
||||||
display_obj.tft.println(text_table2[8] + String(written) + "/" + String(updateSize) + text_table2[9]);
|
|
||||||
#endif
|
|
||||||
Serial.println("Written only : " + String(written) + "/" + String(updateSize) + ". Retry?");
|
|
||||||
}
|
|
||||||
if (Update.end()) {
|
|
||||||
Serial.println("OTA done!");
|
|
||||||
if (Update.isFinished()) {
|
|
||||||
#ifdef HAS_SCREEN
|
|
||||||
display_obj.tft.println(F(text_table2[11]));
|
|
||||||
#endif
|
|
||||||
Serial.println(F("Update successfully completed. Rebooting."));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
#ifdef HAS_SCREEN
|
|
||||||
display_obj.tft.setTextColor(TFT_RED);
|
|
||||||
display_obj.tft.println(text_table2[12]);
|
|
||||||
#endif
|
|
||||||
Serial.println("Update not finished? Something went wrong!");
|
|
||||||
#ifdef HAS_SCREEN
|
|
||||||
display_obj.tft.setTextColor(TFT_WHITE);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
#ifdef HAS_SCREEN
|
|
||||||
display_obj.tft.println(text_table2[13] + String(Update.getError()));
|
|
||||||
#endif
|
|
||||||
Serial.println("Error Occurred. Error #: " + String(Update.getError()));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
// whe finished remove the binary from sd card to indicate end of the process
|
||||||
else
|
#ifdef HAS_SCREEN
|
||||||
{
|
display_obj.tft.println(F(text_table2[3]));
|
||||||
#ifdef HAS_SCREEN
|
|
||||||
display_obj.tft.println(text_table2[14]);
|
|
||||||
#endif
|
|
||||||
Serial.println("Not enough space to begin OTA");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SDInterface::checkDetectPin() {
|
|
||||||
#ifdef KIT
|
|
||||||
if (digitalRead(SD_DET) == LOW)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
#endif
|
#endif
|
||||||
|
Serial.println(F("rebooting..."));
|
||||||
return false;
|
//SD.remove("/update.bin");
|
||||||
|
delay(1000);
|
||||||
|
ESP.restart();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
#ifdef HAS_SCREEN
|
||||||
|
display_obj.tft.setTextColor(TFT_RED);
|
||||||
|
display_obj.tft.println(F(text_table2[4]));
|
||||||
|
#endif
|
||||||
|
Serial.println(F("Could not load update.bin from sd root"));
|
||||||
|
#ifdef HAS_SCREEN
|
||||||
|
display_obj.tft.setTextColor(TFT_WHITE);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SDInterface::main() {
|
void SDInterface::performUpdate(Stream &updateSource, size_t updateSize) {
|
||||||
if ((this->supported) && (this->do_save)) {
|
if (Update.begin(updateSize)) {
|
||||||
//Serial.println("Saving packet...");
|
#ifdef HAS_SCREEN
|
||||||
buffer_obj.forceSave(&SD);
|
display_obj.tft.println(text_table2[5] + String(updateSize));
|
||||||
|
display_obj.tft.println(F(text_table2[6]));
|
||||||
|
#endif
|
||||||
|
size_t written = Update.writeStream(updateSource);
|
||||||
|
if (written == updateSize) {
|
||||||
|
#ifdef HAS_SCREEN
|
||||||
|
display_obj.tft.println(text_table2[7] + String(written) + text_table2[10]);
|
||||||
|
#endif
|
||||||
|
Serial.println("Written : " + String(written) + " successfully");
|
||||||
}
|
}
|
||||||
else if (!this->supported) {
|
else {
|
||||||
if (checkDetectPin()) {
|
#ifdef HAS_SCREEN
|
||||||
delay(100);
|
display_obj.tft.println(text_table2[8] + String(written) + "/" + String(updateSize) + text_table2[9]);
|
||||||
this->initSD();
|
#endif
|
||||||
|
Serial.println("Written only : " + String(written) + "/" + String(updateSize) + ". Retry?");
|
||||||
|
}
|
||||||
|
if (Update.end()) {
|
||||||
|
Serial.println("OTA done!");
|
||||||
|
if (Update.isFinished()) {
|
||||||
|
#ifdef HAS_SCREEN
|
||||||
|
display_obj.tft.println(F(text_table2[11]));
|
||||||
|
#endif
|
||||||
|
Serial.println(F("Update successfully completed. Rebooting."));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
#ifdef HAS_SCREEN
|
||||||
|
display_obj.tft.setTextColor(TFT_RED);
|
||||||
|
display_obj.tft.println(text_table2[12]);
|
||||||
|
#endif
|
||||||
|
Serial.println("Update not finished? Something went wrong!");
|
||||||
|
#ifdef HAS_SCREEN
|
||||||
|
display_obj.tft.setTextColor(TFT_WHITE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else {
|
||||||
|
#ifdef HAS_SCREEN
|
||||||
|
display_obj.tft.println(text_table2[13] + String(Update.getError()));
|
||||||
|
#endif
|
||||||
|
Serial.println("Error Occurred. Error #: " + String(Update.getError()));
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#ifdef HAS_SCREEN
|
||||||
|
display_obj.tft.println(text_table2[14]);
|
||||||
|
#endif
|
||||||
|
Serial.println("Not enough space to begin OTA");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SDInterface::checkDetectPin() {
|
||||||
|
#ifdef KIT
|
||||||
|
if (digitalRead(SD_DET) == LOW)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SDInterface::main() {
|
||||||
|
if ((this->supported) && (this->do_save)) {
|
||||||
|
//Serial.println("Saving packet...");
|
||||||
|
buffer_obj.forceSave(&SD);
|
||||||
|
}
|
||||||
|
else if (!this->supported) {
|
||||||
|
if (checkDetectPin()) {
|
||||||
|
delay(100);
|
||||||
|
this->initSD();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -580,8 +580,10 @@ void WiFiScan::RunAPScan(uint8_t scan_mode, uint16_t color)
|
|||||||
{
|
{
|
||||||
#ifdef WRITE_PACKETS_SERIAL
|
#ifdef WRITE_PACKETS_SERIAL
|
||||||
buffer_obj.open();
|
buffer_obj.open();
|
||||||
#else
|
#elif defined(HAS_SD)
|
||||||
sd_obj.openCapture("ap");
|
sd_obj.openCapture("ap");
|
||||||
|
#else
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
@@ -809,7 +811,7 @@ void WiFiScan::RunInfo()
|
|||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
display_obj.tft.println(text_table4[48]);
|
display_obj.tft.println(text_table4[48]);
|
||||||
#endif
|
#endif
|
||||||
#else
|
#elif defined(HAS_SD)
|
||||||
if (sd_obj.supported) {
|
if (sd_obj.supported) {
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
display_obj.tft.println(text_table4[28]);
|
display_obj.tft.println(text_table4[28]);
|
||||||
@@ -823,6 +825,8 @@ void WiFiScan::RunInfo()
|
|||||||
display_obj.tft.println(text_table4[31]);
|
display_obj.tft.println(text_table4[31]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_BATTERY
|
#ifdef HAS_BATTERY
|
||||||
@@ -848,8 +852,10 @@ void WiFiScan::RunInfo()
|
|||||||
void WiFiScan::RunEspressifScan(uint8_t scan_mode, uint16_t color) {
|
void WiFiScan::RunEspressifScan(uint8_t scan_mode, uint16_t color) {
|
||||||
#ifdef WRITE_PACKETS_SERIAL
|
#ifdef WRITE_PACKETS_SERIAL
|
||||||
buffer_obj.open();
|
buffer_obj.open();
|
||||||
#else
|
#elif defined(HAS_SD)
|
||||||
sd_obj.openCapture("espressif");
|
sd_obj.openCapture("espressif");
|
||||||
|
#else
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
@@ -901,8 +907,10 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
|
|||||||
|
|
||||||
#ifdef WRITE_PACKETS_SERIAL
|
#ifdef WRITE_PACKETS_SERIAL
|
||||||
buffer_obj.open();
|
buffer_obj.open();
|
||||||
#else
|
#elif defined(HAS_SD)
|
||||||
sd_obj.openCapture("packet_monitor");
|
sd_obj.openCapture("packet_monitor");
|
||||||
|
#else
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_ILI9341
|
#ifdef HAS_ILI9341
|
||||||
@@ -1020,8 +1028,10 @@ void WiFiScan::RunEapolScan(uint8_t scan_mode, uint16_t color)
|
|||||||
#else
|
#else
|
||||||
#ifdef WRITE_PACKETS_SERIAL
|
#ifdef WRITE_PACKETS_SERIAL
|
||||||
buffer_obj.open();
|
buffer_obj.open();
|
||||||
#else
|
#elif defined(HAS_SD)
|
||||||
sd_obj.openCapture("eapol");
|
sd_obj.openCapture("eapol");
|
||||||
|
#else
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
@@ -1119,8 +1129,10 @@ void WiFiScan::RunPwnScan(uint8_t scan_mode, uint16_t color)
|
|||||||
{
|
{
|
||||||
#ifdef WRITE_PACKETS_SERIAL
|
#ifdef WRITE_PACKETS_SERIAL
|
||||||
buffer_obj.open();
|
buffer_obj.open();
|
||||||
#else
|
#elif defined(HAS_SD)
|
||||||
sd_obj.openCapture("pwnagotchi");
|
sd_obj.openCapture("pwnagotchi");
|
||||||
|
#else
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
@@ -1165,8 +1177,10 @@ void WiFiScan::RunBeaconScan(uint8_t scan_mode, uint16_t color)
|
|||||||
{
|
{
|
||||||
#ifdef WRITE_PACKETS_SERIAL
|
#ifdef WRITE_PACKETS_SERIAL
|
||||||
buffer_obj.open();
|
buffer_obj.open();
|
||||||
#else
|
#elif defined(HAS_SD)
|
||||||
sd_obj.openCapture("beacon");
|
sd_obj.openCapture("beacon");
|
||||||
|
#else
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
@@ -1210,8 +1224,10 @@ void WiFiScan::RunStationScan(uint8_t scan_mode, uint16_t color)
|
|||||||
{
|
{
|
||||||
#ifdef WRITE_PACKETS_SERIAL
|
#ifdef WRITE_PACKETS_SERIAL
|
||||||
buffer_obj.open();
|
buffer_obj.open();
|
||||||
#else
|
#elif defined(HAS_SD)
|
||||||
sd_obj.openCapture("station");
|
sd_obj.openCapture("station");
|
||||||
|
#else
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
@@ -1255,9 +1271,11 @@ void WiFiScan::RunRawScan(uint8_t scan_mode, uint16_t color)
|
|||||||
{
|
{
|
||||||
#ifdef WRITE_PACKETS_SERIAL
|
#ifdef WRITE_PACKETS_SERIAL
|
||||||
buffer_obj.open();
|
buffer_obj.open();
|
||||||
#else
|
#elif defined(HAS_SD)
|
||||||
if (scan_mode != WIFI_SCAN_SIG_STREN)
|
if (scan_mode != WIFI_SCAN_SIG_STREN)
|
||||||
sd_obj.openCapture("raw");
|
sd_obj.openCapture("raw");
|
||||||
|
#else
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
@@ -1304,8 +1322,10 @@ void WiFiScan::RunDeauthScan(uint8_t scan_mode, uint16_t color)
|
|||||||
{
|
{
|
||||||
#ifdef WRITE_PACKETS_SERIAL
|
#ifdef WRITE_PACKETS_SERIAL
|
||||||
buffer_obj.open();
|
buffer_obj.open();
|
||||||
#else
|
#elif defined(HAS_SD)
|
||||||
sd_obj.openCapture("deauth");
|
sd_obj.openCapture("deauth");
|
||||||
|
#else
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
@@ -1351,8 +1371,10 @@ void WiFiScan::RunProbeScan(uint8_t scan_mode, uint16_t color)
|
|||||||
{
|
{
|
||||||
#ifdef WRITE_PACKETS_SERIAL
|
#ifdef WRITE_PACKETS_SERIAL
|
||||||
buffer_obj.open();
|
buffer_obj.open();
|
||||||
#else
|
#elif defined(HAS_SD)
|
||||||
sd_obj.openCapture("probe");
|
sd_obj.openCapture("probe");
|
||||||
|
#else
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
@@ -3209,8 +3231,10 @@ void WiFiScan::addPacket(wifi_promiscuous_pkt_t *snifferPacket, int len) {
|
|||||||
if (save_packet) {
|
if (save_packet) {
|
||||||
#ifdef WRITE_PACKETS_SERIAL
|
#ifdef WRITE_PACKETS_SERIAL
|
||||||
buffer_obj.addPacket(snifferPacket->payload, len);
|
buffer_obj.addPacket(snifferPacket->payload, len);
|
||||||
#else
|
#elif defined(HAS_SD)
|
||||||
sd_obj.addPacket(snifferPacket->payload, len);
|
sd_obj.addPacket(snifferPacket->payload, len);
|
||||||
|
#else
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,11 +38,9 @@
|
|||||||
#include "Assets.h"
|
#include "Assets.h"
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
#include "flipperLED.h"
|
#include "flipperLED.h"
|
||||||
#endif
|
#elif defined(XIAO_ESP32_S3)
|
||||||
#ifdef XIAO_ESP32_S3
|
|
||||||
#include "xiaoLED.h"
|
#include "xiaoLED.h"
|
||||||
#endif
|
#else
|
||||||
#ifndef MARAUDER_FLIPPER || XIAO_ESP32_S3
|
|
||||||
#include "LedInterface.h"
|
#include "LedInterface.h"
|
||||||
#endif
|
#endif
|
||||||
//#include "MenuFunctions.h"
|
//#include "MenuFunctions.h"
|
||||||
|
|||||||
@@ -116,7 +116,6 @@ CommandLine cli_obj;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
const String PROGMEM version_number = MARAUDER_VERSION;
|
const String PROGMEM version_number = MARAUDER_VERSION;
|
||||||
const String PROGMEM board_target = MARAUDER_TARGET;
|
|
||||||
|
|
||||||
#ifdef HAS_NEOPIXEL_LED
|
#ifdef HAS_NEOPIXEL_LED
|
||||||
Adafruit_NeoPixel strip = Adafruit_NeoPixel(Pixels, PIN, NEO_GRB + NEO_KHZ800);
|
Adafruit_NeoPixel strip = Adafruit_NeoPixel(Pixels, PIN, NEO_GRB + NEO_KHZ800);
|
||||||
@@ -267,7 +266,7 @@ void setup()
|
|||||||
|
|
||||||
#ifdef WRITE_PACKETS_SERIAL
|
#ifdef WRITE_PACKETS_SERIAL
|
||||||
buffer_obj = Buffer();
|
buffer_obj = Buffer();
|
||||||
#else
|
#elif defined(HAS_SD)
|
||||||
// Do some SD stuff
|
// Do some SD stuff
|
||||||
if(sd_obj.initSD()) {
|
if(sd_obj.initSD()) {
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
@@ -281,6 +280,8 @@ void setup()
|
|||||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_BATTERY
|
#ifdef HAS_BATTERY
|
||||||
@@ -374,8 +375,10 @@ void loop()
|
|||||||
|
|
||||||
#ifdef WRITE_PACKETS_SERIAL
|
#ifdef WRITE_PACKETS_SERIAL
|
||||||
buffer_obj.forceSaveSerial();
|
buffer_obj.forceSaveSerial();
|
||||||
#else
|
#elif defined(HAS_SD)
|
||||||
sd_obj.main();
|
sd_obj.main();
|
||||||
|
#else
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_BATTERY
|
#ifdef HAS_BATTERY
|
||||||
|
|||||||
Reference in New Issue
Block a user