Table of Contents

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

remoteCharacteristic IBluetoothRemoteCharacteristic

The Bluetooth characteristic 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

ThrowIfCantWrite(IBluetoothRemoteCharacteristic)

Throws a CharacteristicCantWriteException if the specified characteristic cannot be written to.

public static void ThrowIfCantWrite(IBluetoothRemoteCharacteristic baseBluetoothRemoteCharacteristic)

Parameters

baseBluetoothRemoteCharacteristic IBluetoothRemoteCharacteristic

The Bluetooth characteristic to check.

See Also