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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_service_win.cc

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.cc
diff --git a/device/bluetooth/bluetooth_remote_gatt_service_win.cc b/device/bluetooth/bluetooth_remote_gatt_service_win.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c5f7e0a48b93049b0783f002814dc3b757df2a9f
--- /dev/null
+++ b/device/bluetooth/bluetooth_remote_gatt_service_win.cc
@@ -0,0 +1,113 @@
+// 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_win.h"
+
+namespace device {
+BluetoothRemoteGattServiceWin::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)
+ : service_path_(service_path),
+ device_(device),
+ service_uuid_(service_uuid),
+ service_attribute_handle_(service_attribute_handle),
+ is_primary_(is_primary),
+ parent_service_(parent_service),
+ ui_task_runner_(ui_task_runner) {
+ DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(!service_path_.empty());
+ DCHECK(service_uuid_.IsValid());
+ DCHECK(service_attribute_handle_);
+ DCHECK(device_);
+ if (!is_primary_)
+ DCHECK(parent_service_);
+ Update();
+}
+
+BluetoothRemoteGattServiceWin::~BluetoothRemoteGattServiceWin() {}
+
+std::string BluetoothRemoteGattServiceWin::GetIdentifier() const {
+ std::string identifier =
+ service_uuid_.value() + "_" + std::to_string(service_attribute_handle_);
+ if (is_primary_)
+ return device_->GetIdentifier() + "/" + identifier;
+ else
+ return parent_service_->GetIdentifier() + "/" + identifier;
+}
+
+BluetoothUUID BluetoothRemoteGattServiceWin::GetUUID() const {
+ return const_cast<BluetoothUUID&>(service_uuid_);
+}
+
+bool BluetoothRemoteGattServiceWin::IsLocal() const {
+ return false;
+}
+
+bool BluetoothRemoteGattServiceWin::IsPrimary() const {
+ return is_primary_;
+}
+
+BluetoothDevice* BluetoothRemoteGattServiceWin::GetDevice() const {
+ return device_;
+}
+
+std::vector<BluetoothGattCharacteristic*>
+BluetoothRemoteGattServiceWin::GetCharacteristics() const {
+ NOTIMPLEMENTED();
+ return std::vector<BluetoothGattCharacteristic*>();
+}
+
+std::vector<BluetoothGattService*>
+BluetoothRemoteGattServiceWin::GetIncludedServices() const {
+ NOTIMPLEMENTED();
+ return std::vector<BluetoothGattService*>();
+}
+
+BluetoothGattCharacteristic* BluetoothRemoteGattServiceWin::GetCharacteristic(
+ const std::string& identifier) const {
+ NOTIMPLEMENTED();
+ return nullptr;
+}
+
+bool BluetoothRemoteGattServiceWin::AddCharacteristic(
+ device::BluetoothGattCharacteristic* characteristic) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool BluetoothRemoteGattServiceWin::AddIncludedService(
+ device::BluetoothGattService* service) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void BluetoothRemoteGattServiceWin::Register(
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) {
+ NOTIMPLEMENTED();
+ error_callback.Run();
+}
+
+void BluetoothRemoteGattServiceWin::Unregister(
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) {
+ NOTIMPLEMENTED();
+ error_callback.Run();
+}
+
+void BluetoothRemoteGattServiceWin::Update() {
+ DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ NOTIMPLEMENTED();
+}
+
+uint16_t BluetoothRemoteGattServiceWin::GetAttributeHandle() {
+ return service_attribute_handle_;
+}
+
+} // namespace device.
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_service_win.h ('k') | device/bluetooth/bluetooth_task_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698