MetaWear C# SDK  1.2.0
C# API for MbientLab's sensor platform
Public Member Functions | Properties | List of all members
MbientLab.MetaWear.Impl.Platform.IBluetoothLeGatt Interface Reference

Bluetooth GATT operations used by the API, must be implemented by the target platform. More...

Public Member Functions

Task DiscoverServicesAsync ()
 Discover GATT services and characteristics avaiable on the remote device More...
 
Task< bool > ServiceExistsAsync (Guid serviceGuid)
 Checks if a GATT service exists More...
 
Task< byte[]> ReadCharacteristicAsync (Tuple< Guid, Guid > gattChar)
 Reads the requested characteristic's value More...
 
Task WriteCharacteristicAsync (Tuple< Guid, Guid > gattChar, GattCharWriteType writeType, byte[] value)
 Writes a GATT characteristic and its value to the remote device More...
 
Task EnableNotificationsAsync (Tuple< Guid, Guid > gattChar, Action< byte[]> handler)
 Enable notifications for the characteristic More...
 
Task DisconnectAsync ()
 Closes the Bluetooth LE connection More...
 

Properties

ulong BluetoothAddress [get]
 Device's mac address, as an unsigned long More...
 
Action OnDisconnect [get, set]
 Handler to process disconnect events More...
 

Detailed Description

Bluetooth GATT operations used by the API, must be implemented by the target platform.

Before interacting with any of the characteristics, users must first call DiscoverServicesAsync

Member Function Documentation

◆ DisconnectAsync()

Task MbientLab.MetaWear.Impl.Platform.IBluetoothLeGatt.DisconnectAsync ( )

Closes the Bluetooth LE connection

Returns
Null when connection is lost

◆ DiscoverServicesAsync()

Task MbientLab.MetaWear.Impl.Platform.IBluetoothLeGatt.DiscoverServicesAsync ( )

Discover GATT services and characteristics avaiable on the remote device

Returns
Null when discovery is completed

◆ EnableNotificationsAsync()

Task MbientLab.MetaWear.Impl.Platform.IBluetoothLeGatt.EnableNotificationsAsync ( Tuple< Guid, Guid >  gattChar,
Action< byte[]>  handler 
)

Enable notifications for the characteristic

Parameters
gattCharCharacteristic to enable notifications for
handlerListener for handling characteristic notifications
Returns
Null when the task is completed

◆ ReadCharacteristicAsync()

Task<byte[]> MbientLab.MetaWear.Impl.Platform.IBluetoothLeGatt.ReadCharacteristicAsync ( Tuple< Guid, Guid >  gattChar)

Reads the requested characteristic's value

Parameters
gattCharCharacteristic to read
Returns
Characteristic's value

◆ ServiceExistsAsync()

Task<bool> MbientLab.MetaWear.Impl.Platform.IBluetoothLeGatt.ServiceExistsAsync ( Guid  serviceGuid)

Checks if a GATT service exists

Parameters
serviceGuidUUID identifying the service to lookup
Returns
True if service exists, false if not

◆ WriteCharacteristicAsync()

Task MbientLab.MetaWear.Impl.Platform.IBluetoothLeGatt.WriteCharacteristicAsync ( Tuple< Guid, Guid >  gattChar,
GattCharWriteType  writeType,
byte []  value 
)

Writes a GATT characteristic and its value to the remote device

Parameters
gattCharGATT characteristic to write
writeTypeType of GATT write to use
valueValue to be written
Returns
Null when the task is completed

Property Documentation

◆ BluetoothAddress

ulong MbientLab.MetaWear.Impl.Platform.IBluetoothLeGatt.BluetoothAddress
get

Device's mac address, as an unsigned long

◆ OnDisconnect

Action MbientLab.MetaWear.Impl.Platform.IBluetoothLeGatt.OnDisconnect
getset

Handler to process disconnect events


The documentation for this interface was generated from the following file: