CLI application rewrite
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.
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 exe could be a little more user friendly without spaces etc.
e.g uarl-cli
Added log parsing directly from the dumps
I'd argue that we could the
execould be a little more user friendly without spaces etc. e.guarl-cli
Definitely agree. I'll get around to it at some point.