cbsref/telephonyrefplugins/atltsy/integrationtest/inc/testltsysmsatutil.h
branchRCL_3
changeset 65 630d2f34d719
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
       
     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 testltsysmsatutil.h
       
    15 // This contains SmsAtUtil which is util for Sms At command
       
    16 // 
       
    17 
       
    18 #ifndef TESTLTSYSMSATUTIL_H
       
    19 #define TESTLTSYSMSATUTIL_H
       
    20 // system include
       
    21 #include <e32std.h>
       
    22 #include <e32base.h>
       
    23 #include <etelmm.h>
       
    24 
       
    25 
       
    26 /**
       
    27 *  SmsAtUtil
       
    28 * 
       
    29 */
       
    30 class SmsAtUtil : public CBase
       
    31 	{
       
    32 public:
       
    33 	
       
    34 	 /**
       
    35 	 * Converts aAscii ASCII chars to Semi Octets in aData.
       
    36 	 * One ASCII char (8bits in aAscii) is translated to one Semi-Octet (4bits in aData).
       
    37 	 * 
       
    38 	 * @param aAscii input ascii string
       
    39 	 * @param aData  output binary data 
       
    40 	 * @return Standard KErr... values 
       
    41 	 */	
       
    42 	static TInt ConvertAsciiToBinary(const TDesC8& aAscii,TDes8& aData);
       
    43 	
       
    44 	
       
    45 	 /**
       
    46 	 * Appends the binary data (aData) onto the end of an ASCII string (aAscii) in ASCII format.
       
    47 	 * 
       
    48 	 * @param aAscii  an ascii string 
       
    49 	 * @param aData   a  binary string 
       
    50 	 */
       
    51 	static void AppendDataToAscii(TDes8& aAscii,const TDesC8& aData);
       
    52 	
       
    53 	 /**
       
    54 	 * Reads an address from the front of the ASCII string (aAscii) and fills up Address structure (aAddress).
       
    55 	 * The address read from the ASCII string is removed from the ASCII string.
       
    56 	 * 
       
    57 	 * @param aAscii an ascii string 
       
    58 	 * @param aAddress  a SCA address
       
    59 	 * @return Standard KErr... values
       
    60 	 */
       
    61 	static TBool IsAddressChar(TChar aChar);
       
    62 
       
    63 private:
       
    64 	
       
    65 	 /**
       
    66 	 * @param aValue should be an ETSI Numbering-Plan-Identification field
       
    67 	 * @return The equivalent RMobilePhone::TMobileNPI value for aValue
       
    68 	 */
       
    69 	static RMobilePhone::TMobileNPI ConvertNumberingPlan(TInt aValue);
       
    70 	
       
    71 	 /**
       
    72 	 * @param aValue should be an ETSI Type-Of-Number field
       
    73 	 * @return The equivalent RMobilePhone::TMobileTON value for aValue
       
    74 	 */
       
    75 	static RMobilePhone::TMobileTON ConvertTypeOfNumber(TInt aValue); 
       
    76 	
       
    77 	 /**
       
    78 	 * Converts a TInt octet value into ASCII representation and then appends that
       
    79 	 * ASCII representation to the end of the given ASCII string.
       
    80 	 *
       
    81 	 * @param aOctet the octet value to append
       
    82 	 * @param aAscii the ASCII string to which aOctet value should be appended
       
    83 	 */	
       
    84 	static void AppendOctet(TInt aOctet,TDes8& aAscii);
       
    85 	
       
    86 	 /**
       
    87 	 * Returns the equivalent numeric value for a given ASCII address character.
       
    88 	 *
       
    89 	 * @param aChar the address character to be converted
       
    90 	 * @return The numeric value equivalent of the given address character.
       
    91 	 */
       
    92 	static TInt ConvertAddressChar(TChar aChar);
       
    93 	
       
    94 	 /**
       
    95 	 * Returns the equivalent ASCII address character for a given address value.
       
    96 	 *
       
    97 	 * @param aBinary the numerix value of the address character to be returned
       
    98 	 * @return The ASCII charcater which represents the given address numeric value.
       
    99 	 */
       
   100 	static TChar ConvertAddressChar(TInt aBinary);
       
   101 	
       
   102 	};
       
   103 
       
   104 #endif // TESTLTSYSMSATUTIL_H