×
Namespaces

Variants
Actions

Sending files over Bluetooth using RSendAs

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: giaperrucci (07 Jun 2007)
Last edited: hamishwillee (31 May 2013)

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

Header Required:

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

Library needed:

LIBRARY sendas2.lib

Source File:

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


An example depicting another way of transferring files over bluetooth in symbian using QtMobility is here : Bluetooth File Transfer Example

This page was last modified on 31 May 2013, at 02:32.
46 page views in the last 30 days.