BluetoothRemoteGATTCharacteristic: writeValue() method

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("Bluetooth API")}}{{SecureContext_Header}}

Use {{DOMxRef("BluetoothRemoteGATTCharacteristic.writeValueWithResponse()")}} and {{DOMxRef("BluetoothRemoteGATTCharacteristic.writeValueWithoutResponse()")}} instead.

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

Syntax

js-nolint
writeValue(buffer)

Parameters

  • value
  • : An {{jsxref("ArrayBuffer")}}, {{jsxref("TypedArray")}}, or {{jsxref("DataView")}}.

Return value

A {{jsxref("Promise")}}.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}