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

Side by Side Diff: device/bluetooth/bluez/bluetooth_local_gatt_characteristic_bluez.cc

Issue 1973343005: Remove service, add device, in BluetoothLocalGattService::Delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/bluez/bluetooth_local_gatt_characteristic_bluez.h" 5 #include "device/bluetooth/bluez/bluetooth_local_gatt_characteristic_bluez.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 67
68 device::BluetoothGattCharacteristic::Permissions 68 device::BluetoothGattCharacteristic::Permissions
69 BluetoothLocalGattCharacteristicBlueZ::GetPermissions() const { 69 BluetoothLocalGattCharacteristicBlueZ::GetPermissions() const {
70 NOTIMPLEMENTED(); 70 NOTIMPLEMENTED();
71 return Permissions(); 71 return Permissions();
72 } 72 }
73 73
74 device::BluetoothLocalGattCharacteristic::NotificationStatus 74 device::BluetoothLocalGattCharacteristic::NotificationStatus
75 BluetoothLocalGattCharacteristicBlueZ::NotifyValueChanged( 75 BluetoothLocalGattCharacteristicBlueZ::NotifyValueChanged(
76 const device::BluetoothDevice* device,
76 const std::vector<uint8_t>& new_value, 77 const std::vector<uint8_t>& new_value,
77 bool indicate) { 78 bool indicate) {
78 if (indicate && !(properties_ & PROPERTY_INDICATE)) 79 if (indicate && !(properties_ & PROPERTY_INDICATE))
79 return INDICATE_PROPERTY_NOT_SET; 80 return INDICATE_PROPERTY_NOT_SET;
80 if (!indicate && !(properties_ & PROPERTY_NOTIFY)) 81 if (!indicate && !(properties_ & PROPERTY_NOTIFY))
81 return NOTIFY_PROPERTY_NOT_SET; 82 return NOTIFY_PROPERTY_NOT_SET;
82 DCHECK(service_); 83 DCHECK(service_);
83 return service_->GetAdapter()->SendValueChanged(this, new_value) 84 return service_->GetAdapter()->SendValueChanged(this, new_value)
84 ? NOTIFICATION_SUCCESS 85 ? NOTIFICATION_SUCCESS
85 : SERVICE_NOT_REGISTERED; 86 : SERVICE_NOT_REGISTERED;
86 } 87 }
87 88
88 BluetoothLocalGattServiceBlueZ* 89 device::BluetoothLocalGattService*
89 BluetoothLocalGattCharacteristicBlueZ::GetService() { 90 BluetoothLocalGattCharacteristicBlueZ::GetService() const {
90 return service_; 91 return service_;
91 } 92 }
92 93
93 void BluetoothLocalGattCharacteristicBlueZ::AddDescriptor( 94 void BluetoothLocalGattCharacteristicBlueZ::AddDescriptor(
94 std::unique_ptr<BluetoothLocalGattDescriptorBlueZ> descriptor) { 95 std::unique_ptr<BluetoothLocalGattDescriptorBlueZ> descriptor) {
95 descriptors_.push_back(std::move(descriptor)); 96 descriptors_.push_back(std::move(descriptor));
96 } 97 }
97 98
98 const std::vector<std::unique_ptr<BluetoothLocalGattDescriptorBlueZ>>& 99 const std::vector<std::unique_ptr<BluetoothLocalGattDescriptorBlueZ>>&
99 BluetoothLocalGattCharacteristicBlueZ::GetDescriptors() const { 100 BluetoothLocalGattCharacteristicBlueZ::GetDescriptors() const {
100 return descriptors_; 101 return descriptors_;
101 } 102 }
102 103
103 } // namespace bluez 104 } // namespace bluez
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698