Chromium Code Reviews| Index: device/bluetooth/device.h |
| diff --git a/device/bluetooth/device.h b/device/bluetooth/device.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bf9b9386637f1663e17d9b38f9fc32c307acda7d |
| --- /dev/null |
| +++ b/device/bluetooth/device.h |
| @@ -0,0 +1,47 @@ |
| +// 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_DEVICE_H_ |
| +#define DEVICE_BLUETOOTH_DEVICE_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "device/bluetooth/bluetooth_adapter.h" |
| +#include "device/bluetooth/bluetooth_device.h" |
| +#include "device/bluetooth/public/interfaces/device.mojom.h" |
| + |
| +namespace bluetooth { |
| + |
| +// Implementation of Mojo Device located in |
| +// device/bluetooth/public/interfaces/le_device.mojom. |
|
scheib
2016/10/10 20:23:51
Drop the "le_", and check to see if it's anywhere
mbrunson
2016/10/10 22:01:09
Oh I missed one. Done.
|
| +// It handles requests to interact with Bluetooth Device. |
| +// Uses the platform abstraction of device/bluetooth. |
| +class Device : public mojom::Device { |
| + public: |
| + Device(const std::string& address, |
| + scoped_refptr<device::BluetoothAdapter> adapter); |
| + ~Device() override; |
| + |
| + // Creates a mojom::DeviceInfo using info from the given |device|. |
| + static mojom::DeviceInfoPtr ConstructDeviceInfoStruct( |
| + const device::BluetoothDevice* device); |
| + |
| + // mojom::Device overrides: |
| + void GetInfo(const GetInfoCallback& callback) override; |
| + |
| + private: |
| + // The address of the Bluetooth device. |
| + std::string address_; |
| + |
| + // The current BluetoothAdapter. |
| + scoped_refptr<device::BluetoothAdapter> adapter_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(Device); |
| +}; |
| + |
| +} // namespace bluetooth |
| + |
| +#endif // DEVICE_BLUETOOTH_DEVICE_H_ |