Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User Jondeere's Avatar
    Join Date
    Feb 2005
    Posts
    4
    I try use CSendUI class (symbian 3.0) for sending attachment over bluetooht, but CreateAndSendMessageL throw panic -5 not supported.
    I use follows cababilities:
    LocalServices NetworkServices ReadDeviceData WriteDeviceData ReadUserData WriteUserData UserEnvironment LocalServices DRM

    Here is my codes,

    TUid id = TUid::Null();

    switch ( aTransferType )
    {
    case ESMSBackup2CmdViaBT:
    {
    id.iUid = KSenduiMtmBtUidValue;
    break;
    }
    case ESMSBackup2CmdViaIrda:
    {
    id.iUid = KSenduiMtmIrUidValue;
    break;
    }
    default:
    {
    User::Panic( KTxtAppui, EAppuiPanic0 );
    break;
    }
    }

    // Create and send a message, using the selected bearer, with
    // no body and the selected file as an attachment.
    CSendUi* sendAppUi = CSendUi::NewL();
    CleanupStack::PushL( sendAppUi );

    CMessageData* msgData = CMessageData::NewLC();
    msgData->AppendAttachmentL( name );
    CleanupStack::Pop( msgData );

    sendAppUi->CreateAndSendMessageL( id, msgData );
    CleanupStack::PopAndDestroy( sendAppUi );

  2. #2
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,671
    This one works at least, though it also allows sending with mms etc.

    CMessageData* Mymessage = CMessageData::NewLC();

    for(TInt i=0; i< MyArray->Count(); i++)
    {
    Mymessage->AppendAttachmentL(MyArray->MdcaPoint(i));
    }

    TSendingCapabilities MySendCapa;
    MySendCapa.iFlags = TSendingCapabilities::ESupportsAttachments;

    TUid MyServiceUid = iSendUi->ShowSendQueryL(Mymessage,MySendCapa);
    if(iSendUi->ValidateServiceL(MyServiceUid,MySendCapa))
    {
    iSendUi->CreateAndSendMessageL(MyServiceUid,Mymessage);
    }

    CleanupStack::PopAndDestroy( Mymessage);

    could also be that the attachment is "protected" type and it complains about it...

    yucca

  3. #3
    Registered User Jondeere's Avatar
    Join Date
    Feb 2005
    Posts
    4
    thanks, but I get Panic -5 also with your codes.
    attachment file location is c:\ and it is normal .txt file.

  4. #4
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,671
    funny thing, basically, that worked fine for me in N71 & 3250 with just ReadUserData WriteUserData UserEnvironment LocalServices NetworkServices capabilites.

    Could you check that your capabilites string does not have double spaces, since I noticed that couple of times the mmp capabilites were not updated correctly to my apps.

    yucca

  5. #5
    Registered User Jondeere's Avatar
    Join Date
    Feb 2005
    Posts
    4
    I try run this code under emulator, may I should try this in real device.

  6. #6
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,671
    you should try it on device, emulator usually is not supporting all stuff that is supported by phones.

    yucca

  7. #7
    Regular Contributor bharatuppal's Avatar
    Join Date
    Oct 2004
    Posts
    107
    Hi Yucca I tried your code and it is working fine when i am selecting the "Bluetooth" option for sending the file,
    But when i am using the Infrared option it is not working .
    I used the following way for checking
    1> i directly selected the "Infrared"option

    result : First i got the dialoge "connectiing via Infrared" then got the error " Cannot eastablish the connection"

    2> I went to communication folder clicked infrared to activate infrared
    then went to my application and then selected tht infrared option again

    result : First i got the dialoge "connectiing via Infrared" then got the error
    "Failed to send message via Infrared"

    Both the devices were in line of sight

    what cud b wrong and i m using 3rd addition and exactly ur code
    cells were n80 and E60

  8. #8
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,671
    I'm not excatly sure how to get the phone to listen IR, since never really tried that. Anyway, have you tried sending from a phone to a PC, it should al least work.

    yucca

  9. #9
    Regular Contributor bharatuppal's Avatar
    Join Date
    Oct 2004
    Posts
    107
    Hey yucca
    can you actually give a start like api class tht is to be used for making the irda listen

  10. #10
    Registered User mateen_maldar's Avatar
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,063
    hi,

    u can open RComm to open the IRComm


    // Device driver names
    #if defined (__WINS__)
    _LIT(PDD_NAME,"ECDRV");
    _LIT(LDD_NAME,"ECOMM");
    #else
    _LIT(PDD_NAME,"EUART1");
    _LIT(LDD_NAME,"ECOMM");
    #endif
    _LIT(KStatus0,"Connect to file server\n");
    _LIT(KStatus1,"Connect to comm server\n");
    _LIT(KStatus2,"Load IrCOMM.CSY\n");
    _LIT(KStatus3,"Open IrCOMM::0\n");
    _LIT(KStatus4,"Write to IrCOMM::0\n");
    _LIT(KStatus5,"Close IrCOMM::0\n");
    _LIT(KStatus6,"Close server connection\n");
    _LIT(KIrCOMM,"IrCOMM");
    _LIT(KIrCOMM0,"IrCOMM::0");

    const TTimeIntervalMicroSeconds32 KTimeOut(4000000);
    //time-out value

    console->Printf(KStatus0);
    // force a link to the file server
    // so that we're sure the loader
    // will be present

    RFs f;
    User::LeaveIfError(f.Connect());
    f.Close();
    // Initialisation

    Init();

    RCommServ server;

    // Connect to the comm server
    console->Printf(KStatus1);
    server.Connect();

    // Load the IrCOMM comm module
    // C32 will automatically search \System\Libs
    // on all drives for IrCOMM.CSY
    console->Printf(KStatus2);
    TInt ret=server.LoadCommModule(KIrCOMM);

    //test(ret==KErrNone);
    User::LeaveIfError(ret);

    RComm commPort;
    // Open the IrCOMM port unit 0 (the only one supported)
    // Open port in exclusive mode because we don't
    // have any access control code.
    console->Printf(KStatus3);
    ret=commPort.Open(server,KIrCOMM0,ECommExclusive);
    //test(ret==KErrNone);
    User::LeaveIfError(ret);

    TRequestStatus status;
    // Write to the IrCOMM port - the first write
    // takes a long time as the IrDA connection is
    // set up in response to this request. Subsequent
    // writes to IrCOMM are very fast.
    console->Printf(KStatus4);
    commPort.Write(status,KTimeOut,DATA_STRING);
    User::WaitForRequest(status);

    //test(status.Int()==KErrNone);
    User::LeaveIfError(status.Int());
    // Close port
    console->Printf(KStatus5);
    commPort.Close();

    console->Printf(KStatus6);
    server.Close();
    Regards,
    Mateen Maldar
    "Whatever the mind can conceive and believe, the mind can achieve"

Similar Threads

  1. J2ME: Problem in Nokia Solution for a software problem
    By mte01 in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2011-06-08, 05:52
  2. problem when stop playing video on 3650 and try to play again
    By niko86 in forum Mobile Java General
    Replies: 5
    Last Post: 2007-08-03, 07:40
  3. Ringing problem with Nokia N70
    By DVogdos in forum Audio
    Replies: 2
    Last Post: 2007-06-26, 20:49
  4. Replies: 1
    Last Post: 2005-12-04, 12:01
  5. J2ME: Problem in Nokia Solution for a media problem
    By mte01 in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2005-08-12, 11:30

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved