bluetoothengine/headsetsimulator/profiles/hspprofile/inc/dataprocessing/hspcommandparser.h
branchheadsetsimulator
changeset 60 90dbfc0435e3
equal deleted inserted replaced
59:02103bf20ee5 60:90dbfc0435e3
       
     1 /* 
       
     2  *
       
     3  * Copyright (c) <2010> Comarch S.A. and/or its subsidiary(-ies).
       
     4  * All rights reserved.
       
     5  * This component and the accompanying materials are made available
       
     6  * under the terms of the License "Eclipse Public License v1.0"
       
     7  * which accompanies this distribution, and is available
       
     8  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     9  *
       
    10  * Original Contributors:
       
    11  * Comarch S.A. - original contribution.
       
    12  *
       
    13  * Contributors:
       
    14  *
       
    15  * Description:
       
    16  *
       
    17  */
       
    18 
       
    19 #ifndef HSPCOMMANDPARSER_H_
       
    20 #define HSPCOMMANDPARSER_H_
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "hspcommand.h"
       
    25 
       
    26 /**
       
    27  *  @brief Parser for AT commands 
       
    28  */
       
    29 class CHsHSPParser : public CBase
       
    30 {
       
    31 public:
       
    32 
       
    33     /**
       
    34      * Two-phased constructor.
       
    35      * 
       
    36      * @return class instance
       
    37      */
       
    38     static CHsHSPParser* NewL();
       
    39 
       
    40     /**
       
    41      * Two-phased constructor.
       
    42      * 
       
    43      * @return class instance
       
    44      */
       
    45     static CHsHSPParser* NewLC();
       
    46 
       
    47     /** 
       
    48      * Destructor
       
    49      */
       
    50     ~CHsHSPParser();
       
    51 
       
    52 public:
       
    53 
       
    54     /**
       
    55      * Parses 8-bit descriptor into AT command
       
    56      * 
       
    57      * @param aBufCommand descriptor to be parsed
       
    58      * @param aFromAG is data passed from AG
       
    59      * @param aCommand result (AT command)
       
    60      */
       
    61     void ParseL( const TDesC8 &aBufCommand, const TBool aFromAG,
       
    62             CHsHSPCommand& aCommand );
       
    63 
       
    64 private:
       
    65 
       
    66     /**
       
    67      * Contructor for performing 1st stage construction
       
    68      */
       
    69     CHsHSPParser();
       
    70 
       
    71     /**
       
    72      * Constructor for performing 2nd stage contruction
       
    73      */
       
    74     void ConstructL();
       
    75 
       
    76 private:
       
    77 
       
    78     /**
       
    79      * Retrieves command's mode from descriptor data
       
    80      * 
       
    81      * @param aCommand descriptor to be parsed
       
    82      * @param aFromAG denotes if data sent from AG
       
    83      * @return command's mode 
       
    84      */
       
    85     THsHSPCommandMode RetrieveModeL( const TDesC8 &aCommand,
       
    86             const TBool aFromAG );
       
    87 
       
    88     /**
       
    89      * Retrieves command's type from descriptor data
       
    90      * 
       
    91      * @param aCommand descriptor to be parsed
       
    92      * @return command's type 
       
    93      */
       
    94     THsHSPCommandType RetrieveTypeL( const TDesC8 &aCommand );
       
    95 
       
    96     /**
       
    97      * Retrieves command's params from descriptor data
       
    98      * 
       
    99      * @param aCommand descriptor to be parsed
       
   100      * @param aCmdMode command's mode
       
   101      * @param aParams reference for array of params
       
   102      */
       
   103     void RetrieveParamsL( const TDesC8 &aCommand,
       
   104             const THsHSPCommandMode aCmdMode, RATParamArray& aParams );
       
   105 
       
   106 };
       
   107 
       
   108 #endif /* HSPCOMMANDPARSER_H_ */