Bluetooth in Xamarin Shared Library

PascalMassonPascalMasson USMember ✭✭

Hello,

I am workin on an application which should scan the surrounding with bluetooth and print to the console when a device is found.
currently i have this but i am getting an error when it finds a device(i think). i am using the monkey.robotics library

`IAdapter adapter;

ObservableCollection devices;

    public MainPage(IAdapter adapter)
    {
        InitializeComponent();

        this.adapter = adapter;
        this.devices = new ObservableCollection<IDevice>();

        adapter.DeviceDiscovered += (object sender, DeviceDiscoveredEventArgs e) =>
        {
            Console.WriteLine("Found!!", "Found one", "OK");
            devices.Add(e.Device);
        };

        adapter.StartScanningForDevices();
    }`
Sign In or Register to comment.