This may help:
[url]http://www.developer.nokia.com/Community/Discussion/showthread.php?225010-how-to-create-access-point-in-Internet-Destination&highlight=destination+folder+for+internet+access+point[/url]
Printable View
This may help:
[url]http://www.developer.nokia.com/Community/Discussion/showthread.php?225010-how-to-create-access-point-in-Internet-Destination&highlight=destination+folder+for+internet+access+point[/url]
I've already see it.
But I'm not using CMManager but CApAccessPoint
I tried with WriteUint(EApCdmaReqFwdPriority,0); but it doesn't work
[QUOTE=andrea993;908705]
I tried with WriteUint(EApCdmaReqFwdPriority,0); but it doesn't work[/QUOTE]
EApCdmaApType ?
from:
[url]http://library.developer.nokia.com/index.jsp?topic=/S60_5th_Edition_Cpp_Developers_Library/GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6/html/APAccessPointItem_8h.html[/url]
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
[URL="http://www.mediafire.com/?0resr7sl3ryrz8t"]http://www.mediafire.com/?0resr7sl3ryrz8t[/URL]
hmmm... at this moment i have no more ideas, sorry....
I rewrote the code with RCmManager and it works :)
To insert the iap in internet destination:
RCmDestination destination = cmManager.DestinationL(1);
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?
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"));
}
[/CODE]
You can also consider writing a wiki article, which of course has the higher visibility.
Thank you Andrea and well done again!