Class CharacteristicAlreadyWritingException
- Namespace
- Bluetooth.Abstractions.Scanning.Exceptions
- Assembly
- Bluetooth.Abstractions.Scanning.dll
Represents an exception that occurs when a characteristic is already being written to.
public class CharacteristicAlreadyWritingException : CharacteristicWriteException, ISerializable
- Inheritance
-
CharacteristicAlreadyWritingException
- Implements
- Inherited Members
Constructors
CharacteristicAlreadyWritingException(IBluetoothRemoteCharacteristic, ReadOnlyMemory<byte>?, string, Exception?)
Initializes a new instance of the CharacteristicAlreadyWritingException class.
public CharacteristicAlreadyWritingException(IBluetoothRemoteCharacteristic remoteCharacteristic, ReadOnlyMemory<byte>? value = null, string message = "Characteristic is already writing", Exception? innerException = null)
Parameters
remoteCharacteristicIBluetoothRemoteCharacteristicThe Bluetooth characteristic associated with the exception.
valueReadOnlyMemory<byte>?The value that was being written when the exception occurred.
messagestringA message that describes the error.
innerExceptionExceptionThe inner exception that caused the current exception, if any.
Methods
ThrowIfAlreadyWriting(IBluetoothRemoteCharacteristic)
Throws a CharacteristicAlreadyWritingException if the characteristic is currently being written to.
public static void ThrowIfAlreadyWriting(IBluetoothRemoteCharacteristic remoteCharacteristic)
Parameters
remoteCharacteristicIBluetoothRemoteCharacteristicThe characteristic to check.
Exceptions
- ArgumentNullException
Thrown when
remoteCharacteristicis null.- CharacteristicAlreadyWritingException
Thrown when the characteristic is already being written to.