Table of Contents

Class DotNetCoreBluetoothLocalCharacteristic

Namespace
Bluetooth.Maui.Platforms.DotNetCore.Broadcasting
Assembly
Bluetooth.Maui.Platforms.DotNetCore.dll

Base class for Bluetooth broadcast characteristics.

public class DotNetCoreBluetoothLocalCharacteristic : BaseBluetoothLocalCharacteristic, IBluetoothLocalCharacteristic, INotifyPropertyChanged, IAsyncDisposable
Inheritance
DotNetCoreBluetoothLocalCharacteristic
Implements
Inherited Members

Constructors

DotNetCoreBluetoothLocalCharacteristic(IBluetoothLocalService, Guid, BluetoothCharacteristicProperties, BluetoothCharacteristicPermissions, ReadOnlyMemory<byte>?, string?, ILogger<IBluetoothLocalCharacteristic>?)

Initializes a new instance of the BaseBluetoothLocalCharacteristic class.

public DotNetCoreBluetoothLocalCharacteristic(IBluetoothLocalService service, Guid id, BluetoothCharacteristicProperties properties, BluetoothCharacteristicPermissions permissions, ReadOnlyMemory<byte>? initialValue = null, string? name = null, ILogger<IBluetoothLocalCharacteristic>? logger = null)

Parameters

service IBluetoothLocalService
id Guid
properties BluetoothCharacteristicProperties
permissions BluetoothCharacteristicPermissions
initialValue ReadOnlyMemory<byte>?
name string
logger ILogger<IBluetoothLocalCharacteristic>

Exceptions

PlatformNotSupportedException

Methods

NativeCreateDescriptorAsync(Guid, string?, TimeSpan?, CancellationToken)

Creates a new local Bluetooth descriptor with the specified parameters.

protected override ValueTask<IBluetoothLocalDescriptor> NativeCreateDescriptorAsync(Guid id, string? name = null, TimeSpan? timeout = null, CancellationToken cancellationToken = default)

Parameters

id Guid
name string
timeout TimeSpan?
cancellationToken CancellationToken

Returns

ValueTask<IBluetoothLocalDescriptor>

Exceptions

PlatformNotSupportedException

NativeUpdateValueAsync(ReadOnlyMemory<byte>, bool, TimeSpan?, CancellationToken)

Updates the value of the characteristic in the native Bluetooth stack.

protected override ValueTask NativeUpdateValueAsync(ReadOnlyMemory<byte> value, bool notifyClients, TimeSpan? timeout = null, CancellationToken cancellationToken = default)

Parameters

value ReadOnlyMemory<byte>

The new value to set for the characteristic.

notifyClients bool

Indicates whether to notify subscribed clients of the value change.

timeout TimeSpan?

An optional timeout for the operation.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

ValueTask

A task that represents the asynchronous update operation.

Exceptions

PlatformNotSupportedException