diff options
-rw-r--r-- | test/test-platform/TestPlatform.cpp | 4 | ||||
-rw-r--r-- | test/test-platform/TestPlatform.h | 2 | ||||
-rw-r--r-- | test/test-platform/main.cpp | 7 |
3 files changed, 8 insertions, 5 deletions
diff --git a/test/test-platform/TestPlatform.cpp b/test/test-platform/TestPlatform.cpp index fff0a8d..af741ed 100644 --- a/test/test-platform/TestPlatform.cpp +++ b/test/test-platform/TestPlatform.cpp @@ -44,7 +44,7 @@ public: }; -CTestPlatform::CTestPlatform(const string& strClass) : +CTestPlatform::CTestPlatform(const string& strClass, int iPortNumber) : _pParameterMgrPlatformConnector(new CParameterMgrPlatformConnector(strClass)), _pParameterMgrPlatformConnectorLogger(new CParameterMgrPlatformConnectorLogger) { @@ -62,7 +62,7 @@ CTestPlatform::CTestPlatform(const string& strClass) : _pCommandHandler->addCommandParser("applyConfigurations", &CTestPlatform::applyConfigurationsCommandProcess, 0, "", "Apply configurations selected by current selection criteria states"); // Create server - _pRemoteProcessorServer = new CRemoteProcessorServer(5001, _pCommandHandler); + _pRemoteProcessorServer = new CRemoteProcessorServer(iPortNumber, _pCommandHandler); _pParameterMgrPlatformConnector->setLogger(_pParameterMgrPlatformConnectorLogger); } diff --git a/test/test-platform/TestPlatform.h b/test/test-platform/TestPlatform.h index 566fdc8..8a3e59c 100644 --- a/test/test-platform/TestPlatform.h +++ b/test/test-platform/TestPlatform.h @@ -39,7 +39,7 @@ class CTestPlatform { typedef TRemoteCommandHandlerTemplate<CTestPlatform> CCommandHandler; public: - CTestPlatform(const string &strclass); + CTestPlatform(const string &strclass, int iPortNumber); virtual ~CTestPlatform(); // Init diff --git a/test/test-platform/main.cpp b/test/test-platform/main.cpp index 8e2e17c..1cd1594 100644 --- a/test/test-platform/main.cpp +++ b/test/test-platform/main.cpp @@ -26,6 +26,7 @@ #include <semaphore.h> #include "TestPlatform.h" #include <semaphore.h> +#include <stdlib.h> using namespace std; @@ -37,11 +38,13 @@ const char* gpcParameterFrameworkConfigurationFolderPath = "/etc/parameter-frame #endif */ +const int iDefaultPortNumber = 5001; + int main(int argc, char *argv[]) { if (argc < 2) { - cerr << "Missing arguments" << endl; + cerr << "Missing arguments: test-platform <file path> [port number, default " << iDefaultPortNumber << "]" << endl; return -1; } @@ -49,7 +52,7 @@ int main(int argc, char *argv[]) string strError; // Create param mgr - CTestPlatform testPlatform(argv[1]); + CTestPlatform testPlatform(argv[1], argc > 2 ? atoi(argv[2]) : iDefaultPortNumber); // Start platformmgr if (!testPlatform.load(strError)) { |