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/ClosePcScreenAction.cpp | 45 +++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) (limited to 'heimdall/source/ClosePcScreenAction.cpp') diff --git a/heimdall/source/ClosePcScreenAction.cpp b/heimdall/source/ClosePcScreenAction.cpp index a7de9d9..1c53ffe 100644 --- a/heimdall/source/ClosePcScreenAction.cpp +++ b/heimdall/source/ClosePcScreenAction.cpp @@ -25,11 +25,13 @@ #include "Heimdall.h" #include "Interface.h" +using namespace std; using namespace Heimdall; const char *ClosePcScreenAction::usage = "Action: close-pc-screen\n\ Arguments: [--verbose] [--no-reboot] [--stdout-errors] [--delay ]\n\ -Description: Attempts to get rid off the \"connect phone to PC\" screen.\n"; + [--usb-log-level ]\n\ +Description: Attempts to get rid off the \"connect phone to PC\" screen.\n"; // TODO: usb-log-level int ClosePcScreenAction::Execute(int argc, char **argv) { @@ -37,9 +39,11 @@ int ClosePcScreenAction::Execute(int argc, char **argv) map argumentTypes; argumentTypes["no-reboot"] = kArgumentTypeFlag; + argumentTypes["resume"] = kArgumentTypeFlag; argumentTypes["delay"] = kArgumentTypeUnsignedInteger; argumentTypes["verbose"] = kArgumentTypeFlag; argumentTypes["stdout-errors"] = kArgumentTypeFlag; + argumentTypes["usb-log-level"] = kArgumentTypeString; Arguments arguments(argumentTypes); @@ -50,8 +54,44 @@ int ClosePcScreenAction::Execute(int argc, char **argv) } const UnsignedIntegerArgument *communicationDelayArgument = static_cast(arguments.GetArgument("delay")); + 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(ClosePcScreenAction::usage); + return (0); + } + } bool reboot = arguments.GetArgument("no-reboot") == nullptr; + bool resume = arguments.GetArgument("resume") != nullptr; bool verbose = arguments.GetArgument("verbose") != nullptr; if (arguments.GetArgument("stdout-errors") != nullptr) @@ -70,8 +110,9 @@ int ClosePcScreenAction::Execute(int argc, char **argv) communicationDelay = communicationDelayArgument->GetValue(); BridgeManager *bridgeManager = new BridgeManager(verbose, communicationDelay); + bridgeManager->SetUsbLogLevel(usbLogLevel); - if (bridgeManager->Initialise() != BridgeManager::kInitialiseSucceeded || !bridgeManager->BeginSession()) + if (bridgeManager->Initialise(resume) != BridgeManager::kInitialiseSucceeded || !bridgeManager->BeginSession()) { delete bridgeManager; return (1); -- cgit v1.1 From 07dcba54fc8cc5b7c6515305aa233e24a58adc94 Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Mon, 13 May 2013 00:08:30 +1000 Subject: Update copyright notices, version identifier and documentation for 1.4.0 release. --- heimdall/source/ClosePcScreenAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'heimdall/source/ClosePcScreenAction.cpp') diff --git a/heimdall/source/ClosePcScreenAction.cpp b/heimdall/source/ClosePcScreenAction.cpp index 1c53ffe..2bc1b61 100644 --- a/heimdall/source/ClosePcScreenAction.cpp +++ b/heimdall/source/ClosePcScreenAction.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2012 Benjamin Dobell, Glass Echidna +/* Copyright (c) 2010-2013 Benjamin Dobell, Glass Echidna Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -31,7 +31,7 @@ using namespace Heimdall; const char *ClosePcScreenAction::usage = "Action: close-pc-screen\n\ Arguments: [--verbose] [--no-reboot] [--stdout-errors] [--delay ]\n\ [--usb-log-level ]\n\ -Description: Attempts to get rid off the \"connect phone to PC\" screen.\n"; // TODO: usb-log-level +Description: Attempts to get rid off the \"connect phone to PC\" screen.\n"; int ClosePcScreenAction::Execute(int argc, char **argv) { -- cgit v1.1