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 atsmsreceive.h |
|
15 // This contains CAtSmsReceive which received incoming messages |
|
16 // |
|
17 |
|
18 #ifndef ATSMSRECEIVE_H |
|
19 #define ATSMSRECEIVE_H |
|
20 |
|
21 //system include |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 #include <cmmsmsutility.h> |
|
25 |
|
26 //user include |
|
27 #include "atcommandbase.h" |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * CAtSmsReceiveMessage |
|
33 * |
|
34 */ |
|
35 class CAtSmsReceive: public CAtCommandBase |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * Destructor |
|
40 * |
|
41 */ |
|
42 ~CAtSmsReceive(); |
|
43 |
|
44 /** |
|
45 * static NewL |
|
46 * |
|
47 * @param aGloblePhone |
|
48 * @param aCtsyDispatcherCallback |
|
49 */ |
|
50 static CAtSmsReceive* NewL(CGlobalPhonemanager& aGloblePhone, |
|
51 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
52 |
|
53 /** |
|
54 * static NewLC |
|
55 * |
|
56 * @param aGloblePhone |
|
57 * @param aCtsyDispatcherCallback |
|
58 */ |
|
59 static CAtSmsReceive* NewLC(CGlobalPhonemanager& aGloblePhone, |
|
60 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
61 |
|
62 /** |
|
63 * Virtual function. Inherited from CAtCommandBase |
|
64 * Start Execute AT Command |
|
65 */ |
|
66 virtual void ExecuteCommand(); |
|
67 |
|
68 /** |
|
69 * Will be called by AT Manager whenever a event was triggered |
|
70 * |
|
71 * @param aEventSource |
|
72 * @param aStatus |
|
73 */ |
|
74 virtual void EventSignal(TAtEventSource aEventSource, TInt aStatus); |
|
75 |
|
76 /** |
|
77 * Virtual function. Inherited from CAtCommandBase |
|
78 * |
|
79 * @param aResponseBuf Line buf reading from baseband |
|
80 */ |
|
81 virtual void ParseResponseL(const TDesC8& aResponseBuf); |
|
82 |
|
83 /** |
|
84 * Start this request |
|
85 * |
|
86 */ |
|
87 void StartRequest(); |
|
88 protected: |
|
89 /** |
|
90 * Constructor |
|
91 * |
|
92 * @param aGloblePhone |
|
93 * @param aCtsyDispatcherCallback |
|
94 */ |
|
95 CAtSmsReceive(CGlobalPhonemanager& aGloblePhone, |
|
96 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
97 |
|
98 /** |
|
99 * 2nd Constructor |
|
100 */ |
|
101 void ConstructL(); |
|
102 private: |
|
103 /** |
|
104 * Parse 1st line of CMT response, of the format: "+CMT: [<alpha>], <pdu_len>" |
|
105 * Stores the <pdu_len> in aPduLen |
|
106 */ |
|
107 void CMTResponseFirstLineL(); |
|
108 |
|
109 /** |
|
110 * Parse second line of CMT or DS response, of the format: "<pdu>" |
|
111 * The <pdu> is saved to aPdu. If the <pdu> is found to have a prefixed SCA |
|
112 * then that is removed before the save to aPdu. |
|
113 */ |
|
114 void CMTResponseSecondLineL(); |
|
115 private: |
|
116 /** |
|
117 * when receiving a message,its states should be changed |
|
118 */ |
|
119 enum |
|
120 { |
|
121 EReceiveReady, |
|
122 EWaitForCmtSecondLine, |
|
123 EATNotInProgress |
|
124 }iState; |
|
125 |
|
126 /** |
|
127 * Stores the length of PDU received |
|
128 */ |
|
129 TInt iPduLen; |
|
130 |
|
131 /** |
|
132 * binary format of PDU |
|
133 */ |
|
134 RMobileSmsMessaging::TMobileSmsGsmTpdu iPdu; |
|
135 |
|
136 /** |
|
137 * iAttr saved attritube of message revceived |
|
138 */ |
|
139 RMobileSmsMessaging::TMobileSmsReceiveAttributesV1 iAttr; |
|
140 |
|
141 /** |
|
142 * The structure used for callback |
|
143 */ |
|
144 TSmsMsg iMsgReceive; |
|
145 |
|
146 /** |
|
147 * The return error value of AT command executed |
|
148 */ |
|
149 TInt iError; |
|
150 |
|
151 }; // class CAtSmsReceive: |
|
152 #endif // ATSMSRECEIVE_H |
|