aboutsummaryrefslogtreecommitdiffstats
path: root/heimdall/source
diff options
context:
space:
mode:
authorKoushik Dutta <koushd@gmail.com>2013-08-14 10:14:59 -0700
committerKoushik Dutta <koushd@gmail.com>2013-08-14 10:14:59 -0700
commitc5464757ad147f42089e6728eabb3906181be5fe (patch)
tree274c8b52130e1c30e813a502c977fd5424a69b70 /heimdall/source
parent49a02b8c916e8ef011d9f56901d208eca626b85b (diff)
downloadexternal_heimdall-c5464757ad147f42089e6728eabb3906181be5fe.zip
external_heimdall-c5464757ad147f42089e6728eabb3906181be5fe.tar.gz
external_heimdall-c5464757ad147f42089e6728eabb3906181be5fe.tar.bz2
Switch UsbLogLevel back to an int.
AOSP does not support C++11 Change-Id: Iaf2e09cc05f8f867fa776b62313af6774ce47a56
Diffstat (limited to 'heimdall/source')
-rw-r--r--heimdall/source/Android.mk1
-rw-r--r--heimdall/source/BridgeManager.cpp34
-rw-r--r--heimdall/source/BridgeManager.h8
-rw-r--r--heimdall/source/ClosePcScreenAction.cpp12
-rw-r--r--heimdall/source/DetectAction.cpp12
-rw-r--r--heimdall/source/DownloadPitAction.cpp12
-rw-r--r--heimdall/source/FlashAction.cpp12
-rw-r--r--heimdall/source/PrintPitAction.cpp12
8 files changed, 51 insertions, 52 deletions
diff --git a/heimdall/source/Android.mk b/heimdall/source/Android.mk
index 9d015b9..d1bd0f7 100644
--- a/heimdall/source/Android.mk
+++ b/heimdall/source/Android.mk
@@ -12,7 +12,6 @@ LOCAL_SRC_FILES := \
VersionAction.cpp \
BridgeManager.cpp \
DetectAction.cpp \
- DumpAction.cpp \
HelpAction.cpp \
Interface.cpp \
Utility.cpp \
diff --git a/heimdall/source/BridgeManager.cpp b/heimdall/source/BridgeManager.cpp
index 5150788..8d4a9b6 100644
--- a/heimdall/source/BridgeManager.cpp
+++ b/heimdall/source/BridgeManager.cpp
@@ -467,7 +467,7 @@ BridgeManager::BridgeManager(bool verbose, int communicationDelay)
fileTransferPacketSize = kFileTransferPacketSizeDefault;
fileTransferSequenceTimeout = kFileTransferSequenceTimeoutDefault;
- usbLogLevel = UsbLogLevel::Default;
+ usbLogLevel = Default;
}
BridgeManager::~BridgeManager()
@@ -499,23 +499,23 @@ bool BridgeManager::DetectDevice(void)
// Setup libusb log level.
switch (usbLogLevel)
{
- case UsbLogLevel::None:
+ case None:
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_NONE);
break;
- case UsbLogLevel::Error:
+ case Error:
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_ERROR);
break;
- case UsbLogLevel::Warning:
+ case Warning:
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_WARNING);
break;
- case UsbLogLevel::Info:
+ case Info:
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_INFO);
break;
- case UsbLogLevel::Debug:
+ case Debug:
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_DEBUG);
break;
}
@@ -588,23 +588,23 @@ int BridgeManager::Initialise(bool resume)
// Setup libusb log level.
switch (usbLogLevel)
{
- case UsbLogLevel::None:
+ case None:
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_NONE);
break;
- case UsbLogLevel::Error:
+ case Error:
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_ERROR);
break;
- case UsbLogLevel::Warning:
+ case Warning:
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_WARNING);
break;
- case UsbLogLevel::Info:
+ case Info:
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_INFO);
break;
- case UsbLogLevel::Debug:
+ case Debug:
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_DEBUG);
break;
}
@@ -1366,7 +1366,7 @@ bool BridgeManager::SendFile(FILE *file, unsigned int destination, unsigned int
return (true);
}
-void BridgeManager::SetUsbLogLevel(UsbLogLevel usbLogLevel)
+void BridgeManager::SetUsbLogLevel(int usbLogLevel)
{
this->usbLogLevel = usbLogLevel;
@@ -1374,23 +1374,23 @@ void BridgeManager::SetUsbLogLevel(UsbLogLevel usbLogLevel)
{
switch (usbLogLevel)
{
- case UsbLogLevel::None:
+ case None:
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_NONE);
break;
- case UsbLogLevel::Error:
+ case Error:
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_ERROR);
break;
- case UsbLogLevel::Warning:
+ case Warning:
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_WARNING);
break;
- case UsbLogLevel::Info:
+ case Info:
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_INFO);
break;
- case UsbLogLevel::Debug:
+ case Debug:
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_DEBUG);
break;
}
diff --git a/heimdall/source/BridgeManager.h b/heimdall/source/BridgeManager.h
index e67c679..063b273 100644
--- a/heimdall/source/BridgeManager.h
+++ b/heimdall/source/BridgeManager.h
@@ -83,7 +83,7 @@ namespace Heimdall
kPidDroidCharge = 0x68C3
};
- enum class UsbLogLevel
+ enum UsbLogLevel
{
None = 0,
Error,
@@ -122,7 +122,7 @@ namespace Heimdall
unsigned int fileTransferPacketSize;
unsigned int fileTransferSequenceTimeout;
- UsbLogLevel usbLogLevel;
+ int usbLogLevel;
int FindDeviceInterface(void);
bool ClaimDeviceInterface(void);
@@ -153,9 +153,9 @@ namespace Heimdall
bool SendFile(FILE *file, unsigned int destination, unsigned int deviceType, unsigned int fileIdentifier = 0xFFFFFFFF) const;
- void SetUsbLogLevel(UsbLogLevel usbLogLevel);
+ void SetUsbLogLevel(int usbLogLevel);
- UsbLogLevel GetUsbLogLevel(void) const
+ int GetUsbLogLevel(void) const
{
return usbLogLevel;
}
diff --git a/heimdall/source/ClosePcScreenAction.cpp b/heimdall/source/ClosePcScreenAction.cpp
index 2bc1b61..2f6435e 100644
--- a/heimdall/source/ClosePcScreenAction.cpp
+++ b/heimdall/source/ClosePcScreenAction.cpp
@@ -56,7 +56,7 @@ int ClosePcScreenAction::Execute(int argc, char **argv)
const UnsignedIntegerArgument *communicationDelayArgument = static_cast<const UnsignedIntegerArgument *>(arguments.GetArgument("delay"));
const StringArgument *usbLogLevelArgument = static_cast<const StringArgument *>(arguments.GetArgument("usb-log-level"));
- BridgeManager::UsbLogLevel usbLogLevel = BridgeManager::UsbLogLevel::Default;
+ int usbLogLevel = BridgeManager::Default;
if (usbLogLevelArgument)
{
@@ -64,23 +64,23 @@ int ClosePcScreenAction::Execute(int argc, char **argv)
if (usbLogLevelString.compare("none") == 0 || usbLogLevelString.compare("NONE") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::None;
+ usbLogLevel = BridgeManager::None;
}
else if (usbLogLevelString.compare("error") == 0 || usbLogLevelString.compare("ERROR") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Error;
+ usbLogLevel = BridgeManager::Error;
}
else if (usbLogLevelString.compare("warning") == 0 || usbLogLevelString.compare("WARNING") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Warning;
+ usbLogLevel = BridgeManager::Warning;
}
else if (usbLogLevelString.compare("info") == 0 || usbLogLevelString.compare("INFO") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Info;
+ usbLogLevel = BridgeManager::Info;
}
else if (usbLogLevelString.compare("debug") == 0 || usbLogLevelString.compare("DEBUG") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Debug;
+ usbLogLevel = BridgeManager::Debug;
}
else
{
diff --git a/heimdall/source/DetectAction.cpp b/heimdall/source/DetectAction.cpp
index 13d8ea1..f137e88 100644
--- a/heimdall/source/DetectAction.cpp
+++ b/heimdall/source/DetectAction.cpp
@@ -57,7 +57,7 @@ int DetectAction::Execute(int argc, char **argv)
const StringArgument *usbLogLevelArgument = static_cast<const StringArgument *>(arguments.GetArgument("usb-log-level"));
- BridgeManager::UsbLogLevel usbLogLevel = BridgeManager::UsbLogLevel::Default;
+ BridgeManager::UsbLogLevel usbLogLevel = BridgeManager::Default;
if (usbLogLevelArgument)
{
@@ -65,23 +65,23 @@ int DetectAction::Execute(int argc, char **argv)
if (usbLogLevelString.compare("none") == 0 || usbLogLevelString.compare("NONE") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::None;
+ usbLogLevel = BridgeManager::None;
}
else if (usbLogLevelString.compare("error") == 0 || usbLogLevelString.compare("ERROR") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Error;
+ usbLogLevel = BridgeManager::Error;
}
else if (usbLogLevelString.compare("warning") == 0 || usbLogLevelString.compare("WARNING") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Warning;
+ usbLogLevel = BridgeManager::Warning;
}
else if (usbLogLevelString.compare("info") == 0 || usbLogLevelString.compare("INFO") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Info;
+ usbLogLevel = BridgeManager::Info;
}
else if (usbLogLevelString.compare("debug") == 0 || usbLogLevelString.compare("DEBUG") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Debug;
+ usbLogLevel = BridgeManager::Debug;
}
else
{
diff --git a/heimdall/source/DownloadPitAction.cpp b/heimdall/source/DownloadPitAction.cpp
index abebfae..20c8fb0 100644
--- a/heimdall/source/DownloadPitAction.cpp
+++ b/heimdall/source/DownloadPitAction.cpp
@@ -78,7 +78,7 @@ int DownloadPitAction::Execute(int argc, char **argv)
const StringArgument *usbLogLevelArgument = static_cast<const StringArgument *>(arguments.GetArgument("usb-log-level"));
- BridgeManager::UsbLogLevel usbLogLevel = BridgeManager::UsbLogLevel::Default;
+ BridgeManager::UsbLogLevel usbLogLevel = BridgeManager::Default;
if (usbLogLevelArgument)
{
@@ -86,23 +86,23 @@ int DownloadPitAction::Execute(int argc, char **argv)
if (usbLogLevelString.compare("none") == 0 || usbLogLevelString.compare("NONE") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::None;
+ usbLogLevel = BridgeManager::None;
}
else if (usbLogLevelString.compare("error") == 0 || usbLogLevelString.compare("ERROR") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Error;
+ usbLogLevel = BridgeManager::Error;
}
else if (usbLogLevelString.compare("warning") == 0 || usbLogLevelString.compare("WARNING") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Warning;
+ usbLogLevel = BridgeManager::Warning;
}
else if (usbLogLevelString.compare("info") == 0 || usbLogLevelString.compare("INFO") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Info;
+ usbLogLevel = BridgeManager::Info;
}
else if (usbLogLevelString.compare("debug") == 0 || usbLogLevelString.compare("DEBUG") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Debug;
+ usbLogLevel = BridgeManager::Debug;
}
else
{
diff --git a/heimdall/source/FlashAction.cpp b/heimdall/source/FlashAction.cpp
index 6f2d49b..0bea8a6 100644
--- a/heimdall/source/FlashAction.cpp
+++ b/heimdall/source/FlashAction.cpp
@@ -428,7 +428,7 @@ int FlashAction::Execute(int argc, char **argv)
const StringArgument *usbLogLevelArgument = static_cast<const StringArgument *>(arguments.GetArgument("usb-log-level"));
- BridgeManager::UsbLogLevel usbLogLevel = BridgeManager::UsbLogLevel::Default;
+ BridgeManager::UsbLogLevel usbLogLevel = BridgeManager::Default;
if (usbLogLevelArgument)
{
@@ -436,23 +436,23 @@ int FlashAction::Execute(int argc, char **argv)
if (usbLogLevelString.compare("none") == 0 || usbLogLevelString.compare("NONE") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::None;
+ usbLogLevel = BridgeManager::None;
}
else if (usbLogLevelString.compare("error") == 0 || usbLogLevelString.compare("ERROR") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Error;
+ usbLogLevel = BridgeManager::Error;
}
else if (usbLogLevelString.compare("warning") == 0 || usbLogLevelString.compare("WARNING") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Warning;
+ usbLogLevel = BridgeManager::Warning;
}
else if (usbLogLevelString.compare("info") == 0 || usbLogLevelString.compare("INFO") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Info;
+ usbLogLevel = BridgeManager::Info;
}
else if (usbLogLevelString.compare("debug") == 0 || usbLogLevelString.compare("DEBUG") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Debug;
+ usbLogLevel = BridgeManager::Debug;
}
else
{
diff --git a/heimdall/source/PrintPitAction.cpp b/heimdall/source/PrintPitAction.cpp
index 1c8c98a..20144a7 100644
--- a/heimdall/source/PrintPitAction.cpp
+++ b/heimdall/source/PrintPitAction.cpp
@@ -72,7 +72,7 @@ int PrintPitAction::Execute(int argc, char **argv)
const StringArgument *usbLogLevelArgument = static_cast<const StringArgument *>(arguments.GetArgument("usb-log-level"));
- BridgeManager::UsbLogLevel usbLogLevel = BridgeManager::UsbLogLevel::Default;
+ BridgeManager::UsbLogLevel usbLogLevel = BridgeManager::Default;
if (usbLogLevelArgument)
{
@@ -80,23 +80,23 @@ int PrintPitAction::Execute(int argc, char **argv)
if (usbLogLevelString.compare("none") == 0 || usbLogLevelString.compare("NONE") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::None;
+ usbLogLevel = BridgeManager::None;
}
else if (usbLogLevelString.compare("error") == 0 || usbLogLevelString.compare("ERROR") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Error;
+ usbLogLevel = BridgeManager::Error;
}
else if (usbLogLevelString.compare("warning") == 0 || usbLogLevelString.compare("WARNING") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Warning;
+ usbLogLevel = BridgeManager::Warning;
}
else if (usbLogLevelString.compare("info") == 0 || usbLogLevelString.compare("INFO") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Info;
+ usbLogLevel = BridgeManager::Info;
}
else if (usbLogLevelString.compare("debug") == 0 || usbLogLevelString.compare("DEBUG") == 0)
{
- usbLogLevel = BridgeManager::UsbLogLevel::Debug;
+ usbLogLevel = BridgeManager::Debug;
}
else
{