From 951ecce4fbf195694b14ef8504c59732354abcdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Boisnard?= Date: Mon, 10 Sep 2012 12:10:48 +0200 Subject: PFW: Allow custom port number in test-platform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BZ: 56440 This patch aims to allow custom port number in test-platform: test-platform [port number, default 5001] Change-Id: Ia617507045a58d0e79a5dc1df83b0173c968853a Signed-off-by: Frédéric Boisnard Reviewed-on: http://android.intel.com:8080/65412 Reviewed-by: Denneulin, Guillaume Reviewed-by: Rocard, KevinX Reviewed-by: De Chivre, Renaud Tested-by: Mendi, EduardoX Reviewed-by: buildbot Tested-by: buildbot --- test/test-platform/TestPlatform.cpp | 4 ++-- test/test-platform/TestPlatform.h | 2 +- test/test-platform/main.cpp | 7 +++++-- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'test/test-platform') 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 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 #include "TestPlatform.h" #include +#include 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 [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)) { -- cgit v1.1