Skip to content

Can not find any devices #465

@harper-rhett

Description

@harper-rhett

I can not seem to get any Bluetooth Classic devices to show up. Everything was working fine with the legacy package 32feet.NET. This is on Windows 11, tested on two laptops.

using InTheHand.Net.Bluetooth;
using InTheHand.Net.Sockets;

BluetoothClient bluetoothClient = new();
bluetoothClient.InquiryLength = TimeSpan.FromSeconds(20);
bluetoothClient.Authenticate = false;
bluetoothClient.Encrypt = false;

Console.WriteLine("Start searching");

ListDevices();
ListDevicesAsync();

void ListDevices()
{
	BluetoothDeviceInfo[] devices = bluetoothClient.DiscoverDevices().ToArray();
	Console.WriteLine($"Devices found: {devices.Length}");

	foreach (BluetoothDeviceInfo device in devices)
	{
		Console.WriteLine(device.DeviceName);
	}
}

async void ListDevicesAsync()
{
	IAsyncEnumerable<BluetoothDeviceInfo> devices = bluetoothClient.DiscoverDevicesAsync();

	await foreach (BluetoothDeviceInfo device in devices)
	{
		Console.WriteLine(device.DeviceName);
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions