Class BluetoothRemoteGATTCharacteristic
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalBluetoothRemoteGattCharacteristic 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
ExperimentalBluetoothRemoteGATTCharacteristic.propertiesread-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
ExperimentalBluetoothRemoteGATTCharacteristic.service read-onlyproperty returns the BluetoothRemoteGATTService this characteristic belongs to.
[Value("service")]
public BluetoothRemoteGATTService Service { get; }
Property Value
- BluetoothRemoteGATTService
An instance BluetoothRemoteGATTService.
Remarks
Uuid
NOTE
ExperimentalBluetoothRemoteGATTCharacteristic.uuid read-onlyproperty returns a string containing the UUID of the characteristic, for
example
'00002a37-0000-1000-8000-00805f9b34fb' for the Heart RateMeasurement characteristic.
[Value("uuid")]
public string Uuid { get; }
Property Value
- string
A string.
Remarks
Value
NOTE
ExperimentalBluetoothRemoteGATTCharacteristic.value read-onlyproperty 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
ExperimentalBluetoothRemoteGATTCharacteristic.getDescriptor() methodreturns a Promise that resolves to the
first BluetoothRemoteGATTDescriptor for a given descriptor UUID.
[Value("getDescriptor")]
public Task<BluetoothRemoteGATTDescriptor> GetDescriptor(Union178 descriptor)
Parameters
descriptorUnion178
Returns
- Task<BluetoothRemoteGATTDescriptor>
A Promise that resolves to the
first BluetoothRemoteGATTDescriptor.
Remarks
GetDescriptors(Union178)
NOTE
ExperimentalBluetoothRemoteGATTCharacteristic.getDescriptors() methodreturns 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
descriptorUnion178
Returns
- Task<List<BluetoothRemoteGATTDescriptor>>
A Promise that resolves to an Array
of BluetoothRemoteGATTDescriptor objects.
Remarks
ReadValue()
NOTE
ExperimentalBluetoothRemoteGATTCharacteristic.readValue() methodreturns a Promise that resolves to a DataView holding a
duplicate of the
value property if it is available and supported. Otherwiseit throws an error.
[Value("readValue")]
public Task<DataView> ReadValue()
Returns
Remarks
StartNotifications()
NOTE
ExperimentalBluetoothRemoteGATTCharacteristic.startNotifications() methodreturns 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
ExperimentalBluetoothRemoteGATTCharacteristic.stopNotifications() methodreturns a Promise to the BluetoothRemoteGATTCharacteristic instance when
there is no longer an active notification on it.
[Value("stopNotifications")]
public Task<BluetoothRemoteGATTCharacteristic> StopNotifications()
Returns
Remarks
WriteValue(Union224)
IMPORTANT
Deprecated[Value("writeValue")]
public Task<GlobalObject.Undefined> WriteValue(Union224 value)
Parameters
valueUnion224
Returns
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.
WriteValueWithResponse(Union224)
NOTE
ExperimentalBluetoothRemoteGATTCharacteristic.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
valueUnion224
Returns
Remarks
WriteValueWithoutResponse(Union224)
NOTE
ExperimentalBluetoothRemoteGATTCharacteristic.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
valueUnion224