1*c33452fbSAndroid Build Coastguard Worker /* 2*c33452fbSAndroid Build Coastguard Worker * Copyright (c) 2011-2016, Intel Corporation 3*c33452fbSAndroid Build Coastguard Worker * All rights reserved. 4*c33452fbSAndroid Build Coastguard Worker * 5*c33452fbSAndroid Build Coastguard Worker * Redistribution and use in source and binary forms, with or without modification, 6*c33452fbSAndroid Build Coastguard Worker * are permitted provided that the following conditions are met: 7*c33452fbSAndroid Build Coastguard Worker * 8*c33452fbSAndroid Build Coastguard Worker * 1. Redistributions of source code must retain the above copyright notice, this 9*c33452fbSAndroid Build Coastguard Worker * list of conditions and the following disclaimer. 10*c33452fbSAndroid Build Coastguard Worker * 11*c33452fbSAndroid Build Coastguard Worker * 2. Redistributions in binary form must reproduce the above copyright notice, 12*c33452fbSAndroid Build Coastguard Worker * this list of conditions and the following disclaimer in the documentation and/or 13*c33452fbSAndroid Build Coastguard Worker * other materials provided with the distribution. 14*c33452fbSAndroid Build Coastguard Worker * 15*c33452fbSAndroid Build Coastguard Worker * 3. Neither the name of the copyright holder nor the names of its contributors 16*c33452fbSAndroid Build Coastguard Worker * may be used to endorse or promote products derived from this software without 17*c33452fbSAndroid Build Coastguard Worker * specific prior written permission. 18*c33452fbSAndroid Build Coastguard Worker * 19*c33452fbSAndroid Build Coastguard Worker * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20*c33452fbSAndroid Build Coastguard Worker * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21*c33452fbSAndroid Build Coastguard Worker * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22*c33452fbSAndroid Build Coastguard Worker * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 23*c33452fbSAndroid Build Coastguard Worker * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24*c33452fbSAndroid Build Coastguard Worker * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25*c33452fbSAndroid Build Coastguard Worker * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 26*c33452fbSAndroid Build Coastguard Worker * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27*c33452fbSAndroid Build Coastguard Worker * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28*c33452fbSAndroid Build Coastguard Worker * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29*c33452fbSAndroid Build Coastguard Worker */ 30*c33452fbSAndroid Build Coastguard Worker #pragma once 31*c33452fbSAndroid Build Coastguard Worker 32*c33452fbSAndroid Build Coastguard Worker #include <mutex> 33*c33452fbSAndroid Build Coastguard Worker #include <map> 34*c33452fbSAndroid Build Coastguard Worker #include <vector> 35*c33452fbSAndroid Build Coastguard Worker #include "RemoteCommandHandlerTemplate.h" 36*c33452fbSAndroid Build Coastguard Worker #include "PathNavigator.h" 37*c33452fbSAndroid Build Coastguard Worker #include "SelectionCriterionType.h" 38*c33452fbSAndroid Build Coastguard Worker #include "SelectionCriterion.h" 39*c33452fbSAndroid Build Coastguard Worker #include "Element.h" 40*c33452fbSAndroid Build Coastguard Worker #include "XmlDocSink.h" 41*c33452fbSAndroid Build Coastguard Worker #include "XmlDocSource.h" 42*c33452fbSAndroid Build Coastguard Worker #include "XmlDomainExportContext.h" 43*c33452fbSAndroid Build Coastguard Worker #include "Results.h" 44*c33452fbSAndroid Build Coastguard Worker #include "ElementHandle.h" 45*c33452fbSAndroid Build Coastguard Worker #include <log/LogWrapper.h> 46*c33452fbSAndroid Build Coastguard Worker #include <log/Context.h> 47*c33452fbSAndroid Build Coastguard Worker 48*c33452fbSAndroid Build Coastguard Worker #include <istream> 49*c33452fbSAndroid Build Coastguard Worker #include <memory> 50*c33452fbSAndroid Build Coastguard Worker #include <ostream> 51*c33452fbSAndroid Build Coastguard Worker #include <string> 52*c33452fbSAndroid Build Coastguard Worker 53*c33452fbSAndroid Build Coastguard Worker class CElementLibrarySet; 54*c33452fbSAndroid Build Coastguard Worker class CSubsystemLibrary; 55*c33452fbSAndroid Build Coastguard Worker class CSystemClass; 56*c33452fbSAndroid Build Coastguard Worker class CSelectionCriteria; 57*c33452fbSAndroid Build Coastguard Worker class CParameterFrameworkConfiguration; 58*c33452fbSAndroid Build Coastguard Worker class CParameterBlackboard; 59*c33452fbSAndroid Build Coastguard Worker class CConfigurableDomains; 60*c33452fbSAndroid Build Coastguard Worker class IRemoteProcessorServerInterface; 61*c33452fbSAndroid Build Coastguard Worker class CParameterHandle; 62*c33452fbSAndroid Build Coastguard Worker class CSubsystemPlugins; 63*c33452fbSAndroid Build Coastguard Worker class CParameterAccessContext; 64*c33452fbSAndroid Build Coastguard Worker class CConfigurableElement; 65*c33452fbSAndroid Build Coastguard Worker 66*c33452fbSAndroid Build Coastguard Worker class CParameterMgr : private CElement 67*c33452fbSAndroid Build Coastguard Worker { 68*c33452fbSAndroid Build Coastguard Worker enum ChildElement 69*c33452fbSAndroid Build Coastguard Worker { 70*c33452fbSAndroid Build Coastguard Worker EFrameworkConfiguration, 71*c33452fbSAndroid Build Coastguard Worker ESelectionCriteria, 72*c33452fbSAndroid Build Coastguard Worker ESystemClass, 73*c33452fbSAndroid Build Coastguard Worker EConfigurableDomains 74*c33452fbSAndroid Build Coastguard Worker }; 75*c33452fbSAndroid Build Coastguard Worker enum ElementLibrary 76*c33452fbSAndroid Build Coastguard Worker { 77*c33452fbSAndroid Build Coastguard Worker EFrameworkConfigurationLibrary, 78*c33452fbSAndroid Build Coastguard Worker EParameterCreationLibrary, 79*c33452fbSAndroid Build Coastguard Worker EParameterConfigurationLibrary 80*c33452fbSAndroid Build Coastguard Worker }; 81*c33452fbSAndroid Build Coastguard Worker 82*c33452fbSAndroid Build Coastguard Worker // Parameter handle friendship 83*c33452fbSAndroid Build Coastguard Worker friend class ElementHandle; 84*c33452fbSAndroid Build Coastguard Worker 85*c33452fbSAndroid Build Coastguard Worker public: 86*c33452fbSAndroid Build Coastguard Worker // Construction 87*c33452fbSAndroid Build Coastguard Worker CParameterMgr(const std::string &strConfigurationFilePath, core::log::ILogger &logger); 88*c33452fbSAndroid Build Coastguard Worker ~CParameterMgr() override; 89*c33452fbSAndroid Build Coastguard Worker 90*c33452fbSAndroid Build Coastguard Worker /** Load plugins, structures and settings from the config file given. 91*c33452fbSAndroid Build Coastguard Worker * 92*c33452fbSAndroid Build Coastguard Worker * @param[out] strError is a std::string describing the error if an error occurred 93*c33452fbSAndroid Build Coastguard Worker * undefined otherwise. 94*c33452fbSAndroid Build Coastguard Worker * 95*c33452fbSAndroid Build Coastguard Worker * @return true if no error occurred, false otherwise. 96*c33452fbSAndroid Build Coastguard Worker */ 97*c33452fbSAndroid Build Coastguard Worker bool load(std::string &strError); 98*c33452fbSAndroid Build Coastguard Worker 99*c33452fbSAndroid Build Coastguard Worker // Remote command parsers 100*c33452fbSAndroid Build Coastguard Worker using CommandHandler = std::unique_ptr<TRemoteCommandHandlerTemplate<CParameterMgr>>; 101*c33452fbSAndroid Build Coastguard Worker 102*c33452fbSAndroid Build Coastguard Worker /** Create and return a command handler for this ParameterMgr instance 103*c33452fbSAndroid Build Coastguard Worker * 104*c33452fbSAndroid Build Coastguard Worker * @returns a Command Handler 105*c33452fbSAndroid Build Coastguard Worker */ 106*c33452fbSAndroid Build Coastguard Worker CommandHandler createCommandHandler(); 107*c33452fbSAndroid Build Coastguard Worker 108*c33452fbSAndroid Build Coastguard Worker // Selection Criteria 109*c33452fbSAndroid Build Coastguard Worker CSelectionCriterionType *createSelectionCriterionType(bool bIsInclusive); 110*c33452fbSAndroid Build Coastguard Worker CSelectionCriterion *createSelectionCriterion( 111*c33452fbSAndroid Build Coastguard Worker const std::string &strName, const CSelectionCriterionType *pSelectionCriterionType); 112*c33452fbSAndroid Build Coastguard Worker // Selection criterion retrieval 113*c33452fbSAndroid Build Coastguard Worker CSelectionCriterion *getSelectionCriterion(const std::string &strName); 114*c33452fbSAndroid Build Coastguard Worker 115*c33452fbSAndroid Build Coastguard Worker // Configuration application 116*c33452fbSAndroid Build Coastguard Worker void applyConfigurations(); 117*c33452fbSAndroid Build Coastguard Worker 118*c33452fbSAndroid Build Coastguard Worker /** const version of getConfigurableElement */ 119*c33452fbSAndroid Build Coastguard Worker const CConfigurableElement *getConfigurableElement(const std::string &strPath, 120*c33452fbSAndroid Build Coastguard Worker std::string &strError) const; 121*c33452fbSAndroid Build Coastguard Worker 122*c33452fbSAndroid Build Coastguard Worker /** Returns the CConfigurableElement corresponding to the path given in argument. 123*c33452fbSAndroid Build Coastguard Worker * 124*c33452fbSAndroid Build Coastguard Worker * @param[in] strPath A std::string representing a path to an element. 125*c33452fbSAndroid Build Coastguard Worker * @param[out] strError Error message 126*c33452fbSAndroid Build Coastguard Worker * 127*c33452fbSAndroid Build Coastguard Worker * @return A const pointer to the corresponding CConfigurableElement. 128*c33452fbSAndroid Build Coastguard Worker * On error, NULL is returned and the error is explained in strError. 129*c33452fbSAndroid Build Coastguard Worker */ 130*c33452fbSAndroid Build Coastguard Worker CConfigurableElement *getConfigurableElement(const std::string &strPath, std::string &strError); 131*c33452fbSAndroid Build Coastguard Worker // Dynamic parameter handling 132*c33452fbSAndroid Build Coastguard Worker CParameterHandle *createParameterHandle(const std::string &strPath, std::string &strError); 133*c33452fbSAndroid Build Coastguard Worker 134*c33452fbSAndroid Build Coastguard Worker /** Creates a handle to a configurable element. 135*c33452fbSAndroid Build Coastguard Worker * 136*c33452fbSAndroid Build Coastguard Worker * The returned object is owned by the client who is responsible to delete it. 137*c33452fbSAndroid Build Coastguard Worker * 138*c33452fbSAndroid Build Coastguard Worker * @param[in] path A string representing a path to a configurable element. 139*c33452fbSAndroid Build Coastguard Worker * @param[out] error On error: an human readable error message 140*c33452fbSAndroid Build Coastguard Worker * On success: undefined 141*c33452fbSAndroid Build Coastguard Worker * 142*c33452fbSAndroid Build Coastguard Worker * @return An element handle on success 143*c33452fbSAndroid Build Coastguard Worker * nullptr on error 144*c33452fbSAndroid Build Coastguard Worker */ 145*c33452fbSAndroid Build Coastguard Worker ElementHandle *createElementHandle(const std::string &path, std::string &error); 146*c33452fbSAndroid Build Coastguard Worker 147*c33452fbSAndroid Build Coastguard Worker /** Is the remote interface forcefully disabled ? 148*c33452fbSAndroid Build Coastguard Worker */ 149*c33452fbSAndroid Build Coastguard Worker bool getForceNoRemoteInterface() const; 150*c33452fbSAndroid Build Coastguard Worker 151*c33452fbSAndroid Build Coastguard Worker /** 152*c33452fbSAndroid Build Coastguard Worker * Forcefully disable the remote interface or cancel this policy 153*c33452fbSAndroid Build Coastguard Worker * 154*c33452fbSAndroid Build Coastguard Worker * @param[in] bForceNoRemoteInterface disable the remote interface if true. 155*c33452fbSAndroid Build Coastguard Worker */ 156*c33452fbSAndroid Build Coastguard Worker void setForceNoRemoteInterface(bool bForceNoRemoteInterface); 157*c33452fbSAndroid Build Coastguard Worker 158*c33452fbSAndroid Build Coastguard Worker /** Should start fail in case of missing subsystems. 159*c33452fbSAndroid Build Coastguard Worker * 160*c33452fbSAndroid Build Coastguard Worker * @param[in] bFail: If set to true, parameterMgr start will fail on missing subsystems. 161*c33452fbSAndroid Build Coastguard Worker * If set to false, missing subsystems will fallback on virtual subsystem. 162*c33452fbSAndroid Build Coastguard Worker */ 163*c33452fbSAndroid Build Coastguard Worker void setFailureOnMissingSubsystem(bool bFail); 164*c33452fbSAndroid Build Coastguard Worker 165*c33452fbSAndroid Build Coastguard Worker /** Would start fail in case of missing subsystems. 166*c33452fbSAndroid Build Coastguard Worker * 167*c33452fbSAndroid Build Coastguard Worker * @return true if the subsystem will fail on missing subsystem, false otherwise. 168*c33452fbSAndroid Build Coastguard Worker */ 169*c33452fbSAndroid Build Coastguard Worker bool getFailureOnMissingSubsystem() const; 170*c33452fbSAndroid Build Coastguard Worker 171*c33452fbSAndroid Build Coastguard Worker /** Should start fail in failed settings load. 172*c33452fbSAndroid Build Coastguard Worker * 173*c33452fbSAndroid Build Coastguard Worker * @param[in] bFail: If set to true, parameterMgr start will fail on failed settings load. 174*c33452fbSAndroid Build Coastguard Worker * If set to false, failed settings load will be ignored. 175*c33452fbSAndroid Build Coastguard Worker */ 176*c33452fbSAndroid Build Coastguard Worker void setFailureOnFailedSettingsLoad(bool bFail); 177*c33452fbSAndroid Build Coastguard Worker /** Would start fail in case of failed settings load. 178*c33452fbSAndroid Build Coastguard Worker * 179*c33452fbSAndroid Build Coastguard Worker * @return failure on failed settings load policy state. 180*c33452fbSAndroid Build Coastguard Worker */ 181*c33452fbSAndroid Build Coastguard Worker bool getFailureOnFailedSettingsLoad() const; 182*c33452fbSAndroid Build Coastguard Worker 183*c33452fbSAndroid Build Coastguard Worker /** Get the XML Schemas URI 184*c33452fbSAndroid Build Coastguard Worker * 185*c33452fbSAndroid Build Coastguard Worker * @returns the XML Schemas URI 186*c33452fbSAndroid Build Coastguard Worker */ 187*c33452fbSAndroid Build Coastguard Worker const std::string &getSchemaUri() const; 188*c33452fbSAndroid Build Coastguard Worker 189*c33452fbSAndroid Build Coastguard Worker /** Override the XML Schemas URI 190*c33452fbSAndroid Build Coastguard Worker * 191*c33452fbSAndroid Build Coastguard Worker * @param[in] schemaUri XML Schemas URI 192*c33452fbSAndroid Build Coastguard Worker */ 193*c33452fbSAndroid Build Coastguard Worker void setSchemaUri(const std::string &schemaUri); 194*c33452fbSAndroid Build Coastguard Worker 195*c33452fbSAndroid Build Coastguard Worker /** Should .xml files be validated on start ? 196*c33452fbSAndroid Build Coastguard Worker * 197*c33452fbSAndroid Build Coastguard Worker * @param[in] bValidate: 198*c33452fbSAndroid Build Coastguard Worker * If set to true, parameterMgr will report an error 199*c33452fbSAndroid Build Coastguard Worker * when being unable to validate .xml files 200*c33452fbSAndroid Build Coastguard Worker * If set to false, no .xml/xsd validation will happen 201*c33452fbSAndroid Build Coastguard Worker * (default behaviour) 202*c33452fbSAndroid Build Coastguard Worker * 203*c33452fbSAndroid Build Coastguard Worker * @return false if unable to set, true otherwise. 204*c33452fbSAndroid Build Coastguard Worker */ 205*c33452fbSAndroid Build Coastguard Worker void setValidateSchemasOnStart(bool bValidate); 206*c33452fbSAndroid Build Coastguard Worker 207*c33452fbSAndroid Build Coastguard Worker /** Would .xml files be validated on start? 208*c33452fbSAndroid Build Coastguard Worker * 209*c33452fbSAndroid Build Coastguard Worker * @return areSchemasValidated 210*c33452fbSAndroid Build Coastguard Worker */ 211*c33452fbSAndroid Build Coastguard Worker bool getValidateSchemasOnStart() const; 212*c33452fbSAndroid Build Coastguard Worker 213*c33452fbSAndroid Build Coastguard Worker //////////// Tuning ///////////// 214*c33452fbSAndroid Build Coastguard Worker /** 215*c33452fbSAndroid Build Coastguard Worker * Activate / deactivate the tuning mode. 216*c33452fbSAndroid Build Coastguard Worker * 217*c33452fbSAndroid Build Coastguard Worker * @param[in] bOn true if tuning mode activation is requested, false for desactivation 218*c33452fbSAndroid Build Coastguard Worker * @param[out] strError human readable error 219*c33452fbSAndroid Build Coastguard Worker * @return true if request is successful, false if the Parameter Manager is already in the mode 220*c33452fbSAndroid Build Coastguard Worker * requested or in case of error. 221*c33452fbSAndroid Build Coastguard Worker * If false, strError is set with the associated human readable error. 222*c33452fbSAndroid Build Coastguard Worker */ 223*c33452fbSAndroid Build Coastguard Worker bool setTuningMode(bool bOn, std::string &strError); 224*c33452fbSAndroid Build Coastguard Worker bool tuningModeOn() const; 225*c33452fbSAndroid Build Coastguard Worker 226*c33452fbSAndroid Build Coastguard Worker // Current value space for user set/get value interpretation 227*c33452fbSAndroid Build Coastguard Worker void setValueSpace(bool bIsRaw); 228*c33452fbSAndroid Build Coastguard Worker bool valueSpaceIsRaw(); 229*c33452fbSAndroid Build Coastguard Worker 230*c33452fbSAndroid Build Coastguard Worker // Current Output Raw Format for user get value interpretation 231*c33452fbSAndroid Build Coastguard Worker void setOutputRawFormat(bool bIsHex); 232*c33452fbSAndroid Build Coastguard Worker bool outputRawFormatIsHex(); 233*c33452fbSAndroid Build Coastguard Worker 234*c33452fbSAndroid Build Coastguard Worker // Automatic hardware synchronization control (during tuning session) 235*c33452fbSAndroid Build Coastguard Worker bool setAutoSync(bool bAutoSyncOn, std::string &strError); 236*c33452fbSAndroid Build Coastguard Worker bool autoSyncOn() const; 237*c33452fbSAndroid Build Coastguard Worker bool sync(std::string &strError); 238*c33452fbSAndroid Build Coastguard Worker 239*c33452fbSAndroid Build Coastguard Worker // User set/get parameters 240*c33452fbSAndroid Build Coastguard Worker bool accessParameterValue(const std::string &strPath, std::string &strValue, bool bSet, 241*c33452fbSAndroid Build Coastguard Worker std::string &strError); 242*c33452fbSAndroid Build Coastguard Worker /** 243*c33452fbSAndroid Build Coastguard Worker * Returns the element mapping corresponding to the path given in parameter. 244*c33452fbSAndroid Build Coastguard Worker * 245*c33452fbSAndroid Build Coastguard Worker * @param[in] strPath Path of an element 246*c33452fbSAndroid Build Coastguard Worker * @param[out] strValue A sting containing the mapping 247*c33452fbSAndroid Build Coastguard Worker * 248*c33452fbSAndroid Build Coastguard Worker * @return true if a mapping was found for this element 249*c33452fbSAndroid Build Coastguard Worker */ 250*c33452fbSAndroid Build Coastguard Worker bool getParameterMapping(const std::string &strPath, std::string &strValue) const; 251*c33452fbSAndroid Build Coastguard Worker bool accessConfigurationValue(const std::string &strDomain, const std::string &stConfiguration, 252*c33452fbSAndroid Build Coastguard Worker const std::string &strPath, std::string &strValue, bool bSet, 253*c33452fbSAndroid Build Coastguard Worker std::string &strError); 254*c33452fbSAndroid Build Coastguard Worker 255*c33452fbSAndroid Build Coastguard Worker ////////// Configuration/Domains handling ////////////// 256*c33452fbSAndroid Build Coastguard Worker // Creation/Deletion 257*c33452fbSAndroid Build Coastguard Worker bool createDomain(const std::string &strName, std::string &strError); 258*c33452fbSAndroid Build Coastguard Worker bool renameDomain(const std::string &strName, const std::string &strNewName, 259*c33452fbSAndroid Build Coastguard Worker std::string &strError); 260*c33452fbSAndroid Build Coastguard Worker bool deleteDomain(const std::string &strName, std::string &strError); 261*c33452fbSAndroid Build Coastguard Worker bool deleteAllDomains(std::string &strError); 262*c33452fbSAndroid Build Coastguard Worker bool setSequenceAwareness(const std::string &strName, bool bSequenceAware, 263*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 264*c33452fbSAndroid Build Coastguard Worker bool getSequenceAwareness(const std::string &strName, bool &bSequenceAware, 265*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 266*c33452fbSAndroid Build Coastguard Worker bool createConfiguration(const std::string &strDomain, const std::string &strConfiguration, 267*c33452fbSAndroid Build Coastguard Worker std::string &strError); 268*c33452fbSAndroid Build Coastguard Worker bool deleteConfiguration(const std::string &strDomain, const std::string &strConfiguration, 269*c33452fbSAndroid Build Coastguard Worker std::string &strError); 270*c33452fbSAndroid Build Coastguard Worker bool renameConfiguration(const std::string &strDomain, const std::string &strConfiguration, 271*c33452fbSAndroid Build Coastguard Worker const std::string &strNewConfiguration, std::string &strError); 272*c33452fbSAndroid Build Coastguard Worker 273*c33452fbSAndroid Build Coastguard Worker /** Restore a configuration 274*c33452fbSAndroid Build Coastguard Worker * 275*c33452fbSAndroid Build Coastguard Worker * @param[in] strDomain the domain name 276*c33452fbSAndroid Build Coastguard Worker * @param[in] strConfiguration the configuration name 277*c33452fbSAndroid Build Coastguard Worker * @param[out] errors errors encountered during restoration 278*c33452fbSAndroid Build Coastguard Worker * @return true if success false otherwise 279*c33452fbSAndroid Build Coastguard Worker */ 280*c33452fbSAndroid Build Coastguard Worker bool restoreConfiguration(const std::string &strDomain, const std::string &strConfiguration, 281*c33452fbSAndroid Build Coastguard Worker core::Results &errors); 282*c33452fbSAndroid Build Coastguard Worker 283*c33452fbSAndroid Build Coastguard Worker bool saveConfiguration(const std::string &strDomain, const std::string &strConfiguration, 284*c33452fbSAndroid Build Coastguard Worker std::string &strError); 285*c33452fbSAndroid Build Coastguard Worker 286*c33452fbSAndroid Build Coastguard Worker // Configurable element - domain association 287*c33452fbSAndroid Build Coastguard Worker bool addConfigurableElementToDomain(const std::string &strDomain, 288*c33452fbSAndroid Build Coastguard Worker const std::string &strConfigurableElementPath, 289*c33452fbSAndroid Build Coastguard Worker std::string &strError); 290*c33452fbSAndroid Build Coastguard Worker bool removeConfigurableElementFromDomain(const std::string &strDomain, 291*c33452fbSAndroid Build Coastguard Worker const std::string &strConfigurableElementPath, 292*c33452fbSAndroid Build Coastguard Worker std::string &strError); 293*c33452fbSAndroid Build Coastguard Worker bool split(const std::string &strDomain, const std::string &strConfigurableElementPath, 294*c33452fbSAndroid Build Coastguard Worker std::string &strError); 295*c33452fbSAndroid Build Coastguard Worker bool setElementSequence(const std::string &strDomain, const std::string &strConfiguration, 296*c33452fbSAndroid Build Coastguard Worker const std::vector<std::string> &astrNewElementSequence, 297*c33452fbSAndroid Build Coastguard Worker std::string &strError); 298*c33452fbSAndroid Build Coastguard Worker 299*c33452fbSAndroid Build Coastguard Worker bool getApplicationRule(const std::string &strDomain, const std::string &strConfiguration, 300*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 301*c33452fbSAndroid Build Coastguard Worker bool setApplicationRule(const std::string &strDomain, const std::string &strConfiguration, 302*c33452fbSAndroid Build Coastguard Worker const std::string &strApplicationRule, std::string &strError); 303*c33452fbSAndroid Build Coastguard Worker bool clearApplicationRule(const std::string &strDomain, const std::string &strConfiguration, 304*c33452fbSAndroid Build Coastguard Worker std::string &strError); 305*c33452fbSAndroid Build Coastguard Worker 306*c33452fbSAndroid Build Coastguard Worker /** 307*c33452fbSAndroid Build Coastguard Worker * Method that imports Configurable Domains from an Xml source. 308*c33452fbSAndroid Build Coastguard Worker * 309*c33452fbSAndroid Build Coastguard Worker * @param[in] xmlSource a std::string containing an xml description or a path to an xml file 310*c33452fbSAndroid Build Coastguard Worker * @param[in] withSettings a boolean that determines if the settings should be used in the 311*c33452fbSAndroid Build Coastguard Worker * xml description 312*c33452fbSAndroid Build Coastguard Worker * @param[in] fromFile a boolean that determines if the source is an xml description in 313*c33452fbSAndroid Build Coastguard Worker * xmlSource or contained in a file. In that case xmlSource is just the file path. 314*c33452fbSAndroid Build Coastguard Worker * @param[out] errorMsg is used as the error output 315*c33452fbSAndroid Build Coastguard Worker * 316*c33452fbSAndroid Build Coastguard Worker * @return false if any error occures 317*c33452fbSAndroid Build Coastguard Worker */ 318*c33452fbSAndroid Build Coastguard Worker bool importDomainsXml(const std::string &xmlSource, bool withSettings, bool fromFile, 319*c33452fbSAndroid Build Coastguard Worker std::string &errorMsg); 320*c33452fbSAndroid Build Coastguard Worker 321*c33452fbSAndroid Build Coastguard Worker /** 322*c33452fbSAndroid Build Coastguard Worker * Method that imports a single Configurable Domain from an Xml source. 323*c33452fbSAndroid Build Coastguard Worker * 324*c33452fbSAndroid Build Coastguard Worker * @param[in] xmlSource a string containing an xml description or a path to an xml file 325*c33452fbSAndroid Build Coastguard Worker * @param[in] overwrite when importing an existing domain, allow 326*c33452fbSAndroid Build Coastguard Worker * overwriting or return an error 327*c33452fbSAndroid Build Coastguard Worker * @param[in] withSettings a boolean that determines if the settings should be used in the 328*c33452fbSAndroid Build Coastguard Worker * xml description 329*c33452fbSAndroid Build Coastguard Worker * @param[in] fromFile a boolean that determines if the source is an xml description in 330*c33452fbSAndroid Build Coastguard Worker * xmlSource or contained in a file. In that case xmlSource is just the file path. 331*c33452fbSAndroid Build Coastguard Worker * @param[out] errorMsg is used as the error output 332*c33452fbSAndroid Build Coastguard Worker * 333*c33452fbSAndroid Build Coastguard Worker * @return false if any error occurs 334*c33452fbSAndroid Build Coastguard Worker */ 335*c33452fbSAndroid Build Coastguard Worker bool importSingleDomainXml(const std::string &xmlSource, bool overwrite, bool withSettings, 336*c33452fbSAndroid Build Coastguard Worker bool fromFile, std::string &errorMsg); 337*c33452fbSAndroid Build Coastguard Worker 338*c33452fbSAndroid Build Coastguard Worker /** 339*c33452fbSAndroid Build Coastguard Worker * Method that exports Configurable Domains to an Xml destination. 340*c33452fbSAndroid Build Coastguard Worker * 341*c33452fbSAndroid Build Coastguard Worker * @param[in,out] xmlDest a string containing an xml description or a path to an xml file 342*c33452fbSAndroid Build Coastguard Worker * @param[in] withSettings a boolean that determines if the settings should be used in the 343*c33452fbSAndroid Build Coastguard Worker * xml description 344*c33452fbSAndroid Build Coastguard Worker * @param[in] toFile a boolean that determines if the destination is an xml description in 345*c33452fbSAndroid Build Coastguard Worker * xmlDest or contained in a file. In that case xmlDest is just the file path. 346*c33452fbSAndroid Build Coastguard Worker * @param[out] errorMsg is used as the error output 347*c33452fbSAndroid Build Coastguard Worker * 348*c33452fbSAndroid Build Coastguard Worker * @return false if any error occurs, true otherwise. 349*c33452fbSAndroid Build Coastguard Worker */ 350*c33452fbSAndroid Build Coastguard Worker bool exportDomainsXml(std::string &xmlDest, bool withSettings, bool toFile, 351*c33452fbSAndroid Build Coastguard Worker std::string &errorMsg) const; 352*c33452fbSAndroid Build Coastguard Worker 353*c33452fbSAndroid Build Coastguard Worker /** 354*c33452fbSAndroid Build Coastguard Worker * Method that exports a given Configurable Domain to an Xml destination. 355*c33452fbSAndroid Build Coastguard Worker * 356*c33452fbSAndroid Build Coastguard Worker * @param[in,out] xmlDest a string containing an xml description or a path to an xml file 357*c33452fbSAndroid Build Coastguard Worker * @param[in] domainName the name of the domain to be exported 358*c33452fbSAndroid Build Coastguard Worker * @param[in] withSettings a boolean that determines if the settings should be used in the 359*c33452fbSAndroid Build Coastguard Worker * xml description 360*c33452fbSAndroid Build Coastguard Worker * @param[in] toFile a boolean that determines if the destination is an xml description in 361*c33452fbSAndroid Build Coastguard Worker * xmlDest or contained in a file. In that case xmlDest is just the file path. 362*c33452fbSAndroid Build Coastguard Worker * @param[out] errorMsg is used as the error output 363*c33452fbSAndroid Build Coastguard Worker * 364*c33452fbSAndroid Build Coastguard Worker * @return false if any error occurs, true otherwise. 365*c33452fbSAndroid Build Coastguard Worker */ 366*c33452fbSAndroid Build Coastguard Worker bool exportSingleDomainXml(std::string &xmlDest, const std::string &domainName, 367*c33452fbSAndroid Build Coastguard Worker bool withSettings, bool toFile, std::string &errorMsg) const; 368*c33452fbSAndroid Build Coastguard Worker 369*c33452fbSAndroid Build Coastguard Worker /** 370*c33452fbSAndroid Build Coastguard Worker * Method that exports an Xml description of the passed element into a string 371*c33452fbSAndroid Build Coastguard Worker * 372*c33452fbSAndroid Build Coastguard Worker * @param[in] pXmlSource The source element to export 373*c33452fbSAndroid Build Coastguard Worker * @param[in] strRootElementType The XML root element name of the exported instance document 374*c33452fbSAndroid Build Coastguard Worker * @param[in] xmlSerializingContext the context to use for serialization 375*c33452fbSAndroid Build Coastguard Worker * Is an rvalue as it must be destructed after this function 376*c33452fbSAndroid Build Coastguard Worker * call to set the error. 377*c33452fbSAndroid Build Coastguard Worker * Additionally, using it for an other serialization would 378*c33452fbSAndroid Build Coastguard Worker * override the error. 379*c33452fbSAndroid Build Coastguard Worker * @param[out] strResult contains the xml description or the error description in case false is 380*c33452fbSAndroid Build Coastguard Worker * returned 381*c33452fbSAndroid Build Coastguard Worker * 382*c33452fbSAndroid Build Coastguard Worker * @return true for success, false if any error occurs during the creation of the xml 383*c33452fbSAndroid Build Coastguard Worker * description (validation or encoding) 384*c33452fbSAndroid Build Coastguard Worker */ 385*c33452fbSAndroid Build Coastguard Worker bool exportElementToXMLString(const IXmlSource *pXmlSource, 386*c33452fbSAndroid Build Coastguard Worker const std::string &strRootElementType, 387*c33452fbSAndroid Build Coastguard Worker CXmlSerializingContext &&xmlSerializingContext, 388*c33452fbSAndroid Build Coastguard Worker std::string &strResult) const; 389*c33452fbSAndroid Build Coastguard Worker 390*c33452fbSAndroid Build Coastguard Worker // CElement 391*c33452fbSAndroid Build Coastguard Worker std::string getKind() const override; 392*c33452fbSAndroid Build Coastguard Worker 393*c33452fbSAndroid Build Coastguard Worker private: 394*c33452fbSAndroid Build Coastguard Worker CParameterMgr(const CParameterMgr &); 395*c33452fbSAndroid Build Coastguard Worker CParameterMgr &operator=(const CParameterMgr &); 396*c33452fbSAndroid Build Coastguard Worker 397*c33452fbSAndroid Build Coastguard Worker // Init 398*c33452fbSAndroid Build Coastguard Worker bool init(std::string &strError) override; 399*c33452fbSAndroid Build Coastguard Worker 400*c33452fbSAndroid Build Coastguard Worker // Version 401*c33452fbSAndroid Build Coastguard Worker std::string getVersion() const; 402*c33452fbSAndroid Build Coastguard Worker 403*c33452fbSAndroid Build Coastguard Worker // This using is here for internal reasons: CommandHandler is public and is 404*c33452fbSAndroid Build Coastguard Worker // a unique_ptr but we want the type that's inside. And for legacy reason 405*c33452fbSAndroid Build Coastguard Worker // because that's the original name before a rework; this directive avoids 406*c33452fbSAndroid Build Coastguard Worker // renaming a lot of stuff. 407*c33452fbSAndroid Build Coastguard Worker using CCommandHandler = CommandHandler::element_type; 408*c33452fbSAndroid Build Coastguard Worker using RemoteCommandParser = CCommandHandler::CommandStatus (CParameterMgr::*)( 409*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 410*c33452fbSAndroid Build Coastguard Worker 411*c33452fbSAndroid Build Coastguard Worker // Parser descriptions 412*c33452fbSAndroid Build Coastguard Worker struct SRemoteCommandParserItem 413*c33452fbSAndroid Build Coastguard Worker { 414*c33452fbSAndroid Build Coastguard Worker const char *_pcCommandName; 415*c33452fbSAndroid Build Coastguard Worker CParameterMgr::RemoteCommandParser _pfnParser; 416*c33452fbSAndroid Build Coastguard Worker size_t _minArgumentCount; 417*c33452fbSAndroid Build Coastguard Worker const char *_pcHelp; 418*c33452fbSAndroid Build Coastguard Worker const char *_pcDescription; 419*c33452fbSAndroid Build Coastguard Worker }; 420*c33452fbSAndroid Build Coastguard Worker 421*c33452fbSAndroid Build Coastguard Worker ////////////////:: Remote command parsers 422*c33452fbSAndroid Build Coastguard Worker /// Version 423*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus versionCommandProcess(const IRemoteCommand &remoteCommand, 424*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 425*c33452fbSAndroid Build Coastguard Worker /// Status 426*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus statusCommandProcess(const IRemoteCommand &remoteCommand, 427*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 428*c33452fbSAndroid Build Coastguard Worker /// Tuning Mode 429*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus setTuningModeCommandProcess(const IRemoteCommand &remoteCommand, 430*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 431*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getTuningModeCommandProcess(const IRemoteCommand &remoteCommand, 432*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 433*c33452fbSAndroid Build Coastguard Worker /// Value Space 434*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus setValueSpaceCommandProcess(const IRemoteCommand &remoteCommand, 435*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 436*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getValueSpaceCommandProcess(const IRemoteCommand &remoteCommand, 437*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 438*c33452fbSAndroid Build Coastguard Worker /// Output Raw Format 439*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus setOutputRawFormatCommandProcess( 440*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 441*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getOutputRawFormatCommandProcess( 442*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 443*c33452fbSAndroid Build Coastguard Worker /// Sync 444*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus setAutoSyncCommandProcess(const IRemoteCommand &remoteCommand, 445*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 446*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getAutoSyncCommandProcess(const IRemoteCommand &remoteCommand, 447*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 448*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus syncCommandProcess(const IRemoteCommand &remoteCommand, 449*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 450*c33452fbSAndroid Build Coastguard Worker /// Criteria 451*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus listCriteriaCommandProcess(const IRemoteCommand &remoteCommand, 452*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 453*c33452fbSAndroid Build Coastguard Worker /// Domains 454*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus listDomainsCommandProcess(const IRemoteCommand &remoteCommand, 455*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 456*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus createDomainCommandProcess(const IRemoteCommand &remoteCommand, 457*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 458*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus deleteDomainCommandProcess(const IRemoteCommand &remoteCommand, 459*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 460*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus deleteAllDomainsCommandProcess( 461*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 462*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus renameDomainCommandProcess(const IRemoteCommand &remoteCommand, 463*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 464*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus setSequenceAwarenessCommandProcess( 465*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 466*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getSequenceAwarenessCommandProcess( 467*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 468*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus listDomainElementsCommandProcess( 469*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 470*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus addElementCommandProcess(const IRemoteCommand &remoteCommand, 471*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 472*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus removeElementCommandProcess(const IRemoteCommand &remoteCommand, 473*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 474*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus splitDomainCommandProcess(const IRemoteCommand &remoteCommand, 475*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 476*c33452fbSAndroid Build Coastguard Worker /// Configurations 477*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus listConfigurationsCommandProcess( 478*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 479*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus dumpDomainsCommandProcess(const IRemoteCommand &remoteCommand, 480*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 481*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus createConfigurationCommandProcess( 482*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 483*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus deleteConfigurationCommandProcess( 484*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 485*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus renameConfigurationCommandProcess( 486*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 487*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus saveConfigurationCommandProcess( 488*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 489*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus restoreConfigurationCommandProcess( 490*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 491*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus setElementSequenceCommandProcess( 492*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 493*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getElementSequenceCommandProcess( 494*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 495*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus setRuleCommandProcess(const IRemoteCommand &remoteCommand, 496*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 497*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus clearRuleCommandProcess(const IRemoteCommand &remoteCommand, 498*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 499*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getRuleCommandProcess(const IRemoteCommand &remoteCommand, 500*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 501*c33452fbSAndroid Build Coastguard Worker /// Elements/Parameters 502*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus listElementsCommandProcess(const IRemoteCommand &remoteCommand, 503*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 504*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus listParametersCommandProcess(const IRemoteCommand &remoteCommand, 505*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 506*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getElementStructureXMLCommandProcess( 507*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 508*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getElementBytesCommandProcess( 509*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 510*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus setElementBytesCommandProcess( 511*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 512*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getElementXMLCommandProcess(const IRemoteCommand &remoteCommand, 513*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 514*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus setElementXMLCommandProcess(const IRemoteCommand &remoteCommand, 515*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 516*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus dumpElementCommandProcess(const IRemoteCommand &remoteCommand, 517*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 518*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getElementSizeCommandProcess(const IRemoteCommand &remoteCommand, 519*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 520*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus showPropertiesCommandProcess(const IRemoteCommand &remoteCommand, 521*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 522*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getParameterCommandProcess(const IRemoteCommand &remoteCommand, 523*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 524*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus setParameterCommandProcess(const IRemoteCommand &remoteCommand, 525*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 526*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getConfigurationParameterCommandProcess( 527*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 528*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus setConfigurationParameterCommandProcess( 529*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 530*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus listBelongingDomainsCommandProcess( 531*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 532*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus listAssociatedDomainsCommandProcess( 533*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 534*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus showMappingCommandProcess(const IRemoteCommand &remoteCommand, 535*c33452fbSAndroid Build Coastguard Worker std::string &strResult); 536*c33452fbSAndroid Build Coastguard Worker /// Browse 537*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus listAssociatedElementsCommandProcess( 538*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 539*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus listConflictingElementsCommandProcess( 540*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 541*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus listRogueElementsCommandProcess( 542*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 543*c33452fbSAndroid Build Coastguard Worker /// Settings Import/Export 544*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus exportDomainsXMLCommandProcess( 545*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 546*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus importDomainsXMLCommandProcess( 547*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 548*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus exportDomainsWithSettingsXMLCommandProcess( 549*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 550*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus importDomainsWithSettingsXMLCommandProcess( 551*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 552*c33452fbSAndroid Build Coastguard Worker /** 553*c33452fbSAndroid Build Coastguard Worker * Command handler method for exportDomainWithSettingsXML command. 554*c33452fbSAndroid Build Coastguard Worker * 555*c33452fbSAndroid Build Coastguard Worker * @param[in] remoteCommand contains the arguments of the received command. 556*c33452fbSAndroid Build Coastguard Worker * @param[out] result a std::string containing the result of the command 557*c33452fbSAndroid Build Coastguard Worker * 558*c33452fbSAndroid Build Coastguard Worker * @return CCommandHandler::ESucceeded if command succeeded or CCommandHandler::EFailed 559*c33452fbSAndroid Build Coastguard Worker * in the other case 560*c33452fbSAndroid Build Coastguard Worker */ 561*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus exportDomainWithSettingsXMLCommandProcess( 562*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &result); 563*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus importDomainWithSettingsXMLCommandProcess( 564*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 565*c33452fbSAndroid Build Coastguard Worker 566*c33452fbSAndroid Build Coastguard Worker /** 567*c33452fbSAndroid Build Coastguard Worker * Command handler method for getDomainsWithSettings command. 568*c33452fbSAndroid Build Coastguard Worker * 569*c33452fbSAndroid Build Coastguard Worker * @param[in] remoteCommand contains the arguments of the received command. 570*c33452fbSAndroid Build Coastguard Worker * @param[out] strResult a std::string containing the result of the command 571*c33452fbSAndroid Build Coastguard Worker * 572*c33452fbSAndroid Build Coastguard Worker * @return CCommandHandler::ESucceeded if command succeeded or CCommandHandler::EFailed 573*c33452fbSAndroid Build Coastguard Worker * in the other case 574*c33452fbSAndroid Build Coastguard Worker */ 575*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getDomainsWithSettingsXMLCommandProcess( 576*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 577*c33452fbSAndroid Build Coastguard Worker 578*c33452fbSAndroid Build Coastguard Worker /** 579*c33452fbSAndroid Build Coastguard Worker * Command handler method for getDomainWithSettings command. 580*c33452fbSAndroid Build Coastguard Worker * 581*c33452fbSAndroid Build Coastguard Worker * @param[in] remoteCommand contains the arguments of the received command. 582*c33452fbSAndroid Build Coastguard Worker * @param[out] strResult a string containing the result of the command 583*c33452fbSAndroid Build Coastguard Worker * 584*c33452fbSAndroid Build Coastguard Worker * @return CCommandHandler::ESucceeded if command succeeded or CCommandHandler::EFailed 585*c33452fbSAndroid Build Coastguard Worker * in the other case 586*c33452fbSAndroid Build Coastguard Worker */ 587*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getDomainWithSettingsXMLCommandProcess( 588*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 589*c33452fbSAndroid Build Coastguard Worker 590*c33452fbSAndroid Build Coastguard Worker /** 591*c33452fbSAndroid Build Coastguard Worker * Command handler method for setDomainsWithSettings command. 592*c33452fbSAndroid Build Coastguard Worker * 593*c33452fbSAndroid Build Coastguard Worker * @param[in] remoteCommand contains the arguments of the received command. 594*c33452fbSAndroid Build Coastguard Worker * @param[out] strResult a std::string containing the result of the command 595*c33452fbSAndroid Build Coastguard Worker * 596*c33452fbSAndroid Build Coastguard Worker * @return CCommandHandler::ESucceeded if command succeeded or CCommandHandler::EFailed 597*c33452fbSAndroid Build Coastguard Worker * in the other case 598*c33452fbSAndroid Build Coastguard Worker */ 599*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus setDomainsWithSettingsXMLCommandProcess( 600*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 601*c33452fbSAndroid Build Coastguard Worker 602*c33452fbSAndroid Build Coastguard Worker /** 603*c33452fbSAndroid Build Coastguard Worker * Command handler method for setDomainWithSettings command. 604*c33452fbSAndroid Build Coastguard Worker * 605*c33452fbSAndroid Build Coastguard Worker * @param[in] remoteCommand contains the arguments of the received command. 606*c33452fbSAndroid Build Coastguard Worker * @param[out] result a std::string containing the result of the command 607*c33452fbSAndroid Build Coastguard Worker * 608*c33452fbSAndroid Build Coastguard Worker * @return CCommandHandler::ESucceeded if command succeeded or CCommandHandler::EFailed 609*c33452fbSAndroid Build Coastguard Worker * in the other case 610*c33452fbSAndroid Build Coastguard Worker */ 611*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus setDomainWithSettingsXMLCommandProcess( 612*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &result); 613*c33452fbSAndroid Build Coastguard Worker 614*c33452fbSAndroid Build Coastguard Worker /** 615*c33452fbSAndroid Build Coastguard Worker * Command handler method for getSystemClass command. 616*c33452fbSAndroid Build Coastguard Worker * 617*c33452fbSAndroid Build Coastguard Worker * @param[in] remoteCommand contains the arguments of the received command. 618*c33452fbSAndroid Build Coastguard Worker * @param[out] strResult a std::string containing the result of the command 619*c33452fbSAndroid Build Coastguard Worker * 620*c33452fbSAndroid Build Coastguard Worker * @return CCommandHandler::ESucceeded if command succeeded or CCommandHandler::EFailed 621*c33452fbSAndroid Build Coastguard Worker * in the other case 622*c33452fbSAndroid Build Coastguard Worker */ 623*c33452fbSAndroid Build Coastguard Worker CCommandHandler::CommandStatus getSystemClassXMLCommandProcess( 624*c33452fbSAndroid Build Coastguard Worker const IRemoteCommand &remoteCommand, std::string &strResult); 625*c33452fbSAndroid Build Coastguard Worker 626*c33452fbSAndroid Build Coastguard Worker // Max command usage length, use for formatting 627*c33452fbSAndroid Build Coastguard Worker void setMaxCommandUsageLength(); 628*c33452fbSAndroid Build Coastguard Worker 629*c33452fbSAndroid Build Coastguard Worker // For tuning, check we're in tuning mode 630*c33452fbSAndroid Build Coastguard Worker bool checkTuningModeOn(std::string &strError) const; 631*c33452fbSAndroid Build Coastguard Worker 632*c33452fbSAndroid Build Coastguard Worker // Blackboard (dynamic parameter handling) 633*c33452fbSAndroid Build Coastguard Worker std::mutex &getBlackboardMutex(); 634*c33452fbSAndroid Build Coastguard Worker 635*c33452fbSAndroid Build Coastguard Worker // Blackboard reference (dynamic parameter handling) 636*c33452fbSAndroid Build Coastguard Worker CParameterBlackboard *getParameterBlackboard(); 637*c33452fbSAndroid Build Coastguard Worker 638*c33452fbSAndroid Build Coastguard Worker // Parameter access 639*c33452fbSAndroid Build Coastguard Worker bool accessValue(CParameterAccessContext ¶meterAccessContext, const std::string &strPath, 640*c33452fbSAndroid Build Coastguard Worker std::string &strValue, bool bSet, std::string &strError); 641*c33452fbSAndroid Build Coastguard Worker bool doSetValue(const std::string &strPath, const std::string &strValue, bool bRawValueSpace, 642*c33452fbSAndroid Build Coastguard Worker bool bDynamicAccess, std::string &strError) const; 643*c33452fbSAndroid Build Coastguard Worker bool doGetValue(const std::string &strPath, std::string &strValue, bool bRawValueSpace, 644*c33452fbSAndroid Build Coastguard Worker bool bHexOutputRawFormat, bool bDynamicAccess, std::string &strError) const; 645*c33452fbSAndroid Build Coastguard Worker 646*c33452fbSAndroid Build Coastguard Worker // Framework global configuration loading 647*c33452fbSAndroid Build Coastguard Worker bool loadFrameworkConfiguration(std::string &strError); 648*c33452fbSAndroid Build Coastguard Worker 649*c33452fbSAndroid Build Coastguard Worker /** Load required subsystems 650*c33452fbSAndroid Build Coastguard Worker * 651*c33452fbSAndroid Build Coastguard Worker * @param[out] error error description if there is one 652*c33452fbSAndroid Build Coastguard Worker * @return true if succeed false otherwise 653*c33452fbSAndroid Build Coastguard Worker */ 654*c33452fbSAndroid Build Coastguard Worker bool loadSubsystems(std::string &error); 655*c33452fbSAndroid Build Coastguard Worker 656*c33452fbSAndroid Build Coastguard Worker // System class Structure loading 657*c33452fbSAndroid Build Coastguard Worker bool loadStructure(std::string &strError); 658*c33452fbSAndroid Build Coastguard Worker 659*c33452fbSAndroid Build Coastguard Worker // System class Structure loading 660*c33452fbSAndroid Build Coastguard Worker bool loadSettings(std::string &strError); 661*c33452fbSAndroid Build Coastguard Worker bool loadSettingsFromConfigFile(std::string &strError); 662*c33452fbSAndroid Build Coastguard Worker 663*c33452fbSAndroid Build Coastguard Worker /** Get settings from a configurable element in binary format. 664*c33452fbSAndroid Build Coastguard Worker * 665*c33452fbSAndroid Build Coastguard Worker * @param[in] element configurable element. 666*c33452fbSAndroid Build Coastguard Worker * @param[out] settings current element settings (in mainblackboard) in binary format 667*c33452fbSAndroid Build Coastguard Worker * 668*c33452fbSAndroid Build Coastguard Worker * @return true on success, false on error 669*c33452fbSAndroid Build Coastguard Worker */ 670*c33452fbSAndroid Build Coastguard Worker void getSettingsAsBytes(const CConfigurableElement &element, 671*c33452fbSAndroid Build Coastguard Worker std::vector<uint8_t> &settings) const; 672*c33452fbSAndroid Build Coastguard Worker 673*c33452fbSAndroid Build Coastguard Worker /** Assign settings to a configurable element in binary format. 674*c33452fbSAndroid Build Coastguard Worker * 675*c33452fbSAndroid Build Coastguard Worker * @param[in] element configurable element. 676*c33452fbSAndroid Build Coastguard Worker * @param[in] settings the settings as byte array (binary). 677*c33452fbSAndroid Build Coastguard Worker * @param[out] error error message filled in case of error 678*c33452fbSAndroid Build Coastguard Worker * 679*c33452fbSAndroid Build Coastguard Worker * @return true in case of success, false oherwise, in which case error is filled with error 680*c33452fbSAndroid Build Coastguard Worker * message. 681*c33452fbSAndroid Build Coastguard Worker */ 682*c33452fbSAndroid Build Coastguard Worker bool setSettingsAsBytes(const CConfigurableElement &element, 683*c33452fbSAndroid Build Coastguard Worker const std::vector<uint8_t> &settings, std::string &error); 684*c33452fbSAndroid Build Coastguard Worker 685*c33452fbSAndroid Build Coastguard Worker /** Assign settings to a configurable element in XML format. 686*c33452fbSAndroid Build Coastguard Worker * 687*c33452fbSAndroid Build Coastguard Worker * @param[in] configurableElement The element to set. 688*c33452fbSAndroid Build Coastguard Worker * @param[in] settings The settings to set. 689*c33452fbSAndroid Build Coastguard Worker * @param[out] error human readable error message filled in case of error, 690*c33452fbSAndroid Build Coastguard Worker * undefined in case of success. 691*c33452fbSAndroid Build Coastguard Worker * @return true in case of success, false otherwise 692*c33452fbSAndroid Build Coastguard Worker */ 693*c33452fbSAndroid Build Coastguard Worker bool setSettingsAsXML(CConfigurableElement *configurableElement, const std::string &settings, 694*c33452fbSAndroid Build Coastguard Worker std::string &error); 695*c33452fbSAndroid Build Coastguard Worker 696*c33452fbSAndroid Build Coastguard Worker /** Get settings from a configurable element in XML format. 697*c33452fbSAndroid Build Coastguard Worker * 698*c33452fbSAndroid Build Coastguard Worker * @param[in] configurableElement The element to get settings from. 699*c33452fbSAndroid Build Coastguard Worker * @param[out] result on success: the exported setttings in XML 700*c33452fbSAndroid Build Coastguard Worker * on error: human readable error message 701*c33452fbSAndroid Build Coastguard Worker * 702*c33452fbSAndroid Build Coastguard Worker * @return true in case of success, false otherwise. 703*c33452fbSAndroid Build Coastguard Worker */ 704*c33452fbSAndroid Build Coastguard Worker bool getSettingsAsXML(const CConfigurableElement *configurableElement, 705*c33452fbSAndroid Build Coastguard Worker std::string &result) const; 706*c33452fbSAndroid Build Coastguard Worker 707*c33452fbSAndroid Build Coastguard Worker /** Parse an XML stream into an element 708*c33452fbSAndroid Build Coastguard Worker * 709*c33452fbSAndroid Build Coastguard Worker * @param[in] elementSerializingContext serializing context 710*c33452fbSAndroid Build Coastguard Worker * @param[out] pRootElement the receiving element 711*c33452fbSAndroid Build Coastguard Worker * @param[in] input the input XML stream 712*c33452fbSAndroid Build Coastguard Worker * @param[in] baseUri the XML input file URI or "" 713*c33452fbSAndroid Build Coastguard Worker * @param[in] eElementLibrary which element library to be used 714*c33452fbSAndroid Build Coastguard Worker * @param[in] replace Should the element be overridden or modified in place 715*c33452fbSAndroid Build Coastguard Worker * @param[in] strNameAttributeName the name of the element's XML "name" attribute 716*c33452fbSAndroid Build Coastguard Worker * 717*c33452fbSAndroid Build Coastguard Worker * @returns true if parsing succeeded, false otherwise 718*c33452fbSAndroid Build Coastguard Worker */ 719*c33452fbSAndroid Build Coastguard Worker bool xmlParse(CXmlElementSerializingContext &elementSerializingContext, CElement *pRootElement, 720*c33452fbSAndroid Build Coastguard Worker _xmlDoc *doc, const std::string &baseUri, ElementLibrary eElementLibrary, 721*c33452fbSAndroid Build Coastguard Worker bool replace = true, const std::string &strNameAttributeName = "Name"); 722*c33452fbSAndroid Build Coastguard Worker 723*c33452fbSAndroid Build Coastguard Worker /** Wrapper for converting public APIs semantics to internal API 724*c33452fbSAndroid Build Coastguard Worker * 725*c33452fbSAndroid Build Coastguard Worker * Public APIs have a string argument that can either contain: 726*c33452fbSAndroid Build Coastguard Worker * - a path to an XML file or; 727*c33452fbSAndroid Build Coastguard Worker * - an actual XML document. 728*c33452fbSAndroid Build Coastguard Worker * They also have a boolean argument specifying which of the two cases it 729*c33452fbSAndroid Build Coastguard Worker * is. 730*c33452fbSAndroid Build Coastguard Worker * 731*c33452fbSAndroid Build Coastguard Worker * Instead, the internal APIs only take an std::istream argument. This 732*c33452fbSAndroid Build Coastguard Worker * method opens the file as a stream if applicable or simply wrap the 733*c33452fbSAndroid Build Coastguard Worker * string in a stream. It then passes the stream to the internal methods. 734*c33452fbSAndroid Build Coastguard Worker * 735*c33452fbSAndroid Build Coastguard Worker * @param[in] xmlSource the XML source (either a path or an actual xml 736*c33452fbSAndroid Build Coastguard Worker * document) 737*c33452fbSAndroid Build Coastguard Worker * @param[in] fromFile specifies whether xmlSource is a path or an 738*c33452fbSAndroid Build Coastguard Worker * actual XML document 739*c33452fbSAndroid Build Coastguard Worker * @param[in] withSettings if false, only import the configurations 740*c33452fbSAndroid Build Coastguard Worker * applicability rules; if true, also import their settings 741*c33452fbSAndroid Build Coastguard Worker * @param[out] element the receiving element 742*c33452fbSAndroid Build Coastguard Worker * @param[in] nameAttributeName the name of the element's XML "name" 743*c33452fbSAndroid Build Coastguard Worker * attribute 744*c33452fbSAndroid Build Coastguard Worker * @param[out] errorMsg string used as output for any error message 745*c33452fbSAndroid Build Coastguard Worker * 746*c33452fbSAndroid Build Coastguard Worker * @returns true if the import succeeded, false otherwise 747*c33452fbSAndroid Build Coastguard Worker */ 748*c33452fbSAndroid Build Coastguard Worker bool wrapLegacyXmlImport(const std::string &xmlSource, bool fromFile, bool withSettings, 749*c33452fbSAndroid Build Coastguard Worker CElement &element, const std::string &nameAttributeName, 750*c33452fbSAndroid Build Coastguard Worker std::string &errorMsg); 751*c33452fbSAndroid Build Coastguard Worker 752*c33452fbSAndroid Build Coastguard Worker /** 753*c33452fbSAndroid Build Coastguard Worker * Export an element object to an Xml destination. 754*c33452fbSAndroid Build Coastguard Worker * 755*c33452fbSAndroid Build Coastguard Worker * 756*c33452fbSAndroid Build Coastguard Worker * @param[out] output the stream to output the XML to 757*c33452fbSAndroid Build Coastguard Worker * @param[in] xmlSerializingContext the serializing context 758*c33452fbSAndroid Build Coastguard Worker * @param[in] element object to be serialized. 759*c33452fbSAndroid Build Coastguard Worker * 760*c33452fbSAndroid Build Coastguard Worker * @return false if any error occurs, true otherwise. 761*c33452fbSAndroid Build Coastguard Worker */ 762*c33452fbSAndroid Build Coastguard Worker bool serializeElement(std::ostream &output, CXmlSerializingContext &xmlSerializingContext, 763*c33452fbSAndroid Build Coastguard Worker const CElement &element) const; 764*c33452fbSAndroid Build Coastguard Worker 765*c33452fbSAndroid Build Coastguard Worker /** Wrapper for converting public APIs semantics to internal API 766*c33452fbSAndroid Build Coastguard Worker * 767*c33452fbSAndroid Build Coastguard Worker * Public APIs have a string argument that can either: 768*c33452fbSAndroid Build Coastguard Worker * - contain a path to an XML file or; 769*c33452fbSAndroid Build Coastguard Worker * - receive an actual XML document. 770*c33452fbSAndroid Build Coastguard Worker * They also have a boolean argument specifying which of the two cases it 771*c33452fbSAndroid Build Coastguard Worker * is. 772*c33452fbSAndroid Build Coastguard Worker * 773*c33452fbSAndroid Build Coastguard Worker * Instead, the internal APIs only take an std::ostream argument. This 774*c33452fbSAndroid Build Coastguard Worker * method opens the file as a stream if applicable or simply wrap the 775*c33452fbSAndroid Build Coastguard Worker * string in a stream. It then passes the stream to the internal methods. 776*c33452fbSAndroid Build Coastguard Worker * 777*c33452fbSAndroid Build Coastguard Worker * @param[in] xmlDest the XML sink (either a path or any string that 778*c33452fbSAndroid Build Coastguard Worker * will be filled) 779*c33452fbSAndroid Build Coastguard Worker * @param[in] toFile specifies whether xmlSource is a path or a 780*c33452fbSAndroid Build Coastguard Worker * string that will receive an actual XML document 781*c33452fbSAndroid Build Coastguard Worker * @param[in] withSettings if false, only export the configurations 782*c33452fbSAndroid Build Coastguard Worker * applicability rules; if true, also export their settings 783*c33452fbSAndroid Build Coastguard Worker * @param[out] element the element to be exported 784*c33452fbSAndroid Build Coastguard Worker * @param[out] errorMsg string used as output for any error message 785*c33452fbSAndroid Build Coastguard Worker * 786*c33452fbSAndroid Build Coastguard Worker * @returns true if the export succeeded, false otherwise 787*c33452fbSAndroid Build Coastguard Worker */ 788*c33452fbSAndroid Build Coastguard Worker bool wrapLegacyXmlExport(std::string &xmlDest, bool toFile, bool withSettings, 789*c33452fbSAndroid Build Coastguard Worker const CElement &element, std::string &errorMsg) const; 790*c33452fbSAndroid Build Coastguard Worker 791*c33452fbSAndroid Build Coastguard Worker /** Wrapper for converting public APIs semantics to internal API 792*c33452fbSAndroid Build Coastguard Worker * 793*c33452fbSAndroid Build Coastguard Worker * @see wrapLegacyXmlExport 794*c33452fbSAndroid Build Coastguard Worker */ 795*c33452fbSAndroid Build Coastguard Worker bool wrapLegacyXmlExportToFile(std::string &xmlDest, const CElement &element, 796*c33452fbSAndroid Build Coastguard Worker CXmlDomainExportContext &context) const; 797*c33452fbSAndroid Build Coastguard Worker 798*c33452fbSAndroid Build Coastguard Worker /** Wrapper for converting public APIs semantics to internal API 799*c33452fbSAndroid Build Coastguard Worker * 800*c33452fbSAndroid Build Coastguard Worker * @see wrapLegacyXmlExport 801*c33452fbSAndroid Build Coastguard Worker */ 802*c33452fbSAndroid Build Coastguard Worker bool wrapLegacyXmlExportToString(std::string &xmlDest, const CElement &element, 803*c33452fbSAndroid Build Coastguard Worker CXmlDomainExportContext &context) const; 804*c33452fbSAndroid Build Coastguard Worker 805*c33452fbSAndroid Build Coastguard Worker // Framework Configuration 806*c33452fbSAndroid Build Coastguard Worker CParameterFrameworkConfiguration *getFrameworkConfiguration(); 807*c33452fbSAndroid Build Coastguard Worker const CParameterFrameworkConfiguration *getConstFrameworkConfiguration(); 808*c33452fbSAndroid Build Coastguard Worker 809*c33452fbSAndroid Build Coastguard Worker // Selection Criteria 810*c33452fbSAndroid Build Coastguard Worker CSelectionCriteria *getSelectionCriteria(); 811*c33452fbSAndroid Build Coastguard Worker const CSelectionCriteria *getConstSelectionCriteria(); 812*c33452fbSAndroid Build Coastguard Worker 813*c33452fbSAndroid Build Coastguard Worker // System Class 814*c33452fbSAndroid Build Coastguard Worker CSystemClass *getSystemClass(); 815*c33452fbSAndroid Build Coastguard Worker const CSystemClass *getConstSystemClass() const; 816*c33452fbSAndroid Build Coastguard Worker 817*c33452fbSAndroid Build Coastguard Worker // Configurable Domains 818*c33452fbSAndroid Build Coastguard Worker CConfigurableDomains *getConfigurableDomains(); 819*c33452fbSAndroid Build Coastguard Worker const CConfigurableDomains *getConstConfigurableDomains(); 820*c33452fbSAndroid Build Coastguard Worker const CConfigurableDomains *getConstConfigurableDomains() const; 821*c33452fbSAndroid Build Coastguard Worker 822*c33452fbSAndroid Build Coastguard Worker // Apply configurations 823*c33452fbSAndroid Build Coastguard Worker void doApplyConfigurations(bool bForce); 824*c33452fbSAndroid Build Coastguard Worker 825*c33452fbSAndroid Build Coastguard Worker // Dynamic object creation libraries feeding 826*c33452fbSAndroid Build Coastguard Worker void feedElementLibraries(); 827*c33452fbSAndroid Build Coastguard Worker 828*c33452fbSAndroid Build Coastguard Worker // Remote Processor Server connection handling 829*c33452fbSAndroid Build Coastguard Worker bool isRemoteInterfaceRequired(); 830*c33452fbSAndroid Build Coastguard Worker bool handleRemoteProcessingInterface(std::string &strError); 831*c33452fbSAndroid Build Coastguard Worker 832*c33452fbSAndroid Build Coastguard Worker /** Log the result of a function 833*c33452fbSAndroid Build Coastguard Worker * 834*c33452fbSAndroid Build Coastguard Worker * @param[in] isSuccess indicates if the previous function has succeed 835*c33452fbSAndroid Build Coastguard Worker * @param[in] result function provided result string 836*c33452fbSAndroid Build Coastguard Worker * @return isSuccess parameter 837*c33452fbSAndroid Build Coastguard Worker */ 838*c33452fbSAndroid Build Coastguard Worker bool logResult(bool isSuccess, const std::string &result); 839*c33452fbSAndroid Build Coastguard Worker 840*c33452fbSAndroid Build Coastguard Worker /** Info logger call helper */ 841*c33452fbSAndroid Build Coastguard Worker inline core::log::details::Info info(); 842*c33452fbSAndroid Build Coastguard Worker 843*c33452fbSAndroid Build Coastguard Worker /** Warning logger call helper */ 844*c33452fbSAndroid Build Coastguard Worker inline core::log::details::Warning warning(); 845*c33452fbSAndroid Build Coastguard Worker 846*c33452fbSAndroid Build Coastguard Worker // Tuning 847*c33452fbSAndroid Build Coastguard Worker bool _bTuningModeIsOn{false}; 848*c33452fbSAndroid Build Coastguard Worker 849*c33452fbSAndroid Build Coastguard Worker // Value Space 850*c33452fbSAndroid Build Coastguard Worker bool _bValueSpaceIsRaw{false}; 851*c33452fbSAndroid Build Coastguard Worker 852*c33452fbSAndroid Build Coastguard Worker // Output Raw Format 853*c33452fbSAndroid Build Coastguard Worker bool _bOutputRawFormatIsHex{false}; 854*c33452fbSAndroid Build Coastguard Worker 855*c33452fbSAndroid Build Coastguard Worker // Automatic synchronization to HW during Tuning session 856*c33452fbSAndroid Build Coastguard Worker bool _bAutoSyncOn{true}; 857*c33452fbSAndroid Build Coastguard Worker 858*c33452fbSAndroid Build Coastguard Worker // Current Parameter Settings 859*c33452fbSAndroid Build Coastguard Worker CParameterBlackboard *_pMainParameterBlackboard; 860*c33452fbSAndroid Build Coastguard Worker 861*c33452fbSAndroid Build Coastguard Worker // Dynamic object creation 862*c33452fbSAndroid Build Coastguard Worker CElementLibrarySet *_pElementLibrarySet; 863*c33452fbSAndroid Build Coastguard Worker 864*c33452fbSAndroid Build Coastguard Worker // XML parsing, object creation handling 865*c33452fbSAndroid Build Coastguard Worker std::string _xmlConfigurationUri; 866*c33452fbSAndroid Build Coastguard Worker std::string _schemaUri; // Place where schemas stand 867*c33452fbSAndroid Build Coastguard Worker 868*c33452fbSAndroid Build Coastguard Worker // Subsystem plugin location 869*c33452fbSAndroid Build Coastguard Worker const CSubsystemPlugins *_pSubsystemPlugins{nullptr}; 870*c33452fbSAndroid Build Coastguard Worker 871*c33452fbSAndroid Build Coastguard Worker // Remote Processor Server 872*c33452fbSAndroid Build Coastguard Worker IRemoteProcessorServerInterface *_pRemoteProcessorServer{nullptr}; 873*c33452fbSAndroid Build Coastguard Worker 874*c33452fbSAndroid Build Coastguard Worker // Parser description array 875*c33452fbSAndroid Build Coastguard Worker static const SRemoteCommandParserItem gastRemoteCommandParserItems[]; 876*c33452fbSAndroid Build Coastguard Worker 877*c33452fbSAndroid Build Coastguard Worker // Maximum command usage length 878*c33452fbSAndroid Build Coastguard Worker size_t _maxCommandUsageLength{0}; 879*c33452fbSAndroid Build Coastguard Worker 880*c33452fbSAndroid Build Coastguard Worker // Blackboard access mutex 881*c33452fbSAndroid Build Coastguard Worker std::mutex _blackboardMutex; 882*c33452fbSAndroid Build Coastguard Worker 883*c33452fbSAndroid Build Coastguard Worker /** Application main logger based on the one provided by the client */ 884*c33452fbSAndroid Build Coastguard Worker mutable core::log::Logger _logger; 885*c33452fbSAndroid Build Coastguard Worker 886*c33452fbSAndroid Build Coastguard Worker /** If set to false, the remote interface won't be started no matter what. 887*c33452fbSAndroid Build Coastguard Worker * If set to true - the default - it has no impact on the policy for 888*c33452fbSAndroid Build Coastguard Worker * starting the remote interface. 889*c33452fbSAndroid Build Coastguard Worker */ 890*c33452fbSAndroid Build Coastguard Worker bool _bForceNoRemoteInterface{false}; 891*c33452fbSAndroid Build Coastguard Worker 892*c33452fbSAndroid Build Coastguard Worker /** If set to true, missing subsystem will abort parameterMgr start. 893*c33452fbSAndroid Build Coastguard Worker * If set to false, missing subsystem will fallback on virtual subsystem. 894*c33452fbSAndroid Build Coastguard Worker */ 895*c33452fbSAndroid Build Coastguard Worker bool _bFailOnMissingSubsystem{true}; 896*c33452fbSAndroid Build Coastguard Worker /** If set to true, unparsable or discording domains will abort parameterMgr start. 897*c33452fbSAndroid Build Coastguard Worker * If set to false, unparsable or discording domains 898*c33452fbSAndroid Build Coastguard Worker * will continue the parameterMgr start with no domains. 899*c33452fbSAndroid Build Coastguard Worker */ 900*c33452fbSAndroid Build Coastguard Worker bool _bFailOnFailedSettingsLoad{true}; 901*c33452fbSAndroid Build Coastguard Worker 902*c33452fbSAndroid Build Coastguard Worker /** 903*c33452fbSAndroid Build Coastguard Worker * If set to true, parameterMgr will report an error 904*c33452fbSAndroid Build Coastguard Worker * when being unable to validate .xml files 905*c33452fbSAndroid Build Coastguard Worker * If set to false, no .xml/xsd validation will happen (default behaviour) 906*c33452fbSAndroid Build Coastguard Worker */ 907*c33452fbSAndroid Build Coastguard Worker bool _bValidateSchemasOnStart{false}; 908*c33452fbSAndroid Build Coastguard Worker }; 909