diff -r 02103bf20ee5 -r 90dbfc0435e3 bluetoothengine/headsetsimulator/profiles/hfpprofile/inc/dataprocessing/hfpcommandparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bluetoothengine/headsetsimulator/profiles/hfpprofile/inc/dataprocessing/hfpcommandparser.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 HFPCOMMANDPARSER_H_ +#define HFPCOMMANDPARSER_H_ + +#include + +#include "hfpcommand.h" + +/** + * @brief AT command parser + */ +class CHsHFPParser : public CBase + { +public: + + /** + * Two-phased constructor. + * + * @return class instance + */ + static CHsHFPParser* NewL(); + + /** + * Two-phased constructor. + * + * @return class instance + */ + static CHsHFPParser* NewLC(); + + /** + * Destructor + */ + ~CHsHFPParser(); + +public: + + /** + * Parses AT command. Sets type, mode and params. + * + * @param aBufCommand AT command as descriptor + * @param aFromAG denotes if AT command was sent from AG + * @param aCommand on exit command object + */ + void ParseL(const TDesC8 &aBufCommand, const TBool aFromAG, + CHsHFPCommand& aCommand); + +private: + /** + * Constructor for performing 1st stage construction + */ + CHsHFPParser(); + + /** + * Constructor for performing 2nd stage construction + */ + void ConstructL(); + + /** + * Retrieves command mode + * + * @param aCommand AT command as descriptor + * @param aFromAG denotes if AT command was sent from AG + * + * @return command mode + */ + THsHFPCommandMode RetrieveModeL(const TDesC8 &aCommand, + const TBool aFromAG); + + /** + * Retrieves command type + * + * @param aCommand AT command as descriptor + * + * @return command type + */ + THsHFPCommandType RetrieveTypeL(const TDesC8 &aCommand); + + /** + * Retrieves command params + * + * @param aCommand AT command as descriptor + * @param aCmdMode command mode + * @param aParams on exit array contains AT params + * + */ + void RetrieveParamsL(const TDesC8 &aCommand, + const THsHFPCommandMode aCmdMode, RATParamArray& aParams); + + }; + +#endif /* HFPCOMMANDPARSER_H_ */