| Index: third_party/WebKit/public/platform/modules/bluetooth/WebBluetooth.h
|
| diff --git a/third_party/WebKit/public/platform/modules/bluetooth/WebBluetooth.h b/third_party/WebKit/public/platform/modules/bluetooth/WebBluetooth.h
|
| index 13da332c1627ae53a12a5331fe94792a2f19ecd1..ed8228989bede31dba6d34c36814ac2876915d8b 100644
|
| --- a/third_party/WebKit/public/platform/modules/bluetooth/WebBluetooth.h
|
| +++ b/third_party/WebKit/public/platform/modules/bluetooth/WebBluetooth.h
|
| @@ -15,9 +15,11 @@ namespace blink {
|
|
|
| class WebBluetoothDevice;
|
| class WebBluetoothRemoteGATTCharacteristic;
|
| +class WebBluetoothRemoteGATTDescriptor;
|
|
|
| struct WebBluetoothDeviceInit;
|
| struct WebBluetoothRemoteGATTCharacteristicInit;
|
| +struct WebBluetoothRemoteGATTDescriptorInit;
|
| struct WebBluetoothRemoteGATTService;
|
| struct WebRequestDeviceOptions;
|
|
|
| @@ -41,6 +43,11 @@ using WebBluetoothGetCharacteristicsCallbacks = WebCallbacks<
|
| const WebVector<WebBluetoothRemoteGATTCharacteristicInit*>&,
|
| int32_t /* Corresponds to WebBluetoothResult in web_bluetooth.mojom */>;
|
|
|
| +// Success and failure callbacks for getDescriptor(s).
|
| +using WebBluetoothGetDescriptorsCallbacks = WebCallbacks<
|
| + const WebVector<WebBluetoothRemoteGATTDescriptorInit*>&,
|
| + int32_t /* Corresponds to WebBluetoothResult in web_bluetooth.mojom */>;
|
| +
|
| // Success and failure callbacks for readValue.
|
| using WebBluetoothReadValueCallbacks = WebCallbacks<
|
| const WebVector<uint8_t>&,
|
| @@ -96,15 +103,32 @@ class WebBluetooth {
|
| // BluetoothRemoteGATTCharacteristic methods:
|
| // See
|
| // https://webbluetoothchrome.github.io/web-bluetooth/#bluetoothgattcharacteristic
|
| - virtual void readValue(const WebString& characteristicInstanceID,
|
| - WebBluetoothReadValueCallbacks*) {}
|
| - virtual void writeValue(const WebString& characteristicInstanceID,
|
| - const WebVector<uint8_t>& value,
|
| - WebBluetoothWriteValueCallbacks*) {}
|
| + virtual void characteristicReadValue(
|
| + const WebString& characteristicInstanceID,
|
| + WebBluetoothReadValueCallbacks*) {}
|
| + virtual void characteristicWriteValue(
|
| + const WebString& characteristicInstanceID,
|
| + const WebVector<uint8_t>& value,
|
| + WebBluetoothWriteValueCallbacks*) {}
|
| virtual void startNotifications(const WebString& characteristicInstanceID,
|
| WebBluetoothNotificationsCallbacks*) {}
|
| virtual void stopNotifications(const WebString& characteristicInstanceID,
|
| WebBluetoothNotificationsCallbacks*) {}
|
| + virtual void getDescriptors(
|
| + const WebString& serviceInstanceID,
|
| + // Corresponds to WebBluetoothGATTQueryQuantity in web_bluetooth.mojom
|
| + int32_t quantity,
|
| + const WebString& descriptorsUUID,
|
| + WebBluetoothGetDescriptorsCallbacks*) = 0;
|
| +
|
| + // BluetoothRemoteGATTDescriptor methods:
|
| + // See
|
| + // https://webbluetoothchrome.github.io/web-bluetooth/#bluetoothgattdescriptor
|
| + virtual void descriptorReadValue(const WebString& descriptorInstanceID,
|
| + WebBluetoothReadValueCallbacks*) {}
|
| + virtual void descriptorWriteValue(const WebString& descriptorInstanceID,
|
| + const WebVector<uint8_t>& value,
|
| + WebBluetoothWriteValueCallbacks*) {}
|
|
|
| // Called when addEventListener is called on a characteristic.
|
| virtual void registerCharacteristicObject(
|
| @@ -113,6 +137,12 @@ class WebBluetooth {
|
| virtual void characteristicObjectRemoved(
|
| const WebString& characteristicInstanceID,
|
| WebBluetoothRemoteGATTCharacteristic*) {}
|
| +
|
| + // Called when addEventListener is called on a descriptor.
|
| + virtual void registerDescriptorObject(const WebString& descriptorInstanceID,
|
| + WebBluetoothRemoteGATTDescriptor*) = 0;
|
| + virtual void descriptorObjectRemoved(const WebString& descriptorInstanceID,
|
| + WebBluetoothRemoteGATTDescriptor*) {}
|
| };
|
|
|
| } // namespace blink
|
|
|