Index: device/bluetooth/device.h |
diff --git a/device/bluetooth/device.h b/device/bluetooth/device.h |
index c82439e6c283ecb6e851e466061bedf060a18420..82b5b5b5d2d31669d5a8fbd867ee675756770ca4 100644 |
--- a/device/bluetooth/device.h |
+++ b/device/bluetooth/device.h |
@@ -5,12 +5,15 @@ |
#ifndef DEVICE_BLUETOOTH_DEVICE_H_ |
#define DEVICE_BLUETOOTH_DEVICE_H_ |
+#include <memory> |
#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/bluetooth_gatt_connection.h" |
+#include "device/bluetooth/bluetooth_remote_gatt_service.h" |
#include "device/bluetooth/public/interfaces/device.mojom.h" |
namespace bluetooth { |
@@ -21,8 +24,8 @@ namespace bluetooth { |
// Uses the platform abstraction of device/bluetooth. |
class Device : public mojom::Device { |
public: |
- Device(const std::string& address, |
- scoped_refptr<device::BluetoothAdapter> adapter); |
+ Device(scoped_refptr<device::BluetoothAdapter> adapter, |
+ std::unique_ptr<device::BluetoothGattConnection> connection); |
~Device() override; |
// Creates a mojom::DeviceInfo using info from the given |device|. |
@@ -31,14 +34,18 @@ class Device : public mojom::Device { |
// mojom::Device overrides: |
void GetInfo(const GetInfoCallback& callback) override; |
+ void GetServices(const GetServicesCallback& callback) override; |
private: |
- // The address of the Bluetooth device. |
- std::string address_; |
+ mojom::ServiceInfoPtr ConstructServiceInfoStruct( |
+ const device::BluetoothRemoteGattService* service); |
// The current BluetoothAdapter. |
scoped_refptr<device::BluetoothAdapter> adapter_; |
+ // The GATT connection to this device. |
+ std::unique_ptr<device::BluetoothGattConnection> connection_; |
+ |
DISALLOW_COPY_AND_ASSIGN(Device); |
}; |