| Index: Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
|
| diff --git a/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp b/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
|
| index 35ecae79b130676c19680a0539ee8bb5b45cbb37..febc3ce2424ed8d5311b27a98d51ac3cd80d76dc 100644
|
| --- a/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
|
| +++ b/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
|
| @@ -11,6 +11,7 @@
|
| #include "core/dom/DOMException.h"
|
| #include "core/dom/ExceptionCode.h"
|
| #include "modules/bluetooth/BluetoothError.h"
|
| +#include "modules/bluetooth/ConvertWebVectorToArrayBuffer.h"
|
| #include "public/platform/Platform.h"
|
| #include "public/platform/modules/bluetooth/WebBluetooth.h"
|
| #include "wtf/OwnPtr.h"
|
| @@ -35,4 +36,15 @@ void BluetoothGATTCharacteristic::dispose(WebBluetoothGATTCharacteristic* webCha
|
| delete webCharacteristic;
|
| }
|
|
|
| +ScriptPromise BluetoothGATTCharacteristic::readValue(ScriptState* scriptState)
|
| +{
|
| + WebBluetooth* webbluetooth = Platform::current()->bluetooth();
|
| +
|
| + RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
|
| + ScriptPromise promise = resolver->promise();
|
| + webbluetooth->readValue(m_webCharacteristic->characteristicInstanceID, new CallbackPromiseAdapter<ConvertWebVectorToArrayBuffer, BluetoothError>(resolver));
|
| +
|
| + return promise;
|
| +}
|
| +
|
| } // namespace blink
|
|
|