C# Class Plugin.BLE.Abstractions.Extensions.AdapterExtenstion

显示文件 Open project: xabre/xamarin-bluetooth-le

Public Methods

Method Description
ConnectToDeviceAsync ( this adapter, IDevice device, CancellationToken cancellationToken ) : Task

Connects to the device.

DiscoverDeviceAsync ( this adapter, bool>.Func deviceFilter, CancellationToken cancellationToken = default(CancellationToken) ) : Task
DiscoverDeviceAsync ( this adapter, System.Guid deviceId, CancellationToken cancellationToken = default(CancellationToken) ) : Task
StartScanningForDevicesAsync ( this adapter, CancellationToken cancellationToken ) : Task

Starts scanning for BLE devices.

StartScanningForDevicesAsync ( this adapter, bool>.Func deviceFilter, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Starts scanning for BLE devices that fulfill the deviceFilter. DeviceDiscovered will only be called, if deviceFilter returns true for the discovered device.

StartScanningForDevicesAsync ( this adapter, System.Guid serviceUuids, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Starts scanning for BLE devices that advertise the services included in serviceUuids.

Method Details

ConnectToDeviceAsync() public static method

Connects to the device.
Thrown if the device connection fails.
public static ConnectToDeviceAsync ( this adapter, IDevice device, CancellationToken cancellationToken ) : Task
adapter this Target adapter.
device IDevice Device to connect to.
cancellationToken System.Threading.CancellationToken The token to monitor for cancellation requests. The default value is None.
return Task

DiscoverDeviceAsync() public static method

public static DiscoverDeviceAsync ( this adapter, bool>.Func deviceFilter, CancellationToken cancellationToken = default(CancellationToken) ) : Task
adapter this
deviceFilter bool>.Func
cancellationToken System.Threading.CancellationToken
return Task

DiscoverDeviceAsync() public static method

public static DiscoverDeviceAsync ( this adapter, System.Guid deviceId, CancellationToken cancellationToken = default(CancellationToken) ) : Task
adapter this
deviceId System.Guid
cancellationToken System.Threading.CancellationToken
return Task

StartScanningForDevicesAsync() public static method

Starts scanning for BLE devices.
public static StartScanningForDevicesAsync ( this adapter, CancellationToken cancellationToken ) : Task
adapter this Target adapter.
cancellationToken System.Threading.CancellationToken The token to monitor for cancellation requests.
return Task

StartScanningForDevicesAsync() public static method

Starts scanning for BLE devices that fulfill the deviceFilter. DeviceDiscovered will only be called, if deviceFilter returns true for the discovered device.
public static StartScanningForDevicesAsync ( this adapter, bool>.Func deviceFilter, CancellationToken cancellationToken = default(CancellationToken) ) : Task
adapter this Target adapter.
deviceFilter bool>.Func Function that filters the devices.
cancellationToken System.Threading.CancellationToken The token to monitor for cancellation requests. The default value is None.
return Task

StartScanningForDevicesAsync() public static method

Starts scanning for BLE devices that advertise the services included in serviceUuids.
public static StartScanningForDevicesAsync ( this adapter, System.Guid serviceUuids, CancellationToken cancellationToken = default(CancellationToken) ) : Task
adapter this Target adapter.
serviceUuids System.Guid Requested service Ids.
cancellationToken System.Threading.CancellationToken The token to monitor for cancellation requests. The default value is None.
return Task