localconnectivityservice/dun/atext/inc/DunAtSpecialCmdHandler.h
branchRCL_3
changeset 14 2553637c2525
parent 10 031b9cffe6e4
child 20 3dcb815346df
equal deleted inserted replaced
13:2702348f1fe7 14:2553637c2525
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    19 #define C_CDUNATSPECIALCMDHANDLER_H
    19 #define C_CDUNATSPECIALCMDHANDLER_H
    20 
    20 
    21 #include <e32base.h>
    21 #include <e32base.h>
    22 #include <badesca.h>
    22 #include <badesca.h>
    23 
    23 
    24 const TInt KInputBufLength  = (512 + 1);  // 512 chars for command + <CR>
    24 const TInt KInputBufLength = (512 + 1);  // Set this the same as in KDunInputBufLength
    25 
    25 
    26 /**
    26 /**
    27  *  Class for special AT command handler
    27  *  Class for special AT command handler
    28  *
    28  *
    29  *  @lib dunatext.lib
    29  *  @lib dunatext.lib
    30  *  @since S60 v5.0
    30  *  @since TB9.2
    31  */
    31  */
    32 NONSHARABLE_CLASS( CDunAtSpecialCmdHandler ) : public CBase
    32 NONSHARABLE_CLASS( CDunAtSpecialCmdHandler ) : public CBase
    33     {
    33     {
    34 
    34 
    35 public:
    35 public:
    43 
    43 
    44     /**
    44     /**
    45     * Destructor.
    45     * Destructor.
    46     */
    46     */
    47     ~CDunAtSpecialCmdHandler();
    47     ~CDunAtSpecialCmdHandler();
    48     
    48 
    49 public:
    49 public:
    50     
    50 
    51     TBool IsCompleteSubCommand(TChar aCharacter);
    51     /**
    52     TBool IsCompleteSubCommand(TDesC8& aDes, TInt aStartIndex, TInt& aEndIndex);
    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();
    53 
    72 
    54 private:
    73 private:
    55 
    74 
    56     CDunAtSpecialCmdHandler();
    75     CDunAtSpecialCmdHandler();
    57 
    76 
    58     void ConstructL();
    77     void ConstructL();
    59     
    78 
    60     TBool IsDataReadyForComparison(TInt aLength);
    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      */
    61     TInt MinimumLength();
    94     TInt MinimumLength();
    62 
    95 
       
    96 private:  // data
    63 
    97 
    64 private:  // data
       
    65     /**
    98     /**
    66      * Buffer for temporary AT command input
    99      * Buffer for temporary AT command input
    67      */
   100      */
    68     TBuf8<KInputBufLength> iBuffer;
   101     TBuf8<KInputBufLength> iBuffer;
    69 
   102 
    70     /**
   103     /**
    71      * Special commands for parsing
   104      * Special commands for parsing
    72      */
   105      */
    73     CDesC8Array *iSpecialCmds;    
   106     CDesC8Array *iSpecialCmds;
       
   107 
    74     };
   108     };
    75 
   109 
    76 #endif  // C_CDUNATSPECIALCMDHANDLER_H
   110 #endif  // C_CDUNATSPECIALCMDHANDLER_H