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

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: Fixing comments 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..2e840703e40d32391166aa9f42ca0fcaa277b2ab
--- /dev/null
+++ b/device/bluetooth/bluetooth_remote_gatt_service_mac.mm
@@ -0,0 +1,72 @@
+// 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]);
+ identifier_ =
+ [NSString stringWithFormat:@"%s-%p", uuid_.canonical_value().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
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_service_mac.h ('k') | device/bluetooth/bluetooth_remote_gatt_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698