aboutsummaryrefslogtreecommitdiffstats
path: root/parameter
diff options
context:
space:
mode:
authorDavid Wagner <david.wagner@intel.com>2015-01-06 17:23:48 +0100
committerDavid Wagner <david.wagner@intel.com>2015-01-22 12:02:31 +0100
commit873db82f0fe7b54386d5cc26dec6737e0446d93d (patch)
tree678d9114d8fad0d0f42ae37475a4e9db09aa6e99 /parameter
parent17d59220b9517963bbe27c450207e3c0a43443fb (diff)
downloadexternal_parameter-framework-873db82f0fe7b54386d5cc26dec6737e0446d93d.zip
external_parameter-framework-873db82f0fe7b54386d5cc26dec6737e0446d93d.tar.gz
external_parameter-framework-873db82f0fe7b54386d5cc26dec6737e0446d93d.tar.bz2
ParameterMgr: enforce Tuning Mode on write access of parameters
This applies only to setParameter: this commands should only be available in Tuning Mode. This is enforced by moving the tuning mode check from the remote interface to the internal CParameterMgr::accessParameterValue() method. Additionaly, CParameterMgr::accessValue is made private. Change-Id: I189362a768ce1cd9709b6e5d48cd833f7ca56479 Signed-off-by: David Wagner <david.wagner@intel.com>
Diffstat (limited to 'parameter')
-rw-r--r--parameter/ParameterMgr.cpp11
-rw-r--r--parameter/ParameterMgr.h2
2 files changed, 7 insertions, 6 deletions
diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp
index edf8080..b81243d 100644
--- a/parameter/ParameterMgr.cpp
+++ b/parameter/ParameterMgr.cpp
@@ -1414,11 +1414,6 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::getParameterCommman
CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::setParameterCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
{
- // Check tuning mode
- if (!checkTuningModeOn(strResult)) {
-
- return CCommandHandler::EFailed;
- }
// Get value to set
string strValue = remoteCommand.packArguments(1, remoteCommand.getArgumentCount() - 1);
@@ -1644,6 +1639,12 @@ CParameterMgr::CCommandHandler::CommandStatus
// User set/get parameters in main BlackBoard
bool CParameterMgr::accessParameterValue(const string& strPath, string& strValue, bool bSet, string& strError)
{
+ // Forbid write access when not in TuningMode
+ if (bSet && !checkTuningModeOn(strError)) {
+
+ return false;
+ }
+
// Define context
CParameterAccessContext parameterAccessContext(strError, _pMainParameterBlackboard, _bValueSpaceIsRaw, _bOutputRawFormatIsHex);
diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h
index 7ce19a5..5fd41b1 100644
--- a/parameter/ParameterMgr.h
+++ b/parameter/ParameterMgr.h
@@ -205,7 +205,6 @@ public:
bool sync(std::string& strError);
// User set/get parameters
- bool accessValue(CParameterAccessContext& parameterAccessContext, const std::string& strPath, std::string& strValue, bool bSet, std::string& strError);
bool accessParameterValue(const std::string& strPath, std::string& strValue, bool bSet, std::string& strError);
/**
* Returns the element mapping corresponding to the path given in parameter.
@@ -502,6 +501,7 @@ private:
CParameterBlackboard* getParameterBlackboard();
// Parameter access
+ bool accessValue(CParameterAccessContext& parameterAccessContext, const std::string& strPath, std::string& strValue, bool bSet, std::string& strError);
bool doSetValue(const std::string& strPath, const std::string& strValue, bool bRawValueSpace, bool bDynamicAccess, std::string& strError) const;
bool doGetValue(const std::string& strPath, std::string& strValue, bool bRawValueSpace, bool bHexOutputRawFormat, bool bDynamicAccess, std::string& strError) const;