×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    140

    How to remove an access point completely on devices?

    Hello everybody,

    I am using the following code to delete an access point on my N95. After running the code, the access point has not been shown on the list of 'Access point' on device. But, when I try to create manually a new access point with the same name of the access point deleted before, it shows the error 'the name already in use.', Could anybody give me any advice? I will appreciate that. Thanks!

    Code:
    	CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP);
    	CleanupStack::PushL(commDb);
    	commDb->ShowHiddenRecords();
    	err = commDb->BeginTransaction();
    	// open IAP table
    	CCommsDbTableView* commView = 
            commDb->OpenIAPTableViewMatchingBearerSetLC(
            		ECommDbBearerWLAN|ECommDbBearerVirtual,
            		ECommDbConnectionDirectionOutgoing);
    
    	TUint32 iapId = 0;
    	TInt returnValue = 0;	
    	returnValue = commView -> GotoFirstRecord();
    	TInt deleteValue = 0;
    	TBuf<52> iapName;
    	
    	while( returnValue == KErrNone)
    		{
        		commView->ReadUintL(TPtrC(COMMDB_ID), iapId);	
        		commView->ReadTextL(TPtrC(COMMDB_NAME), iapName);
    
        		TInt relCmp = 0;
        		relCmp = iapName.Find(textResource->Des()); //textResource is the name of access point
        		if(!relCmp)
    			{
    			deleteValue = commView -> DeleteRecord();
    			if( deleteValue != KErrNone)
    				{
    				User::Leave(deleteValue);		
    				}
    			returnValue = commView -> GotoPreviousRecord();
    			if(returnValue == KErrNone)
    				continue;
    			}
        	
    		returnValue = commView -> GotoNextRecord();
    		}
    	
    	//commView->PutRecordChanges();
    	err = commDb->CommitTransaction();
    	
    	CleanupStack::PopAndDestroy(commView);
    	CleanupStack::PopAndDestroy(commDb);	
        CleanupStack::PopAndDestroy( textResource );

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: How to remove an access point completely on devices?

    Though it is not that advanced, CApDataHandler::RemoveAPL may happen to be able to delete AP-s correctly.

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    140

    Re: How to remove an access point completely on devices?

    Thanks for your help, I will take it in mind.
    now I add the code ' commView->UpdateRecord();',it seems to work normally,
    but add the code 'commView->PutRecordChanges();' after the above line, it will exit with an error.

    I will continue testing it for finding the cause and solution.

  4. #4
    Registered User
    Join Date
    Mar 2008
    Posts
    140

    Re: How to remove an access point completely on devices?

    Quote Originally Posted by wizard_hu_ View Post
    Though it is not that advanced, CApDataHandler::RemoveAPL may happen to be able to delete AP-s correctly.
    'System error (-1)' occurs after implementing the line code
    handler->RemoveAPL(iapId);

    The same error occurs when running the line code:
    handler->AccessPointDataL(iapId,*wlanNewItem);

    Through testing, I found some of the APs can pass the above code, some new created APs will cause the system error(-1), which I think represents the APs do not exist on the database. Am I right? if it is so, Why are the APs shown in the list of access point not in the database? or I can not read correctly the APs from database, the main code is:
    Code:
    CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP);
    
    commDb->ShowHiddenRecords();
    
    CCommsDbTableView* commView = 
            commDb->OpenIAPTableViewMatchingBearerSetLC(
            		ECommDbBearerWLAN|ECommDbBearerVirtual,
            		ECommDbConnectionDirectionOutgoing);
    
    CApDataHandler* handler = CApDataHandler::NewLC(*commDb);
    
    returnValue = commView -> GotoFirstRecord();
    
    CApAccessPointItem* wlanNewItem=CApAccessPointItem::NewLC();
    
    while( returnValue == KErrNone)
    {
           commView->ReadUintL(TPtrC(COMMDB_ID), iapId);	
           handler->AccessPointDataL(iapId,*wlanNewItem); 
           if(...)
           {
             handler->RemoveAPL(iapId);
             break;
           }
           returnValue = commView -> GotoNextRecord();
    }//while_end
    
    commView->UpdateRecord();
    commDb->CommitTransaction();
    Expecting any help!

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: How to remove an access point completely on devices?

    It may easily happen that "aUid" expected by CApDataHandler is not the IAP ID, but the WAP ID, or even something else. You can try if CApUtils::WapIdFromIapIdL helps.

  6. #6
    Registered User
    Join Date
    Mar 2008
    Posts
    140

    Re: How to remove an access point completely on devices?

    Quote Originally Posted by wizard_hu_ View Post
    It may easily happen that "aUid" expected by CApDataHandler is not the IAP ID, but the WAP ID, or even something else. You can try if CApUtils::WapIdFromIapIdL helps.
    oh, you are right, thanks very much!

  7. #7
    Registered User
    Join Date
    Jul 2008
    Posts
    28

    Re: How to remove an access point completely on devices?

    Hello yfw1966

    I am also tring to delete an access point.
    Can you show your final code.

    Thank you

  8. #8
    Registered User
    Join Date
    Mar 2008
    Posts
    140

    Re: How to remove an access point completely on devices?

    Quote Originally Posted by leodom View Post
    Hello yfw1966

    I am also tring to delete an access point.
    Can you show your final code.

    Thank you
    I have not had time to make further modification and test. But the following code is enough for removing an AP on devices.
    Code:
    	// open commdb
    	CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP);
    	CleanupStack::PushL(commDb);
    	commDb->ShowHiddenRecords();
    	err = commDb->BeginTransaction();
    	// open IAP table
    	CCommsDbTableView* commView = 
            commDb->OpenIAPTableViewMatchingBearerSetLC(
            		ECommDbBearerWLAN|ECommDbBearerVirtual,
            		ECommDbConnectionDirectionOutgoing);
    
    	returnValue = commView -> GotoFirstRecord();
    
    	while( returnValue == KErrNone)
    		{
        	commView->ReadUintL(TPtrC(COMMDB_ID), iapId);	
        	commView->ReadTextL(TPtrC(COMMDB_NAME), iapName);
        	if(...)
    			{
    			
    			deleteValue = commView -> DeleteRecord();
    			if( deleteValue != KErrNone)
    				{
    				User::Leave(deleteValue);		
    				}
    			break;
    			}
        	
    		returnValue = commView -> GotoNextRecord();
    		}
    	commView->UpdateRecord();
    	//commView->PutRecordChanges();
    	err = commDb->CommitTransaction();
    
    	CleanupStack::PopAndDestroy(commView);
    	CleanupStack::PopAndDestroy(commDb);
    Hope this can help you.

  9. #9
    Registered User
    Join Date
    Oct 2008
    Posts
    1

    Re: How to remove an access point completely on devices?

    Hi,

    i have this same problem where in Access Point screen, it's been deleted, but if i create the same access point, it's say already in use.. i also notice if i use some 3rd party application that need to access internet(e.g. Opera), the access point list shown is showing the deleted access point.

    BTW, i'm not a programmer so if anyone knows how to remove the hidden accesspoint without programming, it will be great.. i searched the web for days and this is the only threads showing the same problem i have..

    Thanks.

    Quote Originally Posted by yfw1966 View Post
    Hello everybody,

    I am using the following code to delete an access point on my N95. After running the code, the access point has not been shown on the list of 'Access point' on device. But, when I try to create manually a new access point with the same name of the access point deleted before, it shows the error 'the name already in use.', Could anybody give me any advice? I will appreciate that. Thanks!

    Code:
    	CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP);
    	CleanupStack::PushL(commDb);
    	commDb->ShowHiddenRecords();
    	err = commDb->BeginTransaction();
    	// open IAP table
    	CCommsDbTableView* commView = 
            commDb->OpenIAPTableViewMatchingBearerSetLC(
            		ECommDbBearerWLAN|ECommDbBearerVirtual,
            		ECommDbConnectionDirectionOutgoing);
    
    	TUint32 iapId = 0;
    	TInt returnValue = 0;	
    	returnValue = commView -> GotoFirstRecord();
    	TInt deleteValue = 0;
    	TBuf<52> iapName;
    	
    	while( returnValue == KErrNone)
    		{
        		commView->ReadUintL(TPtrC(COMMDB_ID), iapId);	
        		commView->ReadTextL(TPtrC(COMMDB_NAME), iapName);
    
        		TInt relCmp = 0;
        		relCmp = iapName.Find(textResource->Des()); //textResource is the name of access point
        		if(!relCmp)
    			{
    			deleteValue = commView -> DeleteRecord();
    			if( deleteValue != KErrNone)
    				{
    				User::Leave(deleteValue);		
    				}
    			returnValue = commView -> GotoPreviousRecord();
    			if(returnValue == KErrNone)
    				continue;
    			}
        	
    		returnValue = commView -> GotoNextRecord();
    		}
    	
    	//commView->PutRecordChanges();
    	err = commDb->CommitTransaction();
    	
    	CleanupStack::PopAndDestroy(commView);
    	CleanupStack::PopAndDestroy(commDb);	
        CleanupStack::PopAndDestroy( textResource );

  10. #10
    Registered User
    Join Date
    Mar 2008
    Posts
    140

    Re: How to remove an access point completely on devices?

    Hello,

    The problem confused me once more in this two days.

    Originally, through running my program, I can created successfully an new AP(access point) after removing an prior AP of the same name on my N95-8gb, but what's the only pity is the name of AP will be not completely consistent.e.g. if the original name of AP is 'AP_name', the name of the new created AP will be 'AP_name(01)'. And when I try to change manually it to 'AP_name', it shows "the name 'AP_name' is already in use". But Actually, I have removed it through running the segment of code that I have putted it here before.

    At last, I found one possible way to resolve it without programs:
    you can duplicate the access point created by you before, then the name of AP will be 'AP_name(02)', '(03)'..., when the Number becomes very big, open them one by one, if you find the inner name of one AP is different from the shown name outside, to close it, the name will changed to be the inner one, which may be the most original name:'AP_name'.

    Hope this information helpful.

    My problem is:
    First I edit my program based on VoIPSettingsProv project. I changed it from console platform to S60 3rd UI platform, this way, I can configure the AP many times on devices.

    I had tested my project many times on N95-8gb, and the AP could be created and shown successfully. yesterday morning, I removed mistakenly all APs created by me before, When I tested it again, After running correctly the project on my N95-8gb, I could not found the AP shown in the list of AP. When I tried to manually created it, it say 'the name is already in use.', I think the AP has been created, but the list of AP did not updated.

    Is there anything wrong with me?


    Thanks.

Similar Threads

  1. Access point selection panics
    By tote_b5 in forum Symbian
    Replies: 31
    Last Post: 2009-01-25, 22:09
  2. Connection Monitor Server & Access Point Engine API's
    By j4y4n7 in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2007-06-20, 16:09
  3. Midlet and WAP access point!!!
    By khurshed79 in forum Mobile Java Networking & Messaging & Security
    Replies: 5
    Last Post: 2006-08-24, 09:35
  4. 6600 + WAP Access Point = NO Internet?
    By tzihx2 in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2005-05-11, 15:23
  5. setting access point for tcp/ip connection on 7650
    By suckho in forum Symbian Networking & Messaging (Closed)
    Replies: 7
    Last Post: 2003-11-13, 10: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
  •  
×