-
-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve WiFi logging #358
base: main
Are you sure you want to change the base?
Improve WiFi logging #358
Conversation
ESP8266 WiFi encryption type is according to 802.11, while ESP32 seems to report based on whatever... It would also be oh so convenient if we just report the name, so here it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/serial/serialcommands.cpp
Outdated
@@ -248,9 +290,9 @@ namespace SerialCommands { | |||
if (scanRes >= 0) { | |||
logger.info("[WSCAN] Found %d networks:", scanRes); | |||
for (int i = 0; i < scanRes; i++) { | |||
logger.info("[WSCAN] %d:\t%02d\t%s\t(%d)\t%s", | |||
logger.info("[WSCAN] %d: %02d '%s' (%d dBm) %s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the original reason for the usages of \t
and no '
or
is because it simplified parsing as the only people that would be able to input tab in their SSID would be people that know what the hell they are doing, a '
or a
could easily be put on the SSID and break parsing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to tabs now, the '
can be considered to always surround the SSID and be trimmed (and/or use the length printed before)
It was mentioned this would be easier for parsing, so I'll just leave it the same but with quotes, as it's still just as readable now
Tested on official trackers and it works :3 |
Currently our WiFi stuff is logged in different ways each time we log it, this makes it all surround the SSID in singlequotes and the "OPEN" vs "PASSWD" printout now just says the encryption type (plus it never worked on ESP8266 since "OPEN" is actually 7, not 0).
I'm absolutely certain this isn't the best way of doing this so please complain about it in the reviews/comments or whatever and I can fix it.