telutils/phoneparser/src/CPhoneGsmSimControlHandler.cpp
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     1 /*
       
     2 * Copyright (c) 2002 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:  Handler for SIM control procedures.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include    "cphonegsmsimcontrolhandler.h" 
       
    21 #include    "cphonegsmsimcontrolparser.h" 
       
    22 #include    "cphonegsmparserresult.h" 
       
    23 #include    "phonegsmparser.h" 
       
    24 
       
    25 // CONSTANTS
       
    26 const TInt KPhoneSimControlOldPinPukParam = 0;
       
    27 const TInt KPhoneSimControlNewPinParam = 1;
       
    28 const TInt KPhoneSimControlNewPinVerifyParam = 2;
       
    29 
       
    30 // ============================ MEMBER FUNCTIONS ===============================
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // CPhoneGsmSimControlHandler::ProcessL
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 EXPORT_C void CPhoneGsmSimControlHandler::ProcessL( 
       
    37         CPhoneGsmParserResult& aResult )
       
    38     {
       
    39     switch( aResult.Uid() )
       
    40         {
       
    41         case KPhoneUidPinChange:
       
    42             ProcessPinChangeL( EPinCode, aResult );
       
    43             break;
       
    44 
       
    45         case KPhoneUidPin2Change:
       
    46             ProcessPinChangeL( EPin2Code, aResult );
       
    47             break;
       
    48 
       
    49         case KPhoneUidPinUnblock:
       
    50             ProcessPinUnblockL( EPinCode, aResult );
       
    51             break;
       
    52 
       
    53         case KPhoneUidPin2Unblock:
       
    54             ProcessPinUnblockL( EPin2Code, aResult );
       
    55             break;
       
    56 
       
    57         default:
       
    58             break;
       
    59         }
       
    60     }
       
    61 
       
    62 // -----------------------------------------------------------------------------
       
    63 // CPhoneGsmSimControlHandler::ProcessPinChangeL
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 void CPhoneGsmSimControlHandler::ProcessPinChangeL( 
       
    67         TPinCode aType,
       
    68         CPhoneGsmParserResult& aResult )
       
    69     {
       
    70     ProcessChangePinL( 
       
    71         aType,
       
    72         aResult.ParameterAt( KPhoneSimControlOldPinPukParam ),
       
    73         aResult.ParameterAt( KPhoneSimControlNewPinParam ),
       
    74         aResult.ParameterAt( KPhoneSimControlNewPinVerifyParam ) );
       
    75     }
       
    76 
       
    77 // -----------------------------------------------------------------------------
       
    78 // CPhoneGsmSimControlHandler::ProcessPinUnblockL
       
    79 // -----------------------------------------------------------------------------
       
    80 //
       
    81 void CPhoneGsmSimControlHandler::ProcessPinUnblockL(
       
    82         TPinCode aType,
       
    83         CPhoneGsmParserResult& aResult )
       
    84     {
       
    85     ProcessUnblockPinL( 
       
    86         aType,
       
    87         aResult.ParameterAt( KPhoneSimControlOldPinPukParam ),
       
    88         aResult.ParameterAt( KPhoneSimControlNewPinParam ),
       
    89         aResult.ParameterAt( KPhoneSimControlNewPinVerifyParam ) );
       
    90     }
       
    91 
       
    92 //  End of File