Interface IBluetoothLocalDescriptor
- Namespace
- Bluetooth.Abstractions.Broadcasting
- Assembly
- Bluetooth.Abstractions.Broadcasting.dll
Represents a descriptor in the context of Bluetooth broadcasting. Descriptors provide additional information about a characteristic.
public interface IBluetoothLocalDescriptor : INotifyPropertyChanged, IAsyncDisposable
- Inherited Members
Properties
Characteristic
Gets the Bluetooth characteristic hosting this descriptor.
IBluetoothLocalCharacteristic Characteristic { get; }
Property Value
Id
Gets the unique identifier of the descriptor. This is typically a UUID that distinguishes this descriptor from others in the Bluetooth broadcasting context.
Guid Id { get; }
Property Value
Name
Gets the name of the descriptor.
string Name { get; }
Property Value
Value
Gets the value of the descriptor as a read-only memory segment. Useful for asynchronous operations.
ReadOnlyMemory<byte> Value { get; }
Property Value
ValueSpan
Gets the value of the descriptor as a read-only span. Useful for high-performance scenarios.
ReadOnlySpan<byte> ValueSpan { get; }
Property Value
Methods
UpdateValueAsync(ReadOnlyMemory<byte>, TimeSpan?, CancellationToken)
Updates the value of a hosted descriptor.
ValueTask UpdateValueAsync(ReadOnlyMemory<byte> value, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
Parameters
valueReadOnlyMemory<byte>The new value.
timeoutTimeSpan?The timeout for this operation
cancellationTokenCancellationTokenA cancellation token to cancel this operation.
Returns
- ValueTask
A task that represents the asynchronous operation.
Events
ReadRequested
Event raised when a client device requests to read this descriptor.
event EventHandler<DescriptorReadRequestEventArgs>? ReadRequested
Event Type
WriteRequested
Event raised when a client device requests to write to this descriptor.
event EventHandler<DescriptorWriteRequestEventArgs>? WriteRequested