summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parameter-connector-test/main.cpp8
-rw-r--r--parameter/Android.mk4
-rw-r--r--parameter/ArrayParameter.cpp2
-rw-r--r--parameter/BitParameter.cpp8
-rw-r--r--parameter/BitParameterBlock.cpp2
-rw-r--r--parameter/InstanceConfigurableElement.cpp2
-rw-r--r--parameter/InstanceConfigurableElement.h1
-rw-r--r--parameter/IntegerParameterType.cpp2
-rw-r--r--parameter/Parameter.cpp8
-rw-r--r--parameter/ParameterBlackboard.cpp14
-rw-r--r--parameter/ParameterBlackboard.h6
-rw-r--r--parameter/ParameterMgr.cpp2
-rw-r--r--parameter/ParameterMgrPlatformConnector.cpp2
-rw-r--r--parameter/ParameterMgrPlatformConnector.h2
-rw-r--r--parameter/SelectionCriterionType.cpp2
-rw-r--r--parameter/StringParameter.cpp97
-rw-r--r--parameter/StringParameter.h58
-rw-r--r--parameter/StringParameterType.cpp76
-rw-r--r--parameter/StringParameterType.h59
-rw-r--r--parameter/Subsystem.cpp1
20 files changed, 328 insertions, 28 deletions
diff --git a/parameter-connector-test/main.cpp b/parameter-connector-test/main.cpp
index ebd6986..a756426 100644
--- a/parameter-connector-test/main.cpp
+++ b/parameter-connector-test/main.cpp
@@ -31,17 +31,9 @@
#include <iostream>
#include <semaphore.h>
#include "ExamplePlatform.h"
-#include <semaphore.h>
using namespace std;
-#ifdef SIMULATION
-//const char* gpcParameterFrameworkConfigurationFolderPath = "/home/pat/projects/qt/parameter-framework/XML";
-const char* gpcParameterFrameworkConfigurationFolderPath = "/home/pat/Documents/gingerbread/hardware/intel/PRIVATE/parameter-framework/XML";
-#else
-const char* gpcParameterFrameworkConfigurationFolderPath = "/etc/parameter-framework";
-#endif
-
int main(int argc, char *argv[])
{
if (argc < 2) {
diff --git a/parameter/Android.mk b/parameter/Android.mk
index b2d4d38..f6ce250 100644
--- a/parameter/Android.mk
+++ b/parameter/Android.mk
@@ -83,7 +83,9 @@ LOCAL_SRC_FILES:= \
SubsystemObject.cpp \
SubsystemObjectCreator.cpp \
BaseParameter.cpp \
- AutoLock.cpp
+ AutoLock.cpp \
+ StringParameterType.cpp \
+ StringParameter.cpp
LOCAL_MODULE:= libparameter
diff --git a/parameter/ArrayParameter.cpp b/parameter/ArrayParameter.cpp
index 5e0ea1e..e8d351d 100644
--- a/parameter/ArrayParameter.cpp
+++ b/parameter/ArrayParameter.cpp
@@ -177,7 +177,7 @@ void CArrayParameter::setDefaultValues(CParameterAccessContext& parameterAccessC
for (uiValueIndex = 0; uiValueIndex < uiArrayLength; uiValueIndex++) {
// Beware this code works on little endian architectures only!
- pBlackboard->write(&uiDefaultValue, uiSize, uiOffset, bSubsystemIsBigEndian);
+ pBlackboard->writeInteger(&uiDefaultValue, uiSize, uiOffset, bSubsystemIsBigEndian);
uiOffset += uiSize;
}
diff --git a/parameter/BitParameter.cpp b/parameter/BitParameter.cpp
index db1da38..d94ed9a 100644
--- a/parameter/BitParameter.cpp
+++ b/parameter/BitParameter.cpp
@@ -69,7 +69,7 @@ bool CBitParameter::doSetValue(const string& strValue, uint32_t uiOffset, CParam
CParameterBlackboard* pBlackboard = parameterAccessContext.getParameterBlackboard();
// Beware this code works on little endian architectures only!
- pBlackboard->read(&uiData, getBelongingBlockSize(), uiOffset, parameterAccessContext.isBigEndianSubsystem());
+ pBlackboard->readInteger(&uiData, getBelongingBlockSize(), uiOffset, parameterAccessContext.isBigEndianSubsystem());
// Convert
if (!static_cast<const CBitParameterType*>(getTypeElement())->asInteger(strValue, uiData, parameterAccessContext)) {
@@ -77,7 +77,7 @@ bool CBitParameter::doSetValue(const string& strValue, uint32_t uiOffset, CParam
return false;
}
// Write blackboard
- pBlackboard->write(&uiData, getBelongingBlockSize(), uiOffset, parameterAccessContext.isBigEndianSubsystem());
+ pBlackboard->writeInteger(&uiData, getBelongingBlockSize(), uiOffset, parameterAccessContext.isBigEndianSubsystem());
return true;
}
@@ -87,10 +87,10 @@ void CBitParameter::doGetValue(string& strValue, uint32_t uiOffset, CParameterAc
uint32_t uiData = 0;
// Read blackboard
- CParameterBlackboard* pBlackboard = parameterAccessContext.getParameterBlackboard();
+ const CParameterBlackboard* pBlackboard = parameterAccessContext.getParameterBlackboard();
// Beware this code works on little endian architectures only!
- pBlackboard->read(&uiData, getBelongingBlockSize(), uiOffset, parameterAccessContext.isBigEndianSubsystem());
+ pBlackboard->readInteger(&uiData, getBelongingBlockSize(), uiOffset, parameterAccessContext.isBigEndianSubsystem());
// Convert
static_cast<const CBitParameterType*>(getTypeElement())->asString(uiData, strValue, parameterAccessContext);
diff --git a/parameter/BitParameterBlock.cpp b/parameter/BitParameterBlock.cpp
index 61a38c9..d169fed 100644
--- a/parameter/BitParameterBlock.cpp
+++ b/parameter/BitParameterBlock.cpp
@@ -66,6 +66,6 @@ void CBitParameterBlock::setDefaultValues(CParameterAccessContext& parameterAcce
CParameterBlackboard* pBlackboard = parameterAccessContext.getParameterBlackboard();
// Beware this code works on little endian architectures only!
- pBlackboard->write(&uiDefaultValue, getSize(), getOffset(), parameterAccessContext.isBigEndianSubsystem());
+ pBlackboard->writeInteger(&uiDefaultValue, getSize(), getOffset(), parameterAccessContext.isBigEndianSubsystem());
}
diff --git a/parameter/InstanceConfigurableElement.cpp b/parameter/InstanceConfigurableElement.cpp
index 70c6d89..f35be87 100644
--- a/parameter/InstanceConfigurableElement.cpp
+++ b/parameter/InstanceConfigurableElement.cpp
@@ -148,7 +148,7 @@ bool CInstanceConfigurableElement::sync(CParameterAccessContext& parameterAccess
if (!pSyncer) {
- parameterAccessContext.setError("Unable to synchronize modification. No Syncer object associated to configurable element " + getPath());
+ parameterAccessContext.setError("Unable to synchronize modification. No Syncer object associated to configurable element:");
return false;
}
diff --git a/parameter/InstanceConfigurableElement.h b/parameter/InstanceConfigurableElement.h
index 232621a..0604a69 100644
--- a/parameter/InstanceConfigurableElement.h
+++ b/parameter/InstanceConfigurableElement.h
@@ -44,6 +44,7 @@ public:
EBitParameter,
EBitParameterBlock,
EParameter,
+ EStringParameter,
EParameterBlock,
EComponent
};
diff --git a/parameter/IntegerParameterType.cpp b/parameter/IntegerParameterType.cpp
index a55adff..3455fd5 100644
--- a/parameter/IntegerParameterType.cpp
+++ b/parameter/IntegerParameterType.cpp
@@ -112,7 +112,7 @@ bool CIntegerParameterType::fromXml(const CXmlElement& xmlElement, CXmlSerializi
_uiMax = xmlElement.getAttributeInteger("Max");
} else {
- _uiMax = -1L >> (32 - uiSizeInBits);
+ _uiMax = -1L >> (8 * sizeof(uint32_t) - uiSizeInBits);
}
}
diff --git a/parameter/Parameter.cpp b/parameter/Parameter.cpp
index 70865ad..7242e0d 100644
--- a/parameter/Parameter.cpp
+++ b/parameter/Parameter.cpp
@@ -83,7 +83,7 @@ void CParameter::setDefaultValues(CParameterAccessContext& parameterAccessContex
CParameterBlackboard* pBlackboard = parameterAccessContext.getParameterBlackboard();
// Beware this code works on little endian architectures only!
- pBlackboard->write(&uiDefaultValue, getSize(), getOffset(), parameterAccessContext.isBigEndianSubsystem());
+ pBlackboard->writeInteger(&uiDefaultValue, getSize(), getOffset(), parameterAccessContext.isBigEndianSubsystem());
}
// Actual parameter access
@@ -100,7 +100,7 @@ bool CParameter::doSetValue(const string& strValue, uint32_t uiOffset, CParamete
CParameterBlackboard* pBlackboard = parameterAccessContext.getParameterBlackboard();
// Beware this code works on little endian architectures only!
- pBlackboard->write(&uiData, getSize(), uiOffset, parameterAccessContext.isBigEndianSubsystem());
+ pBlackboard->writeInteger(&uiData, getSize(), uiOffset, parameterAccessContext.isBigEndianSubsystem());
return true;
}
@@ -110,10 +110,10 @@ void CParameter::doGetValue(string& strValue, uint32_t uiOffset, CParameterAcces
uint32_t uiData = 0;
// Read blackboard
- CParameterBlackboard* pBlackboard = parameterAccessContext.getParameterBlackboard();
+ const CParameterBlackboard* pBlackboard = parameterAccessContext.getParameterBlackboard();
// Beware this code works on little endian architectures only!
- pBlackboard->read(&uiData, getSize(), uiOffset, parameterAccessContext.isBigEndianSubsystem());
+ pBlackboard->readInteger(&uiData, getSize(), uiOffset, parameterAccessContext.isBigEndianSubsystem());
static_cast<const CParameterType*>(getTypeElement())->asString(uiData, strValue, parameterAccessContext);
}
diff --git a/parameter/ParameterBlackboard.cpp b/parameter/ParameterBlackboard.cpp
index 242c6a8..d843a0e 100644
--- a/parameter/ParameterBlackboard.cpp
+++ b/parameter/ParameterBlackboard.cpp
@@ -62,7 +62,7 @@ uint32_t CParameterBlackboard::getSize() const
}
// Single parameter access
-void CParameterBlackboard::write(const void* pvSrcData, uint32_t uiSize, uint32_t uiOffset, bool bBigEndian)
+void CParameterBlackboard::writeInteger(const void* pvSrcData, uint32_t uiSize, uint32_t uiOffset, bool bBigEndian)
{
assert(uiSize + uiOffset <= _uiSize);
@@ -81,7 +81,7 @@ void CParameterBlackboard::write(const void* pvSrcData, uint32_t uiSize, uint32_
}
}
-void CParameterBlackboard::read(void* pvDstData, uint32_t uiSize, uint32_t uiOffset, bool bBigEndian) const
+void CParameterBlackboard::readInteger(void* pvDstData, uint32_t uiSize, uint32_t uiOffset, bool bBigEndian) const
{
assert(uiSize + uiOffset <= _uiSize);
@@ -100,6 +100,16 @@ void CParameterBlackboard::read(void* pvDstData, uint32_t uiSize, uint32_t uiOff
}
}
+void CParameterBlackboard::writeString(const char* pcSrcData, uint32_t uiOffset)
+{
+ strcpy((char*)_pucData + uiOffset, pcSrcData);
+}
+
+void CParameterBlackboard::readString(char* pcDstData, uint32_t uiOffset) const
+{
+ strcpy(pcDstData, (const char*)_pucData + uiOffset);
+}
+
// Access from/to subsystems
uint8_t* CParameterBlackboard::getLocation(uint32_t uiOffset)
{
diff --git a/parameter/ParameterBlackboard.h b/parameter/ParameterBlackboard.h
index da4fc7b..0427311 100644
--- a/parameter/ParameterBlackboard.h
+++ b/parameter/ParameterBlackboard.h
@@ -46,8 +46,10 @@ public:
uint32_t getSize() const;
// Single parameter access
- void write(const void* pvSrcData, uint32_t uiSize, uint32_t uiOffset, bool bBigEndian);
- void read(void* pvDstData, uint32_t uiSize, uint32_t uiOffset, bool bBigEndian) const;
+ void writeInteger(const void* pvSrcData, uint32_t uiSize, uint32_t uiOffset, bool bBigEndian);
+ void readInteger(void* pvDstData, uint32_t uiSize, uint32_t uiOffset, bool bBigEndian) const;
+ void writeString(const char* pcSrcData, uint32_t uiOffset);
+ void readString(char* pcDstData, uint32_t uiOffset) const;
// Access from/to subsystems
uint8_t* getLocation(uint32_t uiOffset);
diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp
index 329ab37..d5932e3 100644
--- a/parameter/ParameterMgr.cpp
+++ b/parameter/ParameterMgr.cpp
@@ -63,6 +63,7 @@
#include "XmlDomainSerializingContext.h"
#include "BitParameterBlockType.h"
#include "BitParameterType.h"
+#include "StringParameterType.h"
#include "RemoteProcessorServerInterface.h"
#include "ElementLocator.h"
#include "AutoLog.h"
@@ -1714,6 +1715,7 @@ void CParameterMgr::feedElementLibraries()
pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CComponentInstance>("Component"));
pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CBitParameterType>("BitParameter"));
pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CBitParameterBlockType>("BitParameterBlock"));
+ pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CStringParameterType>("StringParameter"));
pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CParameterBlockType>("ParameterBlock"));
pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CBooleanParameterType>("BooleanParameter"));
pParameterCreationLibrary->addElementBuilder(new TNamedElementBuilderTemplate<CIntegerParameterType>("IntegerParameter"));
diff --git a/parameter/ParameterMgrPlatformConnector.cpp b/parameter/ParameterMgrPlatformConnector.cpp
index 7f570c5..2ce45fa 100644
--- a/parameter/ParameterMgrPlatformConnector.cpp
+++ b/parameter/ParameterMgrPlatformConnector.cpp
@@ -34,7 +34,7 @@
#include <assert.h>
#ifdef SIMULATION
-const char* gpcParameterFrameworkConfigurationFolderPath = "/home/pat/projects/qt/parameter-framework/XML";
+const char* gpcParameterFrameworkConfigurationFolderPath = "/home/pat/Documents/gingerbread2/hardware/intel/PRIVATE/parameter-framework/XML";
#else
const char* gpcParameterFrameworkConfigurationFolderPath = "/etc/parameter-framework";
#endif
diff --git a/parameter/ParameterMgrPlatformConnector.h b/parameter/ParameterMgrPlatformConnector.h
index 91fa1b2..43a5c95 100644
--- a/parameter/ParameterMgrPlatformConnector.h
+++ b/parameter/ParameterMgrPlatformConnector.h
@@ -40,7 +40,7 @@ public:
// Construction
CParameterMgrPlatformConnector(const std::string& strSystemClassName);
- ~CParameterMgrPlatformConnector(); // Not virtual since supposed to be derived!
+ ~CParameterMgrPlatformConnector(); // Not virtual since not supposed to be derived!
// Selection Criteria interface. Beware returned objects are lent, clients shall not delete them!
// Should be called before start
diff --git a/parameter/SelectionCriterionType.cpp b/parameter/SelectionCriterionType.cpp
index 478fb43..26fc441 100644
--- a/parameter/SelectionCriterionType.cpp
+++ b/parameter/SelectionCriterionType.cpp
@@ -134,7 +134,7 @@ string CSelectionCriterionType::getFormattedState(int iValue) const
uint32_t uiBit;
bool bFirst = true;
- for (uiBit = 0; uiBit < sizeof(iValue) << 3; uiBit++) {
+ for (uiBit = 0; uiBit < sizeof(iValue) * 8; uiBit++) {
int iSingleBitValue = iValue & (1 << uiBit);
diff --git a/parameter/StringParameter.cpp b/parameter/StringParameter.cpp
new file mode 100644
index 0000000..5040379
--- /dev/null
+++ b/parameter/StringParameter.cpp
@@ -0,0 +1,97 @@
+/* <auto_header>
+ * <FILENAME>
+ *
+ * INTEL CONFIDENTIAL
+ * Copyright © 2011 Intel
+ * Corporation All Rights Reserved.
+ *
+ * The source code contained or described herein and all documents related to
+ * the source code ("Material") are owned by Intel Corporation or its suppliers
+ * or licensors. Title to the Material remains with Intel Corporation or its
+ * suppliers and licensors. The Material contains trade secrets and proprietary
+ * and confidential information of Intel or its suppliers and licensors. The
+ * Material is protected by worldwide copyright and trade secret laws and
+ * treaty provisions. No part of the Material may be used, copied, reproduced,
+ * modified, published, uploaded, posted, transmitted, distributed, or
+ * disclosed in any way without Intel’s prior express written permission.
+ *
+ * No license under any patent, copyright, trade secret or other intellectual
+ * property right is granted to or conferred upon you by disclosure or delivery
+ * of the Materials, either expressly, by implication, inducement, estoppel or
+ * otherwise. Any license under such intellectual property rights must be
+ * express and approved by Intel in writing.
+ *
+ * AUTHOR: Patrick Benavoli (patrickx.benavoli@intel.com)
+ * CREATED: 2011-06-01
+ * UPDATED: 2011-07-27
+ *
+ *
+ * </auto_header>
+ */
+#include "StringParameter.h"
+#include "StringParameterType.h"
+#include "ParameterAccessContext.h"
+#include "ConfigurationAccessContext.h"
+#include "ParameterBlackboard.h"
+#include <alloca.h>
+
+#define base CBaseParameter
+
+CStringParameter::CStringParameter(const string& strName, const CTypeElement* pTypeElement) : base(strName, pTypeElement)
+{
+}
+
+CInstanceConfigurableElement::Type CStringParameter::getType() const
+{
+ return EStringParameter;
+}
+
+uint32_t CStringParameter::getFootPrint() const
+{
+ return getSize();
+}
+
+uint32_t CStringParameter::getSize() const
+{
+ return static_cast<const CStringParameterType*>(getTypeElement())->getMaxLength() + 1;
+}
+
+// Used for simulation only
+void CStringParameter::setDefaultValues(CParameterAccessContext& parameterAccessContext) const
+{
+ // Write blackboard
+ CParameterBlackboard* pBlackboard = parameterAccessContext.getParameterBlackboard();
+
+ pBlackboard->writeString("", getOffset());
+}
+
+// Actual parameter access
+bool CStringParameter::doSetValue(const string& strValue, uint32_t uiOffset, CParameterAccessContext& parameterAccessContext) const
+{
+ if (strValue.length() >= getSize()) {
+
+ parameterAccessContext.setError("Maximum length exceeded");
+
+ return false;
+ }
+
+ // Write blackboard
+ CParameterBlackboard* pBlackboard = parameterAccessContext.getParameterBlackboard();
+
+ pBlackboard->writeString(strValue.c_str(), uiOffset);
+
+ return true;
+}
+
+void CStringParameter::doGetValue(string& strValue, uint32_t uiOffset, CParameterAccessContext& parameterAccessContext) const
+{
+ char* pcValue = (char*)alloca(getSize());
+
+ // Read blackboard
+ const CParameterBlackboard* pBlackboard = parameterAccessContext.getParameterBlackboard();
+
+ pBlackboard->readString(pcValue, uiOffset);
+
+ strValue = pcValue;
+}
+
diff --git a/parameter/StringParameter.h b/parameter/StringParameter.h
new file mode 100644
index 0000000..8ed1c5b
--- /dev/null
+++ b/parameter/StringParameter.h
@@ -0,0 +1,58 @@
+/* <auto_header>
+ * <FILENAME>
+ *
+ * INTEL CONFIDENTIAL
+ * Copyright © 2011 Intel
+ * Corporation All Rights Reserved.
+ *
+ * The source code contained or described herein and all documents related to
+ * the source code ("Material") are owned by Intel Corporation or its suppliers
+ * or licensors. Title to the Material remains with Intel Corporation or its
+ * suppliers and licensors. The Material contains trade secrets and proprietary
+ * and confidential information of Intel or its suppliers and licensors. The
+ * Material is protected by worldwide copyright and trade secret laws and
+ * treaty provisions. No part of the Material may be used, copied, reproduced,
+ * modified, published, uploaded, posted, transmitted, distributed, or
+ * disclosed in any way without Intel’s prior express written permission.
+ *
+ * No license under any patent, copyright, trade secret or other intellectual
+ * property right is granted to or conferred upon you by disclosure or delivery
+ * of the Materials, either expressly, by implication, inducement, estoppel or
+ * otherwise. Any license under such intellectual property rights must be
+ * express and approved by Intel in writing.
+ *
+ * AUTHOR: Patrick Benavoli (patrickx.benavoli@intel.com)
+ * CREATED: 2011-06-01
+ * UPDATED: 2011-07-27
+ *
+ *
+ * </auto_header>
+ */
+#pragma once
+
+#include <stdint.h>
+
+#include "BaseParameter.h"
+
+class CStringParameter : public CBaseParameter
+{
+public:
+ CStringParameter(const string& strName, const CTypeElement* pTypeElement);
+
+ // Instantiation, allocation
+ virtual uint32_t getFootPrint() const;
+
+ // Type
+ virtual Type getType() const;
+protected:
+ // Used for simulation only
+ virtual void setDefaultValues(CParameterAccessContext& parameterAccessContext) const;
+
+ // Actual value access
+ virtual bool doSetValue(const string& strValue, uint32_t uiOffset, CParameterAccessContext& parameterAccessContext) const;
+ virtual void doGetValue(string& strValue, uint32_t uiOffset, CParameterAccessContext& parameterAccessContext) const;
+
+ // Size
+ uint32_t getSize() const;
+};
+
diff --git a/parameter/StringParameterType.cpp b/parameter/StringParameterType.cpp
new file mode 100644
index 0000000..01b9d0f
--- /dev/null
+++ b/parameter/StringParameterType.cpp
@@ -0,0 +1,76 @@
+/* <auto_header>
+ * <FILENAME>
+ *
+ * INTEL CONFIDENTIAL
+ * Copyright © 2011 Intel
+ * Corporation All Rights Reserved.
+ *
+ * The source code contained or described herein and all documents related to
+ * the source code ("Material") are owned by Intel Corporation or its suppliers
+ * or licensors. Title to the Material remains with Intel Corporation or its
+ * suppliers and licensors. The Material contains trade secrets and proprietary
+ * and confidential information of Intel or its suppliers and licensors. The
+ * Material is protected by worldwide copyright and trade secret laws and
+ * treaty provisions. No part of the Material may be used, copied, reproduced,
+ * modified, published, uploaded, posted, transmitted, distributed, or
+ * disclosed in any way without Intel’s prior express written permission.
+ *
+ * No license under any patent, copyright, trade secret or other intellectual
+ * property right is granted to or conferred upon you by disclosure or delivery
+ * of the Materials, either expressly, by implication, inducement, estoppel or
+ * otherwise. Any license under such intellectual property rights must be
+ * express and approved by Intel in writing.
+ *
+ * AUTHOR: Patrick Benavoli (patrickx.benavoli@intel.com)
+ * CREATED: 2011-06-01
+ * UPDATED: 2011-07-27
+ *
+ *
+ * </auto_header>
+ */
+#include "StringParameterType.h"
+#include "StringParameter.h"
+
+#define base CTypeElement
+
+CStringParameterType::CStringParameterType(const string& strName) : base(strName), _uiMaxLength(0)
+{
+}
+
+// CElement
+string CStringParameterType::getKind() const
+{
+ return "StringParameter";
+}
+
+// Element properties
+void CStringParameterType::showProperties(string& strResult) const
+{
+ base::showProperties(strResult);
+
+ // Max length
+ strResult += "Max length: ";
+ strResult += toString(_uiMaxLength);
+ strResult += "\n";
+}
+
+// From IXmlSink
+bool CStringParameterType::fromXml(const CXmlElement& xmlElement, CXmlSerializingContext& serializingContext)
+{
+ // MaxLength
+ _uiMaxLength = xmlElement.getAttributeInteger("MaxLength");
+
+ // Base
+ return base::fromXml(xmlElement, serializingContext);
+}
+
+CInstanceConfigurableElement* CStringParameterType::doInstantiate() const
+{
+ return new CStringParameter(getName(), this);
+}
+
+// Max length
+uint32_t CStringParameterType::getMaxLength() const
+{
+ return _uiMaxLength;
+}
diff --git a/parameter/StringParameterType.h b/parameter/StringParameterType.h
new file mode 100644
index 0000000..5f9799f
--- /dev/null
+++ b/parameter/StringParameterType.h
@@ -0,0 +1,59 @@
+/* <auto_header>
+ * <FILENAME>
+ *
+ * INTEL CONFIDENTIAL
+ * Copyright © 2011 Intel
+ * Corporation All Rights Reserved.
+ *
+ * The source code contained or described herein and all documents related to
+ * the source code ("Material") are owned by Intel Corporation or its suppliers
+ * or licensors. Title to the Material remains with Intel Corporation or its
+ * suppliers and licensors. The Material contains trade secrets and proprietary
+ * and confidential information of Intel or its suppliers and licensors. The
+ * Material is protected by worldwide copyright and trade secret laws and
+ * treaty provisions. No part of the Material may be used, copied, reproduced,
+ * modified, published, uploaded, posted, transmitted, distributed, or
+ * disclosed in any way without Intel’s prior express written permission.
+ *
+ * No license under any patent, copyright, trade secret or other intellectual
+ * property right is granted to or conferred upon you by disclosure or delivery
+ * of the Materials, either expressly, by implication, inducement, estoppel or
+ * otherwise. Any license under such intellectual property rights must be
+ * express and approved by Intel in writing.
+ *
+ * AUTHOR: Patrick Benavoli (patrickx.benavoli@intel.com)
+ * CREATED: 2011-06-01
+ * UPDATED: 2011-07-27
+ *
+ *
+ * </auto_header>
+ */
+#pragma once
+
+#include <stdint.h>
+
+#include "TypeElement.h"
+
+class CStringParameterType : public CTypeElement
+{
+public:
+ CStringParameterType(const string& strName);
+
+ // Max length
+ uint32_t getMaxLength() const;
+
+ // From IXmlSink
+ virtual bool fromXml(const CXmlElement& xmlElement, CXmlSerializingContext& serializingContext);
+
+ // Element properties
+ virtual void showProperties(string& strResult) const;
+
+ // CElement
+ virtual string getKind() const;
+private:
+ // Instantiation
+ virtual CInstanceConfigurableElement* doInstantiate() const;
+
+ // Max length in bytes
+ uint32_t _uiMaxLength;
+};
diff --git a/parameter/Subsystem.cpp b/parameter/Subsystem.cpp
index 97de091..7fb4bed 100644
--- a/parameter/Subsystem.cpp
+++ b/parameter/Subsystem.cpp
@@ -314,6 +314,7 @@ bool CSubsystem::mapBegin(CInstanceConfigurableElement* pInstanceConfigurableEle
case CInstanceConfigurableElement::EParameterBlock:
case CInstanceConfigurableElement::EBitParameterBlock:
case CInstanceConfigurableElement::EParameter:
+ case CInstanceConfigurableElement::EStringParameter:
{
if (!handleSubsystemObjectCreation(pInstanceConfigurableElement, context, strError)) {