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

Unified Diff: device/bluetooth/device.h

Issue 2448713002: bluetooth: Add Device connection logic and accompanying user interface. (Closed)
Patch Set: 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/device.h
diff --git a/device/bluetooth/device.h b/device/bluetooth/device.h
index c82439e6c283ecb6e851e466061bedf060a18420..fbfbb3e850440380a07a0bad94b130af3ce23b59 100644
--- a/device/bluetooth/device.h
+++ b/device/bluetooth/device.h
@@ -11,6 +11,8 @@
#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 +23,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 +33,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);
};

Powered by Google App Engine
This is Rietveld 408576698