telutils/phoneparser/src/PhoneGsmParser.cpp
branchRCL_3
changeset 19 7d48bed6ce0c
parent 0 ff3b6d0fd310
child 20 987c9837762f
equal deleted inserted replaced
18:594d59766373 19:7d48bed6ce0c
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // INCLUDE FILES
    19 // INCLUDE FILES
    20 #include    "PhoneGsmParser.h"
    20 #include    "phonegsmparser.h" 
    21 #include    "CPhoneGsmParser.h"
    21 #include    "cphonegsmparser.h" 
    22 #include    "CPhoneGsmParserBase.h"
    22 #include    "cphonegsmparserbase.h" 
    23 #include    "CPhoneGsmParserResult.h"
    23 #include    "cphonegsmparserresult.h" 
    24 #include    "CPhoneGsmOptionContainer.h"
    24 #include    "cphonegsmoptioncontainer.h" 
    25 
    25 
    26 #include    "CPhoneGsmParserContainer.h"
    26 #include    "cphonegsmparsercontainer.h" 
    27 #include    "CPhoneGsmSsParser.h"
    27 #include    "cphonegsmssparser.h" 
    28 #include    "CPhoneGsmSimControlParser.h"
    28 #include    "cphonegsmsimcontrolparser.h" 
    29 #include    "CPhoneGsmPhoneNumberParser.h"
    29 #include    "cphonegsmphonenumberparser.h" 
    30 #include    "CPhoneGsmSsCallParser.h"
    30 #include    "cphonegsmsscallparser.h" 
    31 #include    "CPhoneGsmManufacturerParser.h"
    31 #include    "cphonegsmmanufacturerparser.h" 
    32 #include    "CPhoneGsmPcnProcedureParser.h"
    32 #include    "cphonegsmpcnprocedureparser.h" 
    33 #include    "CPhoneGsmManufacturerHandler.h"
    33 #include    "cphonegsmmanufacturerhandler.h" 
    34 #include    "CPhoneGsmEmergencyNumberParser.h"
    34 #include    "cphonegsmemergencynumberparser.h" 
    35 #include    "CPhoneParserFeatures.h"
    35 #include    "cphoneparserfeatures.h" 
    36 #include    "CPhoneVoipNumberParser.h"
    36 #include    "cphonevoipnumberparser.h" 
    37 #include    "CPhoneGsmImeiParser.h"
       
    38 
       
    39 
    37 
    40 // CONSTANTS
    38 // CONSTANTS
    41 const TInt KPhoneParserResultParameterReserver = 10;
    39 const TInt KPhoneParserResultParameterReserver = 10;
    42 _LIT( KPhoneParserPanic, "PhoneParser" );
    40 _LIT( KPhoneParserPanic, "PhoneParser" );
    43 
    41 
    44 // Software version display code
    42 // Software version display code
    45 _LIT( KPhoneCodeSwVersion, "*#0000#" );
       
    46 _LIT( KPhoneCodeBadPinChange, "**04*" );
    43 _LIT( KPhoneCodeBadPinChange, "**04*" );
    47 _LIT( KPhoneCodeBadPin2Change, "**042*" );
    44 _LIT( KPhoneCodeBadPin2Change, "**042*" );
    48 _LIT( KPhoneCodeBadPinUnblock, "**05*" );
    45 _LIT( KPhoneCodeBadPinUnblock, "**05*" );
    49 _LIT( KPhoneCodeBadPin2Unblock, "**052*" );
    46 _LIT( KPhoneCodeBadPin2Unblock, "**052*" );
    50 _LIT( KPhoneCodeActivateRfsNormal, "*#7780#" );
    47 _LIT( KPhoneCodeActivateRfsNormal, "*#7780#" );
    51 _LIT( KPhoneCodeActivateRfsDeep, "*#7370#" );
    48 _LIT( KPhoneCodeActivateRfsDeep, "*#7370#" );
    52 _LIT( KPhoneCodeBtAddress, "*#2820#" );
    49 _LIT( KPhoneCodeBtAddress, "*#2820#" );
    53 _LIT( KPhoneCodeLifeTimer, "*#92702689#" );
       
    54 _LIT( KPhoneCodeRFLoopback, "*#9990#" );
    50 _LIT( KPhoneCodeRFLoopback, "*#9990#" );
    55 _LIT( KPhoneCodeWLANMAC, "*#62209526#" );
    51 _LIT( KPhoneCodeWLANMAC, "*#62209526#" );
    56 _LIT( KPhoneCodeBtDebugMode, "*#2873#" );
    52 _LIT( KPhoneCodeBtDebugMode, "*#2873#" );
    57                   
    53                   
    58 // ============================= LOCAL FUNCTIONS ===============================
    54 // ============================= LOCAL FUNCTIONS ===============================
    97         
    93         
    98     // 6. VOIP NUMBER PARSER TO STACK
    94     // 6. VOIP NUMBER PARSER TO STACK
    99     CPhoneGsmParserBase* voipNumberParser =
    95     CPhoneGsmParserBase* voipNumberParser =
   100         CPhoneVoipNumberParser::NewLC();
    96         CPhoneVoipNumberParser::NewLC();
   101     
    97     
   102     // 7. IMEI PARSER TO STACK
       
   103     CPhoneGsmParserBase* imeiParser =
       
   104         CPhoneGsmImeiParser::NewLC();
       
   105     
       
   106     CPhoneGsmParser* parser = 
    98     CPhoneGsmParser* parser = 
   107         CPhoneGsmParser::NewL(
    99         CPhoneGsmParser::NewL(
   108             ssContainer, 
   100             ssContainer, 
   109             simControlProcedure,
   101             simControlProcedure,
   110             phoneNumber,
   102             phoneNumber,
   111             manufacturerSpecific,
   103             manufacturerSpecific,
   112             emergencyNumberParser,
   104             emergencyNumberParser,
   113             voipNumberParser,
   105             voipNumberParser);
   114             imeiParser );
   106 
   115 
   107     CleanupStack::Pop( 6, ssContainer );
   116     CleanupStack::Pop( 7, ssContainer );
       
   117 
   108 
   118     return parser;
   109     return parser;
   119     }
   110     }
   120 
   111 
   121 // -----------------------------------------------------------------------------
   112 // -----------------------------------------------------------------------------
   231     {  
   222     {  
   232     TUint32 uid = aResult.Uid();
   223     TUint32 uid = aResult.Uid();
   233     
   224     
   234     // Allowed:
   225     // Allowed:
   235     //      0 SEND
   226     //      0 SEND
   236     //      IMEI
   227     //      All manufacturer codes
   237     //      All manufacturer codes (incl. SW version)
       
   238     //      All sim control procedures
   228     //      All sim control procedures
   239     //      All pcn procedures
   229     //      All pcn procedures
   240     
   230     
   241     return ( uid == KPhoneUidCommand0 ||
   231     return ( uid == KPhoneUidCommand0 ||
   242              uid == KPhoneUidIMEI ||
       
   243              uid == KPhoneUidManufacturerDebugCode ||
   232              uid == KPhoneUidManufacturerDebugCode ||
   244              uid == KPhoneUidManufacturerCode || 
   233              uid == KPhoneUidManufacturerCode || 
   245              PHONE_EXTRACT_MAIN( uid ) == KPhoneGsmUidSimControlProcedure ||
   234              PHONE_EXTRACT_MAIN( uid ) == KPhoneGsmUidSimControlProcedure ||
   246              PHONE_EXTRACT_MAIN( uid ) == KPhoneGsmUidPcnProcedures );
   235              PHONE_EXTRACT_MAIN( uid ) == KPhoneGsmUidPcnProcedures );
   247     }
   236     }
   256     TUint32 uid = aResult.Uid();
   245     TUint32 uid = aResult.Uid();
   257     TUint aux = aResult.AuxInformation();
   246     TUint aux = aResult.AuxInformation();
   258 
   247 
   259     // Allowed:
   248     // Allowed:
   260     //      DialEmergency
   249     //      DialEmergency
   261     //      IMEI
   250     //      Some manufacturer codes
   262     //      Some manufacturer codes (incl. SW version)
       
   263     //      All sim control procedures
   251     //      All sim control procedures
   264     //      All pcn procedures
   252     //      All pcn procedures
   265     
   253     
   266     return ( uid == KPhoneUidEmergencyNumber ||
   254     return ( uid == KPhoneUidEmergencyNumber ||
   267              uid == KPhoneUidIMEI ||
       
   268              uid == KPhoneUidManufacturerDebugCode ||
   255              uid == KPhoneUidManufacturerDebugCode ||
   269              ( uid == KPhoneUidManufacturerCode && 
   256              ( uid == KPhoneUidManufacturerCode && 
   270                ( aux == CPhoneGsmManufacturerHandler::EShowVersion ||
   257                ( aux == CPhoneGsmManufacturerHandler::EBadPinChange ||
   271                  aux == CPhoneGsmManufacturerHandler::ELifeTimer ||
       
   272                  aux == CPhoneGsmManufacturerHandler::EBadPinChange ||
       
   273                  aux == CPhoneGsmManufacturerHandler::EBadPin2Change ||
   258                  aux == CPhoneGsmManufacturerHandler::EBadPin2Change ||
   274                  aux == CPhoneGsmManufacturerHandler::EBadPinUnblock ||
   259                  aux == CPhoneGsmManufacturerHandler::EBadPinUnblock ||
   275                  aux == CPhoneGsmManufacturerHandler::EBadPin2Unblock ) ) ||
   260                  aux == CPhoneGsmManufacturerHandler::EBadPin2Unblock ) ) ||
   276 
   261 
   277              PHONE_EXTRACT_MAIN( uid ) == KPhoneGsmUidSimControlProcedure ||
   262              PHONE_EXTRACT_MAIN( uid ) == KPhoneGsmUidSimControlProcedure ||
   324     CPhoneGsmManufacturerParser* manuCodes =
   309     CPhoneGsmManufacturerParser* manuCodes =
   325         CPhoneGsmManufacturerParser::NewLC();
   310         CPhoneGsmManufacturerParser::NewLC();
   326     manufacturer->AddL( *manuCodes );
   311     manufacturer->AddL( *manuCodes );
   327     CleanupStack::Pop( manuCodes );
   312     CleanupStack::Pop( manuCodes );
   328 
   313 
   329     manuCodes->AddStringL(
       
   330         KPhoneCodeSwVersion, 
       
   331         CPhoneGsmManufacturerParser::EFlagCode,
       
   332         CPhoneGsmManufacturerHandler::EShowVersion );
       
   333 
       
   334     manuCodes->AddStringL( 
   314     manuCodes->AddStringL( 
   335         KPhoneCodeBadPinChange,
   315         KPhoneCodeBadPinChange,
   336         CPhoneGsmManufacturerParser::EFlagCode + 
   316         CPhoneGsmManufacturerParser::EFlagCode + 
   337         CPhoneGsmManufacturerParser::EFlagPrefix,
   317         CPhoneGsmManufacturerParser::EFlagPrefix,
   338         CPhoneGsmManufacturerHandler::EBadPinChange );
   318         CPhoneGsmManufacturerHandler::EBadPinChange );
   373 
   353 
   374     manuCodes->AddStringL(
   354     manuCodes->AddStringL(
   375         KPhoneCodeWLANMAC, 
   355         KPhoneCodeWLANMAC, 
   376         CPhoneGsmManufacturerParser::EFlagCode,
   356         CPhoneGsmManufacturerParser::EFlagCode,
   377         CPhoneGsmManufacturerHandler::EShowWlanMac,
   357         CPhoneGsmManufacturerHandler::EShowWlanMac,
   378         KFeatureIdProtocolWlan );		
   358         KFeatureIdProtocolWlan );       
   379 
       
   380     if ( CPhoneParserFeatures::LifeTimerEnabled())
       
   381         {
       
   382         manuCodes->AddStringL( 
       
   383             KPhoneCodeLifeTimer,
       
   384             CPhoneGsmManufacturerParser::EFlagCode,
       
   385             CPhoneGsmManufacturerHandler::ELifeTimer );
       
   386         }
       
   387 
   359 
   388     manuCodes->AddStringL( 
   360     manuCodes->AddStringL( 
   389         KPhoneCodeRFLoopback,
   361         KPhoneCodeRFLoopback,
   390         CPhoneGsmManufacturerParser::EFlagCode,
   362         CPhoneGsmManufacturerParser::EFlagCode,
   391         CPhoneGsmManufacturerHandler::EBTLoopback,
   363         CPhoneGsmManufacturerHandler::EBTLoopback,