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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_service_mac.h

Issue 1948763003: Adding support for service scan on OS X (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: Adding disconnect with error Created 4 years, 7 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_mac.h
diff --git a/device/bluetooth/bluetooth_remote_gatt_service_mac.h b/device/bluetooth/bluetooth_remote_gatt_service_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..1612d2dac219262c9cbee387094bf4f365015270
--- /dev/null
+++ b/device/bluetooth/bluetooth_remote_gatt_service_mac.h
@@ -0,0 +1,72 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
ortuno 2016/05/06 16:03:33 nit: 2016
jlebel 2016/05/07 00:16:11 Done.
+// 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_MAC_H_
+#define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_MAC_H_
+
+#include <stdint.h>
+
+#include <vector>
+
+#include "base/mac/scoped_nsobject.h"
+#include "device/bluetooth/bluetooth_remote_gatt_service.h"
+
+@class CBService;
+
+namespace device {
+
+class BluetoothLowEnergyDeviceMac;
+class BluetoothDevice;
+class BluetoothGattCharacteristic;
+
+class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattServiceMac
+ : public BluetoothRemoteGattService {
+ public:
+ BluetoothRemoteGattServiceMac(
+ BluetoothLowEnergyDeviceMac* bluetooth_device_mac,
+ CBService* service,
+ bool primary);
ortuno 2016/05/06 16:03:33 nit: is_primary
jlebel 2016/05/07 00:16:11 Done.
+ ~BluetoothRemoteGattServiceMac() override;
+
+ // BluetoothRemoteGattService override.
+ std::string GetIdentifier() const override;
+ BluetoothUUID GetUUID() const override;
+ bool IsPrimary() const override;
+ BluetoothDevice* GetDevice() const override;
+ std::vector<BluetoothRemoteGattCharacteristic*> GetCharacteristics()
+ const override;
+ std::vector<BluetoothRemoteGattService*> GetIncludedServices() const override;
+ BluetoothRemoteGattCharacteristic* GetCharacteristic(
+ const std::string& identifier) const override;
+
+ // Registers this GATT service. Calling Register will make this service and
+ // all of its associated attributes available on the local adapters GATT
+ // database and the service UUID will be advertised to nearby devices if the
+ // local adapter is discoverable. Call Unregister to make this service no
+ // longer available.
+ //
+ // These methods only make sense for services that are local and will hence
+ // fail if this instance represents a remote GATT service. |callback| is
+ // called to denote success and |error_callback| to denote failure.
+ void Register(const base::Closure& callback,
+ const ErrorCallback& error_callback);
+ void Unregister(const base::Closure& callback,
ortuno 2016/05/06 16:03:33 You don't need these two functions. BluetoothGattS
jlebel 2016/05/07 00:16:11 Done.
+ const ErrorCallback& error_callback);
+
+ private:
+ friend BluetoothLowEnergyDeviceMac;
+
+ // Returns CBService.
+ CBService* GetService() const;
+
+ BluetoothLowEnergyDeviceMac* bluetooth_device_mac_;
ortuno 2016/05/06 16:03:33 Please add a comment that mentions that this is th
jlebel 2016/05/07 00:16:11 Done.
+ base::scoped_nsobject<CBService> service_;
ortuno 2016/05/06 16:03:33 Also add a comment for this variable.
jlebel 2016/05/07 00:16:11 Done.
+ bool is_primary_;
+
+ DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattServiceMac);
+};
+
+} // namespace device
+
+#endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_MAC_H_

Powered by Google App Engine
This is Rietveld 408576698