| Index: third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom
|
| diff --git a/third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom b/third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom
|
| index 4a25bce715013444b77a26428cb1c31372b3f213..7e8b8f69112b6bda16dfcb2db2714b314a9c802b 100644
|
| --- a/third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom
|
| +++ b/third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom
|
| @@ -156,11 +156,6 @@ struct WebBluetoothRemoteGATTDescriptor {
|
| // Web Bluetooth Interface that Blink can use to perform
|
| // Bluetooth GATT Operations on Bluetooth Devices.
|
| interface WebBluetoothService {
|
| - // Sets the client for this WebBluetoothService. The service will notify the
|
| - // client of device events e.g. when a Characteristic's value changes or when
|
| - // a device disconnects.
|
| - SetClient(associated WebBluetoothServiceClient client);
|
| -
|
| RequestDevice(WebBluetoothRequestDeviceOptions options)
|
| => (WebBluetoothResult result, WebBluetoothDevice? device);
|
|
|
| @@ -168,7 +163,11 @@ interface WebBluetoothService {
|
| // if a connection to the device didn't exist already. If a GATT connection
|
| // existed already then this function increases the ref count to keep that
|
| // connection alive.
|
| - RemoteServerConnect(WebBluetoothDeviceId device_id) => (WebBluetoothResult result);
|
| + // Returns the result of the connection request and a client request if the
|
| + // connection was successful and there was no previous WebBluetoothServerClient.
|
| + RemoteServerConnect(WebBluetoothDeviceId device_id) => (
|
| + WebBluetoothResult result,
|
| + associated WebBluetoothServerClient&? client_request);
|
|
|
| // If a GATT connection exists for Device identified by |device_id| then
|
| // decreases the ref count for that connection.
|
| @@ -219,8 +218,13 @@ interface WebBluetoothService {
|
|
|
| // Starts notifications for the characteristic identified by
|
| // |characteristic_instance_id|.
|
| + // Returns the result of the start notifications request and a client
|
| + // request if the gatt operation was successful and there was no previous
|
| + // WebBluetoothCharacteristicClient.
|
| RemoteCharacteristicStartNotifications(
|
| - string characteristic_instance_id) => (WebBluetoothResult result);
|
| + string characteristic_instance_id) => (
|
| + WebBluetoothResult result,
|
| + associated WebBluetoothCharacteristicClient&? client_request);
|
|
|
| // Stops notifications for the characteristic identified by
|
| // |characteristic_instance_id|.
|
| @@ -259,15 +263,15 @@ interface WebBluetoothService {
|
| array<uint8> value) => (WebBluetoothResult result);
|
| };
|
|
|
| -// Classes should implement this interface and pass an associated pointer
|
| -// bound to them to the WebBluetoothService by using SetClient. Classes
|
| -// that do this will be notified of device events e.g. device disconnection.
|
| -interface WebBluetoothServiceClient {
|
| - // The characteristic identified by |characteristic_instance_id| has received
|
| - // a notification of value change.
|
| - RemoteCharacteristicValueChanged(string characteristic_instance_id,
|
| - array<uint8> value);
|
| +// Classes that implement this interface will be notified of characteristic
|
| +// events.
|
| +interface WebBluetoothCharacteristicClient {
|
| + // Called when we receive a notification for the characteristic.
|
| + RemoteCharacteristicValueChanged(array<uint8> value);
|
| +};
|
|
|
| - // The device identified by |device_id| has been disconnected.
|
| - GattServerDisconnected(WebBluetoothDeviceId device_id);
|
| +// Classes that implement this interface will be notified of device events.
|
| +interface WebBluetoothServerClient {
|
| + // Called when a device disconnects.
|
| + GATTServerDisconnected();
|
| };
|
|
|