mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2026-01-26 11:14:51 -08:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1767f76362 | ||
|
|
908aae7965 | ||
|
|
4127e4d3d0 | ||
|
|
cc4a069af3 | ||
|
|
dae7e19abe | ||
|
|
2a8006a59d | ||
|
|
f0d1c048f5 | ||
|
|
94a7c6c587 | ||
|
|
0a395944c6 |
@@ -1345,26 +1345,43 @@ void CommandLine::runCommand(String input) {
|
||||
// Get list of indices
|
||||
LinkedList<String> ss_index = this->parseCommand(cmd_args.get(ss_sw + 1), ",");
|
||||
|
||||
// Mark APs as selected
|
||||
for (int i = 0; i < ss_index.size(); i++) {
|
||||
int index = ss_index.get(i).toInt();
|
||||
if (!this->inRange(ssids->size(), index)) {
|
||||
Serial.println("Index not in range: " + (String)index);
|
||||
continue;
|
||||
// Select ALL SSIDs
|
||||
if (cmd_args.get(ss_sw + 1) == "all") {
|
||||
for (int i = 0; i < ssids->size(); i++) {
|
||||
if (ssids->get(i).selected) {
|
||||
ssid new_ssid = ssids->get(i);
|
||||
new_ssid.selected = false;
|
||||
ssids->set(i, new_ssid);
|
||||
count_unselected += 1;
|
||||
}
|
||||
else {
|
||||
ssid new_ssid = ssids->get(i);
|
||||
new_ssid.selected = true;
|
||||
ssids->set(i, new_ssid);
|
||||
count_selected += 1;
|
||||
}
|
||||
}
|
||||
if (ssids->get(index).selected) {
|
||||
// Unselect "selected" ap
|
||||
ssid new_ssid = ssids->get(index);
|
||||
new_ssid.selected = false;
|
||||
ssids->set(index, new_ssid);
|
||||
count_unselected += 1;
|
||||
}
|
||||
else {
|
||||
// Select "unselected" ap
|
||||
ssid new_ssid = ssids->get(index);
|
||||
new_ssid.selected = true;
|
||||
ssids->set(index, new_ssid);
|
||||
count_selected += 1;
|
||||
}
|
||||
else {
|
||||
// Mark SSIDs as selected
|
||||
for (int i = 0; i < ss_index.size(); i++) {
|
||||
int index = ss_index.get(i).toInt();
|
||||
if (!this->inRange(ssids->size(), index)) {
|
||||
Serial.println("Index not in range: " + (String)index);
|
||||
continue;
|
||||
}
|
||||
if (ssids->get(index).selected) {
|
||||
ssid new_ssid = ssids->get(index);
|
||||
new_ssid.selected = false;
|
||||
ssids->set(index, new_ssid);
|
||||
count_unselected += 1;
|
||||
}
|
||||
else {
|
||||
ssid new_ssid = ssids->get(index);
|
||||
new_ssid.selected = true;
|
||||
ssids->set(index, new_ssid);
|
||||
count_selected += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
this->showCounts(count_selected, count_unselected);
|
||||
|
||||
@@ -33,7 +33,7 @@ extern Buffer buffer_obj;
|
||||
#define RESET_CMD "reset"
|
||||
#define START_CMD "start"
|
||||
#define ACK_CMD "ack"
|
||||
#define MAX_AP_NAME_SIZE 30
|
||||
#define MAX_AP_NAME_SIZE 32
|
||||
#define WIFI_SCAN_EVIL_PORTAL 30
|
||||
|
||||
char apName[MAX_AP_NAME_SIZE] = "PORTAL";
|
||||
|
||||
@@ -1714,13 +1714,23 @@ void WiFiScan::RunClearSSIDs() {
|
||||
}
|
||||
|
||||
void WiFiScan::setMac() {
|
||||
wifi_mode_t currentWiFiMode;
|
||||
esp_wifi_get_mode(¤tWiFiMode);
|
||||
esp_err_t result;
|
||||
result = esp_wifi_set_mac(WIFI_IF_AP, this->ap_mac);
|
||||
if (result != ESP_OK) Serial.printf("Failed to set AP MAC: %s | 0x%X\n", macToString(this->ap_mac), result);
|
||||
else Serial.println("Successfully set AP MAC: " + macToString(this->ap_mac));
|
||||
if ((result != ESP_OK) &&
|
||||
((currentWiFiMode == WIFI_MODE_AP) || (currentWiFiMode == WIFI_MODE_APSTA) || (currentWiFiMode == WIFI_MODE_NULL)))
|
||||
Serial.printf("Failed to set AP MAC: %s | 0x%X\n", macToString(this->ap_mac), result);
|
||||
else if ((currentWiFiMode == WIFI_MODE_AP) || (currentWiFiMode == WIFI_MODE_APSTA) || (currentWiFiMode == WIFI_MODE_NULL))
|
||||
Serial.println("Successfully set AP MAC: " + macToString(this->ap_mac));
|
||||
|
||||
// Do the station
|
||||
result = esp_wifi_set_mac(WIFI_IF_STA, this->sta_mac);
|
||||
if (result != ESP_OK) Serial.printf("Failed to set STA MAC: %s | 0x%X\n", macToString(this->sta_mac), result);
|
||||
else Serial.println("Successfully set STA MAC: " + macToString(this->sta_mac));
|
||||
if ((result != ESP_OK) &&
|
||||
((currentWiFiMode == WIFI_MODE_STA) || (currentWiFiMode == WIFI_MODE_APSTA)))
|
||||
Serial.printf("Failed to set STA MAC: %s | 0x%X\n", macToString(this->sta_mac), result);
|
||||
else if ((currentWiFiMode == WIFI_MODE_STA) || (currentWiFiMode == WIFI_MODE_APSTA))
|
||||
Serial.println("Successfully set STA MAC: " + macToString(this->sta_mac));
|
||||
}
|
||||
|
||||
void WiFiScan::RunSetMac(uint8_t * mac, bool ap) {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
//#define MARAUDER_REV_FEATHER
|
||||
//// END BOARD TARGETS
|
||||
|
||||
#define MARAUDER_VERSION "v1.4.0"
|
||||
#define MARAUDER_VERSION "v1.4.2"
|
||||
|
||||
#define GRAPH_REFRESH 100
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ void backlightOff() {
|
||||
|
||||
void setup()
|
||||
{
|
||||
//esp_spiram_init();
|
||||
esp_spiram_init();
|
||||
|
||||
#ifdef defined(MARAUDER_M5STICKC) && !defined(MARAUDER_M5STICKCP2)
|
||||
axp192_obj.begin();
|
||||
|
||||
Reference in New Issue
Block a user