Class CharacteristicCantReadException
- Namespace
- Bluetooth.Abstractions.Scanning.Exceptions
- Assembly
- Bluetooth.Abstractions.Scanning.dll
Represents an exception that occurs when attempting to read a characteristic that doesn't support reading.
public class CharacteristicCantReadException : CharacteristicException, ISerializable
- Inheritance
-
CharacteristicCantReadException
- Implements
- Inherited Members
Constructors
CharacteristicCantReadException(IBluetoothRemoteCharacteristic, string, Exception?)
Initializes a new instance of the CharacteristicCantReadException class.
public CharacteristicCantReadException(IBluetoothRemoteCharacteristic remoteCharacteristic, string message = "This characteristic does not have the READ property", Exception? innerException = null)
Parameters
remoteCharacteristicIBluetoothRemoteCharacteristicThe Bluetooth characteristic associated with the exception.
messagestringA message that describes the error.
innerExceptionExceptionThe inner exception that caused the current exception, if any.
Methods
ThrowIfCantRead(IBluetoothRemoteCharacteristic)
Throws a CharacteristicCantReadException if the specified characteristic cannot be read.
public static void ThrowIfCantRead(IBluetoothRemoteCharacteristic baseBluetoothRemoteCharacteristic)
Parameters
baseBluetoothRemoteCharacteristicIBluetoothRemoteCharacteristicThe Bluetooth characteristic to check.