Add command for sniffing airtags

This commit is contained in:
Just Call Me Koko
2024-11-20 17:09:26 -05:00
parent ddb1696292
commit a96af37524
2 changed files with 28 additions and 7 deletions

View File

@@ -846,12 +846,33 @@ void CommandLine::runCommand(String input) {
// Bluetooth scan // Bluetooth scan
if (cmd_args.get(0) == BT_SNIFF_CMD) { if (cmd_args.get(0) == BT_SNIFF_CMD) {
#ifdef HAS_BT #ifdef HAS_BT
int bt_type_sw = this->argSearch(&cmd_args, "-t");
// Specifying type of bluetooth sniff
if (bt_type_sw != -1) {
String bt_type = cmd_args.get(bt_type_sw + 1);
bt_type.toLowerCase();
// Airtag sniff
if (bt_type == "airtag") {
Serial.println("Starting Airtag sniff. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(BT_SCAN_AIRTAG, TFT_WHITE);
}
}
// General bluetooth sniff
else {
Serial.println("Starting Bluetooth scan. Stop with " + (String)STOPSCAN_CMD); Serial.println("Starting Bluetooth scan. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN #ifdef HAS_SCREEN
display_obj.clearScreen(); display_obj.clearScreen();
menu_function_obj.drawStatusBar(); menu_function_obj.drawStatusBar();
#endif #endif
wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN); wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);
}
#else #else
Serial.println("Bluetooth not supported"); Serial.println("Bluetooth not supported");
#endif #endif

View File

@@ -134,7 +134,7 @@ const char PROGMEM HELP_SAVE_CMD[] = "save -a/-s";
const char PROGMEM HELP_LOAD_CMD[] = "load -a/-s"; const char PROGMEM HELP_LOAD_CMD[] = "load -a/-s";
// Bluetooth sniff/scan // Bluetooth sniff/scan
const char PROGMEM HELP_BT_SNIFF_CMD[] = "sniffbt"; const char PROGMEM HELP_BT_SNIFF_CMD[] = "sniffbt [-t] <airtag>";
const char PROGMEM HELP_BT_SPAM_CMD[] = "blespam -t <apple/google/samsung/windows/flipper/all>"; const char PROGMEM HELP_BT_SPAM_CMD[] = "blespam -t <apple/google/samsung/windows/flipper/all>";
//const char PROGMEM HELP_BT_SOUR_APPLE_CMD[] = "sourapple"; //const char PROGMEM HELP_BT_SOUR_APPLE_CMD[] = "sourapple";
//const char PROGMEM HELP_BT_SWIFTPAIR_SPAM_CMD[] = "swiftpair"; //const char PROGMEM HELP_BT_SWIFTPAIR_SPAM_CMD[] = "swiftpair";