此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

BluetoothRemoteGATTCharacteristic:writeValue() 方法

Deprecated

Avoid using this feature in new projects. This feature may be a candidate for removal from web standards or browsers.

安全上下文: 此特性仅在一些支持的浏览器安全上下文(HTTPS)中可用。

请改用 BluetoothRemoteGATTCharacteristic.writeValueWithResponse()BluetoothRemoteGATTCharacteristic.writeValueWithoutResponse()

BluetoothRemoteGATTCharacteristic.writeValue() 方法将一个 BluetoothRemoteGATTCharacteristic 对象的 value 属性设置为给定的 ArrayBuffer 中包含的字节,使用可选响应写入特性值,并返回 Promise