mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2026-02-02 18:17:42 -08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9b037e087 | ||
|
|
29b6783168 | ||
|
|
01f21e0459 | ||
|
|
4a3fa3812f | ||
|
|
2eb5974a69 | ||
|
|
d3d76a1fc4 |
@@ -505,21 +505,26 @@ void Display::displayBuffer(bool do_clear)
|
||||
{
|
||||
if (this->display_buffer->size() > 0)
|
||||
{
|
||||
|
||||
int print_count = 10;
|
||||
|
||||
while ((display_buffer->size() > 0) && (print_count > 0))
|
||||
{
|
||||
// Freeze adding to display buffer
|
||||
if (display_buffer->size() > DISPLAY_BUFFER_LIMIT)
|
||||
this->printing = true;
|
||||
|
||||
#ifndef SCREEN_BUFFER
|
||||
xPos = 0;
|
||||
if ((display_buffer->size() > 0) && (!loading))
|
||||
{
|
||||
printing = true;
|
||||
//printing = true;
|
||||
delay(print_delay_1);
|
||||
yDraw = scroll_line(TFT_RED);
|
||||
tft.setCursor(xPos, yDraw);
|
||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
tft.print(display_buffer->shift());
|
||||
printing = false;
|
||||
//printing = false;
|
||||
delay(print_delay_2);
|
||||
}
|
||||
if (!tteBar)
|
||||
@@ -545,6 +550,8 @@ void Display::displayBuffer(bool do_clear)
|
||||
|
||||
print_count--;
|
||||
}
|
||||
|
||||
this->printing = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
//#define GPS_NMEA_SCRNWRAP true //default:true, except on MARAUDER_MINI where false
|
||||
//#define GPS_NMEA_MAXQUEUE 30 //default:30 messages max in queue
|
||||
|
||||
#ifdef MARAUDER_MINI
|
||||
#if defined(MARAUDER_MINI) || defined(MARAUDER_MINI_V3)
|
||||
#ifndef GPS_NMEA_SCRNWRAP
|
||||
#define GPS_NMEA_SCRNWRAP false
|
||||
#endif
|
||||
|
||||
@@ -463,10 +463,19 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PACKET_RATE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN)) {
|
||||
if (wifi_scan_obj.set_channel < 14)
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel + 1);
|
||||
else
|
||||
wifi_scan_obj.changeChannel(1);
|
||||
#ifndef HAS_DUAL_BAND
|
||||
if (wifi_scan_obj.set_channel < 14)
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel + 1);
|
||||
else
|
||||
wifi_scan_obj.changeChannel(1);
|
||||
#else
|
||||
if (wifi_scan_obj.dual_band_channel_index < DUAL_BAND_CHANNELS - 1)
|
||||
wifi_scan_obj.dual_band_channel_index++;
|
||||
else
|
||||
wifi_scan_obj.dual_band_channel_index = 0;
|
||||
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.dual_band_channel[wifi_scan_obj.dual_band_channel_index]);
|
||||
#endif
|
||||
}
|
||||
else if (wifi_scan_obj.currentScanMode == WIFI_SCAN_CHAN_ACT) {
|
||||
#ifndef HAS_DUAL_BAND
|
||||
@@ -519,10 +528,19 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PACKET_RATE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN)) {
|
||||
if (wifi_scan_obj.set_channel > 1)
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel - 1);
|
||||
else
|
||||
wifi_scan_obj.changeChannel(14);
|
||||
#ifndef HAS_DUAL_BAND
|
||||
if (wifi_scan_obj.set_channel > 1)
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel - 1);
|
||||
else
|
||||
wifi_scan_obj.changeChannel(14);
|
||||
#else
|
||||
if (wifi_scan_obj.dual_band_channel_index > 0)
|
||||
wifi_scan_obj.dual_band_channel_index--;
|
||||
else
|
||||
wifi_scan_obj.dual_band_channel_index = DUAL_BAND_CHANNELS - 1;
|
||||
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.dual_band_channels[wifi_scan_obj.dual_band_channel_index]);
|
||||
#endif
|
||||
}
|
||||
else if (wifi_scan_obj.currentScanMode == WIFI_SCAN_CHAN_ACT) {
|
||||
#ifndef HAS_DUAL_BAND
|
||||
@@ -631,10 +649,19 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PACKET_RATE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN)) {
|
||||
if (wifi_scan_obj.set_channel < 14)
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel + 1);
|
||||
else
|
||||
wifi_scan_obj.changeChannel(1);
|
||||
#ifndef HAS_DUAL_BAND
|
||||
if (wifi_scan_obj.set_channel < 14)
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel + 1);
|
||||
else
|
||||
wifi_scan_obj.changeChannel(1);
|
||||
#else
|
||||
if (wifi_scan_obj.dual_band_channel_index < DUAL_BAND_CHANNELS - 1)
|
||||
wifi_scan_obj.dual_band_channel_index++;
|
||||
else
|
||||
wifi_scan_obj.dual_band_channel_index = 0;
|
||||
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.dual_band_channels[wifi_scan_obj.dual_band_channel_index]);
|
||||
#endif
|
||||
}
|
||||
else if (wifi_scan_obj.currentScanMode == WIFI_SCAN_CHAN_ACT) {
|
||||
#ifndef HAS_DUAL_BAND
|
||||
@@ -695,10 +722,19 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PACKET_RATE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN)) {
|
||||
if (wifi_scan_obj.set_channel > 1)
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel - 1);
|
||||
else
|
||||
wifi_scan_obj.changeChannel(14);
|
||||
#ifndef HAS_DUAL_BAND
|
||||
if (wifi_scan_obj.set_channel > 1)
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel - 1);
|
||||
else
|
||||
wifi_scan_obj.changeChannel(14);
|
||||
#else
|
||||
if (wifi_scan_obj.dual_band_channel_index > 0)
|
||||
wifi_scan_obj.dual_band_channel_index--;
|
||||
else
|
||||
wifi_scan_obj.dual_band_channel_index = DUAL_BAND_CHANNELS - 1;
|
||||
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.dual_band_channels[wifi_scan_obj.dual_band_channel_index]);
|
||||
#endif
|
||||
}
|
||||
else if (wifi_scan_obj.currentScanMode == WIFI_SCAN_CHAN_ACT) {
|
||||
#ifndef HAS_DUAL_BAND
|
||||
@@ -722,10 +758,19 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
if (this->isKeyPressed('/')) {
|
||||
#endif
|
||||
if (wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) {
|
||||
if (wifi_scan_obj.set_channel < 14)
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel + 1);
|
||||
else
|
||||
wifi_scan_obj.changeChannel(1);
|
||||
#ifndef HAS_DUAL_BAND
|
||||
if (wifi_scan_obj.set_channel < 14)
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel + 1);
|
||||
else
|
||||
wifi_scan_obj.changeChannel(1);
|
||||
#else
|
||||
if (wifi_scan_obj.dual_band_channel_index < DUAL_BAND_CHANNELS - 1)
|
||||
wifi_scan_obj.dual_band_channel_index++;
|
||||
else
|
||||
wifi_scan_obj.dual_band_channel_index = 0;
|
||||
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.dual_band_channels[wifi_scan_obj.dual_band_channel_index]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -737,10 +782,19 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
if (this->isKeyPressed(',')) {
|
||||
#endif
|
||||
if (wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) {
|
||||
if (wifi_scan_obj.set_channel > 1)
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel - 1);
|
||||
else
|
||||
wifi_scan_obj.changeChannel(14);
|
||||
#ifndef HAS_DUAL_BAND
|
||||
if (wifi_scan_obj.set_channel > 1)
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel - 1);
|
||||
else
|
||||
wifi_scan_obj.changeChannel(14);
|
||||
#else
|
||||
if (wifi_scan_obj.dual_band_channel_index > 0)
|
||||
wifi_scan_obj.dual_band_channel_index--;
|
||||
else
|
||||
wifi_scan_obj.dual_band_channel_index = DUAL_BAND_CHANNELS - 1;
|
||||
|
||||
wifi_scan_obj.changeChannel(wifi_scan_obj.dual_band_channels[wifi_scan_obj.dual_band_channel_index]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -864,7 +918,7 @@ void MenuFunctions::updateStatusBar()
|
||||
|
||||
bool status_changed = false;
|
||||
|
||||
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) || defined(MARAUDER_CARDPUTER)
|
||||
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) || defined(MARAUDER_CARDPUTER) || defined(MARAUDER_MINI_V3)
|
||||
display_obj.tft.setFreeFont(NULL);
|
||||
#endif
|
||||
|
||||
@@ -918,7 +972,7 @@ void MenuFunctions::updateStatusBar()
|
||||
|
||||
if ((current_channel != wifi_scan_obj.old_channel) || (status_changed)) {
|
||||
wifi_scan_obj.old_channel = current_channel;
|
||||
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) || defined(MARAUDER_CARDPUTER)
|
||||
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) || defined(MARAUDER_CARDPUTER) || defined(MARAUDER_MINI_V3)
|
||||
display_obj.tft.fillRect(TFT_WIDTH/4, 0, CHAR_WIDTH * 6, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||
#elif defined(HAS_DUAL_BAND)
|
||||
display_obj.tft.fillRect(50, 0, (CHAR_WIDTH / 2) * 8, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
static const uint8_t *g_filter_bssid = nullptr;
|
||||
uint8_t *current_act = nullptr;
|
||||
|
||||
MacEntry WiFiScan::mac_entries[mac_history_len];
|
||||
uint8_t WiFiScan::mac_entry_state[mac_history_len];
|
||||
MacEntry WiFiScan::mac_entries[mac_history_len_half];
|
||||
uint8_t WiFiScan::mac_entry_state[mac_history_len_half];
|
||||
|
||||
int num_beacon = 0;
|
||||
int num_deauth = 0;
|
||||
@@ -493,11 +493,11 @@ extern "C" {
|
||||
|
||||
Serial.println();
|
||||
|
||||
while (display_obj.printing)
|
||||
delay(1);
|
||||
display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
display_obj.loading = false;
|
||||
if (!display_obj.printing) {
|
||||
display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
display_obj.loading = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -971,11 +971,11 @@ extern "C" {
|
||||
{
|
||||
display_string.concat(" ");
|
||||
}
|
||||
while (display_obj.printing)
|
||||
delay(1);
|
||||
display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
display_obj.loading = false;
|
||||
if (!display_obj.printing) {
|
||||
display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
display_obj.loading = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1194,11 +1194,11 @@ extern "C" {
|
||||
|
||||
Serial.println();
|
||||
|
||||
while (display_obj.printing)
|
||||
delay(1);
|
||||
display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
display_obj.loading = false;
|
||||
if (!display_obj.printing) {
|
||||
display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
display_obj.loading = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1654,11 +1654,11 @@ extern "C" {
|
||||
{
|
||||
display_string.concat(" ");
|
||||
}
|
||||
while (display_obj.printing)
|
||||
delay(1);
|
||||
display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
display_obj.loading = false;
|
||||
if (!display_obj.printing) {
|
||||
display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
display_obj.loading = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1721,7 +1721,7 @@ void WiFiScan::RunSetup() {
|
||||
mac_history = (struct mac_addr*) ps_malloc(mac_history_len * sizeof(struct mac_addr));
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < mac_history_len; i++)
|
||||
for (int i = 0; i < mac_history_len_half; i++)
|
||||
mac_entry_state[i] = 0;
|
||||
|
||||
#ifdef HAS_BT
|
||||
@@ -1762,6 +1762,8 @@ void WiFiScan::RunSetup() {
|
||||
|
||||
this->shutdownBLE();
|
||||
|
||||
Serial.println("Initializing WiFi...");
|
||||
|
||||
esp_wifi_init(&cfg);
|
||||
#ifdef HAS_IDF_3
|
||||
esp_wifi_set_country(&country);
|
||||
@@ -1773,7 +1775,9 @@ void WiFiScan::RunSetup() {
|
||||
esp_wifi_get_mac(WIFI_IF_STA, this->sta_mac);
|
||||
delay(10);
|
||||
esp_wifi_get_mac(WIFI_IF_AP, this->ap_mac);
|
||||
Serial.println("Setting MAC...");
|
||||
this->setMac();
|
||||
Serial.println("Shutting down WiFi...");
|
||||
this->shutdownWiFi();
|
||||
#endif
|
||||
|
||||
@@ -2360,6 +2364,10 @@ bool WiFiScan::shutdownBLE() {
|
||||
|
||||
pBLEScan->clearResults();
|
||||
|
||||
delay(100);
|
||||
|
||||
Serial.println("Deinitializing NimBLE...");
|
||||
|
||||
//#ifndef HAS_DUAL_BAND
|
||||
NimBLEDevice::deinit();
|
||||
//#endif
|
||||
@@ -2629,7 +2637,7 @@ int16_t WiFiScan::seen_mac_int(unsigned char* mac, bool simple) {
|
||||
tmp[x] = mac[x];
|
||||
}
|
||||
|
||||
for (int x = 0; x < mac_history_len; x++) {
|
||||
for (int x = 0; x < mac_history_len_half; x++) {
|
||||
if (this->mac_cmp(tmp, mac_entries[x].mac)) {
|
||||
return x;
|
||||
}
|
||||
@@ -2650,12 +2658,12 @@ inline uint32_t WiFiScan::hash_mac(const uint8_t mac[6]) {
|
||||
|
||||
int WiFiScan::update_mac_entry(const uint8_t mac[6], int8_t rssi, bool bt) {
|
||||
const uint32_t now_ms = millis();
|
||||
const uint32_t start_idx = hash_mac(mac) & (mac_history_len - 1);
|
||||
const uint32_t start_idx = hash_mac(mac) & (mac_history_len_half - 1);
|
||||
|
||||
int32_t first_tombstone = -1;
|
||||
|
||||
for (uint32_t probe = 0; probe < mac_history_len; probe++) {
|
||||
const uint32_t idx = (start_idx + probe) & (mac_history_len - 1);
|
||||
for (uint32_t probe = 0; probe < mac_history_len_half; probe++) {
|
||||
const uint32_t idx = (start_idx + probe) & (mac_history_len_half - 1);
|
||||
|
||||
switch (mac_entry_state[idx]) {
|
||||
|
||||
@@ -2691,7 +2699,7 @@ int WiFiScan::update_mac_entry(const uint8_t mac[6], int8_t rssi, bool bt) {
|
||||
|
||||
mac_entries[idx].rssi = rssi;
|
||||
|
||||
return idx + mac_history_len;
|
||||
return idx + mac_history_len_half;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2729,7 +2737,7 @@ void WiFiScan::evict_and_insert(const uint8_t mac[6], uint32_t now_ms) {
|
||||
const uint32_t EVICT_AGE_MS = TRACK_EVICT_SEC * 1000UL;
|
||||
|
||||
// 1) Prefer reusing a tombstone if any exist.
|
||||
for (uint32_t i = 0; i < mac_history_len; i++) {
|
||||
for (uint32_t i = 0; i < mac_history_len_half; i++) {
|
||||
if (mac_entry_state[i] == TOMBSTONE_ENTRY) {
|
||||
insert_mac_entry(i, mac, now_ms);
|
||||
return;
|
||||
@@ -2746,7 +2754,7 @@ void WiFiScan::evict_and_insert(const uint8_t mac[6], uint32_t now_ms) {
|
||||
uint16_t victim_any_frames = 0xFFFF;
|
||||
uint32_t victim_any_age = 0;
|
||||
|
||||
for (uint32_t i = 0; i < mac_history_len; i++) {
|
||||
for (uint32_t i = 0; i < mac_history_len_half; i++) {
|
||||
if (mac_entry_state[i] != VALID_ENTRY) continue;
|
||||
|
||||
const uint32_t age = (uint32_t)(now_ms - mac_entries[i].last_seen_ms);
|
||||
@@ -2882,7 +2890,7 @@ uint8_t WiFiScan::build_top10_for_ui(MacEntry* out_top10, MacSortMode mode) {
|
||||
}
|
||||
};
|
||||
|
||||
for (uint32_t i = 0; i < mac_history_len; i++) {
|
||||
for (uint32_t i = 0; i < mac_history_len_half; i++) {
|
||||
if (mac_entry_state[i] != VALID_ENTRY)
|
||||
continue;
|
||||
|
||||
@@ -5030,7 +5038,7 @@ void WiFiScan::RunStationScan(uint8_t scan_mode, uint16_t color)
|
||||
display_obj.print_delay_2 = 10;
|
||||
display_obj.initScrollValues(true);
|
||||
display_obj.tft.setTextWrap(false);
|
||||
display_obj.tft.setTextColor(TFT_WHITE, color);
|
||||
display_obj.tft.setTextColor(TFT_BLACK, color);
|
||||
#ifdef HAS_FULL_SCREEN
|
||||
display_obj.tft.fillRect(0,16,TFT_WIDTH,16, color);
|
||||
display_obj.tft.drawCentreString(text_table1[59],TFT_WIDTH / 2,16,2);
|
||||
@@ -5311,6 +5319,8 @@ void WiFiScan::RunProbeScan(uint8_t scan_mode, uint16_t color)
|
||||
display_obj.tft.drawCentreString(text_table4[40],TFT_WIDTH / 2,16,2);
|
||||
else if (scan_mode == WIFI_SCAN_DETECT_FOLLOW)
|
||||
display_obj.tft.drawCentreString("MAC Monitor",TFT_WIDTH / 2,16,2);
|
||||
else if (scan_mode == WIFI_SCAN_STATION_WAR_DRIVE)
|
||||
display_obj.tft.drawCentreString("Station Wardrive",TFT_WIDTH / 2,16,2);
|
||||
else {
|
||||
Serial.println(F("Starting WiFi sniff for Flock..."));
|
||||
display_obj.tft.drawCentreString("Flock Sniff",TFT_WIDTH / 2,16,2);
|
||||
@@ -7701,7 +7711,11 @@ void WiFiScan::beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
|
||||
Serial.print(F(" "));
|
||||
|
||||
display_obj.display_buffer->add(display_string);
|
||||
if (!display_obj.printing) {
|
||||
display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
display_obj.loading = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
Serial.println();
|
||||
@@ -8071,12 +8085,12 @@ void WiFiScan::beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
else if (wifi_scan_obj.currentScanMode == WIFI_SCAN_DETECT_FOLLOW) {
|
||||
int frame_check = wifi_scan_obj.update_mac_entry(src_addr, snifferPacket->rx_ctrl.rssi);
|
||||
|
||||
if (frame_check >= mac_history_len) {
|
||||
if (frame_check >= mac_history_len_half) {
|
||||
int32_t dloc = 0;
|
||||
bool is_following = is_following_candidate_light(wifi_scan_obj.mac_entries[frame_check - mac_history_len], millis(), &dloc);
|
||||
bool is_following = is_following_candidate_light(wifi_scan_obj.mac_entries[frame_check - mac_history_len_half], millis(), &dloc);
|
||||
if (is_following) {
|
||||
wifi_scan_obj.mac_entries[frame_check - mac_history_len].dloc = dloc;
|
||||
wifi_scan_obj.mac_entries[frame_check - mac_history_len].following = is_following;
|
||||
wifi_scan_obj.mac_entries[frame_check - mac_history_len_half].dloc = dloc;
|
||||
wifi_scan_obj.mac_entries[frame_check - mac_history_len_half].following = is_following;
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,10 +282,6 @@ class WiFiScan
|
||||
uint8_t ap_mac[6] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
|
||||
uint8_t sta_mac[6] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
|
||||
|
||||
uint8_t dual_band_channels[DUAL_BAND_CHANNELS] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 149, 153, 157, 161, 165, 169, 173, 177};
|
||||
|
||||
uint8_t dual_band_channel_index = 0;
|
||||
|
||||
// Settings
|
||||
uint mac_history_cursor = 0;
|
||||
uint8_t channel_hop_delay = 1;
|
||||
@@ -662,8 +658,12 @@ class WiFiScan
|
||||
volatile bool bt_pending_clear = false;
|
||||
|
||||
|
||||
static MacEntry mac_entries[mac_history_len];
|
||||
static uint8_t mac_entry_state[mac_history_len];
|
||||
static MacEntry mac_entries[mac_history_len_half];
|
||||
static uint8_t mac_entry_state[mac_history_len_half];
|
||||
|
||||
uint8_t dual_band_channels[DUAL_BAND_CHANNELS] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 149, 153, 157, 161, 165, 169, 173, 177};
|
||||
|
||||
uint8_t dual_band_channel_index = 0;
|
||||
|
||||
// Stuff for RAW stats
|
||||
uint32_t mgmt_frames = 0;
|
||||
|
||||
@@ -32,9 +32,10 @@
|
||||
//#define MARAUDER_C5
|
||||
//#define MARAUDER_CARDPUTER
|
||||
//#define MARAUDER_V8
|
||||
//#define MARAUDER_MINI_V3
|
||||
//// END BOARD TARGETS
|
||||
|
||||
#define MARAUDER_VERSION "v1.10.1"
|
||||
#define MARAUDER_VERSION "v1.10.2"
|
||||
|
||||
#define GRAPH_REFRESH 100
|
||||
|
||||
@@ -42,6 +43,8 @@
|
||||
|
||||
#define DUAL_BAND_CHANNELS 51
|
||||
|
||||
#define DISPLAY_BUFFER_LIMIT 20
|
||||
|
||||
//// HARDWARE NAMES
|
||||
#ifdef MARAUDER_M5STICKC
|
||||
#define HARDWARE_NAME "M5Stick-C Plus"
|
||||
@@ -87,6 +90,8 @@
|
||||
#define HARDWARE_NAME "ESP32-C5 DevKit"
|
||||
#elif defined(MARAUDER_V8)
|
||||
#define HARDWARE_NAME "Marauder v8"
|
||||
#elif defined(MARAUDER_MINI_V3)
|
||||
#define HARDWARE_NAME "Marauder Mini v3"
|
||||
#else
|
||||
#define HARDWARE_NAME "ESP32"
|
||||
#endif
|
||||
@@ -153,7 +158,7 @@
|
||||
#define HAS_BT
|
||||
#define HAS_BT_REMOTE
|
||||
#define HAS_BUTTONS
|
||||
#define HAS_NEOPIXEL_LED
|
||||
//#define HAS_NEOPIXEL_LED
|
||||
//#define HAS_PWR_MGMT
|
||||
#define HAS_SCREEN
|
||||
#define HAS_FULL_SCREEN
|
||||
@@ -474,6 +479,30 @@
|
||||
#define HAS_NIMBLE_2
|
||||
#define HAS_IDF_3
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_MINI_V3
|
||||
#define HAS_TOUCH
|
||||
//#define HAS_FLIPPER_LED
|
||||
//#define FLIPPER_ZERO_HAT
|
||||
//#define HAS_BATTERY
|
||||
#define HAS_BT
|
||||
#define HAS_BUTTONS
|
||||
//#define HAS_NEOPIXEL_LED
|
||||
//#define HAS_PWR_MGMT
|
||||
#define HAS_MINI_KB
|
||||
#define HAS_SCREEN
|
||||
#define HAS_MINI_SCREEN
|
||||
#define HAS_GPS
|
||||
#define HAS_C5_SD
|
||||
#define HAS_SD
|
||||
#define USE_SD
|
||||
#define HAS_DUAL_BAND
|
||||
#define HAS_PSRAM
|
||||
//#define HAS_TEMP_SENSOR
|
||||
#define HAS_NIMBLE_2
|
||||
#define HAS_IDF_3
|
||||
//#define HAS_SIMPLEX_DISPLAY
|
||||
#endif
|
||||
//// END BOARD FEATURES
|
||||
|
||||
//// POWER MANAGEMENT
|
||||
@@ -738,6 +767,26 @@
|
||||
#define D_PULL true
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_MINI_V3
|
||||
#define L_BTN 0
|
||||
#define C_BTN 1
|
||||
#define U_BTN 4
|
||||
#define R_BTN 8
|
||||
#define D_BTN 9
|
||||
|
||||
#define HAS_L
|
||||
#define HAS_R
|
||||
#define HAS_U
|
||||
#define HAS_D
|
||||
#define HAS_C
|
||||
|
||||
#define L_PULL true
|
||||
#define C_PULL true
|
||||
#define U_PULL true
|
||||
#define R_PULL true
|
||||
#define D_PULL true
|
||||
#endif
|
||||
|
||||
#endif
|
||||
//// END BUTTON DEFINITIONS
|
||||
|
||||
@@ -1826,6 +1875,81 @@
|
||||
#define STATUSBAR_COLOR 0x4A49
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_MINI_V3
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
#define TFT_MISO 19
|
||||
#define TFT_MOSI 23
|
||||
#define TFT_SCLK 18
|
||||
#define TFT_CS 27
|
||||
#define TFT_DC 26
|
||||
#define TFT_RST 5
|
||||
#define TFT_BL 32
|
||||
#define TOUCH_CS 21
|
||||
#define SD_CS 4
|
||||
|
||||
#define SCREEN_BUFFER
|
||||
|
||||
#define MAX_SCREEN_BUFFER 9
|
||||
|
||||
#define BANNER_TEXT_SIZE 1
|
||||
|
||||
#ifndef TFT_WIDTH
|
||||
#define TFT_WIDTH 128
|
||||
#endif
|
||||
|
||||
#ifndef TFT_HEIGHT
|
||||
#define TFT_HEIGHT 128
|
||||
#endif
|
||||
|
||||
#define GRAPH_VERT_LIM TFT_HEIGHT/2 - 1
|
||||
|
||||
#define EXT_BUTTON_WIDTH 0
|
||||
|
||||
#define SCREEN_ORIENTATION 0
|
||||
|
||||
#define CHAR_WIDTH 6
|
||||
#define SCREEN_WIDTH TFT_WIDTH // Originally 240
|
||||
#define SCREEN_HEIGHT TFT_HEIGHT // Originally 320
|
||||
#define HEIGHT_1 TFT_WIDTH
|
||||
#define WIDTH_1 TFT_WIDTH
|
||||
#define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
|
||||
#define TEXT_HEIGHT (TFT_HEIGHT/10) // Height of text to be printed and scrolled
|
||||
#define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
|
||||
#define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
|
||||
#define YMAX TFT_HEIGHT // Bottom of screen area
|
||||
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
|
||||
//#define MENU_FONT NULL
|
||||
#define MENU_FONT &FreeMono9pt7b // Winner
|
||||
//#define MENU_FONT &FreeMonoBold9pt7b
|
||||
//#define MENU_FONT &FreeSans9pt7b
|
||||
//#define MENU_FONT &FreeSansBold9pt7b
|
||||
#define BUTTON_SCREEN_LIMIT 10
|
||||
#define BUTTON_ARRAY_LEN BUTTON_SCREEN_LIMIT
|
||||
#define STATUS_BAR_WIDTH (TFT_HEIGHT/16)
|
||||
#define LVGL_TICK_PERIOD 6
|
||||
|
||||
#define FRAME_X 100
|
||||
#define FRAME_Y 64
|
||||
#define FRAME_W 120
|
||||
#define FRAME_H 50
|
||||
|
||||
// Red zone size
|
||||
#define REDBUTTON_X FRAME_X
|
||||
#define REDBUTTON_Y FRAME_Y
|
||||
#define REDBUTTON_W (FRAME_W/2)
|
||||
#define REDBUTTON_H FRAME_H
|
||||
|
||||
// Green zone size
|
||||
#define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
|
||||
#define GREENBUTTON_Y FRAME_Y
|
||||
#define GREENBUTTON_W (FRAME_W/2)
|
||||
#define GREENBUTTON_H FRAME_H
|
||||
|
||||
#define STATUSBAR_COLOR 0x4A49
|
||||
#endif
|
||||
|
||||
#endif
|
||||
//// END DISPLAY DEFINITIONS
|
||||
|
||||
@@ -2091,6 +2215,24 @@
|
||||
#define ICON_H 22
|
||||
#define BUTTON_PADDING 60
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_MINI_V3
|
||||
#define BANNER_TIME 50
|
||||
|
||||
#define COMMAND_PREFIX "!"
|
||||
|
||||
// Keypad start position, key sizes and spacing
|
||||
#define KEY_X (TFT_WIDTH/2) // Centre of key
|
||||
#define KEY_Y (TFT_HEIGHT/4.5)
|
||||
#define KEY_W TFT_WIDTH // Width and height
|
||||
#define KEY_H (TFT_HEIGHT/12.8)
|
||||
#define KEY_SPACING_X 0 // X and Y gap
|
||||
#define KEY_SPACING_Y 1
|
||||
#define KEY_TEXTSIZE 1 // Font size multiplier
|
||||
#define ICON_W 22
|
||||
#define ICON_H 22
|
||||
#define BUTTON_PADDING 10
|
||||
#endif
|
||||
//// END MENU DEFINITIONS
|
||||
|
||||
//// SD DEFINITIONS
|
||||
@@ -2184,6 +2326,10 @@
|
||||
#define SD_CS 10
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_MINI_V3
|
||||
#define SD_CS 10
|
||||
#endif
|
||||
|
||||
#endif
|
||||
//// END SD DEFINITIONS
|
||||
|
||||
@@ -2285,6 +2431,8 @@
|
||||
#define MEM_LOWER_LIM 10000
|
||||
#elif defined(MARAUDER_V8)
|
||||
#define MEM_LOWER_LIM 10000
|
||||
#elif defined(MARAUDER_MINI_V3)
|
||||
#define MEM_LOWER_LIM 10000
|
||||
#endif
|
||||
//// END MEMORY LOWER LIMIT STUFF
|
||||
|
||||
@@ -2332,6 +2480,8 @@
|
||||
#define mac_history_len 100
|
||||
#endif
|
||||
|
||||
#define mac_history_len_half (mac_history_len / 2)
|
||||
|
||||
#if defined(MARAUDER_V6) || defined(MARAUDER_V6_1)
|
||||
#define GPS_SERIAL_INDEX 2
|
||||
#define GPS_TX 4
|
||||
@@ -2404,9 +2554,14 @@
|
||||
#define GPS_SERIAL_INDEX 1
|
||||
#define GPS_TX 14
|
||||
#define GPS_RX 13
|
||||
#elif defined(MARAUDER_MINI_V3)
|
||||
#define GPS_SERIAL_INDEX 1
|
||||
#define GPS_TX 14
|
||||
#define GPS_RX 13
|
||||
#endif
|
||||
#else
|
||||
#define mac_history_len 100
|
||||
#define mac_history_len_half (mac_history_len / 2)
|
||||
#endif
|
||||
//// END GPS STUFF
|
||||
|
||||
@@ -2507,6 +2662,8 @@
|
||||
#define MARAUDER_TITLE_BYTES 13578
|
||||
#elif defined(MARAUDER_V8)
|
||||
#define MARAUDER_TITLE_BYTES 13578
|
||||
#elif defined(MARAUDER_MINI_V3)
|
||||
#define MARAUDER_TITLE_BYTES 13578
|
||||
#else
|
||||
#define MARAUDER_TITLE_BYTES 13578
|
||||
#endif
|
||||
@@ -2517,9 +2674,9 @@
|
||||
#ifdef HAS_PSRAM
|
||||
#define BUF_SIZE 8 * 1024 // Had to reduce buffer size to save RAM. GG @spacehuhn
|
||||
#define SNAP_LEN 1 * 4096 // max len of each recieved packet
|
||||
#elif !defined(HAS_ILI9341)
|
||||
#define BUF_SIZE 8 * 1024 // Had to reduce buffer size to save RAM. GG @spacehuhn
|
||||
#define SNAP_LEN 4096 // max len of each recieved packet
|
||||
//#elif !defined(HAS_ILI9341)
|
||||
// #define BUF_SIZE 8 * 1024 // Had to reduce buffer size to save RAM. GG @spacehuhn
|
||||
// #define SNAP_LEN 4096 // max len of each recieved packet
|
||||
#else
|
||||
#define BUF_SIZE 3 * 1024 // Had to reduce buffer size to save RAM. GG @spacehuhn
|
||||
#define SNAP_LEN 2324 // max len of each recieved packet
|
||||
@@ -2606,6 +2763,12 @@
|
||||
#define SD_MOSI TFT_MOSI
|
||||
#define SD_SCK TFT_SCLK
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_MINI_V3
|
||||
#define SD_MISO TFT_MISO
|
||||
#define SD_MOSI TFT_MOSI
|
||||
#define SD_SCK TFT_SCLK
|
||||
#endif
|
||||
#endif
|
||||
//// END STUPID CYD STUFF
|
||||
|
||||
|
||||
@@ -125,11 +125,11 @@ uint32_t currentTime = 0;
|
||||
|
||||
void backlightOn() {
|
||||
#ifdef HAS_SCREEN
|
||||
#ifdef MARAUDER_MINI
|
||||
#if defined(MARAUDER_MINI)
|
||||
digitalWrite(TFT_BL, LOW);
|
||||
#endif
|
||||
|
||||
#ifndef MARAUDER_MINI
|
||||
#if !defined(MARAUDER_MINI)
|
||||
digitalWrite(TFT_BL, HIGH);
|
||||
#endif
|
||||
#endif
|
||||
@@ -137,11 +137,11 @@ void backlightOn() {
|
||||
|
||||
void backlightOff() {
|
||||
#ifdef HAS_SCREEN
|
||||
#ifdef MARAUDER_MINI
|
||||
#if defined(MARAUDER_MINI)
|
||||
digitalWrite(TFT_BL, HIGH);
|
||||
#endif
|
||||
|
||||
#ifndef MARAUDER_MINI
|
||||
#if !defined(MARAUDER_MINI)
|
||||
digitalWrite(TFT_BL, LOW);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user