×

Discussion Board

Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25
  1. #16
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,090

    Re: Problem with wlan IAP


  2. #17
    Registered User
    Join Date
    Apr 2011
    Posts
    115

    Re: Problem with wlan IAP

    I've already see it.
    But I'm not using CMManager but CApAccessPoint
    I tried with WriteUint(EApCdmaReqFwdPriority,0); but it doesn't work

  3. #18
    Registered User
    Join Date
    Jan 2005
    Location
    Italy
    Posts
    639

    Re: Problem with wlan IAP

    Quote Originally Posted by andrea993 View Post
    I tried with WriteUint(EApCdmaReqFwdPriority,0); but it doesn't work
    EApCdmaApType ?
    from:
    http://library.developer.nokia.com/i...ntItem_8h.html

  4. #19
    Registered User
    Join Date
    Apr 2011
    Posts
    115

    Re: Problem with wlan IAP

    WriteUint(EApCdmaApType,0); doesn't work

    I'm trying to discover the differences about iap in Internet destination or in Uncatagorised destination in commdb.

    This is a dump of my iap db with "Alice-55564905" that is in Internet destination and "Alice-no" that is the same iap but in Uncatagorised destination.

    But I don't find nothing....l

    http://www.mediafire.com/?0resr7sl3ryrz8t

  5. #20
    Registered User
    Join Date
    Jan 2005
    Location
    Italy
    Posts
    639

    Re: Problem with wlan IAP

    hmmm... at this moment i have no more ideas, sorry....

  6. #21
    Registered User
    Join Date
    Apr 2011
    Posts
    115

    Re: Problem with wlan IAP

    I rewrote the code with RCmManager and it works

    To insert the iap in internet destination:
    RCmDestination destination = cmManager.DestinationL(1);

  7. #22
    Registered User
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    88

    Re: Problem with wlan IAP

    Well done Andrea993! I have also attempted this in the past as per your original code but then got API depreciated warnings since Symbian3. Would you mind sharing the RCmManager based code to set up a WLAN point please?
    David4x

  8. #23
    Registered User
    Join Date
    Apr 2011
    Posts
    115

    Re: Problem with wlan IAP

    This is all the code...excuse me the italian

    Code:
    LOCAL_C void MainL()
    	{
    	//
    	// add your program code here, example code below
    	//
    	console->Write(_L("Conversione key...\n"));
    	TBuf8<58> key;
    	key.Copy(_L("aannddrreeaa1"));
    	HBufC8* keyConv = HBufC8::NewLC(58);
    	ConvertAsciiToHex(key,keyConv);
    	
    	
    	console->Write(_L("Creazione wlan AP...\n"));
    	
    	RCmManager cmManager;
    	cmManager.OpenL();
    	CleanupClosePushL( cmManager );
    	
    	RCmConnectionMethod cm=cmManager.CreateConnectionMethodL(KUidWlanBearerType);
    	CleanupClosePushL(cm);
    	
    	cm.SetStringAttributeL(CMManager::ECmName, _L("Alice-55564905").Left(30));
    	cm.SetStringAttributeL(CMManager::EWlanSSID, _L("Alice-55564905"));
    	cm.SetIntAttributeL(CMManager::EWlanSecurityMode, CMManager::EWlanSecModeWep);
    	cm.SetIntAttributeL(CMManager::EWlanConnectionMode,CMManager::EInfra);
    	
    	console->Write(_L("Update cm...\n"));
    	cm.UpdateL();
    	
    	TUint32 serviceId=cm.GetIntAttributeL(CMManager::ECmIapServiceId);
    	
    	console->Printf(_L("IAP id: %d\n"),serviceId);
    	
    	console->Write(_L("Inserisci in destinazione\n"));
    	RCmDestination destination = cmManager.DestinationL(1);
    	CleanupClosePushL( destination );
    	destination.AddConnectionMethodL( cm );
    	destination.UpdateL();
    	
    	console->Write(_L("Apertura db...\n"));
    	
    	CCommsDbTableView* view;
    	
    	CCommsDatabase *db= CCommsDatabase::NewL();
    	CleanupStack::PushL(db);	
    	
    	TInt dberr= db->BeginTransaction();
    	if(dberr==KErrLocked)
    		{
    		TInt retry=7; //max prove
    		while(retry>0 && dberr==KErrLocked)
    			{
    			User::After(1000000);
    			dberr= db->BeginTransaction();
    			console->Write(_L("Riprova ad aprire il db\n"));
    			retry--;
    			}
    		if(dberr != KErrNone)
    			{
    			console->Write(_L("Impossibile aprire il db\n"));
    			User::Leave(dberr);
    			}
    		}
    	
    
    	view=db->OpenViewMatchingUintLC(TPtrC( WLAN_SERVICE),TPtrC( WLAN_SERVICE_ID),serviceId);
    
    	TInt err=view->GotoFirstRecord();
    	
    	User::LeaveIfError(err);
    	
    	view->UpdateRecord();
    	
    	console->Write(_L("Scrittura db...\n"));
    	
    	console->Write(_L("WLAN_AUTHENTICATION_MODE\n"));
    	TUint32 authMode=EAuthShared;
    	TRAP(err,view->WriteUintL(TPtrC( WLAN_AUTHENTICATION_MODE ),authMode));
    
    	console->Write(_L("WLAN_WEP_INDEX\n"));
    	TUint32 wepKeyinUse=EKeyNumber1;
    	TRAP(err,view->WriteUintL(TPtrC(WLAN_WEP_INDEX),wepKeyinUse));
    
    	console->Write(_L("NU_WLAN_WEP_KEY1\n"));
    	TRAP(err,view->WriteTextL(TPtrC(NU_WLAN_WEP_KEY1),*keyConv));
    
    	console->Write(_L("NU_WLAN_WEP_KEY1\n"));
    	TUint32 wepFormat=EAscii;
    	TRAP(err,view->WriteUintL(TPtrC(WLAN_WEP_KEY1_FORMAT),wepFormat));
    	
    	console->Write(_L("NU_WLAN_CHANNEL_ID\n"));
    	TRAP(err,view->WriteUintL(TPtrC(NU_WLAN_CHANNEL_ID),0));
    	
    	/*WPA
    	 TBuf8<63> wpaKey;
    	 TRAP(err,view->WriteBoolL(TPtrC(WLAN_ENABLE_WPA_PSK),ETrue));
    	 TRAP(err,view->WriteTextL(TPtrC(WLAN_WPA_PRE_SHARED_KEY),wpaKey));
    	 TRAP(err,view->WriteTextL(TPtrC(WLAN_WPA_KEY_LENGTH),wpaKey.Length()));
    	 */
    	
    
    	console->Write(_L("Salvataggio wlan...\n"));
    	view->PutRecordChanges();
    	
    	console->Write(_L("salvataggio db\n"));
    	db->CommitTransaction();
    	
    	console->Write(_L("Pulisci heap...\n"));
    
    
    	CleanupStack::PopAndDestroy(4);
    	console->Write(_L("Fine"));
    
    	}
    
    void ConvertAsciiToHex( const TDesC8& aSource, HBufC8*& aDest )
    	{
    	console->Write(_L("Inizio conversione...\n"));
    			
    	_LIT( hex, "0123456789ABCDEF" );
    	TInt size = aSource.Size();
    	TPtr8 ptr = aDest->Des();
    	for ( TInt ii = 0; ii < size; ii++ )
    		{
    		TText8 ch = aSource[ii];
    		ptr.Append( hex()[(ch/16)&0x0f] );
    		ptr.Append( hex()[ch&0x0f] );
    		}
    	
    	console->Write(_L("Fine conversione\n"));
    	}

  9. #24
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,090

    Re: Problem with wlan IAP

    You can also consider writing a wiki article, which of course has the higher visibility.

  10. #25
    Registered User
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    88

    Re: Problem with wlan IAP

    Thank you Andrea and well done again!
    David4x

Similar Threads

  1. E63 WLAN Problem
    By mohd.ismail in forum General Development Questions
    Replies: 1
    Last Post: 2010-09-14, 08:24
  2. PROBLEM :WLAN
    By neel.soft in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2009-02-04, 06:47
  3. N95 wlan problem
    By doket in forum Wired and Wireless interfaces (Closed)
    Replies: 1
    Last Post: 2007-04-20, 16:23
  4. problem with WLAN on E70
    By ondskapen in forum General Development Questions
    Replies: 2
    Last Post: 2007-03-13, 23:28
  5. problem with WLAN on E70
    By ondskapen in forum Mobile Java General
    Replies: 2
    Last Post: 2007-03-13, 23:28

Posting Permissions

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