|
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // @file atmanager.h |
|
15 // This contains CAtManager which manage AT commands |
|
16 // |
|
17 |
|
18 #ifndef ATMANAGER_H_ |
|
19 #define ATMANAGER_H_ |
|
20 |
|
21 // system include |
|
22 #include <e32base.h> |
|
23 |
|
24 // user include |
|
25 #include "mcommobserver.h" |
|
26 #include "atcommandbase.h" |
|
27 |
|
28 //class forward |
|
29 class CActiveCommandStore; |
|
30 |
|
31 /** |
|
32 * This class is acting an interface between Comms Engine and AT commands, which manage to find active |
|
33 * AT command and send the Event to it. |
|
34 * |
|
35 */ |
|
36 class CAtManager : public CBase, |
|
37 public MCommReadLineNotifier, |
|
38 public MCommEngineObserver |
|
39 { |
|
40 public: |
|
41 /** |
|
42 * Factory function |
|
43 * |
|
44 */ |
|
45 static CAtManager* NewL(); |
|
46 |
|
47 /** |
|
48 * Factory function |
|
49 */ |
|
50 static CAtManager* NewLC(); |
|
51 |
|
52 /** |
|
53 * Destructor |
|
54 */ |
|
55 virtual ~CAtManager(); |
|
56 |
|
57 public: |
|
58 /** |
|
59 * Set current active solicited AT Command. |
|
60 * By default, one one solicited AT command should be currently Active |
|
61 * |
|
62 * @param aSolicitedCommand The solicited AT command |
|
63 */ |
|
64 void SetSolicitedAtCommand(CAtCommandBase* aSolicitedCommand); |
|
65 |
|
66 /** |
|
67 * Get the Active Commands store: only one solicited and number of unsoclited AT Commands |
|
68 * |
|
69 * CActiveCommandStore The active commands store |
|
70 */ |
|
71 CActiveCommandStore* GetActiveCommandStore() const; |
|
72 |
|
73 /** |
|
74 * From MCommEngineObserver |
|
75 * This function would be called when the event @see TAtEventSource happened. |
|
76 * |
|
77 */ |
|
78 virtual void ReadOrWriteComplete(TAtEventSource aEvent, TInt aStatus); |
|
79 |
|
80 /** |
|
81 * From MCommReadLineNotifier |
|
82 * This function would be called when one line string were found |
|
83 */ |
|
84 virtual TBool NotifyOneLineFoundL(TInt aStatus, const TDesC8& aLineBuf); |
|
85 |
|
86 protected: |
|
87 /** |
|
88 * Constructor |
|
89 * |
|
90 */ |
|
91 CAtManager(); |
|
92 |
|
93 /** |
|
94 * 2nd constructor |
|
95 * |
|
96 */ |
|
97 void ConstructL(); |
|
98 |
|
99 private: |
|
100 /** |
|
101 * The active solicited AT command |
|
102 * Not Own |
|
103 */ |
|
104 CAtCommandBase* iSolicitedCommand; |
|
105 |
|
106 /** |
|
107 * The active command store |
|
108 * Own |
|
109 */ |
|
110 CActiveCommandStore* iActiveCommandStore; |
|
111 }; |
|
112 |
|
113 #endif /*ATMANAGER_H_*/ |