diff -r 02103bf20ee5 -r 90dbfc0435e3 bluetoothengine/headsetsimulator/profiles/hspprofile/inc/dataprocessing/hspcommandparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bluetoothengine/headsetsimulator/profiles/hspprofile/inc/dataprocessing/hspcommandparser.h Wed Sep 15 15:59:44 2010 +0200 @@ -0,0 +1,108 @@ +/* + * + * Copyright (c) <2010> Comarch S.A. and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of the License "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Original Contributors: + * Comarch S.A. - original contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef HSPCOMMANDPARSER_H_ +#define HSPCOMMANDPARSER_H_ + +#include + +#include "hspcommand.h" + +/** + * @brief Parser for AT commands + */ +class CHsHSPParser : public CBase +{ +public: + + /** + * Two-phased constructor. + * + * @return class instance + */ + static CHsHSPParser* NewL(); + + /** + * Two-phased constructor. + * + * @return class instance + */ + static CHsHSPParser* NewLC(); + + /** + * Destructor + */ + ~CHsHSPParser(); + +public: + + /** + * Parses 8-bit descriptor into AT command + * + * @param aBufCommand descriptor to be parsed + * @param aFromAG is data passed from AG + * @param aCommand result (AT command) + */ + void ParseL( const TDesC8 &aBufCommand, const TBool aFromAG, + CHsHSPCommand& aCommand ); + +private: + + /** + * Contructor for performing 1st stage construction + */ + CHsHSPParser(); + + /** + * Constructor for performing 2nd stage contruction + */ + void ConstructL(); + +private: + + /** + * Retrieves command's mode from descriptor data + * + * @param aCommand descriptor to be parsed + * @param aFromAG denotes if data sent from AG + * @return command's mode + */ + THsHSPCommandMode RetrieveModeL( const TDesC8 &aCommand, + const TBool aFromAG ); + + /** + * Retrieves command's type from descriptor data + * + * @param aCommand descriptor to be parsed + * @return command's type + */ + THsHSPCommandType RetrieveTypeL( const TDesC8 &aCommand ); + + /** + * Retrieves command's params from descriptor data + * + * @param aCommand descriptor to be parsed + * @param aCmdMode command's mode + * @param aParams reference for array of params + */ + void RetrieveParamsL( const TDesC8 &aCommand, + const THsHSPCommandMode aCmdMode, RATParamArray& aParams ); + +}; + +#endif /* HSPCOMMANDPARSER_H_ */