722 * Gets the GPRS info for the supplied network by reading from the data ini file |
722 * Gets the GPRS info for the supplied network by reading from the data ini file |
723 */ |
723 */ |
724 void TPacketServiceTsyTestHelper::GetGprsSettings(RMobilePhone::TMobilePhoneNetworkInfoV1 aInfo, TPtrC& aAccessPoint, TPtrC& aUser, TPtrC& aPassword,TUint aNumber) |
724 void TPacketServiceTsyTestHelper::GetGprsSettings(RMobilePhone::TMobilePhoneNetworkInfoV1 aInfo, TPtrC& aAccessPoint, TPtrC& aUser, TPtrC& aPassword,TUint aNumber) |
725 { |
725 { |
726 TBuf<200> section; |
726 TBuf<200> section; |
727 if(aInfo.iShortName.Find(_L("voda")) != KErrNotFound) //vodafone |
727 TPtrC ptrNetworkName; |
|
728 if( aInfo.iShortName.Size() > 0 ) |
|
729 { |
|
730 ptrNetworkName.Set(aInfo.iShortName.Ptr(), aInfo.iShortName.Length()); |
|
731 } |
|
732 else |
|
733 { |
|
734 ptrNetworkName.Set(aInfo.iDisplayTag.Ptr(), aInfo.iDisplayTag.Length()); |
|
735 } |
|
736 DEBUG_PRINTF2(_L("Current network is %S"), &ptrNetworkName); |
|
737 if(ptrNetworkName.Find(_L("voda")) != KErrNotFound) //vodafone |
728 { |
738 { |
729 section.Copy(KIniSectionVodafoneGprs); |
739 section.Copy(KIniSectionVodafoneGprs); |
730 DEBUG_PRINTF1(_L("Retrieving Vodafone GPRS settings")); |
740 DEBUG_PRINTF1(_L("Retrieving Vodafone GPRS settings")); |
731 } |
741 } |
732 else if(aInfo.iShortName.Find(_L("O2")) != KErrNotFound)//O2 |
742 else if(ptrNetworkName.Find(_L("O2")) != KErrNotFound)//O2 |
733 { |
743 { |
734 DEBUG_PRINTF1(_L("Retrieving O2 GPRS settings")); |
744 DEBUG_PRINTF1(_L("Retrieving O2 GPRS settings")); |
735 section.Copy(KIniSectionO2Gprs); |
745 section.Copy(KIniSectionO2Gprs); |
736 } |
746 } |
737 else if(aInfo.iShortName.Find(_L("Orange"))!= KErrNotFound) //Orange |
747 else if(ptrNetworkName.Find(_L("Orange"))!= KErrNotFound) //Orange |
738 { |
748 { |
739 DEBUG_PRINTF1(_L("Retrieving Orange GPRS settings")); |
749 DEBUG_PRINTF1(_L("Retrieving Orange GPRS settings")); |
740 section.Copy(KIniSectionOrangeGprs); |
750 section.Copy(KIniSectionOrangeGprs); |
741 } |
751 } |
742 else if((aInfo.iShortName.Find(_L("one2one")) != KErrNotFound)||(aInfo.iShortName.Find(_L("T-Mobile")) != KErrNotFound))//TMobile |
752 else if((ptrNetworkName.Find(_L("one2one")) != KErrNotFound)||(ptrNetworkName.Find(_L("T-Mobile")) != KErrNotFound) || (ptrNetworkName.Find(_L("TMO UK")) != KErrNotFound))//TMobile |
743 { |
753 { |
744 DEBUG_PRINTF1(_L("Retrieving TMobile GPRS settings")); |
754 DEBUG_PRINTF1(_L("Retrieving TMobile GPRS settings")); |
745 section.Copy(KIniSectionTMobileGprs); |
755 section.Copy(KIniSectionTMobileGprs); |
746 } |
756 } |
747 else if(aInfo.iShortName.Find(_L("Elisa"))!= KErrNotFound) //Elisa |
757 else if(ptrNetworkName.Find(_L("Elisa"))!= KErrNotFound) //Elisa |
748 { |
758 { |
749 DEBUG_PRINTF1(_L("Retrieving Elisa GPRS settings")); |
759 DEBUG_PRINTF1(_L("Retrieving Elisa GPRS settings")); |
750 section.Copy(KIniSectionElisaGprs); |
760 section.Copy(KIniSectionElisaGprs); |
751 } |
761 } |
752 else if(aInfo.iShortName.Find(_L("dna"))!= KErrNotFound) //DNA |
762 else if(ptrNetworkName.Find(_L("dna"))!= KErrNotFound) //DNA |
753 { |
763 { |
754 DEBUG_PRINTF1(_L("Retrieving DNA GPRS settings")); |
764 DEBUG_PRINTF1(_L("Retrieving DNA GPRS settings")); |
755 section.Copy(KIniSectionDNAGprs); |
765 section.Copy(KIniSectionDNAGprs); |
756 } |
766 } |
757 else if(aInfo.iShortName.Find(_L("SONERA"))!= KErrNotFound) //SONERA |
767 else if(ptrNetworkName.Find(_L("SONERA"))!= KErrNotFound) //SONERA |
758 { |
768 { |
759 DEBUG_PRINTF1(_L("Retrieving Sonera GPRS settings")); |
769 DEBUG_PRINTF1(_L("Retrieving Sonera GPRS settings")); |
760 section.Copy(KIniSectionSoneraGprs); |
770 section.Copy(KIniSectionSoneraGprs); |
761 |
771 |
762 } |
772 } |
763 else if(aInfo.iShortName.Find(_L("3 UK")) != KErrNotFound) // Three |
773 else if(ptrNetworkName.Find(_L("3 UK")) != KErrNotFound) // Three |
764 { |
774 { |
765 DEBUG_PRINTF1(_L("Retrieving Three GPRS settings")); |
775 DEBUG_PRINTF1(_L("Retrieving Three GPRS settings")); |
766 section.Copy(KIniSectionThreeGprs); |
776 section.Copy(KIniSectionThreeGprs); |
767 } |
777 } |
768 if(aInfo.iShortName.Find(_L("NTN")) != KErrNotFound) // NTN |
778 else if(ptrNetworkName.Find(_L("NTN")) != KErrNotFound) // NTN |
769 { |
779 { |
770 section.Copy(KIniSectionVodafoneGprs); |
780 section.Copy(KIniSectionVodafoneGprs); |
771 DEBUG_PRINTF1(_L("Retrieving NTN GPRS settings")); |
781 DEBUG_PRINTF1(_L("Retrieving NTN GPRS settings")); |
772 } |
782 } |
773 else if( (aInfo.iShortName.Find(_L("01")) >=0) || |
783 else if( (ptrNetworkName.Find(_L("01")) >=0) || |
774 (aInfo.iShortName.Find(_L("ANITE")) >=0) ) // Anite |
784 (ptrNetworkName.Find(_L("ANITE")) >=0) ) // Anite |
775 { |
785 { |
776 DEBUG_PRINTF1(_L("Retrieving Anite GPRS settings")); |
786 DEBUG_PRINTF1(_L("Retrieving Anite GPRS settings")); |
777 section.Copy(KIniSectionVodafoneGprs); // Using vodafone GRPS settings, since Anite should accept any kind |
787 section.Copy(KIniSectionVodafoneGprs); // Using vodafone GRPS settings, since Anite should accept any kind |
778 } |
788 } |
779 else |
789 else |
780 { |
790 { |
781 DEBUG_PRINTF2(_L("Unable to retrieve network name \"%S\". Using defaults"),&(aInfo.iShortName)); |
791 DEBUG_PRINTF2(_L("Unable to retrieve network name \"%S\". Using defaults"),&(ptrNetworkName)); |
782 section.Copy(KIniSectionDefaultGprs); |
792 section.Copy(KIniSectionDefaultGprs); |
783 } |
793 } |
784 if(aNumber!=1) |
794 if(aNumber!=1) |
785 { |
795 { |
786 TBuf<200> temp; |
796 TBuf<200> temp; |