|
1 /* |
|
2 * Copyright (c) 2009 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: AT command handler and notifier |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_CDUNATCMDHANDLER_H |
|
19 #define C_CDUNATCMDHANDLER_H |
|
20 |
|
21 #include <atext.h> |
|
22 #include <e32base.h> |
|
23 #include <atextcommon.h> |
|
24 #include "DunDataPusher.h" |
|
25 #include "DunAtCmdPusher.h" |
|
26 #include "DunAtEcomListen.h" |
|
27 #include "DunAtModeListen.h" |
|
28 #include "DunAtNvramListen.h" |
|
29 |
|
30 const TInt KDunChSetMaxCharLen = 1; // Only ASCII supported for now |
|
31 const TInt KDunOkBufLength = 1+1+2+1+1; // <CR>+<LF>+"OK"+<CR>+<LF> |
|
32 const TInt KDunErrorBufLength = 1+1+5+1+1; // <CR>+<LF>+"ERROR"+<CR>+<LF> |
|
33 const TInt KDunInputBufLength = (512 + 1); // 512 chars for command + <CR> |
|
34 |
|
35 class CDunAtUrcHandler; |
|
36 class MDunConnMon; |
|
37 class MDunStreamManipulator; |
|
38 |
|
39 /** |
|
40 * Class used for storing information related to string conversion and parsing |
|
41 * |
|
42 * @lib dunatext.lib |
|
43 * @since S60 v3.2 |
|
44 */ |
|
45 NONSHARABLE_CLASS( TDunParseInfo ) |
|
46 { |
|
47 |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Buffer for sending |
|
52 */ |
|
53 TBuf8<KDunInputBufLength> iSendBuffer; |
|
54 |
|
55 /** |
|
56 * Conversion limit for upper case conversion. |
|
57 * This is needed to convert the base part of special commands to upper case |
|
58 * where the part after the base part should not be converted to upper case. |
|
59 */ |
|
60 TInt iLimit; |
|
61 |
|
62 }; |
|
63 |
|
64 /** |
|
65 * Class used for AT command decoding related functionality |
|
66 * |
|
67 * @lib dunatext.lib |
|
68 * @since S60 v5.0 |
|
69 */ |
|
70 NONSHARABLE_CLASS( TDunDecodeInfo ) |
|
71 { |
|
72 |
|
73 public: |
|
74 |
|
75 /** |
|
76 * Flag to indicate if first decode |
|
77 */ |
|
78 TBool iFirstDecode; |
|
79 |
|
80 /** |
|
81 * Index in iInputBuffer for decoding to iDecodeBuffer |
|
82 */ |
|
83 TInt iDecodeIndex; |
|
84 |
|
85 /** |
|
86 * Previous character in parsing |
|
87 */ |
|
88 TChar iPrevChar; |
|
89 |
|
90 /** |
|
91 * Flag to indicate if previous character exists |
|
92 */ |
|
93 TBool iPrevExists; |
|
94 |
|
95 /** |
|
96 * Buffer for parsing |
|
97 */ |
|
98 TBuf8<KDunInputBufLength> iDecodeBuffer; |
|
99 |
|
100 }; |
|
101 |
|
102 /** |
|
103 * Notification interface class for command mode start/end |
|
104 * |
|
105 * @lib dunutils.lib |
|
106 * @since S60 v5.0 |
|
107 */ |
|
108 NONSHARABLE_CLASS( MDunCmdModeMonitor ) |
|
109 { |
|
110 |
|
111 public: |
|
112 |
|
113 /** |
|
114 * Notifies about command mode start |
|
115 * |
|
116 * @since S60 5.0 |
|
117 * @return None |
|
118 */ |
|
119 virtual void NotifyCommandModeStart() = 0; |
|
120 |
|
121 /** |
|
122 * Notifies about command mode end |
|
123 * |
|
124 * @since S60 5.0 |
|
125 * @return None |
|
126 */ |
|
127 virtual void NotifyCommandModeEnd() = 0; |
|
128 |
|
129 }; |
|
130 |
|
131 /** |
|
132 * Notification interface class for status changes in AT command handling |
|
133 * |
|
134 * @lib dunatext.lib |
|
135 * @since S60 v5.0 |
|
136 */ |
|
137 NONSHARABLE_CLASS( MDunAtCmdStatusReporter ) |
|
138 { |
|
139 |
|
140 public: |
|
141 |
|
142 /** |
|
143 * Notifies about AT command handling start |
|
144 * |
|
145 * @since S60 5.0 |
|
146 * @return None |
|
147 */ |
|
148 virtual void NotifyAtCmdHandlingStart() = 0; |
|
149 |
|
150 /** |
|
151 * Notifies about AT command handling end |
|
152 * |
|
153 * @since S60 5.0 |
|
154 * @param aEndIndex Index to the start of next command |
|
155 * @return None |
|
156 */ |
|
157 virtual void NotifyAtCmdHandlingEnd( TInt aStartIndex ) = 0; |
|
158 |
|
159 }; |
|
160 |
|
161 /** |
|
162 * Class for AT command handler and notifier |
|
163 * |
|
164 * @lib dunatext.lib |
|
165 * @since S60 v5.0 |
|
166 */ |
|
167 NONSHARABLE_CLASS( CDunAtCmdHandler ) : public CBase, |
|
168 public MDunAtCmdPusher, |
|
169 public MDunAtEcomListen, |
|
170 public MDunAtModeListen |
|
171 { |
|
172 |
|
173 public: |
|
174 |
|
175 /** |
|
176 * Two-phased constructor. |
|
177 * @param aUpstream Callback to upstream |
|
178 * @param aDownstream Callback to downstream |
|
179 * @param aConnectionName Connection identifier name |
|
180 * @return Instance of self |
|
181 */ |
|
182 IMPORT_C static CDunAtCmdHandler* NewL( |
|
183 MDunAtCmdStatusReporter* aUpstream, |
|
184 MDunStreamManipulator* aDownstream, |
|
185 const TDesC8* aConnectionName ); |
|
186 |
|
187 /** |
|
188 * Destructor. |
|
189 */ |
|
190 virtual ~CDunAtCmdHandler(); |
|
191 |
|
192 /** |
|
193 * Resets data to initial values |
|
194 * |
|
195 * @since S60 5.0 |
|
196 * @return None |
|
197 */ |
|
198 IMPORT_C void ResetData(); |
|
199 |
|
200 /** |
|
201 * Adds callback for command mode notification |
|
202 * The callback will be called when command mode starts or ends |
|
203 * |
|
204 * @since S60 5.0 |
|
205 * @param aCallback Callback to call when command mode starts or ends |
|
206 * @return Symbian error code on error, KErrNone otherwise |
|
207 */ |
|
208 IMPORT_C TInt AddCmdModeCallback( MDunCmdModeMonitor* aCallback ); |
|
209 |
|
210 /** |
|
211 * Parses an AT command |
|
212 * |
|
213 * @since S60 5.0 |
|
214 * @param aCommand Command to parse |
|
215 * @param aPartialInput ETrue if partial input, EFalse otherwise |
|
216 * @return Symbian error code on error, KErrNone otherwise |
|
217 */ |
|
218 IMPORT_C TInt ParseCommand( TDesC8& aCommand, TBool& aPartialInput ); |
|
219 |
|
220 /** |
|
221 * Manages request to abort command handling |
|
222 * |
|
223 * @since S60 5.0 |
|
224 * @return Symbian error code on error, KErrNone otherwise |
|
225 */ |
|
226 IMPORT_C TInt ManageAbortRequest(); |
|
227 |
|
228 /** |
|
229 * Sets end of command line marker on for the possible series of AT |
|
230 * commands. |
|
231 * |
|
232 * @since S60 5.0 |
|
233 * @param aClearInput ETrue to clear input buffer, EFalse otherwise |
|
234 * @return None |
|
235 */ |
|
236 IMPORT_C void SetEndOfCmdLine( TBool aClearInput ); |
|
237 |
|
238 /** |
|
239 * Stops sending of AT command from decode buffer |
|
240 * |
|
241 * @since S60 3.2 |
|
242 * @return Symbian error code on error, KErrNone otherwise |
|
243 */ |
|
244 IMPORT_C TInt Stop(); |
|
245 |
|
246 /** |
|
247 * Starts URC message handling |
|
248 * |
|
249 * @since S60 5.0 |
|
250 * @return Symbian error code on error, KErrNone otherwise |
|
251 */ |
|
252 IMPORT_C TInt StartUrc(); |
|
253 |
|
254 /** |
|
255 * Stops URC message handling |
|
256 * |
|
257 * @since S60 3.2 |
|
258 * @return Symbian error code on error, KErrNone otherwise |
|
259 */ |
|
260 IMPORT_C TInt StopUrc(); |
|
261 |
|
262 private: |
|
263 |
|
264 CDunAtCmdHandler( MDunAtCmdStatusReporter* aUpstream, |
|
265 MDunStreamManipulator* aDownstream, |
|
266 const TDesC8* aConnectionName ); |
|
267 |
|
268 void ConstructL(); |
|
269 |
|
270 /** |
|
271 * Initializes this class |
|
272 * |
|
273 * @since S60 3.2 |
|
274 * @return None |
|
275 */ |
|
276 void Initialize(); |
|
277 |
|
278 /** |
|
279 * Creates plugin handlers for this class |
|
280 * |
|
281 * @since S60 5.0 |
|
282 * @return None |
|
283 */ |
|
284 void CreatePluginHandlersL(); |
|
285 |
|
286 /** |
|
287 * Creates the array of special commands |
|
288 * |
|
289 * @since S60 5.0 |
|
290 * @return None |
|
291 */ |
|
292 void CreateSpecialCommandsL(); |
|
293 |
|
294 /** |
|
295 * Recreates special command data. |
|
296 * This is done when a plugin is installed or uninstalled. |
|
297 * |
|
298 * @since S60 5.0 |
|
299 * @return Symbian error code on error, KErrNone otherwise |
|
300 */ |
|
301 TInt RecreateSpecialCommands(); |
|
302 |
|
303 /** |
|
304 * Gets default settings from RATExtCommon and sets them to RATExt |
|
305 * |
|
306 * @since S60 5.0 |
|
307 * @return None |
|
308 */ |
|
309 void GetAndSetDefaultSettingsL(); |
|
310 |
|
311 /** |
|
312 * Regenerates the reply strings based on settings |
|
313 * |
|
314 * @since S60 5.0 |
|
315 * @return ETrue if quiet mode, EFalse otherwise |
|
316 */ |
|
317 TBool RegenerateReplyStrings(); |
|
318 |
|
319 /** |
|
320 * Regenerates the ok reply based on settings |
|
321 * |
|
322 * @since S60 5.0 |
|
323 * @return ETrue if quiet mode, EFalse otherwise |
|
324 */ |
|
325 TBool RegenerateOkReply(); |
|
326 |
|
327 /** |
|
328 * Regenerates the error reply based on settings |
|
329 * |
|
330 * @since S60 5.0 |
|
331 * @return ETrue if quiet mode, EFalse otherwise |
|
332 */ |
|
333 TBool RegenerateErrorReply(); |
|
334 |
|
335 /** |
|
336 * Gets current mode |
|
337 * |
|
338 * @since S60 5.0 |
|
339 * @param aMask Mask for current mode (only one supported) |
|
340 * @return New current mode |
|
341 */ |
|
342 TUint GetCurrentModeL( TUint aMask ); |
|
343 |
|
344 /** |
|
345 * Instantiates one URC message handling class instance and adds it to |
|
346 * the URC message handler array |
|
347 * |
|
348 * @since S60 3.2 |
|
349 * @return None |
|
350 */ |
|
351 CDunAtUrcHandler* AddOneUrcHandlerL(); |
|
352 |
|
353 /** |
|
354 * Deletes all instantiated URC message handlers |
|
355 * |
|
356 * @since S60 5.0 |
|
357 * @return None |
|
358 */ |
|
359 void DeletePluginHandlers(); |
|
360 |
|
361 /** |
|
362 * Manages partial AT command |
|
363 * |
|
364 * @since S60 5.0 |
|
365 * @param aCommand Command to process |
|
366 * @param aNeedsCarriage ETrue if full and non-consumed AT command needs |
|
367 * carriage return (AT command "A/") |
|
368 * @return ETrue if no other processing needed, EFalse otherwise |
|
369 */ |
|
370 TBool ManagePartialCommand( TDesC8& aCommand, |
|
371 TBool& aNeedsCarriage ); |
|
372 |
|
373 /** |
|
374 * Echoes a command if echo is on |
|
375 * |
|
376 * @since S60 5.0 |
|
377 * @param aDes String descriptor |
|
378 * @return ETrue if echo push started, EFalse otherwise |
|
379 */ |
|
380 TBool EchoCommand( TDesC8& aDes ); |
|
381 |
|
382 /** |
|
383 * Handles backspace and cancel characters |
|
384 * |
|
385 * @since S60 5.0 |
|
386 * @param aCommand Command to process |
|
387 * @return ETrue if special character found, EFalse otherwise |
|
388 */ |
|
389 TBool HandleSpecialCharacters( TDesC8& aCommand ); |
|
390 |
|
391 /** |
|
392 * Appends command to input buffer |
|
393 * |
|
394 * @since S60 5.0 |
|
395 * @param aCommand Command to append to input buffer |
|
396 * @param aEndFound ETrue if end (carriage return) was found |
|
397 * @return ETrue if overflow was found, EFalse otherwise |
|
398 */ |
|
399 TBool AppendCommandToInputBuffer( TDesC8& aCommand, TBool& aEndFound ); |
|
400 |
|
401 /** |
|
402 * Handles next decoded command from input buffer |
|
403 * |
|
404 * @since S60 5.0 |
|
405 * @return ETrue if last command decoded, EFalse otherwise |
|
406 */ |
|
407 TBool HandleNextDecodedCommand(); |
|
408 |
|
409 /** |
|
410 * Manages end of AT command handling |
|
411 * |
|
412 * @since S60 5.0 |
|
413 * @param aNotifyExternal Notify external parties |
|
414 * @param aNotifyLocal Notify local parties |
|
415 * @param aClearInput ETrue to clear input buffer, EFalse otherwise |
|
416 * @return None |
|
417 */ |
|
418 void ManageEndOfCmdHandling( TBool aNotifyExternal, |
|
419 TBool aNotifyLocal, |
|
420 TBool aClearInput ); |
|
421 |
|
422 /** |
|
423 * Extracts next decoded command from input buffer to decode buffer |
|
424 * |
|
425 * @since S60 5.0 |
|
426 * @param aPeek Peek for the next command if ETrue, EFalse otherwise |
|
427 * @return ETrue if command extracted, EFalse otherwise |
|
428 */ |
|
429 TBool ExtractNextDecodedCommand( TBool aPeek=EFalse ); |
|
430 |
|
431 /** |
|
432 * Restores old decode info. For ExtractNextDecodedCommand() when aPeeks is |
|
433 * ETrue. |
|
434 * |
|
435 * @since S60 5.0 |
|
436 * @param aPeek Peek for the next command if ETrue, EFalse otherwise |
|
437 * @param aOldInfo Old information to restore when aPeek is ETrue |
|
438 * @return None |
|
439 */ |
|
440 void RestoreOldDecodeInfo( TBool aPeek, TDunDecodeInfo& aOldInfo ); |
|
441 |
|
442 /** |
|
443 * Finds end of an AT command |
|
444 * |
|
445 * @since S60 5.0 |
|
446 * @param aDes String descriptor |
|
447 * @param aStartIndex Start index for search |
|
448 * @return Index if found, KErrNotFound otherwise |
|
449 */ |
|
450 TInt FindEndOfCommand( TDesC8& aDes, TInt aStartIndex=0 ); |
|
451 |
|
452 /** |
|
453 * Tests for end of AT command character |
|
454 * |
|
455 * @since S60 5.0 |
|
456 * @param aCharacter Character to test |
|
457 * @return ETrue if end of command, EFalse otherwise |
|
458 */ |
|
459 TBool IsEndOfCommand( TChar& aCharacter ); |
|
460 |
|
461 /** |
|
462 * Finds start of a decoded AT command |
|
463 * |
|
464 * @since S60 5.0 |
|
465 * @param aDes String descriptor |
|
466 * @param aStartIndex Start index for search |
|
467 * @pram aExtended ETrue if extended command, EFalse otherwise |
|
468 * @return Index if found, KErrNotFound otherwise |
|
469 */ |
|
470 TInt FindStartOfDecodedCommand( TDesC8& aDes, |
|
471 TInt aStartIndex, |
|
472 TBool& aExtended ); |
|
473 |
|
474 /** |
|
475 * Checks if character is delimiter character |
|
476 * |
|
477 * @since S60 5.0 |
|
478 * @param aCharacter Character to test |
|
479 * @return ETrue if delimiter character, EFalse otherwise |
|
480 */ |
|
481 TBool IsDelimiterCharacter( TChar aCharacter ); |
|
482 |
|
483 /** |
|
484 * Checks if character is of extended group |
|
485 * |
|
486 * @since S60 5.0 |
|
487 * @param aCharacter Character to test |
|
488 * @return ETrue if extended character, EFalse otherwise |
|
489 */ |
|
490 TBool IsExtendedCharacter( TChar aCharacter ); |
|
491 |
|
492 /** |
|
493 * Checks extended command |
|
494 * |
|
495 * @since S60 5.0 |
|
496 * @param aStartIndex Start index (doesn't change) |
|
497 * @param aEndIndex End index (changes) |
|
498 * @return ETrue if end of extended found, EFalse otherwise |
|
499 */ |
|
500 TBool CheckExtendedCommand( TInt aStartIndex, TInt& aEndIndex ); |
|
501 |
|
502 /** |
|
503 * Checks special command |
|
504 * |
|
505 * @since S60 5.0 |
|
506 * @param aStartIndex Start index (doesn't change) |
|
507 * @param aEndIndex End index (changes) |
|
508 * @return Symbian error code on error, KErrNone otherwise |
|
509 */ |
|
510 TBool CheckSpecialCommand( TInt aStartIndex, |
|
511 TInt& aEndIndex ); |
|
512 |
|
513 /** |
|
514 * Checks basic command |
|
515 * |
|
516 * @since S60 5.0 |
|
517 * @param aStartIndex Start index (doesn't change) |
|
518 * @param aEndIndex End index (changes) |
|
519 * @param aACmdFound ETrue if one character "A" command found, |
|
520 * EFalse otherwise |
|
521 * @return Symbian error code on error, KErrNone otherwise |
|
522 */ |
|
523 TInt CheckBasicCommand( TInt aStartIndex, |
|
524 TInt& aEndIndex, |
|
525 TBool& aOneCharCmd ); |
|
526 |
|
527 /** |
|
528 * Check if any one character command |
|
529 * |
|
530 * @since S60 5.0 |
|
531 * @param aStartIndex Start index (doesn't change) |
|
532 * @return ETrue if any one character command, EFalse otherwise |
|
533 */ |
|
534 TBool IsOneCharacterCommand( TInt aStartIndex ); |
|
535 |
|
536 /** |
|
537 * Check if one character "A" command |
|
538 * |
|
539 * @since S60 5.0 |
|
540 * @param aStartIndex Start index (doesn't change) |
|
541 * @return ETrue if one character "A" command, EFalse otherwise |
|
542 */ |
|
543 TBool IsOneCharacterACommand( TInt aStartIndex ); |
|
544 |
|
545 /** |
|
546 * Check if "A/" command |
|
547 * |
|
548 * @since S60 5.0 |
|
549 * @return ETrue if "A/" command, EFalse otherwise |
|
550 */ |
|
551 TBool IsASlashCommand(); |
|
552 |
|
553 /** |
|
554 * Handles "A/" command |
|
555 * |
|
556 * @since S60 5.0 |
|
557 * @return ETrue if error reply push started, EFalse otherwise |
|
558 */ |
|
559 TBool HandleASlashCommand(); |
|
560 |
|
561 /** |
|
562 * Resets parse buffers |
|
563 * |
|
564 * @since S60 5.0 |
|
565 * @param aClearInput ETrue to clear input buffer, EFalse otherwise |
|
566 * @return None |
|
567 */ |
|
568 void ResetParseBuffers( TBool aClearInput=ETrue ); |
|
569 |
|
570 /** |
|
571 * Manages command mode change |
|
572 * |
|
573 * @since S60 5.0 |
|
574 * @param aMode Mode to manage |
|
575 * @return ETrue if command mode change detected, EFalse otherwise |
|
576 */ |
|
577 TBool ManageCommandModeChange( TUint aMode ); |
|
578 |
|
579 /** |
|
580 * Reports command mode start/end change |
|
581 * |
|
582 * @since S60 3.2 |
|
583 * @param aStart Command mode start if ETrue, end otherwise |
|
584 * @return None |
|
585 */ |
|
586 void ReportCommandModeChange( TBool aStart ); |
|
587 |
|
588 /** |
|
589 * Manages echo mode change |
|
590 * |
|
591 * @since S60 5.0 |
|
592 * @param aMode Mode to manage |
|
593 * @return ETrue if echo mode change detected, EFalse otherwise |
|
594 */ |
|
595 TBool ManageEchoModeChange( TUint aMode ); |
|
596 |
|
597 /** |
|
598 * Manages quiet mode change |
|
599 * |
|
600 * @since S60 5.0 |
|
601 * @param aMode Mode to manage |
|
602 * @return ETrue if quiet mode change detected, EFalse otherwise |
|
603 */ |
|
604 TBool ManageQuietModeChange( TUint aMode ); |
|
605 |
|
606 /** |
|
607 * Manages verbose mode change |
|
608 * |
|
609 * @since S60 5.0 |
|
610 * @param aMode Mode to manage |
|
611 * @return ETrue if verbose mode change detected, EFalse otherwise |
|
612 */ |
|
613 TBool ManageVerboseModeChange( TUint aMode ); |
|
614 |
|
615 /** |
|
616 * Manages character change |
|
617 * |
|
618 * @since S60 5.0 |
|
619 * @param aMode Mode to manage |
|
620 * @return None |
|
621 */ |
|
622 void ManageCharacterChange( TUint aMode ); |
|
623 |
|
624 // from base class MDunAtCmdPusher |
|
625 |
|
626 /** |
|
627 * From MDunAtCmdPusher. |
|
628 * Notifies about end of AT command processing. |
|
629 * This is after all reply data for an AT command is multiplexed to the |
|
630 * downstream. |
|
631 * |
|
632 * @since S60 5.0 |
|
633 * @return None |
|
634 */ |
|
635 TInt NotifyEndOfProcessing( TInt aError ); |
|
636 |
|
637 /** |
|
638 * Notifies about request to stop AT command handling for the rest of the |
|
639 * command line data |
|
640 * |
|
641 * @since S60 5.0 |
|
642 * @return Symbian error code on error, KErrNone otherwise |
|
643 */ |
|
644 TInt NotifyEndOfCmdLineProcessing(); |
|
645 |
|
646 /** |
|
647 * Notifies about request to peek for the next command |
|
648 * |
|
649 * @since S60 5.0 |
|
650 * @return ETrue if next command exists, EFalse otherwise |
|
651 */ |
|
652 TBool NotifyNextCommandPeekRequest(); |
|
653 |
|
654 // from base class MDunAtEcomListen |
|
655 |
|
656 /** |
|
657 * From MDunAtEcomListen. |
|
658 * Notifies about new plugin installation |
|
659 * |
|
660 * @since S60 5.0 |
|
661 * @return None |
|
662 */ |
|
663 TInt NotifyPluginInstallation( TUid& aPluginUid ); |
|
664 |
|
665 /** |
|
666 * From MDunAtEcomListen. |
|
667 * Notifies about existing plugin uninstallation |
|
668 * |
|
669 * @since S60 5.0 |
|
670 * @return None |
|
671 */ |
|
672 TInt NotifyPluginUninstallation( TUid& aPluginUid ); |
|
673 |
|
674 // from base class MDunAtModeListen |
|
675 |
|
676 /** |
|
677 * From MDunAtModeListen. |
|
678 * Gets called on mode status change |
|
679 * |
|
680 * @since S60 5.0 |
|
681 * @param aMode Mode to manage |
|
682 * @return Symbian error code on error, KErrNone otherwise |
|
683 */ |
|
684 TInt NotifyModeStatusChange( TUint aMode ); |
|
685 |
|
686 private: // data |
|
687 |
|
688 /** |
|
689 * Callback to call when AT command handling status changes |
|
690 * Not own. |
|
691 */ |
|
692 MDunAtCmdStatusReporter* iUpstream; |
|
693 |
|
694 /** |
|
695 * Callback to call when data to push |
|
696 * Not own. |
|
697 */ |
|
698 MDunStreamManipulator* iDownstream; |
|
699 |
|
700 /** |
|
701 * Callback(s) to call when command mode starts or ends |
|
702 * Usually two needed: one for upstream and second for downstream |
|
703 */ |
|
704 RPointerArray<MDunCmdModeMonitor> iCmdCallbacks; |
|
705 |
|
706 /** |
|
707 * Connection identifier name |
|
708 */ |
|
709 const TDesC8* iConnectionName; |
|
710 |
|
711 /** |
|
712 * Current state of AT command handling: active or inactive |
|
713 */ |
|
714 TDunState iHandleState; |
|
715 |
|
716 /** |
|
717 * Character for carriage return |
|
718 */ |
|
719 TInt8 iCarriageReturn; |
|
720 |
|
721 /** |
|
722 * Character for line feed |
|
723 */ |
|
724 TInt8 iLineFeed; |
|
725 |
|
726 /** |
|
727 * Character for backspace |
|
728 */ |
|
729 TInt8 iBackspace; |
|
730 |
|
731 /** |
|
732 * Current command to ParseCommand() |
|
733 * Not own. |
|
734 */ |
|
735 TDesC8* iCommand; |
|
736 |
|
737 /** |
|
738 * Special commands for parsing |
|
739 */ |
|
740 RPointerArray<HBufC8> iSpecials; |
|
741 |
|
742 /** |
|
743 * Buffer for character echoing |
|
744 */ |
|
745 TBuf8<KDunChSetMaxCharLen> iEchoBuffer; |
|
746 |
|
747 /** |
|
748 * Buffer for ok reply |
|
749 */ |
|
750 TBuf8<KDunOkBufLength> iOkBuffer; |
|
751 |
|
752 /** |
|
753 * Buffer for error reply |
|
754 */ |
|
755 TBuf8<KDunErrorBufLength> iErrorBuffer; |
|
756 |
|
757 /** |
|
758 * Buffer for AT command input |
|
759 */ |
|
760 TBuf8<KDunInputBufLength> iInputBuffer; |
|
761 |
|
762 /** |
|
763 * Buffer for last AT command input (for "A/") |
|
764 */ |
|
765 TBuf8<KDunInputBufLength> iLastBuffer; |
|
766 |
|
767 /** |
|
768 * AT command decoding related information |
|
769 */ |
|
770 TDunDecodeInfo iDecodeInfo; |
|
771 |
|
772 /** |
|
773 * Information for parsing |
|
774 */ |
|
775 TDunParseInfo iParseInfo; |
|
776 |
|
777 /** |
|
778 * AT command reply pusher |
|
779 * Own. |
|
780 */ |
|
781 CDunAtCmdPusher* iCmdPusher; |
|
782 |
|
783 /** |
|
784 * URC message handlers |
|
785 * Own. |
|
786 */ |
|
787 RPointerArray<CDunAtUrcHandler> iUrcHandlers; |
|
788 |
|
789 /** |
|
790 * ECOM plugin interface status change listener |
|
791 * Own. |
|
792 */ |
|
793 CDunAtEcomListen* iEcomListen; |
|
794 |
|
795 /** |
|
796 * Modem mode status change listener |
|
797 * Own. |
|
798 */ |
|
799 CDunAtModeListen* iModeListen; |
|
800 |
|
801 /** |
|
802 * NVRAM status change listener |
|
803 * Own. |
|
804 */ |
|
805 CDunAtNvramListen* iNvramListen; |
|
806 |
|
807 /** |
|
808 * Flag to mark command mode start/end |
|
809 */ |
|
810 TBool iDataMode; |
|
811 |
|
812 /** |
|
813 * Flag to be set on if echo on |
|
814 */ |
|
815 TBool iEchoOn; |
|
816 |
|
817 /** |
|
818 * Flag to be set on if quiet mode on |
|
819 */ |
|
820 TBool iQuietOn; |
|
821 |
|
822 /** |
|
823 * Flag to be set on if verbose mode on |
|
824 */ |
|
825 TBool iVerboseOn; |
|
826 |
|
827 /** |
|
828 * End index for command delimiter |
|
829 */ |
|
830 TInt iEndIndex; |
|
831 |
|
832 /** |
|
833 * AT command extension |
|
834 */ |
|
835 RATExt iAtCmdExt; |
|
836 |
|
837 /** |
|
838 * AT command extension to common functionality |
|
839 */ |
|
840 RATExtCommon iAtCmdExtCommon; |
|
841 |
|
842 }; |
|
843 |
|
844 #endif // C_CDUNATCMDHANDLER_H |