|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Special AT command handler |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_CDUNATSPECIALCMDHANDLER_H |
|
19 #define C_CDUNATSPECIALCMDHANDLER_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <badesca.h> |
|
23 |
|
24 const TInt KLineBufLength = (512 + 1); // Set this the same as in KDunLineBufLength |
|
25 |
|
26 /** |
|
27 * Class for special AT command handler |
|
28 * |
|
29 * @lib dunatext.lib |
|
30 * @since TB9.2 |
|
31 */ |
|
32 NONSHARABLE_CLASS( CDunAtSpecialCmdHandler ) : public CBase |
|
33 { |
|
34 |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Two-phased constructor. |
|
39 * @param None |
|
40 * @return Instance of self |
|
41 */ |
|
42 static CDunAtSpecialCmdHandler* NewL(); |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 ~CDunAtSpecialCmdHandler(); |
|
48 |
|
49 public: |
|
50 |
|
51 /** |
|
52 * Checks if the command has to be treated special way. |
|
53 * For example in case of MAC, it sends command AT&FE0Q0V1&C1&D2+IFC=3,1. |
|
54 * meaning there is no delimiters in the command. |
|
55 * In case of MAC we try to search AT&F (sub command) string from the |
|
56 * beginning of the command. |
|
57 * Search is done string basis. |
|
58 * |
|
59 * @since TB9.2 |
|
60 * @param aCharacter Character to add |
|
61 * @return ETrue if data is ready for comparison, EFalse otherwise |
|
62 */ |
|
63 TBool IsCompleteSubCommand( TChar aCharacter ); |
|
64 |
|
65 /** |
|
66 * Resets the buffer used for comparisons |
|
67 * |
|
68 * @since TB9.2 |
|
69 * @return None |
|
70 */ |
|
71 void ResetComparisonBuffer(); |
|
72 |
|
73 private: |
|
74 |
|
75 CDunAtSpecialCmdHandler(); |
|
76 |
|
77 void ConstructL(); |
|
78 |
|
79 /** |
|
80 * Defines when comparison is excecuted, checks if the data lengths are |
|
81 * equal. |
|
82 * |
|
83 * @since TB9.2 |
|
84 * @return ETrue if data is ready for comparison, EFalse otherwise |
|
85 */ |
|
86 TBool IsDataReadyForComparison( TInt aLength ); |
|
87 |
|
88 /** |
|
89 * Defines minimum length of the special commands. |
|
90 * |
|
91 * @since TB9.2 |
|
92 * @return Minimum length of the special commands |
|
93 */ |
|
94 TInt MinimumLength(); |
|
95 |
|
96 private: // data |
|
97 |
|
98 /** |
|
99 * Buffer for temporary AT command input |
|
100 */ |
|
101 TBuf8<KLineBufLength> iBuffer; |
|
102 |
|
103 /** |
|
104 * Special commands for parsing |
|
105 */ |
|
106 CDesC8Array *iSpecialCmds; |
|
107 |
|
108 }; |
|
109 |
|
110 #endif // C_CDUNATSPECIALCMDHANDLER_H |