Невозможно вызвать DiscoverDevices () для BluetoothDeviceInfo [] - PullRequest
0 голосов
/ 13 апреля 2020
using System;
using InTheHand.Net.Bluetooth;
using InTheHand.Net.Sockets;
using InTheHand.Net;

namespace BeaconExample
{
    class Program
    {
        static void Main(string[] args)
        {
            BluetoothRadio.PrimaryRadio.Mode = RadioMode.Connectable; // HERE 1
            BluetoothClient client = new BluetoothClient();
            BluetoothDeviceInfo[] devices = client.DiscoverDevices(); // HERE 2

            foreach (BluetoothDeviceInfo device in devices)
            {
                Console.WriteLine("X" + device.DeviceName.ToString());
            }

            Console.ReadLine();
        }
    }
}

Я получаю:

'BluetoothRadio' does not contain a definition for 'PrimaryRadio'

и:

Cannot implicitly convert type 'System.Collections.Generic.IReadOnlyCollection<InTheHand.Net.Sockets.BluetoothDeviceInfo>' to 'InTheHand.Net.Sockets.BluetoothDeviceInfo[]'. An explicit conversion exists (are you missing a cast?)

Я понимаю первое сообщение об ошибке, но не знаю, как его избежать.

Но я не понимаю второе сообщение об ошибке, кто-нибудь может мне помочь?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...