×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    235

    Question Is this code bound to work on phone?

    I am working on SDK 2 fp3 and this code worked ok on my emulator /machine , but for phone I am doubtfull as it is not showing the desired result . If not how should it be made to work . I am trying specifically N70 for testing.
    Code:
    void CPMHttpEngine::LoadIapsL()
    	{
    	// open commdb
    	CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP);
    	CleanupStack::PushL(commDb);
    
    	open IAP table
    	CCommsDbTableView* commView = commDb->OpenIAPTableViewMatchingBearerSetLC(ECommDbBearerCSD|ECommDbBearerGPRS|ECommDbBearerPAN,ECommDbConnectionDirectionOutgoing);
    	CleanupStack::PushL(commView);
    	search all IAPs
    	if (commView->GotoFirstRecord() == KErrNone)
    		{
    		do
    			{
    			TIap iap;
    			_LIT(KIAPName,"Ethernet");
    			iap.iName.Copy(KIAPName());
    			iap.iId=1;
    			commView->ReadTextL(TPtrC(COMMDB_NAME), iap.iName);
    			commView->ReadUintL(TPtrC(COMMDB_ID), iap.iId);
    			User::LeaveIfError(iIAPs.Append(iap));
    			}
    		while (commView->GotoNextRecord() == KErrNone);
    		}
    	CleanupStack::PopAndDestroy(commView);
    	CleanupStack::PopAndDestroy(commDb);
    	}
    This is a working code for N73 where I added parts.
    Last edited by gigglie; 2008-02-25 at 10:14.

  2. #2
    Regular Contributor
    Join Date
    Sep 2006
    Posts
    79

    Re: Is this code bound to work on phone?

    iap.iName and iap.iId are overwritten by ReadTextL and ReadUintL calls. If you are trying to create new access point check this.

    If you want to read access point settings, iap will hold the settings of the last access point, so while loop is meaningless.

    If you want to overwrite an existing access point use WriteTextL and WriteUintL.(btw if you do so all access points will be overwritten because of the while loop)

  3. #3
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    235

    Question Re: Is this code bound to work on phone?

    Oh I have an IAP list and in N70 the phone is supposed to take in the default 1 that connects to www.google.com say in Web or services , so technically I do not have to input 1 . I was only using the hard coded value as I cannot get the correct IAP . When I added a new bearer say "ECommDbBearerPAN" one IAP was read from the list , before no IAP was being accessed .

    I said the code used before was working as it was connecting through winsock there but I cannot find such socket in the IAP list . In emulator it connects through "Ethernet"

  4. #4
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    235

    Re: Is this code bound to work on phone?

    This is the result of CEDDUMP
    Code:
    ############################################################
    ## AUTO-GENERATED CONFIGURATION FILE
    ## CommDB Database Dump Utility
    ## 1.1
    ############################################################
    
    ############################################################
    ## Network
    ## 
    [Network]
    ADD_SECTION
    # COMMDB_ID = 1
    	Name=Ethernet LAN network
    	FIELD_COUNT=1
    END_ADD
    
    
    ############################################################
    ## ModemBearer
    ## 
    [ModemBearer]
    
    ############################################################
    ## LANBearer
    ## 
    [LANBearer]
    ADD_SECTION
    # COMMDB_ID = 1
    	Name=LAN_bearer_1
    	Agent=NullAgt
    	IfName=ethint
    	LDDFilename=ethercard
    	LDDName=EtherCard
    	PDDFilename=etherwins
    	PDDName=Ethercard.wins
    	PacketDriverName=EtherPkt
    	LastSocketActivityTimeout=600
    	LastSessionClosedTimeout=600
    	LastSocketClosedTimeout=600
    	FIELD_COUNT=11
    END_ADD
    
    
    ############################################################
    ## Location
    ## 
    [Location]
    ADD_TEMPLATE
    	Name=Default Location
    	IntlPrefixCode=+
    	NatPrefixCode=0
    	NatCode=44
    	Mobile=TRUE
    	UsePulseDial=FALSE
    	WaitForDialTone=FALSE
    	PauseAfterDialout=0
    	FIELD_COUNT=8
    END_TEMPLATE
    
    ADD_SECTION
    # COMMDB_ID = 2
    	Name=Office
    	IntlPrefixCode=00
    	NatPrefixCode=0
    	NatCode=44
    	AreaCode=171
    	DialOutCode=9,
    	Mobile=FALSE
    	UsePulseDial=FALSE
    	WaitForDialTone=FALSE
    	PauseAfterDialout=0
    	FIELD_COUNT=10
    END_ADD
    
    ADD_SECTION
    # COMMDB_ID = 3
    	Name=Office Direct Dial
    	IntlPrefixCode=00
    	NatPrefixCode=0
    	NatCode=44
    	AreaCode=171
    	Mobile=FALSE
    	UsePulseDial=FALSE
    	WaitForDialTone=FALSE
    	PauseAfterDialout=0
    	FIELD_COUNT=9
    END_ADD
    
    ADD_SECTION
    # COMMDB_ID = 4
    	Name=Mobile
    	IntlPrefixCode=+
    	NatPrefixCode=0
    	NatCode=44
    	Mobile=TRUE
    	UsePulseDial=FALSE
    	WaitForDialTone=FALSE
    	PauseAfterDialout=0
    	FIELD_COUNT=8
    END_ADD
    
    ADD_SECTION
    # COMMDB_ID = 5
    	Name=Home
    	IntlPrefixCode=00
    	NatPrefixCode=0
    	NatCode=44
    	AreaCode=181
    	Mobile=FALSE
    	UsePulseDial=TRUE
    	WaitForDialTone=TRUE
    	PauseAfterDialout=0
    	FIELD_COUNT=9
    END_ADD
    
    
    ############################################################
    ## Chargecard
    ## 
    [Chargecard]
    ADD_SECTION
    # COMMDB_ID = 1
    	Name=Dummy BT Chargecard
    	AccountNumber=144,12345678
    	Pin=0000
    	LocalRule=HG
    	NatRule=HFG
    	IntlRule=HEFG
    	FIELD_COUNT=6
    END_ADD
    
    ADD_SECTION
    # COMMDB_ID = 2
    	Name=Dummy Mercury Chargecard
    	AccountNumber=0500800800,,12345678
    	Pin=****
    	LocalRule=HG
    	NatRule=J,K,0FG
    	IntlRule=HEFG
    	FIELD_COUNT=6
    END_ADD
    
    
    ############################################################
    ## GlobalSettings
    ## 
    [GlobalSettings]
    ADD_SECTION
    	WAPAccessPoint=1
    	RedialAttempts=0
    	SmsBearer=3
    	SmsReceiveMode=2
    	GPRSAttachMode=1
    	AcceptIncomingGprs=1
    	GPRSClassCBearer=GSM
    	ConnectionAttempts=1
    	ModemForDataAndFax=3
    	ModemForPhoneServicesAndSMS=3
    	LocationForDataAndFax=2
    	LocationForPhoneServicesAndSMS=3
    	DefaultNetwork=1
    	BearerAvailabilityCheckTSY=PHONETSY
    	FIELD_COUNT=14
    END_ADD
    
    
    ############################################################
    ## DialOutISP
    ## 
    [DialOutISP]
    
    ############################################################
    ## DialInISP
    ## 
    [DialInISP]
    
    ############################################################
    ## OutgoingGPRS
    ## 
    [OutgoingGPRS]
    
    ############################################################
    ## IncomingGPRS
    ## 
    [IncomingGPRS]
    
    ############################################################
    ## DefaultGPRS
    ## 
    [DefaultGPRS]
    
    ############################################################
    ## CDMA2000PacketServiceTable
    ## 
    [CDMA2000PacketServiceTable]
    
    ############################################################
    ## DefaultCDMA2000SettingsTable
    ## 
    [DefaultCDMA2000SettingsTable]
    
    ############################################################
    ## LANService
    ## 
    [LANService]
    ADD_SECTION
    # COMMDB_ID = 1
    	Name=Ethernet
    	IfNetworks=ip,ip6
    	IpNetMask=0.0.0.0
    	IpGateway=0.0.0.0
    	IpAddrFromServer=FALSE
    	IpAddr=0.0.0.0
    	IpDNSAddrFromServer=FALSE
    	IpNameServer1=0.0.0.0
    	IpNameServer2=0.0.0.0
    	Ip6DNSAddrFromServer=FALSE
    	FIELD_COUNT=10
    END_ADD
    
    
    ############################################################
    ## IAP
    ## 
    [IAP]
    ADD_SECTION
    # COMMDB_ID = 1
    	Name=Ethernet
    	IAPService=1
    	IAPServiceType=LANService
    	IAPBearer=1
    	IAPBearerType=LANBearer
    	IAPNetwork=1
    	IAPNetworkWeighting=0
    	Location=2
    	FIELD_COUNT=8
    END_ADD
    
    
    ############################################################
    ## ConnectionPreferences
    ## 
    [ConnectionPreferences]
    ADD_SECTION
    	Ranking=1
    	Direction=OUTGOING
    	DialogPref=PROMPT
    	BearerSet=LAN
    	IAP=1
    	FIELD_COUNT=5
    END_ADD
    
    
    ############################################################
    ## BTDeviceTable
    ## 
    [BTDeviceTable]
    
    ############################################################
    ## BTSecurityTable
    ## 
    [BTSecurityTable]
    
    ############################################################
    ## BTDefaultTable
    ## 
    [BTDefaultTable]
    
    ############################################################
    ## Proxies
    ## 
    [Proxies]
    ADD_SECTION
    # COMMDB_ID = 1
    	ISP=1
    	ProxyServiceType=LANService
    	UseProxyServer=FALSE
    	ProxyServerName=www.dummyproxy.com
    	ProtocolName=http
    	PortNumber=80
    	Exceptions=www.dummyproxy.com/exception
    	FIELD_COUNT=7
    END_ADD
    
    
    ############################################################
    ## AgentLookup
    ## 
    [AgentLookup]
    
    ############################################################
    ## WAPAccessPoint
    ## 
    [WAPAccessPoint]
    ADD_TEMPLATE
    	Name=Default Dial In ISP
    	CurrentBearer=WAPIPBearer
    	FIELD_COUNT=2
    END_TEMPLATE
    
    ADD_SECTION
    # COMMDB_ID = 2
    	Name=NT RAS with Null Modem
    	CurrentBearer=WAPIPBearer
    	StartPage=www.wapstart.com
    	FIELD_COUNT=3
    END_ADD
    
    ADD_SECTION
    # COMMDB_ID = 3
    	Name=Direct PPP
    	CurrentBearer=WAPIPBearer
    	StartPage=www.wapstart.com
    	FIELD_COUNT=3
    END_ADD
    
    ADD_SECTION
    # COMMDB_ID = 4
    	Name=Ethernet LAN
    	CurrentBearer=WAPIPBearer
    	StartPage=www.wapstart.com
    	FIELD_COUNT=3
    END_ADD
    
    
    ############################################################
    ## WAPIPBearer
    ## 
    [WAPIPBearer]
    ADD_TEMPLATE
    	AccessPointId=0
    	IAP=0
    	WSPOption=CONNECTIONLESS
    	Security=FALSE
    	ProxyPortNumber=0
    	FIELD_COUNT=5
    END_TEMPLATE
    
    ADD_SECTION
    # COMMDB_ID = 2
    	AccessPointId=2
    	GatewayAddress=www.wapgateway.com
    	IAP=1
    	WSPOption=CONNECTIONORIENTED
    	Security=FALSE
    	ProxyPortNumber=1
    	FIELD_COUNT=6
    END_ADD
    
    ADD_SECTION
    # COMMDB_ID = 3
    	AccessPointId=3
    	GatewayAddress=0.0.0.0
    	IAP=2
    	WSPOption=CONNECTIONORIENTED
    	Security=FALSE
    	ProxyPortNumber=1
    	FIELD_COUNT=6
    END_ADD
    
    ADD_SECTION
    # COMMDB_ID = 4
    	AccessPointId=4
    	GatewayAddress=0.0.0.0
    	IAP=3
    	WSPOption=CONNECTIONORIENTED
    	Security=FALSE
    	ProxyPortNumber=1
    	FIELD_COUNT=6
    END_ADD
    
    
    ############################################################
    ## WAPSMSBearer
    ## 
    [WAPSMSBearer]
    ADD_TEMPLATE
    	AccessPointId=0
    	WSPOption=CONNECTIONLESS
    	Security=FALSE
    	FIELD_COUNT=3
    END_TEMPLATE
    
    ADD_SECTION
    # COMMDB_ID = 2
    	AccessPointId=2
    	GatewayAddress=+4412345678901
    	ServiceCentreAddress=+442071234567
    	WSPOption=CONNECTIONORIENTED
    	Security=FALSE
    	FIELD_COUNT=5
    END_ADD
    
    
    ############################################################
    ## SecureSocketTable
    ## 
    [SecureSocketTable]
    ADD_SECTION
    # COMMDB_ID = 1
    	ProtocolName=ssl3.0
    	ProtoLibrary=ssladaptor.dll
    	FIELD_COUNT=2
    END_ADD
    
    ADD_SECTION
    # COMMDB_ID = 2
    	ProtocolName=tls1.0
    	ProtoLibrary=ssladaptor.dll
    	FIELD_COUNT=2
    END_ADD
    
    
    ############################################################
    ## BTPersistTable
    ## 
    [BTPersistTable]
    
    ############################################################
    ## VirtualBearer
    ## 
    [VirtualBearer]
    
    ############################################################
    ## VpnService
    ## 
    [VpnService]
    
    ############################################################
    ## WLANServiceExtensionTable
    ## 
    [WLANServiceExtensionTable]
    ############################################################
    ## ERROR
    ## AccessTypeTable
    ############################################################
    ############################################################
    ## ERROR
    ## Error opening table
    ############################################################
    ############################################################
    ## ERROR
    ## Unable to find the specified object or missing required field values
    ############################################################

  5. #5
    Regular Contributor
    Join Date
    Sep 2006
    Posts
    79

    Re: Is this code bound to work on phone?

    Hmm...Did you check if the accesspoint named 'Ethernet' exists on N70?

    Make sure, you are using a working access point(check with the browser for instance)...

Similar Threads

  1. 6270 MIDP SocketConnection test work fine on emulator but fail on real phone
    By mtiger2k in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2008-12-13, 13:06
  2. OMA DRM media transfer using PC to Phone using USB
    By venky123 in forum Digital Rights Management & Content Downloading
    Replies: 1
    Last Post: 2008-08-13, 03:02
  3. Replies: 2
    Last Post: 2008-02-19, 15:41
  4. Fixing a bug in an already obfuscated midlet (no source code) ?
    By SPGremlin in forum Mobile Java General
    Replies: 1
    Last Post: 2004-01-12, 21:52

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×