Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 18:19, 3 September 2007.

Sending Files Over Bluetooth Using RSendAs

From Forum Nokia Wiki

This small snippet shows how to send a file over Bluetooth using the RSendAs class present on S60 3rd edition devices.

RSendAs sendas;
    
// Connecting to the SendAs server
TInt res = sendas.Connect();
User::LeaveIfError(res);
CleanupClosePushL(sendas);
    
RSendAsMessage message;
    
// Selecting the appropriate Bluetooth MTM UID
TRAP(res, message.CreateL(sendas, KSenduiMtmBtUid));
User::LeaveIfError(res);
CleanupClosePushL(message);
    
// The file we’re going to push, you need to make sure that the file
// is present on the device
_LIT(KFile, "C:\\pushfile.txt");
    
// Constructing the message
TRequestStatus status;
    
message.AddAttachment(KFile(), status);
User::WaitForRequest(status);
User::LeaveIfError(status.Int());
    
CleanupStack::Pop(1); // RMessage
    
// Launch the dialog allowing us to choose a receiver
// device and send the file
TRAP(res, message.LaunchEditorAndCloseL());
User::LeaveIfError(res);
    
CleanupStack::PopAndDestroy(1); // RSendAs

You need to include the following files:

  • #include <rsendas.h>
  • #include <rsendasmessage.h>
  • #include <senduiconsts.h>

Finally you must link against the following library:

  • sendas2.lib
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZbluetoothQ
     qfnZtopicQUqfnTopicZconnectivityQ
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX