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

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

Issue 2466223002: Implement WebBluetooth getDescriptor[s] (Closed)
Patch Set: Addressing code review comments from ortuno (still working on test changes) 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: 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 1351bce774a99f41527a08764c56fbeff5a61227..a919a8eb33f3f7569ff89d34c20a7634a0ec244d 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(
+ 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;
@@ -105,7 +119,7 @@ class CONTENT_EXPORT WebBluetoothImpl
blink::mojom::WebBluetoothResult result,
mojo::Array<blink::mojom::WebBluetoothRemoteGATTServicePtr> services);
void OnGetCharacteristicsComplete(
- const blink::WebString& service_instance_id,
+ const blink::WebString& characteristic_instance_id,
std::unique_ptr<blink::WebBluetoothGetCharacteristicsCallbacks> callbacks,
blink::mojom::WebBluetoothResult result,
mojo::Array<blink::mojom::WebBluetoothRemoteGATTCharacteristicPtr>
@@ -123,7 +137,12 @@ 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,
+ mojo::Array<blink::mojom::WebBluetoothRemoteGATTDescriptorPtr>
+ characteristics);
void DispatchCharacteristicValueChanged(
const std::string& characteristic_instance_id,
const std::vector<uint8_t>& value);

Powered by Google App Engine
This is Rietveld 408576698