@@ -30,8 +30,11 @@ void CommandLine::main(uint32_t currentTime) {
30
30
31
31
this ->runCommand (input);
32
32
33
- if (input != " " )
34
- Serial.print (" > " );
33
+ if (input != " " ) {
34
+ #ifndef SNIFF_SERIAL
35
+ Serial.print (" > " );
36
+ #endif
37
+ }
35
38
}
36
39
37
40
LinkedList<String> CommandLine::parseCommand (String input, char * delim) {
@@ -94,10 +97,13 @@ bool CommandLine::hasSSIDs() {
94
97
}
95
98
96
99
void CommandLine::runCommand (String input) {
97
- if (input != " " )
98
- Serial.println (" #" + input);
99
- else
100
+ if (input != " " ) {
101
+ #ifndef SNIFF_SERIAL
102
+ Serial.println (" #" + input);
103
+ #endif
104
+ } else {
100
105
return ;
106
+ }
101
107
102
108
LinkedList<String> cmd_args = this ->parseCommand (input, " " );
103
109
@@ -266,7 +272,9 @@ void CommandLine::runCommand(String input) {
266
272
}
267
273
// Raw sniff
268
274
else if (cmd_args.get (0 ) == SNIFF_RAW_CMD) {
269
- Serial.println (" Starting Raw sniff. Stop with " + (String)STOPSCAN_CMD);
275
+ #ifndef SNIFF_SERIAL
276
+ Serial.println (" Starting Raw sniff. Stop with " + (String)STOPSCAN_CMD);
277
+ #endif
270
278
#ifdef HAS_SCREEN
271
279
display_obj.clearScreen ();
272
280
menu_function_obj.drawStatusBar ();
@@ -284,7 +292,9 @@ void CommandLine::runCommand(String input) {
284
292
}
285
293
// Beacon sniff
286
294
else if (cmd_args.get (0 ) == SNIFF_BEACON_CMD) {
287
- Serial.println (" Starting Beacon sniff. Stop with " + (String)STOPSCAN_CMD);
295
+ #ifndef SNIFF_SERIAL
296
+ Serial.println (" Starting Beacon sniff. Stop with " + (String)STOPSCAN_CMD);
297
+ #endif
288
298
#ifdef HAS_SCREEN
289
299
display_obj.clearScreen ();
290
300
menu_function_obj.drawStatusBar ();
@@ -293,7 +303,9 @@ void CommandLine::runCommand(String input) {
293
303
}
294
304
// Probe sniff
295
305
else if (cmd_args.get (0 ) == SNIFF_PROBE_CMD) {
296
- Serial.println (" Starting Probe sniff. Stop with " + (String)STOPSCAN_CMD);
306
+ #ifndef SNIFF_SERIAL
307
+ Serial.println (" Starting Probe sniff. Stop with " + (String)STOPSCAN_CMD);
308
+ #endif
297
309
#ifdef HAS_SCREEN
298
310
display_obj.clearScreen ();
299
311
menu_function_obj.drawStatusBar ();
@@ -302,7 +314,9 @@ void CommandLine::runCommand(String input) {
302
314
}
303
315
// Deauth sniff
304
316
else if (cmd_args.get (0 ) == SNIFF_DEAUTH_CMD) {
305
- Serial.println (" Starting Deauth sniff. Stop with " + (String)STOPSCAN_CMD);
317
+ #ifndef SNIFF_SERIAL
318
+ Serial.println (" Starting Deauth sniff. Stop with " + (String)STOPSCAN_CMD);
319
+ #endif
306
320
#ifdef HAS_SCREEN
307
321
display_obj.clearScreen ();
308
322
menu_function_obj.drawStatusBar ();
@@ -311,7 +325,9 @@ void CommandLine::runCommand(String input) {
311
325
}
312
326
// Pwn sniff
313
327
else if (cmd_args.get (0 ) == SNIFF_PWN_CMD) {
314
- Serial.println (" Starting Pwnagotchi sniff. Stop with " + (String)STOPSCAN_CMD);
328
+ #ifndef SNIFF_SERIAL
329
+ Serial.println (" Starting Pwnagotchi sniff. Stop with " + (String)STOPSCAN_CMD);
330
+ #endif
315
331
#ifdef HAS_SCREEN
316
332
display_obj.clearScreen ();
317
333
menu_function_obj.drawStatusBar ();
@@ -320,7 +336,9 @@ void CommandLine::runCommand(String input) {
320
336
}
321
337
// Espressif sniff
322
338
else if (cmd_args.get (0 ) == SNIFF_ESP_CMD) {
323
- Serial.println (" Starting Espressif device sniff. Stop with " + (String)STOPSCAN_CMD);
339
+ #ifndef SNIFF_SERIAL
340
+ Serial.println (" Starting Espressif device sniff. Stop with " + (String)STOPSCAN_CMD);
341
+ #endif
324
342
#ifdef HAS_SCREEN
325
343
display_obj.clearScreen ();
326
344
menu_function_obj.drawStatusBar ();
@@ -335,16 +353,22 @@ void CommandLine::runCommand(String input) {
335
353
if (ch_sw != -1 ) {
336
354
wifi_scan_obj.set_channel = cmd_args.get (ch_sw + 1 ).toInt ();
337
355
wifi_scan_obj.changeChannel ();
338
- Serial.println (" Set channel: " + (String)wifi_scan_obj.set_channel );
356
+ #ifndef SNIFF_SERIAL
357
+ Serial.println (" Set channel: " + (String)wifi_scan_obj.set_channel );
358
+ #endif
339
359
340
360
}
341
361
342
362
if (d_sw == -1 ) {
343
- Serial.println (" Starting PMKID sniff on channel " + (String)wifi_scan_obj.set_channel + " . Stop with " + (String)STOPSCAN_CMD);
363
+ #ifndef SNIFF_SERIAL
364
+ Serial.println (" Starting PMKID sniff on channel " + (String)wifi_scan_obj.set_channel + " . Stop with " + (String)STOPSCAN_CMD);
365
+ #endif
344
366
wifi_scan_obj.StartScan (WIFI_SCAN_EAPOL, TFT_VIOLET);
345
367
}
346
368
else {
347
- Serial.println (" Starting PMKID sniff with deauthentication on channel " + (String)wifi_scan_obj.set_channel + " . Stop with " + (String)STOPSCAN_CMD);
369
+ #ifndef SNIFF_SERIAL
370
+ Serial.println (" Starting PMKID sniff with deauthentication on channel " + (String)wifi_scan_obj.set_channel + " . Stop with " + (String)STOPSCAN_CMD);
371
+ #endif
348
372
wifi_scan_obj.StartScan (WIFI_SCAN_ACTIVE_EAPOL, TFT_VIOLET);
349
373
}
350
374
}
0 commit comments