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

Unified Diff: device/bluetooth/public/interfaces/device.mojom

Issue 2404623002: bluetooth: Add DeviceChanged logging in Device service. (Closed)
Patch Set: Split JS into functions Created 4 years, 2 months 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: device/bluetooth/public/interfaces/device.mojom
diff --git a/device/bluetooth/public/interfaces/device.mojom b/device/bluetooth/public/interfaces/device.mojom
index b629bab1703d8441c10271394e9345ce2845b566..860c3edfc91c6edd0517b29f1383cac22452f61a 100644
--- a/device/bluetooth/public/interfaces/device.mojom
+++ b/device/bluetooth/public/interfaces/device.mojom
@@ -4,6 +4,12 @@
module bluetooth.mojom;
+struct AdvertisingPacket {
+ uint64 timestamp;
+ int8 rssi;
+ DeviceInfo device;
+};
+
struct DeviceInfo {
string? name;
string name_for_display;
@@ -14,4 +20,18 @@ interface Device {
// Gets basic information about the device. Returns null, if no device is
// available.
GetInfo() => (DeviceInfo? info);
+
+ // Sets the client that listens to events from this device.
+ SetClient(GattClient client);
+};
+
+interface GattClient {
+ // Called when one of the following properties of the device changes:
+ // Address, appearance, Bluetooth class, Inquiry RSSI, Inquiry TX Power,
+ // Service UUIDs, Connectionable state, Connection state, Pairing state,
+ // Trustable state.
+ // Generally called for each advertisement packet recevied, but this is not
+ // guaranteed on ChromeOS or Linux. Because the RSSI is always changing,
+ // it's very likely this will be called for each advertising packet.
+ DeviceChanged(AdvertisingPacket packet);
ortuno 2016/10/13 22:22:49 In the spirit of "Just a Thin Wrapper™️" I think t
scheib 2016/10/14 07:14:51 We've deviated a bit already with DeviceInfo aggre
mbrunson 2016/10/14 18:25:25 I remember ortuno recommending the Mojo clients to
scheib 2016/10/14 20:25:40 I dislike the Android and Core Bluetooth way of ge
ortuno 2016/10/17 05:03:31 If we are going to go ahead with this pattern I ha
mbrunson 2016/10/17 21:33:38 I've moved PacketReceived to Adapter. Given your
};

Powered by Google App Engine
This is Rietveld 408576698