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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 module bluetooth.mojom; 5 module bluetooth.mojom;
6 6
7 struct AdvertisingPacket {
8 uint64 timestamp;
9 int8 rssi;
10 DeviceInfo device;
11 };
12
7 struct DeviceInfo { 13 struct DeviceInfo {
8 string? name; 14 string? name;
9 string name_for_display; 15 string name_for_display;
10 string address; 16 string address;
11 }; 17 };
12 18
13 interface Device { 19 interface Device {
14 // Gets basic information about the device. Returns null, if no device is 20 // Gets basic information about the device. Returns null, if no device is
15 // available. 21 // available.
16 GetInfo() => (DeviceInfo? info); 22 GetInfo() => (DeviceInfo? info);
23
24 // Sets the client that listens to events from this device.
25 SetClient(GattClient client);
17 }; 26 };
27
28 interface GattClient {
29 // Called when one of the following properties of the device changes:
30 // Address, appearance, Bluetooth class, Inquiry RSSI, Inquiry TX Power,
31 // Service UUIDs, Connectionable state, Connection state, Pairing state,
32 // Trustable state.
33 // Generally called for each advertisement packet recevied, but this is not
34 // guaranteed on ChromeOS or Linux. Because the RSSI is always changing,
35 // it's very likely this will be called for each advertising packet.
36 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
37 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698