Interface IBluetoothCharacteristicAccessorListener<TRead>
- Namespace
- Bluetooth.Abstractions.Scanning.Profiles
- Assembly
- Bluetooth.Abstractions.Scanning.dll
Defines listener orchestration for a typed Bluetooth characteristic accessor.
public interface IBluetoothCharacteristicAccessorListener<TRead> : IBluetoothCharacteristicAccessor
Type Parameters
TReadThe typed value produced from notification payloads.
- Inherited Members
Methods
SubscribeAsync(IBluetoothRemoteDevice, Action<TRead>, TimeSpan?, CancellationToken)
Subscribes a typed listener to characteristic notifications.
ValueTask SubscribeAsync(IBluetoothRemoteDevice device, Action<TRead> listener, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
Parameters
deviceIBluetoothRemoteDeviceThe connected remote device that owns the characteristic.
listenerAction<TRead>The callback invoked for each decoded notification value.
timeoutTimeSpan?Optional timeout for resolution and listening operations.
cancellationTokenCancellationTokenToken used to cancel the operation.
Returns
UnsubscribeAllAsync(IBluetoothRemoteDevice, TimeSpan?, CancellationToken)
Unsubscribes all listeners from characteristic notifications.
ValueTask UnsubscribeAllAsync(IBluetoothRemoteDevice device, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
Parameters
deviceIBluetoothRemoteDeviceThe connected remote device that owns the characteristic.
timeoutTimeSpan?Optional timeout for resolution and listening operations.
cancellationTokenCancellationTokenToken used to cancel the operation.
Returns
UnsubscribeAsync(IBluetoothRemoteDevice, Action<TRead>, TimeSpan?, CancellationToken)
Unsubscribes a typed listener from characteristic notifications.
ValueTask UnsubscribeAsync(IBluetoothRemoteDevice device, Action<TRead> listener, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
Parameters
deviceIBluetoothRemoteDeviceThe connected remote device that owns the characteristic.
listenerAction<TRead>The callback to remove.
timeoutTimeSpan?Optional timeout for resolution and listening operations.
cancellationTokenCancellationTokenToken used to cancel the operation.