Table of Contents

Class BluetoothRemoteGATTCharacteristic

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The BluetoothRemoteGattCharacteristic interface of the Web Bluetooth API represents a GATT Characteristic, which is a basic data element that provides further information about a peripheral's service.
[Value("BluetoothRemoteGATTCharacteristic")]
public class BluetoothRemoteGATTCharacteristic : EventTarget, CharacteristicEventHandlers
Inheritance
BluetoothRemoteGATTCharacteristic
Implements
Inherited Members

Remarks

Constructors

BluetoothRemoteGATTCharacteristic()

public BluetoothRemoteGATTCharacteristic()

Properties

Properties

NOTE
Experimental
The BluetoothRemoteGATTCharacteristic.properties
read-only property returns a 'BluetoothCharacteristicProperties' instance
containing the properties of this characteristic.
[Value("properties")]
public BluetoothCharacteristicProperties Properties { get; }

Property Value

BluetoothCharacteristicProperties

The properties of this characteristic.

Remarks

Service

NOTE
Experimental
The BluetoothRemoteGATTCharacteristic.service read-only
property returns the BluetoothRemoteGATTService this characteristic belongs to.
[Value("service")]
public BluetoothRemoteGATTService Service { get; }

Property Value

BluetoothRemoteGATTService

An instance BluetoothRemoteGATTService.

Remarks

Uuid

NOTE
Experimental
The BluetoothRemoteGATTCharacteristic.uuid read-only
property returns a string containing the UUID of the characteristic, for
example '00002a37-0000-1000-8000-00805f9b34fb' for the Heart Rate
Measurement characteristic.
[Value("uuid")]
public string Uuid { get; }

Property Value

string

A string.

Remarks

Value

NOTE
Experimental
The BluetoothRemoteGATTCharacteristic.value read-only
property returns currently cached characteristic value. This value gets updated when the
value of the characteristic is read or updated via a notification or indication.
[Value("value")]
public DataView? Value { get; }

Property Value

DataView

The currently cached characteristic value.

Remarks

Methods

GetDescriptor(Union178)

NOTE
Experimental
The BluetoothRemoteGATTCharacteristic.getDescriptor() method
returns a Promise that resolves to the
first BluetoothRemoteGATTDescriptor for a given descriptor UUID.
[Value("getDescriptor")]
public Task<BluetoothRemoteGATTDescriptor> GetDescriptor(Union178 descriptor)

Parameters

descriptor Union178

Returns

Task<BluetoothRemoteGATTDescriptor>

A Promise that resolves to the
first BluetoothRemoteGATTDescriptor.

Remarks

GetDescriptors(Union178)

NOTE
Experimental
The BluetoothRemoteGATTCharacteristic.getDescriptors() method
returns a Promise that resolves to an Array of all
BluetoothRemoteGATTDescriptor objects for a given descriptor UUID.
[Value("getDescriptors")]
public Task<List<BluetoothRemoteGATTDescriptor>> GetDescriptors(Union178 descriptor = default)

Parameters

descriptor Union178

Returns

Task<List<BluetoothRemoteGATTDescriptor>>

A Promise that resolves to an Array
of BluetoothRemoteGATTDescriptor objects.

Remarks

ReadValue()

NOTE
Experimental
The BluetoothRemoteGATTCharacteristic.readValue() method
returns a Promise that resolves to a DataView holding a
duplicate of the value property if it is available and supported. Otherwise
it throws an error.
[Value("readValue")]
public Task<DataView> ReadValue()

Returns

Task<DataView>

A Promise that resolves to a DataView.

Remarks

StartNotifications()

NOTE
Experimental
The BluetoothRemoteGATTCharacteristic.startNotifications() method
returns a Promise to the BluetoothRemoteGATTCharacteristic instance when
there is an active notification on it.
[Value("startNotifications")]
public Task<BluetoothRemoteGATTCharacteristic> StartNotifications()

Returns

Task<BluetoothRemoteGATTCharacteristic>

A Promise to the BluetoothRemoteGATTCharacteristic instance.

Remarks

StopNotifications()

NOTE
Experimental
The BluetoothRemoteGATTCharacteristic.stopNotifications() method
returns a Promise to the BluetoothRemoteGATTCharacteristic instance when
there is no longer an active notification on it.
[Value("stopNotifications")]
public Task<BluetoothRemoteGATTCharacteristic> StopNotifications()

Returns

Task<BluetoothRemoteGATTCharacteristic>

A Promise.

Remarks

WriteValue(Union224)

[Value("writeValue")]
public Task<GlobalObject.Undefined> WriteValue(Union224 value)

Parameters

value Union224

Returns

Task<GlobalObject.Undefined>

A Promise.

Remarks

The BluetoothRemoteGATTCharacteristic.writeValue() method sets a BluetoothRemoteGATTCharacteristic object's value property to the bytes contained in a given ArrayBuffer, TypedArray, or DataView, writes the characteristic value with optional response, and returns the resulting Promise.

See also on MDN

WriteValueWithResponse(Union224)

NOTE
Experimental
The BluetoothRemoteGATTCharacteristic.writeValueWithResponse() method sets a BluetoothRemoteGATTCharacteristic object's value property to the bytes contained in a given ArrayBuffer, TypedArray, or DataView, writes the characteristic value with required response, and returns the resulting Promise.
[Value("writeValueWithResponse")]
public Task<GlobalObject.Undefined> WriteValueWithResponse(Union224 value)

Parameters

value Union224

Returns

Task<GlobalObject.Undefined>

A Promise.

Remarks

WriteValueWithoutResponse(Union224)

NOTE
Experimental
The BluetoothRemoteGATTCharacteristic.writeValueWithoutResponse() method sets a BluetoothRemoteGATTCharacteristic object's value property to the bytes contained in a given ArrayBuffer, TypedArray, or DataView, writes the characteristic value without response, and returns the resulting Promise.
[Value("writeValueWithoutResponse")]
public Task<GlobalObject.Undefined> WriteValueWithoutResponse(Union224 value)

Parameters

value Union224

Returns

Task<GlobalObject.Undefined>

A Promise.

Remarks