Table of Contents

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

TRead

The 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

device IBluetoothRemoteDevice

The connected remote device that owns the characteristic.

listener Action<TRead>

The callback invoked for each decoded notification value.

timeout TimeSpan?

Optional timeout for resolution and listening operations.

cancellationToken CancellationToken

Token used to cancel the operation.

Returns

ValueTask

UnsubscribeAllAsync(IBluetoothRemoteDevice, TimeSpan?, CancellationToken)

Unsubscribes all listeners from characteristic notifications.

ValueTask UnsubscribeAllAsync(IBluetoothRemoteDevice device, TimeSpan? timeout = null, CancellationToken cancellationToken = default)

Parameters

device IBluetoothRemoteDevice

The connected remote device that owns the characteristic.

timeout TimeSpan?

Optional timeout for resolution and listening operations.

cancellationToken CancellationToken

Token used to cancel the operation.

Returns

ValueTask

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

device IBluetoothRemoteDevice

The connected remote device that owns the characteristic.

listener Action<TRead>

The callback to remove.

timeout TimeSpan?

Optional timeout for resolution and listening operations.

cancellationToken CancellationToken

Token used to cancel the operation.

Returns

ValueTask