×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    115

    Problem with wlan IAP

    Hi all,
    I have been made a wlan access point in symbian C++ for my router.
    Code:
    CApAccessPointItem *wlan = CApAccessPointItem::NewLC();
        wlan->SetNamesL(_L("MioAP"));
        wlan->SetBearerTypeL(EApBearerTypeWLAN);
        wlan->WriteTextL(EApWlanNetworkName,_L("Alice-55564905"));
        wlan->WriteUint(EApWlanSecurityMode,EWep);
        wlan->WriteUint(EApWlanNetworkMode,EInfra);
    
        CCommsDatabase *db= CCommsDatabase::NewL();
        CleanupStack::PushL(db);
        CApDataHandler *handler= CApDataHandler::NewLC(*db);
        TInt err= db->BeginTransaction();
    
        TUint32 newApId= handler->CreateFromDataL(*wlan);
    
        handler->AccessPointDataL(newApId,*wlan);
    
    
        TUint32 wlanId;
        wlan->ReadUint(EApIapServiceId,wlanId);
    
        CCommsDbTableView* view=db->OpenViewMatchingUintLC(TPtrC( WLAN_SERVICE),TPtrC( WLAN_SERVICE_ID),wlanId);
    
        err=view->GotoFirstRecord();
    
    
            view->UpdateRecord();
            TRAP(err,view->WriteUintL(TPtrC(NU_WLAN_AUTHENTICATION_MODE),(TUint32)EAuthShared));
            TRAP(err,view->WriteUintL(TPtrC(WLAN_WEP_INDEX),(TUint32)EKeyNumber1));
            TRAP(err,view->WriteTextL(TPtrC(NU_WLAN_WEP_KEY1),_L("xxxxxxxxxxxxxxxxxx")));
            TRAP(err,view->WriteUintL(TPtrC(WLAN_WEP_KEY1_FORMAT),(TUint32)EAscii));
            view->PutRecordChanges();
            db->CommitTransaction();
    The device can connect to the router but it doesn't find the default gateway and the DNSs then it can't access to internet.

    If I try to make the same IAP with the manual configuration of symbian OS when I connect the device to the router it found automatically gateway and DNSs.
    Why?

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

    Re: Problem with wlan IAP

    Ciao,
    I think that columns for DNS and gateway settings are into LAN_SERVICE table, take a look at cdbcols.h; i don't know by which index LAN_SERVICE and WLAN_SERVICE tables are related, but you could try to read values from a manually configured IAP and try to replicate them in the programmatically configured one.
    If i well remember from your previous posts, you decided to not use CApAccessPointItem bacause deprecated; well... i had the same constraint as you, but i found that it's still valid in SymbianBelle (i use it for GPRS IAP creation), very easy to use, and there's no risk to mess tables around :-)
    There's a wlan example here, maybe it's working:
    http://read.pudn.com/downloads96/sou...ppui.cpp__.htm

    buon lavoro!
    pg

    EDIT: found this old thread: http://www.developer.nokia.com/Commu...in-ad-hoc-mode

  3. #3
    Registered User
    Join Date
    Apr 2011
    Posts
    115

    Re: Problem with wlan IAP

    Ciao,
    I have read the documentations but they do not explain other.

    I think I' ve read all values of the wifi configuartion made by Symbian manual configurator.
    They seems to be equals.
    Then why it doesn't find DNSs and gateway??
    I'm desperate

    Grazie mille
    A993

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

    Re: Problem with wlan IAP

    Hello,
    just to be sure that you have tried everything, have you tried also:
    http://www.developer.nokia.com/Commu...in-ad-hoc-mode, post #6 (how to get the correct corresponding table into commdb...)
    trying to use _L8("MioAP") or _L8("Alice-55564905") instead of _L8("ApE51") ?
    and trying to use
    Code:
    lanServiceView->WriteBoolL(TPtrC(SERVICE_IP_ADDR_FROM_SERVER), ETrue);
    lanServiceView->WriteBoolL(TPtrC(SERVICE_IP_DNS_ADDR_FROM_SERVER), ETrue);
    instead of
    Code:
    lanServiceView->WriteBoolL(TPtrC(SERVICE_IP_ADDR_FROM_SERVER), EFalse);
    lanServiceView->WriteBoolL(TPtrC(SERVICE_IP_DNS_ADDR_FROM_SERVER), EFalse);
    ?

    otherwise i haven't any other suggestions, sorry
    regards
    pg
    Last edited by pavarang; 2012-09-29 at 21:07. Reason: typo in _L8 usage

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

    Re: Problem with wlan IAP

    I just found this link in the library (click on it twice):
    http://library.developer.nokia.com/i...ntItem_8h.html
    where:
    EApWlanIpNetMask,
    EApWlanIpGateway, EApWlanIpAddrFromServer, EApWlanIpAddr, EApWlanIpDnsAddrFromServer,
    EApWlanIPNameServer1, EApWlanIPNameServer2
    are defined, and an example:
    http://sensorkit.googlecode.com/svn-...c/WlanInit.cpp

    regards,
    pg

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

    Re: Problem with wlan IAP

    Thank you very much
    But I've found the problem with ceddump.
    The problem is NU_WLAN_WEP_KEY1, the key of the iap in HEX.
    My router password is "aannddrreeaa0"
    The password in hex stored in the DB by the symbian OS configuration is:
    "\x3136\x3136\x4536\x4536\x3436\x3436\x3237\x3237\x3536\x3536\x3136\x3136\x3033\xCECE\xCECE\xCECE\xCECE\xCECE\xCECE\xCECE\xCECE\xCECE\xCECE\xCECE\xCECE\xCECE"

    x3136=a
    x4536=n
    x3436=d
    ..
    ..

    But what kind of codify is it? I've never saw it

    Grazie mille ancora

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Problem with wlan IAP

    It is quite easy to find something. In the English alphabet 'a' and 'd' are 3 codes apart, and the second digit (from the left) in 3136 and 3436 really changes by 3. Also, the ASCII code of numerical digits is 3x, so 30 for 0, and 'something like that' appears in 3033. CE seems to be a filler code.
    So the ASCII code of 'a' is 61, 'd' is 64, 'r' is 72. And the ASCII codes for them are 36,31,34,37,32.
    Now comes the 'n' is 6E. 36 is really the code for 6, and 45 turns out to be the ASCII code of upper case E.
    Thus what you see is simply the upper-case encoded hexadecimal string of the ASCII codes of your key. The order of the digit-pairs is swapped because you see them as 16-bit codes for some reason. But in the memory they would look like 3631363136453645...3330, which forms the string 61616E6E...30, which is aann...0.
    I strongly assume that it is mentioned somewhere in the documentation, and perhaps even part of the WLAN specs somehow (at least I remember that various WLAN-things offered me to specify the key as a hexadecimal string).

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

    Re: Problem with wlan IAP

    Thank you, it work.
    But if I pass to "WriteTextL(TPtrC(NU_WLAN_WEP_KEY1),keybuf)" a TBufC16<156> keybuf.
    And keybuf is the correct string. It leave with kerroverflow

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Problem with wlan IAP

    You may really want to check the specification, because I do not want to. But I know for sure that there are specific key sizes which can be used. 156 is unlikely amongst them (regardless of speaking of 156 bits or 156 bytes, it is just a too complicated number).

  10. #10
    Registered User
    Join Date
    Apr 2011
    Posts
    115

    Re: Problem with wlan IAP

    but if i pass to the function the same string (size 156) with _L("...string...") it works

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

    Re: Problem with wlan IAP

    Hello,
    are you sure it's a TBufC16? I think it's a buf8...
    regards
    pg

  12. #12
    Registered User
    Join Date
    Apr 2011
    Posts
    115

    Re: Problem with wlan IAP

    It's a TDesC16

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

    Re: Problem with wlan IAP

    because I've looked into sources, and i can find only 8 buf related to it
    for example:
    into /mw/ipconnmgmt/cmmanager/cmmgr/database/src/cmmanagertableformats.cpp
    Code:
    const SRecordTypeInfo CCDWlanServiceRecord::iRecordInfo[]=
      	{
    ...
        	{ KCDTIdWlanWepKey1,	        EDesC8,     ENoAttrs,   NU_WLAN_WEP_KEY1 },
            { KCDTIdWlanWepKey2,	        EDesC8,     ENoAttrs,   NU_WLAN_WEP_KEY2 },
        	{ KCDTIdWlanWepKey3,	        EDesC8,     ENoAttrs,   NU_WLAN_WEP_KEY3 },
            { KCDTIdWlanWepKey4,	        EDesC8,     ENoAttrs,   NU_WLAN_WEP_KEY4 },
    ...
      	};
    into /app/devicecontrol/omadmadapters/nsmldminternet/src/NSmlWlanSettings.cpp:
    Code:
    TBuf8<KCommsDbSvrMaxFieldLength> columnValue8;
    TRAP(leavecode, iTableView->ReadTextL(TPtrC(NU_WLAN_WEP_KEY1),columnValue8));
    and

    Code:
    iTableView->WriteTextL(TPtrC(NU_WLAN_WEP_KEY1), aWlanSettings->WepKey1);
    where TWlanSettings* aWlanSettings

    and

    Code:
    class TWlanSettings
        {
    public:
        TBuf<KMaxTextLength> Name;
        TUint32 Id;
        TUint32 ServiceID;
        TUint32 ConnectionMode; // Infrastructure / adhoc
        TBuf<KMaxTextLength> SSID;
        TBuf8<KMaxTextLength> WepKey1;
        TBuf8<KMaxTextLength> WepKey2;
        TBuf8<KMaxTextLength> WepKey3;
        TBuf8<KMaxTextLength> WepKey4;
        TUint32 WepIndex;
        TUint32 SecurityMode; // SecurityMode (Allow unsecure, wep, 802.1xs, wpa) enum EWlanSecurityMode
        TUint32 WPAMode; // enum EWpaMode
        TUint32 UseWPAPSK; // CR ID: TMVI-5Y49AS
        TBuf8<KMaxPSKLength> WPAPreSharedKey;
        TUint32 AuthMode;
        TBuf<KMaxTextLength> UsedSSID;
        TUint32 ScanSSID;
        TBuf<KMaxLongTextLength> EapList;
        TBool SecondarySSIDsExisting;
        //    TBuf<KMaxTextLength>        SecondarySSID;
        //    TBuf<KMaxTextLength>        UsedSecondarySSID;
    
        };

  14. #14
    Registered User
    Join Date
    Apr 2011
    Posts
    115

    Re: Problem with wlan IAP

    Code:
    IMPORT_C void WriteTextL(const TDesC& aColumn, const TDesC8& aValue);
    	IMPORT_C void WriteTextL(const TDesC& aColumn, const TDesC16& aValue);
    Is equal but why _L("mykeyCrypted") works and TBufC16<156> keybuf doesn't work??It is not possible!!

  15. #15
    Registered User
    Join Date
    Apr 2011
    Posts
    115

    Re: Problem with wlan IAP

    I solved with HBufC.
    Now how can I set the destination folder of the iap?
    I want to insert my iap in "Internet" destination folder

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
  •  
×