| Index: Source/modules/bluetooth/BluetoothGATTService.cpp
|
| diff --git a/Source/modules/bluetooth/BluetoothGATTService.cpp b/Source/modules/bluetooth/BluetoothGATTService.cpp
|
| index bbe5c0d7c54819e2a3362cb7e067272944072fa1..3bf710aa89b67c56c763e0c6639c18a8b5d45394 100644
|
| --- a/Source/modules/bluetooth/BluetoothGATTService.cpp
|
| +++ b/Source/modules/bluetooth/BluetoothGATTService.cpp
|
| @@ -5,7 +5,15 @@
|
| #include "config.h"
|
| #include "modules/bluetooth/BluetoothGATTService.h"
|
|
|
| -#include "public/platform/modules/bluetooth/WebBluetoothGATTRemoteServer.h"
|
| +#include "bindings/core/v8/CallbackPromiseAdapter.h"
|
| +#include "bindings/core/v8/ScriptPromise.h"
|
| +#include "bindings/core/v8/ScriptPromiseResolver.h"
|
| +#include "core/dom/DOMException.h"
|
| +#include "core/dom/ExceptionCode.h"
|
| +#include "modules/bluetooth/BluetoothError.h"
|
| +#include "modules/bluetooth/BluetoothGATTCharacteristic.h"
|
| +#include "public/platform/Platform.h"
|
| +#include "public/platform/modules/bluetooth/WebBluetooth.h"
|
| #include "wtf/OwnPtr.h"
|
|
|
| namespace blink {
|
| @@ -28,4 +36,16 @@ void BluetoothGATTService::dispose(WebBluetoothGATTService* webService)
|
| delete webService;
|
| }
|
|
|
| +ScriptPromise BluetoothGATTService::getCharacteristic(ScriptState* scriptState,
|
| + String characteristicUUID)
|
| +{
|
| + WebBluetooth* webbluetooth = Platform::current()->bluetooth();
|
| +
|
| + RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
|
| + ScriptPromise promise = resolver->promise();
|
| + webbluetooth->getCharacteristic(m_webService->serviceInstanceID, characteristicUUID, new CallbackPromiseAdapter<BluetoothGATTCharacteristic, BluetoothError>(resolver));
|
| +
|
| + return promise;
|
| +}
|
| +
|
| } // namespace blink
|
|
|