aboutsummaryrefslogtreecommitdiffstats
path: root/heimdall/source/BridgeManager.cpp
diff options
context:
space:
mode:
authorBenjamin Dobell <benjamin.dobell+git@glassechidna.com.au>2014-05-05 03:33:12 +1000
committerBenjamin Dobell <benjamin.dobell+git@glassechidna.com.au>2014-05-06 21:39:07 +1000
commita5452e884a1f1119d87e12e42d6ca9745617d054 (patch)
tree747607f94cfc92456a5aa6e86d5cba42290118c5 /heimdall/source/BridgeManager.cpp
parent0767cff62425ff7b90775e57902e90db8ca09200 (diff)
downloadexternal_heimdall-a5452e884a1f1119d87e12e42d6ca9745617d054.zip
external_heimdall-a5452e884a1f1119d87e12e42d6ca9745617d054.tar.gz
external_heimdall-a5452e884a1f1119d87e12e42d6ca9745617d054.tar.bz2
Cleaned up command line interface
- Removed the "--delay <ms>" argument. - Improved Action usage info.
Diffstat (limited to 'heimdall/source/BridgeManager.cpp')
-rw-r--r--heimdall/source/BridgeManager.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/heimdall/source/BridgeManager.cpp b/heimdall/source/BridgeManager.cpp
index 3e85a09..e954f3b 100644
--- a/heimdall/source/BridgeManager.cpp
+++ b/heimdall/source/BridgeManager.cpp
@@ -447,10 +447,9 @@ bool BridgeManager::InitialiseProtocol(void)
return (false);
}
-BridgeManager::BridgeManager(bool verbose, int communicationDelay)
+BridgeManager::BridgeManager(bool verbose)
{
this->verbose = verbose;
- this->communicationDelay = communicationDelay;
libusbContext = nullptr;
deviceHandle = nullptr;
@@ -725,8 +724,7 @@ bool BridgeManager::SendBulkTransfer(unsigned char *data, int length, int timeou
if (result != LIBUSB_SUCCESS && retry)
{
- // max(250, communicationDelay)
- int retryDelay = (communicationDelay > 250) ? communicationDelay : 250;
+ static const int retryDelay = 250;
if (verbose)
Interface::PrintError("libusb error %d whilst sending bulk transfer.", result);
@@ -767,9 +765,6 @@ bool BridgeManager::SendPacket(OutboundPacket *packet, int timeout, bool retry)
if (!SendBulkTransfer(nullptr, 0, timeout, retry))
return (false);
- if (communicationDelay != 0)
- Sleep(communicationDelay);
-
return (true);
}
@@ -789,8 +784,7 @@ bool BridgeManager::ReceivePacket(InboundPacket *packet, int timeout, bool retry
unsigned int attempt = 0;
unsigned int maxAttempts = (retry) ? kReceivePacketMaxAttempts : 1;
- // max(250, communicationDelay)
- int retryDelay = (communicationDelay > 250) ? communicationDelay : 250;
+ static const int retryDelay = 250;
for (; attempt < maxAttempts; attempt++)
{
@@ -818,9 +812,6 @@ bool BridgeManager::ReceivePacket(InboundPacket *packet, int timeout, bool retry
if (attempt == maxAttempts)
return (false);
- if (communicationDelay != 0)
- Sleep(communicationDelay);
-
if (dataTransferred != packet->GetSize() && !packet->IsSizeVariable())
{
if (verbose)