×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    14

    Transfering image to series 40 device problem

    Hi, i am learning using OBEX in Series60 SDK to transfer an image from series60 devices to another devices via infrared. After i developed my application, it is able to transfer an image to another series60 devices and to pc, but it is unable to transfer the image to series40 devices (eq : nokia 6610,7250, etc);

    Here is some of my code :
    void CIrObexFileSender::ConnectL()
    {
    iIasDb.Close();
    iHostResolver.Close();
    iSocket.Close();
    iSockSrv.Close();

    User::LeaveIfError(iSockSrv.Connect());

    // See number of protocols the socket server is currently aware of
    TUint numOfProtocols;
    User::LeaveIfError(iSockSrv.NumProtocols(numOfProtocols));


    //CMsgBoxUtil::ShowIntL(_L("numOfProt"),numOfProtocols);

    TProtocolName KTinyTP = _L("IrTinyTP");
    TProtocolDesc tinyTpInfo;
    User::LeaveIfError(iSockSrv.FindProtocol(KTinyTP, tinyTpInfo));

    //DEVICE DISCOVERY - only one device is going to be discoverd, discovery level IrLAP
    TInt ret;
    ret=iHostResolver.Open(iSockSrv, tinyTpInfo.iAddrFamily, tinyTpInfo.iProtocol);
    User::LeaveIfError(ret);

    // Make the socket
    ret=iSocket.Open(iSockSrv, tinyTpInfo.iAddrFamily, tinyTpInfo.iSockType, tinyTpInfo.iProtocol);
    User::LeaveIfError(ret);

    // Set number of device to discover
    TPckgBuf<TUint> buf(1);
    User::LeaveIfError(iSocket.SetOpt(KDiscoverySlotsOpt, KLevelIrlap, buf));

    // Get host by name
    TNameEntry log;
    THostName name;
    ret=iHostResolver.GetByName(name, log);
    User::LeaveIfError(ret);

    RNetDatabase iasDb;
    User::LeaveIfError(iIasDb.Open(iSockSrv, tinyTpInfo.iAddrFamily, tinyTpInfo.iProtocol));
    TIrdaSockAddr addr(log().iAddr);
    TIASQuery queryBuf(KClassIrDAIrOBEX, KAttribIrDATinyTP, addr.GetRemoteDevAddr());
    TIASResponse results;

    TRequestStatus stsQuery;
    iIasDb.Query(queryBuf, results, stsQuery);
    User::WaitForRequest(stsQuery);
    TInt intLsapSelNo;
    User::LeaveIfError(stsQuery.Int());
    if (results.Type() == EIASDataInteger)
    User::LeaveIfError(results.GetInteger(intLsapSelNo));

    log().iAddr.SetPort(intLsapSelNo);

    iProtocolInfo.iAddr = (TIrdaSockAddr) log().iAddr;
    CompleteConnectL();
    }


    _LIT8(KClassIrDAIrOBEX, "OBEX");
    _LIT8(KAttribIrDATinyTP,"IrDA:TinyTP:LsapSel");

    void CIrObexFileSender::CompleteConnectL()
    {

    if (iState == ESenderIdle)
    {
    iProtocolInfo.iTransport = _L("IrTinyTP");
    iProtocolInfo.iClassName = KClassIrDAIrOBEX;
    iProtocolInfo.iAttributeName = KAttribIrDATinyTP;
    if (iObexClient)
    {
    delete iObexClient;
    iObexClient = 0;
    }

    TRAPD(errCode, iObexClient = CObexClient::NewL(iProtocolInfo));
    if (errCode != KErrNone)
    {
    User::Leave(errCode);
    }
    else
    {
    iState = ESenderConnecting;
    iState = ESenderConnecting;
    iObexClient->Connect(iStatus);
    SetActive();
    }
    }
    }

    After i done some debugging, the problem is in the iObexClient->Connect. The runL methot never called, which makes some difficulty to know what the real problem is, because no error is generated. The program will still waiting, nothing happened.

    Does anyone know what is the problem ?

    Thanks in advance.

  2. #2
    Registered User
    Join Date
    Feb 2004
    Posts
    4
    Hello Andk

    I'm working with CSendAppUi (sendui.h) to transfer files from s60 via infrared. All works correctly, but appears an exception when the s40 is the destination device.

    it seems s40 devices have a transfer protection to avoid free file copy.


    I'm interested too about it, please keep me up to date. Thanks

  3. #3
    Registered User
    Join Date
    Apr 2004
    Posts
    5

    Link fail for irda related class

    Hi Andk,

    I am newer for learing OBEX in Nokia s60 and impressive the code you post. I adapt it into one of the symbian SDK example and build in VC6 with symbian irda.lib add in project setting. Althought the compliing pass but link keep fail. One of it is

    error LNK2001: unresolved external symbol "public: __thiscall TIrdaSockAddr::TIrdaSockAddr(class TSockAddr const &)" (??0TIrdaSockAddr@@QAE@ABVTSockAddr@@@Z)

    I wonder if the library for irda need to get from symbian separetely?

    So do the s40 issues is interesting too.

    Thanks in advance.

  4. #4
    Registered User
    Join Date
    Apr 2004
    Posts
    5

    link error gone

    Hi,

    The link error gone after I add irda.lib to .mmp and do "bld makefile vc6". It works fine in VC6 IDE.

    Thanks a lot.

Posting Permissions

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