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
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
IsConnected
Indicates whether the client device is currently connected.
bool IsConnected { get; }
Property Value
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
Name
Gets the name of the connected client device.
string? Name { get; }
Property Value
SubscribedCharacteristics
Gets the list of broadcast characteristics this client device is subscribed to.
IReadOnlyList<IBluetoothLocalCharacteristic> SubscribedCharacteristics { get; }
Property Value
Methods
AddCharacteristicSubscription(IBluetoothLocalCharacteristic)
Adds a subscription to a broadcast characteristic for this client device.
void AddCharacteristicSubscription(IBluetoothLocalCharacteristic localCharacteristic)
Parameters
localCharacteristicIBluetoothLocalCharacteristic
DisconnectAsync(TimeSpan?, CancellationToken)
Disconnects the client device from the broadcaster.
ValueTask DisconnectAsync(TimeSpan? timeout = null, CancellationToken cancellationToken = default)
Parameters
timeoutTimeSpan?An optional timeout for the disconnection operation.
cancellationTokenCancellationTokenAn optional cancellation token to cancel the disconnection operation.
Returns
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
localCharacteristicIBluetoothLocalCharacteristic
Events
Connected
Event raised when the client device successfully connects to the broadcaster.
event EventHandler Connected
Event Type
Disconnected
Event raised when the client device disconnects from the broadcaster.
event EventHandler Disconnected
Event Type
MtuChanged
Event raised when the MTU changes for this client connection.
event EventHandler<MtuChangedEventArgs>? MtuChanged