Table of Contents

Interface IBluetoothConnectedDevice

Namespace
Bluetooth.Abstractions.Broadcasting
Assembly
Bluetooth.Abstractions.Broadcasting.dll

Represents a Bluetooth device that has connected to a broadcast (GATT server).

public interface IBluetoothConnectedDevice : INotifyPropertyChanged, IAsyncDisposable
Inherited Members

Properties

Broadcaster

Gets the Bluetooth broadcaster hosting this service.

IBluetoothBroadcaster Broadcaster { get; }

Property Value

IBluetoothBroadcaster

Id

Gets the unique identifier of the connected client device. This is typically a string that distinguishes this client device from others in the Bluetooth broadcasting context, such as a MAC address or a custom identifier assigned by the platform.

string Id { get; }

Property Value

string

IsConnected

Indicates whether the client device is currently connected.

bool IsConnected { get; }

Property Value

bool

Mtu

Gets the current Maximum Transmission Unit (MTU) for this client connection. The MTU determines the maximum size of a single packet that can be sent.

int Mtu { get; }

Property Value

int

Name

Gets the name of the connected client device.

string? Name { get; }

Property Value

string

SubscribedCharacteristics

Gets the list of broadcast characteristics this client device is subscribed to.

IReadOnlyList<IBluetoothLocalCharacteristic> SubscribedCharacteristics { get; }

Property Value

IReadOnlyList<IBluetoothLocalCharacteristic>

Methods

AddCharacteristicSubscription(IBluetoothLocalCharacteristic)

Adds a subscription to a broadcast characteristic for this client device.

void AddCharacteristicSubscription(IBluetoothLocalCharacteristic localCharacteristic)

Parameters

localCharacteristic IBluetoothLocalCharacteristic

DisconnectAsync(TimeSpan?, CancellationToken)

Disconnects the client device from the broadcaster.

ValueTask DisconnectAsync(TimeSpan? timeout = null, CancellationToken cancellationToken = default)

Parameters

timeout TimeSpan?

An optional timeout for the disconnection operation.

cancellationToken CancellationToken

An optional cancellation token to cancel the disconnection operation.

Returns

ValueTask

RemoveAllCharacteristicSubscriptions()

Removes all characteristic subscriptions for this client device.

void RemoveAllCharacteristicSubscriptions()

RemoveCharacteristicSubscription(IBluetoothLocalCharacteristic)

Removes a subscription to a broadcast characteristic for this client device.

void RemoveCharacteristicSubscription(IBluetoothLocalCharacteristic localCharacteristic)

Parameters

localCharacteristic IBluetoothLocalCharacteristic

Events

Connected

Event raised when the client device successfully connects to the broadcaster.

event EventHandler Connected

Event Type

EventHandler

Disconnected

Event raised when the client device disconnects from the broadcaster.

event EventHandler Disconnected

Event Type

EventHandler

MtuChanged

Event raised when the MTU changes for this client connection.

event EventHandler<MtuChangedEventArgs>? MtuChanged

Event Type

EventHandler<MtuChangedEventArgs>