Table of Contents

Class DeviceIsAlreadyConnectedException

Namespace
Bluetooth.Abstractions.Scanning.Exceptions
Assembly
Bluetooth.Abstractions.Scanning.dll

Represents an exception that occurs when a Bluetooth device is already connected.

public class DeviceIsAlreadyConnectedException : DeviceException, ISerializable
Inheritance
DeviceIsAlreadyConnectedException
Implements
Inherited Members

Constructors

DeviceIsAlreadyConnectedException(IBluetoothRemoteDevice, string, Exception?)

Initializes a new instance of the DeviceIsAlreadyConnectedException class.

public DeviceIsAlreadyConnectedException(IBluetoothRemoteDevice device, string message = "Device is already connected", Exception? innerException = null)

Parameters

device IBluetoothRemoteDevice

The Bluetooth device associated with the exception.

message string

A message that describes the error.

innerException Exception

The inner exception that caused the current exception, if any.

Methods

ThrowIfAlreadyConnected(IBluetoothRemoteDevice)

Throws a DeviceIsAlreadyConnectedException if the device is already connected.

public static void ThrowIfAlreadyConnected(IBluetoothRemoteDevice device)

Parameters

device IBluetoothRemoteDevice

The Bluetooth device to check.

Exceptions

ArgumentNullException

Thrown when device is null.

DeviceIsAlreadyConnectedException

Thrown when the device is already connected.

See Also