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
serviceIBluetoothLocalServiceidGuidpropertiesBluetoothCharacteristicPropertiespermissionsBluetoothCharacteristicPermissionsinitialValueReadOnlyMemory<byte>?namestringloggerILogger<IBluetoothLocalCharacteristic>
Exceptions
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
idGuidnamestringtimeoutTimeSpan?cancellationTokenCancellationToken
Returns
Exceptions
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
valueReadOnlyMemory<byte>The new value to set for the characteristic.
notifyClientsboolIndicates whether to notify subscribed clients of the value change.
timeoutTimeSpan?An optional timeout for the operation.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- ValueTask
A task that represents the asynchronous update operation.