|
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 HFPCOMMANDPARSER_H_ |
|
20 #define HFPCOMMANDPARSER_H_ |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "hfpcommand.h" |
|
25 |
|
26 /** |
|
27 * @brief AT command parser |
|
28 */ |
|
29 class CHsHFPParser : public CBase |
|
30 { |
|
31 public: |
|
32 |
|
33 /** |
|
34 * Two-phased constructor. |
|
35 * |
|
36 * @return class instance |
|
37 */ |
|
38 static CHsHFPParser* NewL(); |
|
39 |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 * |
|
43 * @return class instance |
|
44 */ |
|
45 static CHsHFPParser* NewLC(); |
|
46 |
|
47 /** |
|
48 * Destructor |
|
49 */ |
|
50 ~CHsHFPParser(); |
|
51 |
|
52 public: |
|
53 |
|
54 /** |
|
55 * Parses AT command. Sets type, mode and params. |
|
56 * |
|
57 * @param aBufCommand AT command as descriptor |
|
58 * @param aFromAG denotes if AT command was sent from AG |
|
59 * @param aCommand on exit command object |
|
60 */ |
|
61 void ParseL(const TDesC8 &aBufCommand, const TBool aFromAG, |
|
62 CHsHFPCommand& aCommand); |
|
63 |
|
64 private: |
|
65 /** |
|
66 * Constructor for performing 1st stage construction |
|
67 */ |
|
68 CHsHFPParser(); |
|
69 |
|
70 /** |
|
71 * Constructor for performing 2nd stage construction |
|
72 */ |
|
73 void ConstructL(); |
|
74 |
|
75 /** |
|
76 * Retrieves command mode |
|
77 * |
|
78 * @param aCommand AT command as descriptor |
|
79 * @param aFromAG denotes if AT command was sent from AG |
|
80 * |
|
81 * @return command mode |
|
82 */ |
|
83 THsHFPCommandMode RetrieveModeL(const TDesC8 &aCommand, |
|
84 const TBool aFromAG); |
|
85 |
|
86 /** |
|
87 * Retrieves command type |
|
88 * |
|
89 * @param aCommand AT command as descriptor |
|
90 * |
|
91 * @return command type |
|
92 */ |
|
93 THsHFPCommandType RetrieveTypeL(const TDesC8 &aCommand); |
|
94 |
|
95 /** |
|
96 * Retrieves command params |
|
97 * |
|
98 * @param aCommand AT command as descriptor |
|
99 * @param aCmdMode command mode |
|
100 * @param aParams on exit array contains AT params |
|
101 * |
|
102 */ |
|
103 void RetrieveParamsL(const TDesC8 &aCommand, |
|
104 const THsHFPCommandMode aCmdMode, RATParamArray& aParams); |
|
105 |
|
106 }; |
|
107 |
|
108 #endif /* HFPCOMMANDPARSER_H_ */ |