GattSession GattSession GattSession GattSession Class

Definition

This class represents a GATT session.

public : sealed class GattSession : IGattSession, IClosablepublic sealed class GattSession : IGattSession, IDisposablePublic NotInheritable Class GattSession Implements IGattSession, IDisposable// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Properties

CanMaintainConnection CanMaintainConnection CanMaintainConnection CanMaintainConnection

Gets a boolean that indicates if the connection can be maintained.

public : PlatForm::Boolean CanMaintainConnection { get; }public bool CanMaintainConnection { get; }Public ReadOnly Property CanMaintainConnection As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

A boolean that indicates if the connection can be maintained.

DeviceId DeviceId DeviceId DeviceId

Gets the device ID.

public : BluetoothDeviceId DeviceId { get; }public BluetoothDeviceId DeviceId { get; }Public ReadOnly Property DeviceId As BluetoothDeviceId// You can use this property in JavaScript.

MaintainConnection MaintainConnection MaintainConnection MaintainConnection

Gets or sets a boolean that indicates if the connection should be maintained.

public : PlatForm::Boolean MaintainConnection { get; set; }public bool MaintainConnection { get; set; }Public ReadWrite Property MaintainConnection As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

A boolean that indicates if the connection should be maintained.

MaxPduSize MaxPduSize MaxPduSize MaxPduSize

Gets the max PDU size.

public : ushort MaxPduSize { get; }public ushort MaxPduSize { get; }Public ReadOnly Property MaxPduSize As ushort// You can use this property in JavaScript.
Value
ushort ushort ushort ushort

The max PDU size.

SessionStatus SessionStatus SessionStatus SessionStatus

Gets the session status.

public : GattSessionStatus SessionStatus { get; }public GattSessionStatus SessionStatus { get; }Public ReadOnly Property SessionStatus As GattSessionStatus// You can use this property in JavaScript.

Methods

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

Closes the GattSession.

public : void Close()This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.

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

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

This member is not implemented in C++void Dispose()Sub Disposevoid Dispose()

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

Creates a new GattSession object from the specified deviceId.

public : static IAsyncOperation<GattSession> FromDeviceIdAsync(BluetoothDeviceId deviceId)public static IAsyncOperation<GattSession> FromDeviceIdAsync(BluetoothDeviceId deviceId)Public Static Function FromDeviceIdAsync(deviceId As BluetoothDeviceId) As IAsyncOperation( Of GattSession )// You can use this method in JavaScript.
Parameters
Returns

An asynchronous operation that completes with a new GattSession object.

Events

MaxPduSizeChanged MaxPduSizeChanged MaxPduSizeChanged MaxPduSizeChanged

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

public : event TypedEventHandler MaxPduSizeChanged<GattSession,  object>public event TypedEventHandler MaxPduSizeChanged<GattSession,  object>Public Event MaxPduSizeChanged<GattSession,  object>// You can use this event in JavaScript.

SessionStatusChanged SessionStatusChanged SessionStatusChanged SessionStatusChanged

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

public : event TypedEventHandler SessionStatusChanged<GattSession,  GattSessionStatusChangedEventArgs>public event TypedEventHandler SessionStatusChanged<GattSession,  GattSessionStatusChangedEventArgs>Public Event SessionStatusChanged<GattSession,  GattSessionStatusChangedEventArgs>// You can use this event in JavaScript.