diff options
-rw-r--r-- | heimdall/source/BridgeManager.cpp | 95 | ||||
-rw-r--r-- | heimdall/source/BridgeManager.h | 11 | ||||
-rw-r--r-- | heimdall/source/FlashAction.cpp | 1 | ||||
-rw-r--r-- | heimdall/source/ResponsePacket.h | 2 |
4 files changed, 1 insertions, 108 deletions
diff --git a/heimdall/source/BridgeManager.cpp b/heimdall/source/BridgeManager.cpp index 1559a70..7db00d5 100644 --- a/heimdall/source/BridgeManager.cpp +++ b/heimdall/source/BridgeManager.cpp @@ -306,102 +306,10 @@ void BridgeManager::ReleaseDeviceInterface(void) Interface::Print("\n"); } -enum -{ - kControlRequestSetLineCoding = 0x20, - kControlRequestSetControlLineState = 0x22 -}; - - -enum -{ - kLineCodingCharFormatZeroToOneStopBit = 0, - kLineCodingCharFormatOneToOneAndAHalfStopBits = 1, - kLineCodingCharFormatTwoToTwoAndAHalfStopBits = 2 -}; - -enum -{ - kParityTypeNone = 0, - kParityTypeOdd = 1, - kParityTypeEven = 2, - kParityTypeMark = 3, - kParityTypeSpace = 4 -}; - -bool BridgeManager::SetControlLineState(unsigned short controlSignalFlags) -{ - int result = libusb_control_transfer(deviceHandle, LIBUSB_REQUEST_TYPE_CLASS, kControlRequestSetControlLineState, controlSignalFlags, 0, nullptr, 0, 1000); - - if (result != LIBUSB_SUCCESS) - { - if (verbose) - Interface::PrintWarning("Control line state (signal flags: 0x%x) transfer failed. Result: %d\n", controlSignalFlags, result); - - return (false); - } - else - { - return (true); - } -} - -bool BridgeManager::SetControlLineCoding(LineCoding lineCoding) -{ - unsigned char dataBuffer[7]; - - dataBuffer[0] = lineCoding.dteRate & 0xFF; - dataBuffer[1] = (lineCoding.dteRate >> 8) & 0xFF; - dataBuffer[2] = (lineCoding.dteRate >> 16) & 0xFF; - dataBuffer[3] = (lineCoding.dteRate >> 24) & 0xFF; - dataBuffer[4] = lineCoding.charFormat; - dataBuffer[5] = lineCoding.parityType; - dataBuffer[6] = lineCoding.dataBits; - - int result = libusb_control_transfer(deviceHandle, LIBUSB_REQUEST_TYPE_CLASS, kControlRequestSetLineCoding, 0x0, 0, dataBuffer, 7, 1000); - - if (result != LIBUSB_SUCCESS) - { - if (verbose) - Interface::PrintWarning("Setting control line coding failed. Result: %d\n", result); - - return (false); - } - else - { - return (true); - } -} - -enum -{ - kLineStateControlSignalDtePresent = 1, - kLineStateControlSignalCarrierControl = 1 << 1 -}; - bool BridgeManager::InitialiseProtocol(void) { Interface::Print("Initialising protocol...\n"); - /*LineCoding lineCoding; - - lineCoding.dteRate = 115200; - lineCoding.charFormat = kLineCodingCharFormatZeroToOneStopBit; - lineCoding.parityType = kParityTypeNone; - lineCoding.dataBits = 7; - - SetControlLineState(kLineStateControlSignalDtePresent | kLineStateControlSignalCarrierControl); - SetControlLineCoding(lineCoding); - SetControlLineState(kLineStateControlSignalDtePresent | kLineStateControlSignalCarrierControl); - SetControlLineState(kLineStateControlSignalCarrierControl); - - lineCoding.dataBits = 8; - SetControlLineCoding(lineCoding); - - SetControlLineState(kLineStateControlSignalCarrierControl);*/ - - int dataTransferred = 0; - unsigned char dataBuffer[7]; // Send "ODIN" @@ -416,8 +324,7 @@ bool BridgeManager::InitialiseProtocol(void) // Expect "LOKE" memset(dataBuffer, 0, 7); - int retry = 0; - dataTransferred = 0; + int dataTransferred = 0; int result = libusb_bulk_transfer(deviceHandle, inEndpoint, dataBuffer, 7, &dataTransferred, 1000); diff --git a/heimdall/source/BridgeManager.h b/heimdall/source/BridgeManager.h index 04b03c3..9ebbdae 100644 --- a/heimdall/source/BridgeManager.h +++ b/heimdall/source/BridgeManager.h @@ -89,14 +89,6 @@ namespace Heimdall Default = Error
};
- typedef struct
- {
- unsigned int dteRate;
- unsigned char charFormat;
- unsigned char parityType;
- unsigned char dataBits;
- } LineCoding;
-
private:
static const DeviceIdentifier supportedDevices[kSupportedDeviceCount];
@@ -133,9 +125,6 @@ namespace Heimdall bool InitialiseProtocol(void);
- bool SetControlLineState(unsigned short controlSignalFlags);
- bool SetControlLineCoding(LineCoding lineCoding);
-
bool SendBulkTransfer(unsigned char *data, int length, int timeout = 3000, bool retry = true) const;
public:
diff --git a/heimdall/source/FlashAction.cpp b/heimdall/source/FlashAction.cpp index e528680..2ceaa3e 100644 --- a/heimdall/source/FlashAction.cpp +++ b/heimdall/source/FlashAction.cpp @@ -100,7 +100,6 @@ static bool openFiles(Arguments& arguments, vector<PartitionFile>& partitionFile for (vector<const Argument *>::const_iterator it = arguments.GetArguments().begin(); it != arguments.GetArguments().end(); it++) { - bool isPartitionArgument = false; const string& argumentName = (*it)->GetName(); // The only way an argument could exist without being in the argument types map is if it's a wild-card. diff --git a/heimdall/source/ResponsePacket.h b/heimdall/source/ResponsePacket.h index 9463333..d0769af 100644 --- a/heimdall/source/ResponsePacket.h +++ b/heimdall/source/ResponsePacket.h @@ -64,8 +64,6 @@ namespace Heimdall virtual bool Unpack(void)
{
- const unsigned char *data = GetData();
-
unsigned int receivedResponseType = UnpackInteger(0);
if (receivedResponseType != responseType)
{
|