CLI application rewrite#33
Open
RJohnsonPGH wants to merge 29 commits into
Open
Conversation
added 6 commits
May 12, 2025 16:20
…, add basic unit tests for moved functions
… to reduce allocations
…implified console flow, etc.
This was referenced May 15, 2025
Open
|
Great work, and beat me too it! I think it's a good idea to leave the CLI to take parameters and let the GUI do the easy mode bits. I'd argue that we could the |
Author
Author
Definitely agree. I'll get around to it at some point. |
added 17 commits
May 16, 2025 16:07
…ed dump file is valid. Added comments and summaries to various classes.
Web UI creation
Finalize basic web app and GitHub page deployment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Okay, there's a lot going on here:
Rather than an interactive prompt/menu driven CLI application, I've changed things to a more traditional argument/option driven CLI application with Spectre.Console. This handles (mostly) automatic generation of help pages, argument and option parsing, and other things. While this is somewhat less user friendly (which I've tried to mitigate as much as possible with help output, documentation, etc.) it significantly reduces the complexity of the code with the various branches, prompting/reading selections, loops, etc.
The code has been moved from a single monolithic source file (Program.cs) into a more standard .NET approach with DI, Services, etc.
UART operations are now in the
UartServiceclass which handles serial communication with the UART, clearing and reading error codes. SerialPort usage has been changed to handle more potential error states, as well as closing/disposal. Retrieved error codes have more validation of the retrieved data to validate checksums.NOR/BIOS operations are now in the
BiosServiceclass which handles BIOS reading and modification. Significant validation checks have been added for reading properties from the dump file.Error code description retrieval is now in the
ErrorCodeServiceclass which handles loading the XML from the web and finding the matching description.All of the above services (as well as the rest of the application) have extensive use of ILogger to assist in troubleshooting failures. The application creates a
log.txtfile in the directory it is running from that contains logged data.Unit tests have been created for some common functions used in the application (parsing retrieved error codes, calculating checksums, etc.), BIOS reading/modification (requires a known good BIOS dump for the test to run), and error code description retrieval. Tests for UART reading/clearing need to be written still.
The modified functions should be easily exportable into a cross platform GUI application as well, which I'm going to take a shot at next.




