aboutsummaryrefslogtreecommitdiffstats
path: root/heimdall/source/BridgeManager.h
diff options
context:
space:
mode:
authorBenjamin Dobell <benjamin.dobell+git@glassechidna.com.au>2012-10-01 12:43:05 +1000
committerBenjamin Dobell <benjamin.dobell+git@glassechidna.com.au>2012-10-02 01:41:25 +1000
commit6cd6b35c737e0e4042a8fd79af1decc9f10ed84b (patch)
tree89625119662474ef30c84f410c056343d412121b /heimdall/source/BridgeManager.h
parent66f1e84dd2eafc4dd617f10f832c274885a8a28c (diff)
downloadexternal_heimdall-6cd6b35c737e0e4042a8fd79af1decc9f10ed84b.zip
external_heimdall-6cd6b35c737e0e4042a8fd79af1decc9f10ed84b.tar.gz
external_heimdall-6cd6b35c737e0e4042a8fd79af1decc9f10ed84b.tar.bz2
Heimdall 1.4 RC1:
- Massive refactoring. - Support for Qualcomm based devices. - Print PIT from file. - Use partition names as arguments e.g. --HIDDEN, --KERNEL, --MOVINAND etc. - Heimdall Frontend UI improvements. - And much more...
Diffstat (limited to 'heimdall/source/BridgeManager.h')
-rw-r--r--heimdall/source/BridgeManager.h37
1 files changed, 26 insertions, 11 deletions
diff --git a/heimdall/source/BridgeManager.h b/heimdall/source/BridgeManager.h
index f131bda..1c3a435 100644
--- a/heimdall/source/BridgeManager.h
+++ b/heimdall/source/BridgeManager.h
@@ -41,8 +41,8 @@ namespace Heimdall
const int productId;
DeviceIdentifier(int vid, int pid) :
- vendorId(vid),
- productId(pid)
+ vendorId(vid),
+ productId(pid)
{
}
};
@@ -53,10 +53,12 @@ namespace Heimdall
enum
{
- kSupportedDeviceCount = 3,
+ kSupportedDeviceCount = 3,
+ };
- kCommunicationDelayDefault = 0,
- kDumpBufferSize = 4096
+ enum
+ {
+ kCommunicationDelayDefault = 0
};
enum
@@ -83,15 +85,18 @@ namespace Heimdall
static const DeviceIdentifier supportedDevices[kSupportedDeviceCount];
bool verbose;
+ int communicationDelay;
libusb_context *libusbContext;
libusb_device_handle *deviceHandle;
libusb_device *heimdallDevice;
+
int interfaceIndex;
+ int altSettingIndex;
int inEndpoint;
int outEndpoint;
- int communicationDelay;
+ bool interfaceClaimed;
#ifdef OS_LINUX
@@ -99,29 +104,39 @@ namespace Heimdall
#endif
+ unsigned int fileTransferSequenceMaxLength;
+ unsigned int fileTransferPacketSize;
+ unsigned int fileTransferSequenceTimeout;
+
+ int FindDeviceInterface(void);
+ bool ClaimDeviceInterface(void);
+ bool SetupDeviceInterface(void);
+ void ReleaseDeviceInterface(void);
+
bool CheckProtocol(void) const;
bool InitialiseProtocol(void) const;
public:
- BridgeManager(bool verbose, int communicationDelay);
+ BridgeManager(bool verbose, int communicationDelay = BridgeManager::kCommunicationDelayDefault);
~BridgeManager();
bool DetectDevice(void);
int Initialise(void);
- bool BeginSession(void) const;
+ bool BeginSession(void);
bool EndSession(bool reboot) const;
bool SendPacket(OutboundPacket *packet, int timeout = 3000, bool retry = true) const;
- bool ReceivePacket(InboundPacket *packet, int timeout = 3000, bool retry = true) const;
+ bool ReceivePacket(InboundPacket *packet, int timeout = 3000, bool retry = true, unsigned char *buffer = nullptr, unsigned int bufferSize = -1) const;
- bool RequestDeviceInfo(unsigned int request, int *result) const;
+ bool RequestDeviceType(unsigned int request, int *result) const;
bool SendPitFile(FILE *file) const;
int ReceivePitFile(unsigned char **pitBuffer) const;
+ int DownloadPitFile(unsigned char **pitBuffer) const; // Thin wrapper around ReceivePitFile() with additional logging.
- bool SendFile(FILE *file, unsigned int destination, unsigned int chipIdentifier, unsigned int fileIdentifier = 0xFFFFFFFF) const;
+ bool SendFile(FILE *file, unsigned int destination, unsigned int deviceType, unsigned int fileIdentifier = 0xFFFFFFFF) const;
bool ReceiveDump(unsigned int chipType, unsigned int chipId, FILE *file) const;
bool IsVerbose(void) const