Forum Cross Platform with Xamarin
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Bluetooth LE samples not listing devices after scan

Hi,

BLE Explorer: https://github.com/xamarin/mobile-samples/tree/master/BluetoothLEExplorer
HeartRateMonitor: https://github.com/conceptdev/xamarin-forms-samples/tree/master/BluetoothHeartRateMonitor

Downloaded samples referred by John Douglas and Craig Dunn [BLE Explorer and HeartRateMonitorXF] for Cross platform Xamarin Forms PCL project related to Bluetooth LE. There is no compilation error and successful in running and deploying the project in Android mobile using Visual Studio debugger.

The problem is when we press scan, the discovered devices List<> shows no count i.e. No devices found though bluetooth turned on. Then timeout happens. Increased the time out period but no listing of devices.

Am I missing something badly?

Regards
Lonewolf

Answers

  • mauricewindleymauricewindley AUMember

    same for me, device was Nexus 7 and Lenovo Tab 2

  • LonewolfLonewolf USMember

    AFIK, These samples are meant for specific significant bluetooth devices[Heart Rate monitor devices etc] and not conventional bluetooth devices[Phones].

  • TomaszKot.6014TomaszKot.6014 PLMember

    Hi,

    I tried it on iOS, also could not get my phone or BT speaker listed.

    Finally I understood that the code in this project performs a "central" role of BT LE schema:
    https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothOverview/CoreBluetoothOverview.html

    The key is, the device to be found must act as Peripheral and sends so called 'Advertising'.
    I was able to get a list of devices by running this app on the one device : https://github.com/0x7fffffff/Core-Bluetooth-Transfer-Demo and then BLE Explorer on the other device.
    If you don't have iOS device I guess there are also android apps doing BT advertising.

    Regards,
    Tom

  • HI, any ideas? not working scanne

  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    CoreBluetooth is not for connecting to speakers, headphones, etc. It's for communicating with Bluetooth LE devices like the heart rate monitor.

    There is really no need for your application to connect to bluetooth speakers or headsets. The user can already do that with the Settings app. If the user wants your app playing through a bluetooth speaker, he/she can do that very easily without assistance from your app.

    If your problem is with scanning for Bluetooth LE devices, then please be more specific in your question.

  • sureshbabuluckysureshbabulucky USMember ✭✭

    unable to scan the nearest devices on Bluetooth. can anyone clear that problem please let me know.

    Thanks in Advance

  • Im_lavanIm_lavan USMember ✭✭

    Hi, Is there any Plugin which Scans Smart Phones In Xamarin Forms? Currently I'm Using Plugin.BLE which scans devices like Bluetooth Speakers and Head Phones.

    Thanks In Advance!

  • MondQMondQ Member ✭✭

    @Im_lavan did you actually get Plugin.BLE to show devices? Tried scanning for some bluetooth headphones and a bluetooth mouse, but they don't show up.

    ...
                this.ble = CrossBluetoothLE.Current;
                this.adapter = CrossBluetoothLE.Current.Adapter;
    ...
                adapter.DeviceDiscovered += (s, ev) => label2.Text += " " + ev.Device.Id + " " + ev.Device.Name;
                adapter.ScanTimeout = 1000000;
                await adapter.StartScanningForDevicesAsync();
                label2.Text += "\ndone\n";
    
Sign In or Register to comment.