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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_service_win.h

Issue 1681853003: Add BluetoothRemoteGattServiceWin to BluetoothDeviceWin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add PlatformSupportsLowEnergy check in the unittests Created 4 years, 10 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/bluetooth_remote_gatt_service_win.h
diff --git a/device/bluetooth/bluetooth_remote_gatt_service_win.h b/device/bluetooth/bluetooth_remote_gatt_service_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..5af0293b3d6304cc98178522b7761230666200d7
--- /dev/null
+++ b/device/bluetooth/bluetooth_remote_gatt_service_win.h
@@ -0,0 +1,63 @@
+// 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_BLUETOOTH_REMOTE_GATT_SERVICE_WIN_H_
+#define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_WIN_H_
+
+#include "base/files/file.h"
+#include "device/bluetooth/bluetooth_device_win.h"
+#include "device/bluetooth/bluetooth_gatt_service.h"
+
+namespace device {
+
+// The BluetoothRemoteGattServiceWin class implements BluetoothGattService
+// for remote GATT services on Windows 8 and later.
+class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattServiceWin
+ : public BluetoothGattService {
+ public:
+ BluetoothRemoteGattServiceWin(
+ BluetoothDeviceWin* device,
+ base::FilePath service_path,
+ BluetoothUUID service_uuid,
+ uint16_t service_attribute_handle,
+ bool is_primary,
+ BluetoothRemoteGattServiceWin* parent_service,
+ scoped_refptr<base::SequencedTaskRunner>& ui_task_runner);
+ ~BluetoothRemoteGattServiceWin() override;
+
+ // Override BluetoothGattService interfaces.
+ std::string GetIdentifier() const override;
+ BluetoothUUID GetUUID() const override;
+ bool IsLocal() const override;
+ bool IsPrimary() const override;
+ BluetoothDevice* GetDevice() const override;
+ std::vector<BluetoothGattCharacteristic*> GetCharacteristics() const override;
+ std::vector<BluetoothGattService*> GetIncludedServices() const override;
+ BluetoothGattCharacteristic* GetCharacteristic(
+ const std::string& identifier) const override;
+ bool AddCharacteristic(BluetoothGattCharacteristic* characteristic) override;
+ bool AddIncludedService(BluetoothGattService* service) override;
+ void Register(const base::Closure& callback,
+ const ErrorCallback& error_callback) override;
+ void Unregister(const base::Closure& callback,
+ const ErrorCallback& error_callback) override;
+
+ // Update included services and characteristics.
+ void Update();
+ uint16_t GetAttributeHandle();
+
+ private:
+ BluetoothDeviceWin* device_;
+ base::FilePath service_path_;
+ BluetoothUUID service_uuid_;
+ uint16_t service_attribute_handle_;
+ bool is_primary_;
+ BluetoothRemoteGattServiceWin* parent_service_;
+ scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattServiceWin);
+};
+
+} // namespace device.
+#endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698