Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1323)

Unified Diff: third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom

Issue 2466223002: Implement WebBluetooth getDescriptor[s] (Closed)
Patch Set: Ensure that we throw a kGattServerNotConnected error if getDescriptor[s] is called while not connec… Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 c641728ca7719b88caac7fe76d7ab9c7c8cc9add..4a3c8270824388088a7f10af51e83ab870c6d737 100644
--- a/third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom
+++ b/third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom
@@ -20,6 +20,7 @@ enum WebBluetoothResult {
// InvalidStateError:
SERVICE_NO_LONGER_EXISTS,
CHARACTERISTIC_NO_LONGER_EXISTS,
+ DESCRIPTOR_NO_LONGER_EXISTS,
// NetworkError:
CONNECT_ALREADY_IN_PROGRESS,
CONNECT_ATTRIBUTE_LENGTH_INVALID,
@@ -51,6 +52,8 @@ enum WebBluetoothResult {
NO_SERVICES_FOUND,
CHARACTERISTIC_NOT_FOUND,
NO_CHARACTERISTICS_FOUND,
+ DESCRIPTOR_NOT_FOUND,
+ NO_DESCRIPTORS_FOUND,
WEB_BLUETOOTH_NOT_SUPPORTED,
BLUETOOTH_LOW_ENERGY_NOT_AVAILABLE,
// NotSupportedError:
@@ -61,6 +64,7 @@ enum WebBluetoothResult {
GATT_UNTRANSLATED_ERROR_CODE,
// SecurityError:
GATT_NOT_AUTHORIZED,
+ BLACKLISTED_DESCRIPTOR_UUID,
BLACKLISTED_CHARACTERISTIC_UUID,
BLACKLISTED_READ,
BLACKLISTED_WRITE,
@@ -108,6 +112,11 @@ struct WebBluetoothRemoteGATTCharacteristic {
uint32 properties;
};
+struct WebBluetoothRemoteGATTDescriptor {
+ string instance_id;
+ string uuid;
+};
+
// Web Bluetooth Interface that Blink can use to perform
// Bluetooth GATT Operations on Bluetooth Devices.
interface WebBluetoothService {
@@ -177,6 +186,34 @@ interface WebBluetoothService {
// |characteristic_instance_id|.
RemoteCharacteristicStopNotifications(
string characteristic_instance_id) => ();
+
+ // Returns the Descriptors of a GATT Characteristics with |service_instance_id|.
+ // If |quantity| == WebBluetoothGATTQueryQuantity::SINGLE, only one
+ // descriptor will be returned.
+ RemoteCharacteristicGetDescriptors(
+ string characteristics_instance_id,
+ WebBluetoothGATTQueryQuantity quantity,
+ bluetooth.mojom.UUID? characteristics_uuid) => (
+ WebBluetoothResult result,
+ array<WebBluetoothRemoteGATTDescriptor>? descriptors);
+
+ // Reads the value for descriptor with
+ // |descriptor_instance_id|. If the value is successfully read the
+ // callback will be run with WebBluetoothResult::SUCCESS and the
+ // descriptor's value. If the value is not successfully read the
+ // callback with be run with the corresponding error and nullptr for value.
+ RemoteDescriptorReadValue(
+ string descriptor_instance_id) => (
+ WebBluetoothResult result,
+ array<uint8>? value);
+
+ // Writes a value to the descriptor with
+ // |descriptor_instance_id|. The callback is run with
+ // WebBluetoothResult::SUCCESS if the value was successfully
+ // written.
+ RemoteDescriptorWriteValue(
+ string descriptor_instance_id,
+ array<uint8> value) => (WebBluetoothResult result);
};
// Classes should implement this interface and pass an associated pointer
@@ -185,5 +222,7 @@ interface WebBluetoothService {
interface WebBluetoothServiceClient {
RemoteCharacteristicValueChanged(string characteristic_instance_id,
array<uint8> value);
+ RemoteDescriptorValueChanged(string descriptor_instance_id,
ortuno 2016/11/21 03:34:09 I don't think we need this. We do it for character
dougt 2016/11/22 01:47:17 Acknowledged.
+ array<uint8> value);
GattServerDisconnected(WebBluetoothDeviceId device_id);
};

Powered by Google App Engine
This is Rietveld 408576698