Class CharacteristicCantWriteException
- Namespace
- Bluetooth.Abstractions.Scanning.Exceptions
- Assembly
- Bluetooth.Abstractions.Scanning.dll
Represents an exception that occurs when attempting to write to a characteristic that doesn't support writing.
public class CharacteristicCantWriteException : CharacteristicException, ISerializable
- Inheritance
-
CharacteristicCantWriteException
- Implements
- Inherited Members
Constructors
CharacteristicCantWriteException(IBluetoothRemoteCharacteristic, string, Exception?)
Initializes a new instance of the CharacteristicCantWriteException class.
public CharacteristicCantWriteException(IBluetoothRemoteCharacteristic remoteCharacteristic, string message = "This characteristic does not have the WRITE 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
ThrowIfCantWrite(IBluetoothRemoteCharacteristic)
Throws a CharacteristicCantWriteException if the specified characteristic cannot be written to.
public static void ThrowIfCantWrite(IBluetoothRemoteCharacteristic baseBluetoothRemoteCharacteristic)
Parameters
baseBluetoothRemoteCharacteristicIBluetoothRemoteCharacteristicThe Bluetooth characteristic to check.