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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_service_mac.mm

Issue 1948763003: Adding support for service scan on OS X (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: Fixes 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.mm
diff --git a/device/bluetooth/bluetooth_remote_gatt_service_mac.mm b/device/bluetooth/bluetooth_remote_gatt_service_mac.mm
new file mode 100644
index 0000000000000000000000000000000000000000..d95ddf23a48463e47b20cdab7102934fe5cda4f1
--- /dev/null
+++ b/device/bluetooth/bluetooth_remote_gatt_service_mac.mm
@@ -0,0 +1,73 @@
+// 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.
+
+#include "device/bluetooth/bluetooth_remote_gatt_service_mac.h"
+
+#import <CoreBluetooth/CoreBluetooth.h>
+#include <vector>
+
+#include "base/logging.h"
+#include "device/bluetooth/bluetooth_adapter_mac.h"
+#include "device/bluetooth/bluetooth_low_energy_device_mac.h"
+#include "device/bluetooth/bluetooth_uuid.h"
+
+namespace device {
+
+BluetoothRemoteGattServiceMac::BluetoothRemoteGattServiceMac(
+ BluetoothLowEnergyDeviceMac* bluetooth_device_mac,
+ CBService* service,
+ bool is_primary)
+ : bluetooth_device_mac_(bluetooth_device_mac),
+ service_(service, base::scoped_policy::RETAIN),
+ is_primary_(is_primary) {
+ uuid_ = BluetoothAdapterMac::BluetoothUUIDWithCBUUID([service_.get() UUID]);
+ const std::string string_uuid(
ortuno 2016/05/09 19:54:01 You already have a BluetoothUUID so you can just g
jlebel 2016/05/09 23:05:59 Done.
+ BluetoothAdapterMac::StringWithCBUUID([service_.get() UUID]));
+ identifier_ =
+ [NSString stringWithFormat:@"%s-%p", string_uuid.c_str(), (void*)service_]
+ .UTF8String;
+}
+
+BluetoothRemoteGattServiceMac::~BluetoothRemoteGattServiceMac() {}
+
+std::string BluetoothRemoteGattServiceMac::GetIdentifier() const {
+ return identifier_;
+}
+
+BluetoothUUID BluetoothRemoteGattServiceMac::GetUUID() const {
+ return uuid_;
+}
+
+bool BluetoothRemoteGattServiceMac::IsPrimary() const {
+ return is_primary_;
+}
+
+BluetoothDevice* BluetoothRemoteGattServiceMac::GetDevice() const {
+ return bluetooth_device_mac_;
+}
+
+std::vector<BluetoothRemoteGattCharacteristic*>
+BluetoothRemoteGattServiceMac::GetCharacteristics() const {
+ NOTIMPLEMENTED();
+ return std::vector<BluetoothRemoteGattCharacteristic*>();
+}
+
+std::vector<BluetoothRemoteGattService*>
+BluetoothRemoteGattServiceMac::GetIncludedServices() const {
+ NOTIMPLEMENTED();
+ return std::vector<BluetoothRemoteGattService*>();
+}
+
+BluetoothRemoteGattCharacteristic*
+BluetoothRemoteGattServiceMac::GetCharacteristic(
+ const std::string& identifier) const {
+ NOTIMPLEMENTED();
+ return nullptr;
+}
+
+CBService* BluetoothRemoteGattServiceMac::GetService() const {
+ return service_.get();
+}
+
+} // namespace device

Powered by Google App Engine
This is Rietveld 408576698