Skip to content

Commit

Permalink
Merge pull request #125 from Spooks4576/Development
Browse files Browse the repository at this point in the history
more s2 fixes (actually)
  • Loading branch information
jaylikesbunda authored Dec 20, 2024
2 parents 3f00cf9 + a11a160 commit bb4cf72
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 3 additions & 2 deletions main/core/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ static int ble_hs_adv_parse_fields_cb(const struct ble_hs_adv_field *field, void
}
#endif


// wrap for esp32s2
#ifndef CONFIG_IDF_TARGET_ESP32S2
static const char *SKIMMER_TAG = "SKIMMER_DETECT";

// suspicious device names commonly used in skimmers
Expand All @@ -470,8 +473,6 @@ static const char *suspicious_names[] = {
"CC41-A", "MLT-BT05", "SPP-CA", "FFD0"
};
static const int suspicious_names_count = sizeof(suspicious_names) / sizeof(suspicious_names[0]);
// wrap for esp32s2
#ifndef CONFIG_IDF_TARGET_ESP32S2
void ble_skimmer_scan_callback(struct ble_gap_event *event, void *arg) {
if (!event || event->type != BLE_GAP_EVENT_DISC) {
return;
Expand Down
13 changes: 10 additions & 3 deletions main/core/commandline.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,11 +694,13 @@ void handle_capture_scan(int argc, char** argv) {
printf("Stopping packet capture...\n");
TERMINAL_VIEW_ADD_TEXT("Stopping packet capture...\n");
wifi_manager_stop_monitor_mode();
#ifndef CONFIG_IDF_TARGET_ESP32S2
ble_stop();
ble_stop_skimmer_detection();
#endif
pcap_file_close();
}

#ifndef CONFIG_IDF_TARGET_ESP32S2
if (strcmp(capturetype, "-ble") == 0) {
printf("Starting BLE packet capture...\n");
TERMINAL_VIEW_ADD_TEXT("Starting BLE packet capture...\n");
Expand All @@ -719,6 +721,7 @@ void handle_capture_scan(int argc, char** argv) {
// Start skimmer detection
ble_start_skimmer_detection();
}
#endif
}

void stop_portal(int argc, char **argv)
Expand Down Expand Up @@ -981,12 +984,13 @@ void handle_capture(int argc, char **argv) {
TERMINAL_VIEW_ADD_TEXT("Usage: capture [-probe|-beacon|-deauth|-raw|-ble]\n");
return;
}

#ifndef CONFIG_IDF_TARGET_ESP32S2
if (strcmp(argv[1], "-ble") == 0) {
printf("Starting BLE packet capture...\n");
TERMINAL_VIEW_ADD_TEXT("Starting BLE packet capture...\n");
ble_start_capture();
}
#endif
}

void handle_gps_info(int argc, char **argv) {
Expand Down Expand Up @@ -1017,6 +1021,7 @@ void handle_gps_info(int argc, char **argv) {
}
}

#ifndef CONFIG_IDF_TARGET_ESP32S2
void handle_ble_wardriving(int argc, char **argv) {
bool stop_flag = false;

Expand Down Expand Up @@ -1052,7 +1057,7 @@ void handle_ble_wardriving(int argc, char **argv) {
TERMINAL_VIEW_ADD_TEXT("BLE wardriving started.\n");
}
}

#endif

void register_commands() {
register_command("help", handle_help);
Expand All @@ -1077,8 +1082,10 @@ void register_commands() {
register_command("reboot", handle_reboot);
register_command("startwd", handle_startwd);
register_command("gpsinfo", handle_gps_info);
#ifndef CONFIG_IDF_TARGET_ESP32S2
register_command("blescan", handle_ble_scan_cmd);
register_command("blewardriving", handle_ble_wardriving);
#endif
#ifdef DEBUG
register_command("crash", handle_crash); // For Debugging
#endif
Expand Down

0 comments on commit bb4cf72

Please sign in to comment.