I make an attempt to detect devices using Bluetooth LE, did as written in this library for Xamarin, but the devices found 0
Necessary manifestos in android included. Increased the time for scanning to 30 seconds, but nothing. Bluetooth enabled, version 4.0
Asus_Z00ED device (Android 6.0 - API 23). The project was created with a target on Android 8.1. Tried to switch target versions of Android (8.0,9.0) in the manifest, but there is also no detection
What else could be the reason for the lack of detection?
public class Page6 : ContentPage
{
IBluetoothLE ble;
IAdapter adapter;
ObservableCollection<IDevice> deviceList;
Label label;
public Page6()
{
ble = CrossBluetoothLE.Current;
adapter = CrossBluetoothLE.Current.Adapter;
deviceList = new ObservableCollection<IDevice>();
label = new Label { Text = "Welcome to Xamarin.Forms!" };
var buttonList = new Button() { Text = "Devices List" };
buttonList.Clicked += ButtonList_Clicked;
Content = new StackLayout
{
Children = {
label,
buttonList,
}
};
}
private async void ButtonList_Clicked(object sender, EventArgs e)
{
deviceList.Clear();
adapter.ScanTimeout = 30000;
adapter.DeviceDiscovered += (s, a) =>
{
deviceList.Add(a.Device);
};
await adapter.StartScanningForDevicesAsync(); // сканирование
label.Text = deviceList.Count.ToString();
}
}