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

Unified Diff: device/bluetooth/bluetooth_adapter.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
« no previous file with comments | « device/bluetooth/bluetooth_adapter.h ('k') | device/bluetooth/bluetooth_adapter_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_adapter.cc
diff --git a/device/bluetooth/bluetooth_adapter.cc b/device/bluetooth/bluetooth_adapter.cc
index 2f90428c83bec10c7a821e17e2ff7941837cf55f..390bb939520c47f177598c7615ae7dcb395fb076 100644
--- a/device/bluetooth/bluetooth_adapter.cc
+++ b/device/bluetooth/bluetooth_adapter.cc
@@ -13,6 +13,9 @@
#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_discovery_session.h"
#include "device/bluetooth/bluetooth_discovery_session_outcome.h"
+#include "device/bluetooth/bluetooth_gatt_characteristic.h"
+#include "device/bluetooth/bluetooth_gatt_descriptor.h"
+#include "device/bluetooth/bluetooth_gatt_service.h"
namespace device {
@@ -155,6 +158,99 @@ BluetoothDevice::PairingDelegate* BluetoothAdapter::DefaultPairingDelegate() {
return pairing_delegates_.front().first;
}
+void BluetoothAdapter::NotifyGattServiceAdded(BluetoothGattService* service) {
+ DCHECK_EQ(service->GetDevice()->GetAdapter(), this);
+
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattServiceAdded(this, service->GetDevice(), service));
+}
+
+void BluetoothAdapter::NotifyGattServiceRemoved(BluetoothGattService* service) {
+ DCHECK_EQ(service->GetDevice()->GetAdapter(), this);
+
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattServiceRemoved(this, service->GetDevice(), service));
+}
+
+void BluetoothAdapter::NotifyGattServiceChanged(BluetoothGattService* service) {
+ DCHECK_EQ(service->GetDevice()->GetAdapter(), this);
+
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattServiceChanged(this, service));
+}
+
+void BluetoothAdapter::NotifyGattServicesDiscovered(BluetoothDevice* device) {
+ DCHECK(device->GetAdapter() == this);
+
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattServicesDiscovered(this, device));
+}
+
+void BluetoothAdapter::NotifyGattDiscoveryComplete(
+ BluetoothGattService* service) {
+ DCHECK_EQ(service->GetDevice()->GetAdapter(), this);
+
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattDiscoveryCompleteForService(this, service));
+}
+
+void BluetoothAdapter::NotifyGattCharacteristicAdded(
+ BluetoothGattCharacteristic* characteristic) {
+ DCHECK_EQ(characteristic->GetService()->GetDevice()->GetAdapter(), this);
+
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattCharacteristicAdded(this, characteristic));
+}
+
+void BluetoothAdapter::NotifyGattCharacteristicRemoved(
+ BluetoothGattCharacteristic* characteristic) {
+ DCHECK_EQ(characteristic->GetService()->GetDevice()->GetAdapter(), this);
+
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattCharacteristicRemoved(this, characteristic));
+}
+
+void BluetoothAdapter::NotifyGattDescriptorAdded(
+ BluetoothGattDescriptor* descriptor) {
+ DCHECK_EQ(
+ descriptor->GetCharacteristic()->GetService()->GetDevice()->GetAdapter(),
+ this);
+
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattDescriptorAdded(this, descriptor));
+}
+
+void BluetoothAdapter::NotifyGattDescriptorRemoved(
+ BluetoothGattDescriptor* descriptor) {
+ DCHECK_EQ(
+ descriptor->GetCharacteristic()->GetService()->GetDevice()->GetAdapter(),
+ this);
+
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattDescriptorRemoved(this, descriptor));
+}
+
+void BluetoothAdapter::NotifyGattCharacteristicValueChanged(
+ BluetoothGattCharacteristic* characteristic,
+ const std::vector<uint8_t>& value) {
+ DCHECK_EQ(characteristic->GetService()->GetDevice()->GetAdapter(), this);
+
+ FOR_EACH_OBSERVER(
+ BluetoothAdapter::Observer, observers_,
+ GattCharacteristicValueChanged(this, characteristic, value));
+}
+
+void BluetoothAdapter::NotifyGattDescriptorValueChanged(
+ BluetoothGattDescriptor* descriptor,
+ const std::vector<uint8_t>& value) {
+ DCHECK_EQ(
+ descriptor->GetCharacteristic()->GetService()->GetDevice()->GetAdapter(),
+ this);
+
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattDescriptorValueChanged(this, descriptor, value));
+}
+
BluetoothAdapter::BluetoothAdapter() : weak_ptr_factory_(this) {
}
« no previous file with comments | « device/bluetooth/bluetooth_adapter.h ('k') | device/bluetooth/bluetooth_adapter_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698