Languages

Menu
Sites
Language
bluetooth app closing unexpectedly

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;
 
// 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
 
 
 

 

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

8 Replies
Pushpa G
ok, can you attach the error logs you are getting in Log pane in the IDE so taht it will help anayse the issue better
talari praveen kumar
07-25 12:52:44.535 : INFO / emptyapp ( 6919 : 6919 ) : int OspMain(int, char **)(20) > Application started. 07-25 12:52:44.600 : ERROR / Tizen::Base ( 6919 : 6919 ) : result Tizen::Base::String::SubString(int, Tizen::Base::String&) const(1112) > [E_OUT_OF_RANGE] The startIndex(47) MUST be greater than or equal to 0, and less than the length of this string(47). 07-25 12:52:44.605 : ERROR / Tizen::Base ( 6919 : 6919 ) : result Tizen::Base::String::SubString(int, Tizen::Base::String&) const(1112) > [E_OUT_OF_RANGE] The startIndex(47) MUST be greater than or equal to 0, and less than the length of this string(47). 07-25 12:52:44.610 : ERROR / Tizen::Base ( 6919 : 6919 ) : result Tizen::Base::String::SubString(int, Tizen::Base::String&) const(1112) > [E_OUT_OF_RANGE] The startIndex(47) MUST be greater than or equal to 0, and less than the length of this string(47). 07-25 12:52:44.620 : ERROR / Tizen::Base::Collection ( 2583 : 2583 ) : virtual const Tizen::Base::Object* Tizen::Base::Collection::ArrayList::GetAt(int) const(241) > [E_OUT_OF_RANGE] The index(2) MUST be greater than or equal to 0 and less than the number of elements(2). 07-25 12:52:44.625 : ERROR / Tizen::Base ( 6919 : 6919 ) : result Tizen::Base::String::SubString(int, Tizen::Base::String&) const(1112) > [E_OUT_OF_RANGE] The startIndex(47) MUST be greater than or equal to 0, and less than the length of this string(47). 07-25 12:52:44.640 : ERROR / Tizen::Io ( 6919 : 6919 ) : static bool Tizen::Io::File::IsFileExist(const Tizen::Base::String&)(300) > [E_INVALID_ARG] Given filePath length is zero or exceeds system limitations. 07-25 12:52:44.685 : ERROR / Tizen::Base ( 6919 : 6919 ) : result Tizen::Base::String::SubString(int, Tizen::Base::String&) const(1112) > [E_OUT_OF_RANGE] The startIndex(47) MUST be greater than or equal to 0, and less than the length of this string(47). 07-25 12:52:44.735 : INFO / emptyapp ( 6919 : 6919 ) : virtual bool emptyappApp::OnAppInitializing(Tizen::App::AppRegistry &)(70) > Praveen t 07-25 12:52:44.735 : INFO / emptyapp ( 6919 : 6919 ) : virtual bool emptyappApp::OnAppInitializing(Tizen::App::AppRegistry &)(73) > /opt/apps/GwYgTVLiIl/data/text.dat 07-25 12:52:44.780 : ERROR / emptyapp ( 6919 : 6919 ) : virtual bool emptyappApp::OnAppInitializing(Tizen::App::AppRegistry &)(75) > exception [E_SUCCESS] 07-25 12:52:44.780 : INFO / emptyapp ( 6919 : 6919 ) : virtual bool emptyappApp::OnAppInitializing(Tizen::App::AppRegistry &)(81) > sucess 07-25 12:52:44.785 : ERROR / BLUETOOTH_FRWK_SERVICE ( 4803 : 4803 ) : bt-request-handler.c: __bt_service_check_privilege(823) > (cookie == NULL) return 07-25 12:52:44.785 : ERROR / BLUETOOTH_FRWK_SERVICE ( 4803 : 4803 ) : bt-service-opp-client.c: __bt_free_sending_info(117) > (info == NULL) return 07-25 12:52:44.785 : ERROR / BLUETOOTH_FRWK_SERVICE ( 4803 : 4803 ) : bt-service-opp-client.c: __bt_opp_client_agent_deinit(88) > (opc_obex_agent == NULL) return 07-25 12:52:44.790 : ERROR / BLUETOOTH_FRWK_SERVICE ( 4803 : 4803 ) : bt-service-opp-client.c: __bt_free_transfer_info(105) > (info == NULL) return 07-25 12:52:46.555 : ERROR / BLUETOOTH_FRWK_SERVICE ( 4803 : 4803 ) : bt-service-opp-client.c: __bt_send_files_cb(429) > (sending_info == NULL) return
talari praveen kumar
hi pushpa do you have any updates regarding this post i have attached my log
Pushpa G
Hi Praveen, ok.Can you check once if this same issue is happening in FriendFinder sample app that’s available in the IDE(Tizen IDE>File>New >Project>Tizen>Tizen Native Project>Sample>FriendFinder And also can you check if the opp server is ready to accept the file from the opp client ( opp server on the remote device) If the server is not ready, the connection will fail.
talari praveen kumar
Hi Pushpa, i have checked the friend finder sample also, but when i pressed profile button the application is returning to home screen. I switched on bluetooth in my remote device, when i am sending files manually through bluetooth i am able to receive files. Is the code i have written correct? or shall i add anything else??
Pushpa G
can you try in 2.2b version
talari praveen kumar
Hi Pushpa I have tried it in 2.2 sdk only but the device am using is RD-210(flashed with 2.1 image). I dont have the device that supports 2.2 image.
Pushpa G
if you want receive event callback, you should not make a local variable as the object receive the event callback. because the object has already been destroyed when the callback event occur. Declare both btManager and oppClient as member variable in your class, and use the objects until the class is destroyed. Also check FriendFinder sample code, opp client and server should be started to find the friend in other device via bluetooth