We are at the moment dealing with file sends from the phone to a PC over Bluetooth. We used the below example and modified it for dealing with files instead of text, as some people here in the forum did. (thanks for that)
This is the object we are using for sending one file.
CObexBufObject* CObjectExchangeClient::CreateObject(TInt filenumber)
if (filenumber == 1)
filedata = new TUint8[size];
TPtr8 ptr(filedata, size, size);
iBufFlat = NULL;
iBufFlat = CBufFlat::NewL(size);
iCurrObject = NULL;
iCurrObject = CObexBufObject::NewL(iBufFlat);
f.Set(KCsvFileName, NULL, NULL);
We are calling the SendObject-function from a buttonhandler. The iClient is defined as CObexClient* iClient.
void CObjectExchangeClient::SendObjectL(TInt number)
if (iState != EWaitingToSend)
else if (IsActive())
We know that create object works as we can send one file but When we're trying to call the SendObject-function again, from the button handler, to send a second file it crashes. We think/know it has something to do with the active object. Is it possible to send multiple files over bluetooth from the phone with the above example? If so, how can this be done. Thanks in advance!!!
Daniel and Ronan