Create and print activation hash on request

To request, pass option -a on the command-line
This commit is contained in:
Srivats P 2021-07-06 21:09:14 +05:30
parent 46a54fd56b
commit 4be8a2969d
4 changed files with 19 additions and 4 deletions

View File

@ -86,7 +86,11 @@ int main(int argc, char *argv[])
app.applicationName().toLower());
qDebug("Settings: %s", qPrintable(appSettings->fileName()));
initTurbo();
if (!initTurbo())
{
exitCode = 1;
goto _exit2;
}
drone = new Drone();
OstProtocolManager = new ProtocolManager();
@ -116,6 +120,7 @@ _exit:
delete drone;
delete OstProtocolManager;
_exit2:
google::protobuf::ShutdownProtobufLibrary();
fprintf(stderr, "done.\n");

View File

@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
#include "params.h"
#include "pcapextra.h"
#include "turbo.h"
#include <unistd.h>
@ -55,6 +56,10 @@ int Params::parseCommandLine(int argc, char* argv[])
exit(0);
case 'h':
default:
if (c != 'h') {
if (processTurboOption(optopt))
continue;
}
printf("usage: %s [-dhv] [-p <port-number>]\n", argv[0]);
exit(1);
}

View File

@ -19,9 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
#include "turbo.h"
void initTurbo()
bool initTurbo()
{
return;
return true;
}
bool isTurboPort(const char* device)
@ -34,5 +34,9 @@ AbstractPort* createTurboPort(int id, const char* device)
return nullptr;
}
bool processTurboOption(int /*opt*/)
{
return false;
}
#endif

View File

@ -22,9 +22,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
class AbstractPort;
void initTurbo();
bool initTurbo();
bool isTurboPort(const char* device);
AbstractPort* createTurboPort(int id, const char* device);
bool processTurboOption(int opt);
#endif