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
deviceIBluetoothRemoteDeviceThe Bluetooth device associated with the exception.
messagestringA message that describes the error.
innerExceptionExceptionThe 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
deviceIBluetoothRemoteDeviceThe Bluetooth device to check.
Exceptions
- ArgumentNullException
Thrown when
deviceis null.- DeviceIsAlreadyConnectedException
Thrown when the device is already connected.