mikeacosta / mvx-custom-binding

Simple MvvmCross Custom Data Binding example
3 stars 1 forks source link

Getting Exception while trying to Connect #1

Open ShaileshBhatNP opened 4 years ago

ShaileshBhatNP commented 4 years ago

I'm getting below exception "read failed, socket might closed or timeout, read ret: -1", while executing

await _socket.ConnectAsync();

What maybe the solution for this..Can you please help me?..

mikeacosta commented 4 years ago

Please confirm that the device you are trying to connect to supports Classic Bluetooth (not BLE)? Also, make sure the BT device is paired with your phone/tablet, and that you are passing in the correct device name when trying to connect. BluetoothAdapter.DefaultAdapter has a BondedDevices property that is a list of paired devices. That should give you the correct device name.

ShaileshBhatNP commented 4 years ago

Does this supports to connect only Classic Bluetooth devices.? I'm trying to connect a mobile phone from another mobile phone(I think both supports BLE, not Classic Bluetooth). Both devices paired, device name is also proper and I'm getting list of paired devices in BondedDevices property also.

What I have to do, if I want to connect to BLE devices using Xamarin.forms..is there any working sample...

mikeacosta commented 4 years ago

My code is specifically for Classic Bluetooth. For BLE with Xamarin, here are some possible solutions (I haven't used these myself):

https://github.com/xabre/xamarin-bluetooth-le

https://github.com/shinyorg/shiny

ShaileshBhatNP commented 4 years ago

Ok..Thanks for the help..But got same issues in above samples also... https://stackoverflow.com/q/62371859/7204954