Index: device/bluetooth/le_device.h |
diff --git a/device/bluetooth/le_device.h b/device/bluetooth/le_device.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c0d5ffc4e61a4b82783272b87c47c815322acbc1 |
--- /dev/null |
+++ b/device/bluetooth/le_device.h |
@@ -0,0 +1,43 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef DEVICE_BLUETOOTH_LE_DEVICE_H_ |
+#define DEVICE_BLUETOOTH_LE_DEVICE_H_ |
+ |
+#include <string> |
+ |
+#include "base/macros.h" |
ortuno
2016/10/10 00:11:20
Include: base/memory/ref_counted.h for scoped_refp
mbrunson
2016/10/10 19:21:28
Done.
|
+#include "device/bluetooth/bluetooth_adapter.h" |
+#include "device/bluetooth/bluetooth_device.h" |
+#include "device/bluetooth/public/interfaces/le_device.mojom.h" |
+ |
+namespace bluetooth { |
+ |
+// Implementation of Mojo LEDevice located in |
+// device/bluetooth/public/interfaces/le_device.mojom. |
+// It handles requests for Bluetooth low energy device capabilities |
+// and service and uses the platform abstraction of device/bluetooth. |
ortuno
2016/10/10 00:11:20
It handles requests to interact with a Bluetooth D
mbrunson
2016/10/10 19:21:28
Done.
|
+class LEDevice : public mojom::LEDevice { |
+ public: |
+ LEDevice(const std::string& address, |
+ const scoped_refptr<device::BluetoothAdapter>& adapter); |
ortuno
2016/10/10 00:11:20
Don't take a const&, rather take just a scoped_ref
mbrunson
2016/10/10 19:21:28
Done.
|
+ ~LEDevice() override; |
+ |
+ // Creates a mojom::LEDeviceInfo using info from the given |device|. |
+ static mojom::LEDeviceInfoPtr ConstructLEDeviceInfoStruct( |
+ const device::BluetoothDevice* device); |
+ |
+ // mojom::LEDevice overrides: |
+ void GetInfo(const GetInfoCallback& callback) override; |
+ |
+ private: |
+ std::string address_; |
+ scoped_refptr<device::BluetoothAdapter> adapter_; |
ortuno
2016/10/10 00:11:20
Comments please.
mbrunson
2016/10/10 19:21:28
Done.
|
+ |
+ DISALLOW_COPY_AND_ASSIGN(LEDevice); |
+}; |
+ |
+} // namespace bluetooth |
+ |
+#endif // DEVICE_BLUETOOTH_LE_DEVICE_H_ |