×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor
    Join Date
    May 2006
    Location
    Hyderabad,India
    Posts
    89

    socket connection in E61

    Hi,
    I have a problem with UDP connection on E61. Every thing works fine on emulator, but on device (E61) it’s not working. I have a developer certificate with all capabilities given by Symbian. Every thing works fine even opening connection and all. Do we need to write capabilities in pkg file for socket connection? Pls clarify this. Anybody have problem like this on 9.1 devices pls help me!
    Do we need to "bind" socket? Or setLocalPort() is enough. Initially I tried binding but after successful binding it’s not able to send a packet. And with SetLocalPort only it was able to send a packet. This method worked on 2nd edition fp2. Did this change in version 3 devices?

    Thanks & Regards,
    Sheshu Kumar Inguva.

  2. #2
    Registered User
    Join Date
    Jun 2006
    Location
    Tampere, Finland
    Posts
    29

    Re: socket connection in E61

    Hi,
    I have exactly the same problem so you are not alone with this.

    Everything is working fine in the emulator and also in the phone everything seems to work except no data is received. I'm using Nokia E70 + developer license.

    Here is my connection code which works fine in the emulator.
    Code:
    // Creating connection classes...
    iSocketServ = new (ELeave) RSocketServ;
    iConnection = new (ELeave) RConnection;
    iSocket = new (ELeave) RSocket;
    
    User::LeaveIfError( iSocketServ->Connect() );
    // Here phone asked the WLAN access point I'm using.
    User::LeaveIfError( iConnection->Open(*iSocketServ) );
    User::LeaveIfError( iConnection->Start() );
    
    // ...opening socket...
    User::LeaveIfError( iSocket->Open( *iSocketServ, KAfInet, KSockDatagram, KProtocolInetUdp, *iConnection) );
    User::LeaveIfError( iSocket->SetLocalPort( iServerPort ) );
    User::LeaveIfError( iSocket->SetOpt( KSoReuseAddr, KProtocolInetIp, 1 ) );
    
    // ...and here emulator is receiving data but the phone isn't.
    iSocket->RecvFrom( iDataBuf, iSockAddrCurrent, 0 , iStatus );
    -SageX
    Last edited by SageX; 2006-08-08 at 06:18.

  3. #3
    Regular Contributor
    Join Date
    May 2006
    Location
    Hyderabad,India
    Posts
    89

    Re: socket connection in E61

    Thanks for your reply i am not alone with this issue, is there any solution for this? do we need some privilages to work on device? Any thing we need to add to pkg?

    Thanks & Regards,
    Sheshu Kumar Inguva.

  4. #4
    Regular Contributor
    Join Date
    May 2006
    Location
    Hyderabad,India
    Posts
    89

    Re: socket connection in E61

    Hi,
    Do i need to change these for developer certificate

    app uid - 0xA000017F

    __EMULATOR_IMAGE_HEADER2(0x1000007a,0x100039ce,0xa000017f,EPriorityForeground,0x00000000u,0x00000000u,0xa000017f,0x00000000,0x00010000,0) in file app_UID.cpp

    In s60_3_0_how_to_sign_sis_files_1_4.pdf this was given

    Code:
    3. Checklist
    Things to check while creating a self signed .sis file:
    • Make sure that the package UID is not within the protected range (that is, that it is not less than 0x80000000)
    • Make sure that the SID is not within the protected range (that is, not less than 0x80000000)
    • Make sure that the Vendor id is 0
    • Make sure that your applicatons have a capability set that is less/equal than/to the following:
    o NetworkServices
    o LocalServices
    o ReadUSerData
    o WriteUserData
    o UserEnvironment
    where do we set this capability?

    Thanks & Regards,
    Sheshu Kumar Inguva.

  5. #5
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: socket connection in E61

    Set the emulator to display any missing capability when running your program. These should be displayed in the debug window. You define the necessary capabilities in the mmp file. If it still doesn't work, use some logging to a) determine where it's failing b) what error code you're getting

  6. #6
    Regular Contributor
    Join Date
    May 2006
    Location
    Hyderabad,India
    Posts
    89

    Re: socket connection in E61

    My code is working in Emulator properly. And for device i got all capabilities that Symbian can give in developer certificate. In their developer certificate documentation they mentioned that if certification satisfies code capabilities then it will work! Will udp comes under CommDD (phone manufacturer capability?)

    I need some help; do we need to specify the capabilities in mmp? Can you pls write some code how to add that capability for Network services and multimediaDD?

    Do I need to import project from mmp again (after adding capabilities) or CW will get them from MMP?

    Thanks & Regards,
    Sheshu Kumar Inguva.

  7. #7
    Regular Contributor
    Join Date
    May 2006
    Location
    Hyderabad,India
    Posts
    89

    Re: socket connection in E61

    Hi,

    for RSocket::sendTo i am getting error -46(KErrPermissionDenied ). how can we add permission?

    Thanks & Regards,
    Sheshu Kumar Inguva.

  8. #8
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: socket connection in E61

    That it "does work" on the emulator doesn't mean you have some missing capability. Check the debug window for these messages, as I already mentioned. You need to specify them in the mmp file and also reimport (an clean everything up to make sure).

    Regarding code snippets, please dedicate some time on your own to read documentation, which explains this very well (including examples, etc)

  9. #9
    Regular Contributor
    Join Date
    May 2006
    Location
    Hyderabad,India
    Posts
    89

    Re: socket connection in E61

    Ok thanks,

    I got this from SIP example given
    Code:
    CAPABILITY     NetworkServices LocalServices Location ReadUserData \
                   WriteUserData WriteDeviceData SwEvent ProtServ
    i am reimporting my project.

    I have a doubt regarding UID for using developer certificate. do we need to do use unprotected uid or Developement use only?

    Code:
    0x00000000 - 0x0FFFFFFF
    Development use only
    
    0x10000000 - 0x1FFFFFFF
    Legacy UID allocations 
    
    0x20000000 - 0x2FFFFFFF
    V9 protected UID allocations 
    
    0xA0000000 - 0xAFFFFFFF
    V9 unprotected UID allocations 
    
    0xE0000000 - 0xEFFFFFFF
    Development use only
    currently i am using unprotected uid 0xA000017F.

    Thanks & Regards,
    Sheshu Kumar Inguva.

  10. #10
    Regular Contributor
    Join Date
    May 2006
    Location
    Hyderabad,India
    Posts
    89

    Thumbs up Re: socket connection in E61

    Its working now!

    I added capabilities in mmp file and reimported.

    Thanks & Regards,
    Sheshu Kumar Inguva.

  11. #11
    Registered User
    Join Date
    Jul 2006
    Posts
    15

    Re: socket connection in E61

    Hi

    I am also using E61 device

    I am trrying to write Irda application

    But i am not able to connect as my RSocket.Connect is failing and in RunL i am getting "KErrDisconnected" error message..


    This is my connect call...
    {
    HBufC* text = StringLoader::
    LoadLC( R_IRDA_WRITER_CONNECTING_STRING );
    iView.SetStatus( *text );
    CleanupStack::PopAndDestroy( text );

    iTimer->After( KTimeOut ); // Request time out
    //Protocol to be used is IrTinyTP
    _LIT( SocketsProtocolName, "IrTinyTP" );
    TProtocolName protoName(SocketsProtocolName);

    //TBuf<KProtocolBuffer> tinyTP( SocketsProtocolName );
    CAknInformationNote *note = NULL;
    //Open protocol
    TInt ret( iSocketServ.FindProtocol( protoName, iPInfo ) );
    User::LeaveIfError( ret );

    //Make host resolver
    ret = iResolver.Open(iSocketServ, iPInfo.iAddrFamily, iPInfo.iProtocol);
    User::LeaveIfError( ret );

    //Find the first discovered IrDA device using RHostResolver::GetByName
    THostName name;
    ret = iResolver.GetByName( name, iNameEntry );
    User::LeaveIfError(ret);

    //Take the returned TSockAddr and casts it to a TIrdaSockAddr
    //to find out remote device address
    TIrdaSockAddr addr(iNameEntry().iAddr);
    TUint remDevAddr(addr.GetRemoteDevAddr());

    TInt ResultSock = iSocket.Open(iSocketServ,
    iPInfo.iAddrFamily,
    iPInfo.iSockType,
    iPInfo.iProtocol);
    if(ResultSock == KErrNone )
    {
    //IAS query
    RNetDatabase ias;
    ret = ias.Open( iSocketServ, iPInfo.iAddrFamily, iPInfo.iProtocol );
    User::LeaveIfError(ret);
    TBuf<100> tttttt;
    tttttt.AppendNum(remDevAddr , EDecimal);
    note = new (ELeave) CAknInformationNote(ETrue);
    note->ExecuteLD(tttttt);

    //Query remove device name
    //The IASQuery API expects 8 bit parameters
    _LIT8( KTxtDevice, "Device");
    _LIT8( KTxtDeviceName, "DeviceName");

    //note = new (ELeave) CAknInformationNote(ETrue);
    //note->ExecuteLD(_L("1stIAS"));
    IASQuery( ias, KTxtDevice, KTxtDeviceName, remDevAddr );

    //note = new (ELeave) CAknInformationNote(ETrue);
    //note->ExecuteLD(_L("2ndI AS"));

    //Query for service named "OwnIrDAServer"
    //The IASQuery API expects 8 bit parameters
    //_LIT8(KGdpIrClassName,"MyIrDAService");
    _LIT8(KGdpIrClassName,"IrDA:IrOBEX");
    _LIT8(KGdpIrAttributeName,"IrDA:TinyTP:LsapSel");
    IASQuery(ias,KGdpIrClassName,KGdpIrAttributeName, remDevAddr);

    ias.Close(); //Close RNetDB
    iResolver.Close();
    if(iTinyTPPort != 0 )
    {
    CAknInformationNote *note1 = NULL;
    //iNameEntry().iAddr.SetPort( iTinyTPPort );
    addr.SetPort(iTinyTPPort );
    note1= new (ELeave) CAknInformationNote(ETrue);
    note1->ExecuteLD(_L("iSocket.Connect Success"));

    iSocket.Connect(addr, iStatus );
    User::WaitForRequest(iStatus);
    ChangeStatus( EConnecting );
    SetActive();
    }
    else
    {
    note = new (ELeave) CAknInformationNote(ETrue);
    note->ExecuteLD(_L("iSocket.Connect--Failed"));
    }
    }

    }

    Please help

Similar Threads

  1. Unable to do a socket connection
    By PriyankaChaurishia123 in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2006-02-13, 17:53
  2. problem in persistant socket connection
    By poms4symbian in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2006-01-03, 13:23
  3. socket connection problem
    By bhatti81 in forum Mobile Java General
    Replies: 2
    Last Post: 2003-10-08, 14:43
  4. opening a socket connection
    By bhatti81 in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2003-07-16, 10:08
  5. PC Sync with 6310i and Socket BT Connection Kit
    By sami_laiho in forum Bluetooth Technology
    Replies: 0
    Last Post: 2002-09-17, 05:25

Posting Permissions

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