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 atsmsstorewrite.h |
|
15 // This contains CAtSmsStoreWrite which is used to write sms message |
|
16 // |
|
17 |
|
18 #ifndef ATSMSSTOREWRITE_H |
|
19 #define ATSMSSTOREWRITE_H |
|
20 |
|
21 // system include |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 #include <ctsy/ltsy/mltsydispatchphonebookinterface.h> |
|
25 #include <callbacktimer.h> |
|
26 |
|
27 // user include |
|
28 #include "atcommandbase.h" |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * CAtSmsStoreWrite |
|
34 * |
|
35 */ |
|
36 |
|
37 class CAtSmsStoreWrite : public CAtCommandBase, |
|
38 public MTimerObserver |
|
39 { |
|
40 public: |
|
41 /** |
|
42 * Destructor |
|
43 * |
|
44 */ |
|
45 ~CAtSmsStoreWrite(); |
|
46 |
|
47 /** |
|
48 * static NewL |
|
49 * |
|
50 * @param aGloblePhone |
|
51 * @param aCtsyDispatcherCallback |
|
52 */ |
|
53 static CAtSmsStoreWrite* NewL(CGlobalPhonemanager& aGloblePhone, |
|
54 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
55 |
|
56 /** |
|
57 * static NewLC |
|
58 * |
|
59 * @param aGloblePhone |
|
60 * @param aCtsyDispatcherCallback |
|
61 */ |
|
62 static CAtSmsStoreWrite* NewLC(CGlobalPhonemanager& aGloblePhone, |
|
63 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
64 |
|
65 /** |
|
66 * Virtual function. Inherited from CAtCommandBase |
|
67 * Start Execute AT Command |
|
68 */ |
|
69 virtual void ExecuteCommand(); |
|
70 |
|
71 |
|
72 /** |
|
73 * Will be called by AT Manager whenever a event was triggered |
|
74 * |
|
75 * @param aEventSource |
|
76 * @param aStatus |
|
77 */ |
|
78 virtual void EventSignal(TAtEventSource aEventSource, TInt aStatus); |
|
79 |
|
80 /** |
|
81 * Virtual function. Inherited from CAtCommandBase |
|
82 * |
|
83 * @param aResponseBuf Line buf reading from baseband |
|
84 */ |
|
85 virtual void ParseResponseL(const TDesC8& aResponseBuf); |
|
86 |
|
87 /** |
|
88 * Start this request |
|
89 * |
|
90 */ |
|
91 void StartRequest(); |
|
92 |
|
93 /** |
|
94 * set GsmSmsEntry which is passed by handler |
|
95 */ |
|
96 void SeGsmSmsEntry(RMobileSmsStore::TMobileGsmSmsEntryV1 aMobileGsmEntry); |
|
97 private: |
|
98 /** |
|
99 * Constructor |
|
100 * |
|
101 * @param aGloblePhone |
|
102 * @param aCtsyDispatcherCallback |
|
103 */ |
|
104 CAtSmsStoreWrite(CGlobalPhonemanager& aGloblePhone, |
|
105 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
106 |
|
107 /** |
|
108 * 2nd Constructor |
|
109 */ |
|
110 void ConstructL(); |
|
111 |
|
112 /** |
|
113 * start a timer |
|
114 */ |
|
115 void BeginTimer(); |
|
116 |
|
117 /** |
|
118 * From MTimerObserver |
|
119 */ |
|
120 virtual void TimerRun(TInt aError); |
|
121 |
|
122 /** |
|
123 * Issue writing AT Command to baseband |
|
124 * not using base class because the buffer length is KMaxAsciiPduLength |
|
125 */ |
|
126 void StartWritingPduLength(); |
|
127 |
|
128 /** |
|
129 * Issue writing AT Command to baseband |
|
130 * not using base class because the buffer length is KMaxAsciiPduLength |
|
131 */ |
|
132 void StartWritingPdu(); |
|
133 |
|
134 /** |
|
135 * Executer AT command for writing a message |
|
136 */ |
|
137 void WriteMessage(); |
|
138 private: |
|
139 /** |
|
140 * state machine for EventSignal |
|
141 */ |
|
142 enum |
|
143 { |
|
144 ESetPDULengthComplete, |
|
145 EWritePDUComplete, |
|
146 }iState; |
|
147 |
|
148 /** |
|
149 * A pointer for Timer |
|
150 */ |
|
151 CCallbackTimer* iCallbackTimer; |
|
152 |
|
153 /** |
|
154 * The buffer contains the "AT" String which should be sent to BaseBand Modem |
|
155 */ |
|
156 TBuf8<KMaxAsciiPduLength> iTxBuffer; |
|
157 |
|
158 /** |
|
159 * writemessage index should be used by callback |
|
160 */ |
|
161 TInt iLocation; |
|
162 |
|
163 /** |
|
164 * PDU in ascii format |
|
165 */ |
|
166 TBuf8<KMaxAsciiPduLength> iMsgDataAscii; |
|
167 |
|
168 /** |
|
169 * get the GsmSmsEntry value passed by handler |
|
170 */ |
|
171 RMobileSmsStore::TMobileGsmSmsEntryV1 iMobileGsmEntry; |
|
172 |
|
173 /** |
|
174 * The return error value of AT command executed |
|
175 */ |
|
176 TInt iError; |
|
177 |
|
178 /** |
|
179 * The error value before Execute write() |
|
180 */ |
|
181 TInt iCallbackVal; |
|
182 }; // class CAtSmsStoreWrite |
|
183 |
|
184 #endif // ATSMSSTOREWRITE_H |
|