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

Unified Diff: content/renderer/bluetooth/web_bluetooth_impl.h

Issue 2466223002: Implement WebBluetooth getDescriptor[s] (Closed)
Patch Set: Rebase Created 4 years 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: content/renderer/bluetooth/web_bluetooth_impl.h
diff --git a/content/renderer/bluetooth/web_bluetooth_impl.h b/content/renderer/bluetooth/web_bluetooth_impl.h
index 431a4e4ae004b9b71c9db060d756474c0bbbc14a..55371fd0912abc25b1bccfef7ac7ba22f75cb1b8 100644
--- a/content/renderer/bluetooth/web_bluetooth_impl.h
+++ b/content/renderer/bluetooth/web_bluetooth_impl.h
@@ -64,11 +64,13 @@ class CONTENT_EXPORT WebBluetoothImpl
web_bluetooth.mojom */,
const blink::WebString& characteristics_uuid,
blink::WebBluetoothGetCharacteristicsCallbacks* callbacks) override;
- void readValue(const blink::WebString& characteristic_instance_id,
- blink::WebBluetoothReadValueCallbacks* callbacks) override;
- void writeValue(const blink::WebString& characteristic_instance_id,
- const blink::WebVector<uint8_t>& value,
- blink::WebBluetoothWriteValueCallbacks*) override;
+ void characteristicReadValue(
+ const blink::WebString& characteristic_instance_id,
+ blink::WebBluetoothReadValueCallbacks* callbacks) override;
+ void characteristicWriteValue(
+ const blink::WebString& characteristic_instance_id,
+ const blink::WebVector<uint8_t>& value,
+ blink::WebBluetoothWriteValueCallbacks*) override;
void startNotifications(
const blink::WebString& characteristic_instance_id,
blink::WebBluetoothNotificationsCallbacks*) override;
@@ -81,6 +83,18 @@ class CONTENT_EXPORT WebBluetoothImpl
void registerCharacteristicObject(
const blink::WebString& characteristic_instance_id,
blink::WebBluetoothRemoteGATTCharacteristic* characteristic) override;
+ void getDescriptors(
+ const blink::WebString& characteristic_instance_id,
+ int32_t quantity /* Corresponds to WebBluetoothGATTQueryQuantity in
+ web_bluetooth.mojom */,
+ const blink::WebString& descriptor_uuid,
+ blink::WebBluetoothGetDescriptorsCallbacks* callbacks) override;
+ void descriptorReadValue(
ortuno 2016/12/02 06:14:50 No need for these since we don't implement it yet.
dougt 2016/12/02 18:31:28 Done.
+ const blink::WebString& descriptor_instance_id,
+ blink::WebBluetoothReadValueCallbacks* callbacks) override;
+ void descriptorWriteValue(const blink::WebString& descriptor_instance_id,
+ const blink::WebVector<uint8_t>& value,
+ blink::WebBluetoothWriteValueCallbacks*) override;
private:
struct GetCharacteristicsCallback;
@@ -88,6 +102,7 @@ class CONTENT_EXPORT WebBluetoothImpl
void RemoteCharacteristicValueChanged(
const std::string& characteristic_instance_id,
const std::vector<uint8_t>& value) override;
+
void GattServerDisconnected(const WebBluetoothDeviceId& device_id) override;
// Callbacks for WebBluetoothService calls:
@@ -107,7 +122,7 @@ class CONTENT_EXPORT WebBluetoothImpl
std::vector<blink::mojom::WebBluetoothRemoteGATTServicePtr>>
services);
void OnGetCharacteristicsComplete(
- const blink::WebString& service_instance_id,
+ const blink::WebString& characteristic_instance_id,
ortuno 2016/12/02 06:14:50 I think it was correct before i.e. service_instanc
dougt 2016/12/02 18:31:28 Done.
std::unique_ptr<blink::WebBluetoothGetCharacteristicsCallbacks> callbacks,
blink::mojom::WebBluetoothResult result,
base::Optional<
@@ -126,7 +141,13 @@ class CONTENT_EXPORT WebBluetoothImpl
blink::mojom::WebBluetoothResult result);
void OnStopNotificationsComplete(
std::unique_ptr<blink::WebBluetoothNotificationsCallbacks> callbacks);
-
+ void OnGetDescriptorsComplete(
+ const blink::WebString& service_instance_id,
+ std::unique_ptr<blink::WebBluetoothGetDescriptorsCallbacks> callbacks,
+ blink::mojom::WebBluetoothResult result,
+ base::Optional<
+ std::vector<blink::mojom::WebBluetoothRemoteGATTDescriptorPtr>>
+ descriptors);
void DispatchCharacteristicValueChanged(
const std::string& characteristic_instance_id,
const std::vector<uint8_t>& value);

Powered by Google App Engine
This is Rietveld 408576698