Skip to content
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

fix(radio): remove invalid characters from logs filename. #5129

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

philmoz
Copy link
Collaborator

@philmoz philmoz commented Jun 6, 2024

Fixes #5128

Logging uses model name to create log file - model name can include characters that are not valid in a filename on the radio.

@pfeerick
Copy link
Member

pfeerick commented Jun 6, 2024

Was just looking at this... perhaps worth doing as a helper function in sdcard.cpp? isFileAvailable() is there already... maybe either another function isValidFsChar()? that just does the letter by letter check or a sanitiseFilename() type one that does that entire check itself and returns a sanitised/valid filename? Are there will probably be other places we need to be doing this at some point... if not now.

@pfeerick pfeerick added the bug 🪲 Something isn't working label Jun 6, 2024
@pfeerick pfeerick added this to the 2.10.2 milestone Jun 6, 2024
@philmoz
Copy link
Collaborator Author

philmoz commented Jun 6, 2024

I've added a helper function in strhelpers.cpp so it can use the existing temp buffer.
Also cleaned up the log filename creation code.

Copy link
Member

@pfeerick pfeerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on TPro with 5" Quad

@pfeerick pfeerick merged commit 8e64c3b into main Jun 6, 2024
45 checks passed
@pfeerick pfeerick deleted the philmoz/sanitize-logs-filename branch June 6, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using the " symbol in model name causing SD card error when enabling SD logging.
2 participants