Table of Contents

Class DeviceNotConnectedException

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

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

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

Constructors

DeviceNotConnectedException(IBluetoothRemoteDevice, string, Exception?)

Initializes a new instance of the DeviceNotConnectedException class.

public DeviceNotConnectedException(IBluetoothRemoteDevice device, string message = "Device needs to be connected to execute this operation", 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

ThrowIfNotConnected(IBluetoothRemoteDevice)

Throws a DeviceNotConnectedException if the specified device is not connected.

public static void ThrowIfNotConnected(IBluetoothRemoteDevice serviceDevice)

Parameters

serviceDevice IBluetoothRemoteDevice

The Bluetooth device to check.

See Also