×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Sep 2008
    Location
    Karachi, Pakistan
    Posts
    98

    Using WLAN in N96 automatically with WlanSampleEx

    I am using WlanSampleEx and want to use accesspoint for connection automatically.

    The following function when executed shows the alert message :

    Unable to connect WLAN
    network not found


    void CWLanSampleExAppUi::EstablishConnectionL()
    {
    // establishes iConnection with the last wlan access point.
    // It also lists all the available access point
    TUint32 accessPoint(0);
    CCommsDatabase* commDB = CCommsDatabase::NewL(EDatabaseTypeIAP);
    CleanupStack::PushL(commDB);
    CApSelect * iSelect =CApSelect::NewLC(*commDB,KEApIspTypeAll,EApBearerTypeWLAN,KEApSortUidAscending);
    TBuf<50> iName;
    TBool move = iSelect->MoveToFirst();
    TInt icount = 0;
    while(icount<iSelect->Count())
    {
    if(move==TRUE)
    {
    iName =iSelect->Name();

    accessPoint=iSelect->Uid();
    if (iName.Find(_L("StationAP")) == KErrNone)
    break;
    }
    move = iSelect->MoveNext();
    icount=icount+1;
    }
    CEikonEnv::InfoWinL(_L("Using"),iName);
    User::LeaveIfError(iServer.Connect(KESockDefaultMessageSlots));
    User::LeaveIfError(iConnection.Open(iServer, KConnectionTypeDefault));
    TCommDbConnPref prefs;
    prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
    prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
    prefs.SetIapId(accessPoint);
    User::LeaveIfError(iConnection.Start(prefs));
    iConnState = ETrue;
    CleanupStack::PopAndDestroy(2);
    }



    StationAP is configured Access Point and I am able to browse the internet through it. But using this in the sample code failed.

    What I am missing ? My target is to use access point automatically without user intervention. But the sample application isn't seems working. The device I am using is N96.

  2. #2
    Super Contributor
    Join Date
    Jul 2007
    Posts
    596

    Re: Using WLAN in N96 automatically with WlanSampleEx

    why don't u put the break points in this func and try debuging this code on emulator. it is possible to trace the reason by debuging.

  3. #3
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: Using WLAN in N96 automatically with WlanSampleEx

    Instead of:-
    Code:
    User::LeaveIfError(iConnection.Start(prefs));
    Use this :-
    Code:
    TInt err = iConnection.Start(prefs);
    Check the Error code to see what errors you are getting.
    Cheers,
    Mayank

  4. #4
    Regular Contributor
    Join Date
    Sep 2008
    Location
    Karachi, Pakistan
    Posts
    98

    Re: Using WLAN in N96 automatically with WlanSampleEx

    The error code I am receiving is -30180. Where can I find the details of these error codes?

  5. #5
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: Using WLAN in N96 automatically with WlanSampleEx

    You are trying to set up a connection to an access point to which either you are not authorized(wrong pre shared key could be one) or an access point which is not really valid anymore i.e. associated with an ssdid/wlan which doesnt exist anymore.

    This is what would be of great help to make sense of seemingly non-sensical errors :-

    http://wiki.forum.nokia.com/index.ph...ve_error_texts
    Cheers,
    Mayank

Similar Threads

  1. Replies: 4
    Last Post: 2009-06-09, 12:08
  2. Access Point Connection Problem on N96... Help!
    By asenechalM5T in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2008-11-17, 15:00
  3. Replies: 1
    Last Post: 2008-11-10, 23:03
  4. Creating WLAN IAP programmatically
    By yddusane in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2008-08-21, 10:04
  5. How to set WLAN IAP network mode to Ad-hoc instead of Infrastructure?
    By PopAndDestroy in forum Wired and Wireless interfaces (Closed)
    Replies: 2
    Last Post: 2007-08-29, 08:04

Posting Permissions

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