On 25 July 2013 07:08, chinna praveen <[email protected]> wrote:
> hi
>
> i want to transfer a file via bluetooth so i am using bluetooth opp client
> here is my code
>
>
>
> BluetoothManager btManager;
> // The application must implement the IBluetoothManagerEventListener
> interface
> btManager.Construct(*this);
> BluetoothOppClient oppClient;

Hi, please make sure the btManager or oppClient doesn't get
desctructed in the meantime. If you leave the current C++ block it will :)
The bada/OSP API (especially the memory management) is designed in a
way that you should be double careful at every step. So either try to
create these objects on heap or have them as private attributes of
your own object.

This is just a guess. If I am right the sample code like the one
'Using Bluetooth Device as an OPP Client' is a bit incomplete.
Regards.

> // The application must implement the IBluetoothOppClientEventListener
> interface
> oppClient.Construct(*this);
>   //pairing
>   IList* pPairedDeviceList = btManager.GetPairedDeviceListN();
>   // Get the paired device element at the index 0
>   BluetoothDevice* pPairedDevice =
> (BluetoothDevice*)pPairedDeviceList->GetAt(0);
>
>   // Get information from the paired device
>   String pairedDeviceName = pPairedDevice->GetName();
>   AppLog("%ls",pairedDeviceName.GetPointer());
>   String filePath =String(Tizen::App::App::GetInstance()->GetAppRootPath() +
> L"data/text1.dat");
> AppLog("%ls",filePath.GetPointer());
>      result r=oppClient.PushFile(*pPairedDevice, filePath);
>       AppLogException("exception [%s]", GetErrorMessage(r));
>
> it is showing the paired devices correctly while transfering file the
> exception is E_SUCCESS but the problem is the application is closing
> unexpectedly ....and i am not able to send files.
>
> suppose if i try to give path as String filePath
> =L"opt/media/Images/image1.jpg" the pushFile function giving the exception
> "E_FAILURE"..please kindly help me in identifying wher the problem is????
>
> i have included bluetooth.admin and bluetooth.opp previliges and also
> network.bluetooth feature
>
> thanks in advance
>
>
> _______________________________________________
> General mailing list
> [email protected]
> https://lists.tizen.org/listinfo/general
>



-- 
regards / pozdrawiam, Jaroslaw Staniek
 Kexi & Calligra & KDE | http://calligra.org/kexi | http://kde.org
 Qt for Tizen | http://qt-project.org/wiki/Tizen
 Qt Certified Specialist | http://www.linkedin.com/in/jstaniek
_______________________________________________
General mailing list
[email protected]
https://lists.tizen.org/listinfo/general

Reply via email to