From a5452e884a1f1119d87e12e42d6ca9745617d054 Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Mon, 5 May 2014 03:33:12 +1000 Subject: Cleaned up command line interface - Removed the "--delay " argument. - Improved Action usage info. --- heimdall/source/PrintPitAction.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'heimdall/source/PrintPitAction.cpp') diff --git a/heimdall/source/PrintPitAction.cpp b/heimdall/source/PrintPitAction.cpp index 1c8c98a..4ed6e6c 100644 --- a/heimdall/source/PrintPitAction.cpp +++ b/heimdall/source/PrintPitAction.cpp @@ -34,10 +34,13 @@ using namespace Heimdall; const char *PrintPitAction::usage = "Action: print-pit\n\ Arguments: [--file ] [--verbose] [--no-reboot] [--stdout-errors]\n\ - [--delay ] [--usb-log-level ]\n\ + [--usb-log-level ]\n\ Description: Prints the contents of a PIT file in a human readable format. If\n\ a filename is not provided then Heimdall retrieves the PIT file from the \n\ - connected device.\n"; + connected device.\n\ +Note: --no-reboot causes the device to remain in download mode after the action\n\ + is completed. If you wish to perform another action whilst remaining in\n\ + download mode, then the following action must specify the --resume flag."; int PrintPitAction::Execute(int argc, char **argv) { @@ -47,7 +50,6 @@ int PrintPitAction::Execute(int argc, char **argv) argumentTypes["file"] = kArgumentTypeString; argumentTypes["no-reboot"] = kArgumentTypeFlag; argumentTypes["resume"] = kArgumentTypeFlag; - argumentTypes["delay"] = kArgumentTypeUnsignedInteger; argumentTypes["verbose"] = kArgumentTypeFlag; argumentTypes["stdout-errors"] = kArgumentTypeFlag; argumentTypes["usb-log-level"] = kArgumentTypeString; @@ -61,7 +63,6 @@ int PrintPitAction::Execute(int argc, char **argv) } const StringArgument *fileArgument = static_cast(arguments.GetArgument("file")); - const UnsignedIntegerArgument *communicationDelayArgument = static_cast(arguments.GetArgument("delay")); bool reboot = arguments.GetArgument("no-reboot") == nullptr; bool resume = arguments.GetArgument("resume") != nullptr; @@ -155,12 +156,7 @@ int PrintPitAction::Execute(int argc, char **argv) { // Print PIT from a device. - int communicationDelay = BridgeManager::kCommunicationDelayDefault; - - if (communicationDelayArgument) - communicationDelay = communicationDelayArgument->GetValue(); - - BridgeManager *bridgeManager = new BridgeManager(verbose, communicationDelay); + BridgeManager *bridgeManager = new BridgeManager(verbose); bridgeManager->SetUsbLogLevel(usbLogLevel); if (bridgeManager->Initialise(resume) != BridgeManager::kInitialiseSucceeded || !bridgeManager->BeginSession()) -- cgit v1.1 From 9f957a193701788cac66292daea2c89ed94a033f Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Tue, 6 May 2014 22:52:10 +1000 Subject: Updated copyright notices to 2014 --- heimdall/source/PrintPitAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'heimdall/source/PrintPitAction.cpp') diff --git a/heimdall/source/PrintPitAction.cpp b/heimdall/source/PrintPitAction.cpp index 4ed6e6c..05f6de7 100644 --- a/heimdall/source/PrintPitAction.cpp +++ b/heimdall/source/PrintPitAction.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2013 Benjamin Dobell, Glass Echidna +/* Copyright (c) 2010-2014 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 -- cgit v1.1 From e6fdafd4829842d96eefa3163b6149265819fe95 Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Sun, 11 May 2014 19:26:26 +1000 Subject: Fixed help output alignment. --- heimdall/source/PrintPitAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'heimdall/source/PrintPitAction.cpp') diff --git a/heimdall/source/PrintPitAction.cpp b/heimdall/source/PrintPitAction.cpp index 05f6de7..01f57aa 100644 --- a/heimdall/source/PrintPitAction.cpp +++ b/heimdall/source/PrintPitAction.cpp @@ -40,7 +40,7 @@ Description: Prints the contents of a PIT file in a human readable format. If\n\ connected device.\n\ Note: --no-reboot causes the device to remain in download mode after the action\n\ is completed. If you wish to perform another action whilst remaining in\n\ - download mode, then the following action must specify the --resume flag."; + download mode, then the following action must specify the --resume flag."; int PrintPitAction::Execute(int argc, char **argv) { -- cgit v1.1 From abea6dbbe0456c374b7889d61902023178beb09b Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Thu, 15 May 2014 00:59:13 +1000 Subject: Added missing new lines to CLI help output. --- heimdall/source/PrintPitAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'heimdall/source/PrintPitAction.cpp') diff --git a/heimdall/source/PrintPitAction.cpp b/heimdall/source/PrintPitAction.cpp index 01f57aa..781973d 100644 --- a/heimdall/source/PrintPitAction.cpp +++ b/heimdall/source/PrintPitAction.cpp @@ -40,7 +40,7 @@ Description: Prints the contents of a PIT file in a human readable format. If\n\ connected device.\n\ Note: --no-reboot causes the device to remain in download mode after the action\n\ is completed. If you wish to perform another action whilst remaining in\n\ - download mode, then the following action must specify the --resume flag."; + download mode, then the following action must specify the --resume flag.\n"; int PrintPitAction::Execute(int argc, char **argv) { -- cgit v1.1 From 082fb091f1a0cab9d00e82de54fee32b6a1c0c7b Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Sun, 1 Jun 2014 14:09:56 +1000 Subject: Fixed support for large files (up to 2^32 - 1 bytes) The Loke protocol supports 32-bit unsigned for the size of files being flashed. However, POSIX file commands only support 32-bit (signed). As such we now have platform specific support for larger files. --- heimdall/source/PrintPitAction.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'heimdall/source/PrintPitAction.cpp') diff --git a/heimdall/source/PrintPitAction.cpp b/heimdall/source/PrintPitAction.cpp index 781973d..12c28d1 100644 --- a/heimdall/source/PrintPitAction.cpp +++ b/heimdall/source/PrintPitAction.cpp @@ -115,7 +115,7 @@ int PrintPitAction::Execute(int argc, char **argv) { const char *filename = fileArgument->GetValue().c_str(); - localPitFile = fopen(filename, "rb"); + localPitFile = FileOpen(filename, "rb"); if (!localPitFile) { @@ -133,14 +133,14 @@ int PrintPitAction::Execute(int argc, char **argv) { // Print PIT from file; there's no need for a BridgeManager. - fseek(localPitFile, 0, SEEK_END); - long localPitFileSize = ftell(localPitFile); - rewind(localPitFile); + FileSeek(localPitFile, 0, SEEK_END); + unsigned int localPitFileSize = (unsigned int)FileTell(localPitFile); + FileRewind(localPitFile); // Load the local pit file into memory. unsigned char *pitFileBuffer = new unsigned char[localPitFileSize]; size_t dataRead = fread(pitFileBuffer, 1, localPitFileSize, localPitFile); // dataRead is discarded, it's here to remove warnings. - fclose(localPitFile); + FileClose(localPitFile); PitData *pitData = new PitData(); pitData->Unpack(pitFileBuffer); -- cgit v1.1 From 05d4c747a97124dbf92af9f718fefe475074ce41 Mon Sep 17 00:00:00 2001 From: Steffen Pankratz Date: Sun, 6 Mar 2016 13:45:37 +0100 Subject: - fixed compiler warning: dead initialization (the values are never read) In order to not get compiler warnings about 'unused return values' a void cast is used, which also makes it clear the the returned values are ignored on purpose --- heimdall/source/PrintPitAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'heimdall/source/PrintPitAction.cpp') diff --git a/heimdall/source/PrintPitAction.cpp b/heimdall/source/PrintPitAction.cpp index 12c28d1..7ae8e6b 100644 --- a/heimdall/source/PrintPitAction.cpp +++ b/heimdall/source/PrintPitAction.cpp @@ -139,7 +139,7 @@ int PrintPitAction::Execute(int argc, char **argv) // Load the local pit file into memory. unsigned char *pitFileBuffer = new unsigned char[localPitFileSize]; - size_t dataRead = fread(pitFileBuffer, 1, localPitFileSize, localPitFile); // dataRead is discarded, it's here to remove warnings. + (void)fread(pitFileBuffer, 1, localPitFileSize, localPitFile); FileClose(localPitFile); PitData *pitData = new PitData(); -- cgit v1.1