Class DotNetCoreBluetoothLocalDescriptor
- Namespace
- Bluetooth.Maui.Platforms.DotNetCore.Broadcasting
- Assembly
- Bluetooth.Maui.Platforms.DotNetCore.dll
Base class for Bluetooth broadcast descriptors.
public class DotNetCoreBluetoothLocalDescriptor : BaseBluetoothLocalDescriptor, IBluetoothLocalDescriptor, INotifyPropertyChanged, IAsyncDisposable
- Inheritance
-
DotNetCoreBluetoothLocalDescriptor
- Implements
- Inherited Members
Constructors
DotNetCoreBluetoothLocalDescriptor(IBluetoothLocalCharacteristic, Guid, ReadOnlyMemory<byte>?, string?, ILogger<IBluetoothLocalDescriptor>?)
Initializes a new instance of the BaseBluetoothLocalDescriptor class.
public DotNetCoreBluetoothLocalDescriptor(IBluetoothLocalCharacteristic characteristic, Guid id, ReadOnlyMemory<byte>? initialValue = null, string? name = null, ILogger<IBluetoothLocalDescriptor>? logger = null)
Parameters
characteristicIBluetoothLocalCharacteristicThe local characteristic this descriptor belongs to.
idGuidThe unique identifier of the descriptor.
initialValueReadOnlyMemory<byte>?The initial value of the descriptor (optional).
namestringThe name of the descriptor (optional).
loggerILogger<IBluetoothLocalDescriptor>Optional logger for logging descriptor operations.
Exceptions
Methods
NativeUpdateValueAsync(ReadOnlyMemory<byte>, TimeSpan?, CancellationToken)
Updates the value of the descriptor in the native Bluetooth stack.
protected override ValueTask NativeUpdateValueAsync(ReadOnlyMemory<byte> value, TimeSpan? timeout, CancellationToken cancellationToken)
Parameters
valueReadOnlyMemory<byte>The new value to set for the descriptor.
timeoutTimeSpan?An optional timeout for the operation.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- ValueTask
A task that represents the asynchronous update operation.