GattSession GattSession GattSession GattSession GattSession Class


Represents a Generic Attribute Profile (GATT) session.

public : sealed class GattSession : IClosable
struct winrt::Windows::Devices::Bluetooth::GenericAttributeProfile::GattSession : IClosable
public sealed class GattSession : IDisposable
Public NotInheritable Class GattSession Implements IDisposable
// This class does not provide a public constructor.

Windows 10 requirements

Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)


CanMaintainConnection CanMaintainConnection CanMaintainConnection CanMaintainConnection CanMaintainConnection

Gets a Boolean value that indicates whether the connection can be maintained.

DeviceId DeviceId DeviceId DeviceId DeviceId

Gets the device ID.

MaintainConnection MaintainConnection MaintainConnection MaintainConnection MaintainConnection

Gets or sets a Boolean value that indicates whether the connection should be maintained.

MaxPduSize MaxPduSize MaxPduSize MaxPduSize MaxPduSize

Gets the max PDU size.

SessionStatus SessionStatus SessionStatus SessionStatus SessionStatus

Gets the session status.


Close() Close() Close() Close() Close()

Closes the GattSession.

Dispose() Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

FromDeviceIdAsync(BluetoothDeviceId) FromDeviceIdAsync(BluetoothDeviceId) FromDeviceIdAsync(BluetoothDeviceId) FromDeviceIdAsync(BluetoothDeviceId) FromDeviceIdAsync(BluetoothDeviceId)

Creates a new GattSession object from the specified deviceId.


MaxPduSizeChanged MaxPduSizeChanged MaxPduSizeChanged MaxPduSizeChanged MaxPduSizeChanged

An event that is triggered when the max PDU size changes.

SessionStatusChanged SessionStatusChanged SessionStatusChanged SessionStatusChanged SessionStatusChanged

An event that is triggered when the GATT session status has changed.