From ebbc3e7cd2086a9f62a857dffe9ab0bd1f5da768 Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Fri, 8 Mar 2013 00:00:52 +1100 Subject: - Removed legacy command line hard-coded partition name parameters. - As a result of the above two points, there are no "known boot partitions", and hence boot partitions are not automatically flashed last. - Made partitions flash in the order in order in which partition arguments are specified. Hence, it's recommended that you specify boot partitions last. - Added --usb-level argument that can be used for debugging libusbx, or flashing issues in general. - Removed generally non-functional firmware dumping behaviour. - Removed auto-resume functionality - Although this feature was definitely nice to have; I believe it may be responsible for flashing compatibility issues for a variety of devices. - As a result of the above. In order perform another action after a --no-reboot action, you must provide the --resume flag. - Heimdall Frontend also has support for specifying the --resume flag via a GUI. Heimdall Frontend also tries to keep track of your actions and enable "Resume" automatically after a "No Reboot" action. - Refactored quite a few of the actions, and code responsible for flashing (particularly PIT file flashing). - Bumped version to 1.4RC3 *however* this commit is not yet an official release candidate. It's still a WIP. In particular build files still have not been updated for Linux and OS X. --- heimdall/source/DetectAction.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'heimdall/source/DetectAction.cpp') diff --git a/heimdall/source/DetectAction.cpp b/heimdall/source/DetectAction.cpp index 319433f..c5b4eb6 100644 --- a/heimdall/source/DetectAction.cpp +++ b/heimdall/source/DetectAction.cpp @@ -25,10 +25,12 @@ #include "Heimdall.h" #include "Interface.h" +using namespace std; using namespace Heimdall; const char *DetectAction::usage = "Action: detect\n\ Arguments: [--verbose] [--stdout-errors]\n\ + [--usb-log-level ]\n\ Description: Indicates whether or not a download mode device can be detected.\n"; int DetectAction::Execute(int argc, char **argv) @@ -38,6 +40,7 @@ int DetectAction::Execute(int argc, char **argv) map argumentTypes; argumentTypes["verbose"] = kArgumentTypeFlag; argumentTypes["stdout-errors"] = kArgumentTypeFlag; + argumentTypes["usb-log-level"] = kArgumentTypeString; Arguments arguments(argumentTypes); @@ -52,9 +55,46 @@ int DetectAction::Execute(int argc, char **argv) if (arguments.GetArgument("stdout-errors") != nullptr) Interface::SetStdoutErrors(true); + const StringArgument *usbLogLevelArgument = static_cast(arguments.GetArgument("usb-log-level")); + + BridgeManager::UsbLogLevel usbLogLevel = BridgeManager::UsbLogLevel::Default; + + if (usbLogLevelArgument) + { + const string& usbLogLevelString = usbLogLevelArgument->GetValue(); + + if (usbLogLevelString.compare("none") == 0 || usbLogLevelString.compare("NONE") == 0) + { + usbLogLevel = BridgeManager::UsbLogLevel::None; + } + else if (usbLogLevelString.compare("error") == 0 || usbLogLevelString.compare("ERROR") == 0) + { + usbLogLevel = BridgeManager::UsbLogLevel::Error; + } + else if (usbLogLevelString.compare("warning") == 0 || usbLogLevelString.compare("WARNING") == 0) + { + usbLogLevel = BridgeManager::UsbLogLevel::Warning; + } + else if (usbLogLevelString.compare("info") == 0 || usbLogLevelString.compare("INFO") == 0) + { + usbLogLevel = BridgeManager::UsbLogLevel::Info; + } + else if (usbLogLevelString.compare("debug") == 0 || usbLogLevelString.compare("DEBUG") == 0) + { + usbLogLevel = BridgeManager::UsbLogLevel::Debug; + } + else + { + Interface::Print("Unknown USB log level: %s\n\n", usbLogLevelString.c_str()); + Interface::Print(DetectAction::usage); + return (0); + } + } + // Download PIT file from device. BridgeManager *bridgeManager = new BridgeManager(verbose); + bridgeManager->SetUsbLogLevel(usbLogLevel); bool detected = bridgeManager->DetectDevice(); -- cgit v1.2.3