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

Unified Diff: device/bluetooth/bluetooth_adapter_win.cc

Issue 1606013002: BLE GATT service implementation in Chrome for Windows 8 and later (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Build.gn Created 4 years, 11 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_adapter_win.cc
diff --git a/device/bluetooth/bluetooth_adapter_win.cc b/device/bluetooth/bluetooth_adapter_win.cc
index 68f781214c74167c9abad8454cb04e27e57f70e8..82bbfaa6fc0e829721d90af45f16dc5deed34894 100644
--- a/device/bluetooth/bluetooth_adapter_win.cc
+++ b/device/bluetooth/bluetooth_adapter_win.cc
@@ -17,7 +17,9 @@
#include "device/bluetooth/bluetooth_discovery_session_outcome.h"
#include "device/bluetooth/bluetooth_socket_thread.h"
#include "device/bluetooth/bluetooth_socket_win.h"
-#include "device/bluetooth/bluetooth_task_manager_win.h"
+#include "device/bluetooth/bluetooth_remote_gatt_characteristic_win.h"
+#include "device/bluetooth/bluetooth_remote_gatt_descriptor_win.h"
+#include "device/bluetooth/bluetooth_remote_gatt_service_win.h"
#include "device/bluetooth/bluetooth_uuid.h"
namespace device {
@@ -375,4 +377,88 @@ void BluetoothAdapterWin::MaybePostStopDiscoveryTask() {
task_manager_->PostStopDiscoveryTask();
}
+void BluetoothAdapterWin::NotifyGattServiceAdded(
+ BluetoothDeviceWin* device,
+ BluetoothRemoteGattServiceWin* service) {
+ DCHECK(service);
+ DCHECK(device);
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattServiceAdded(this, device, service));
+}
+
+void BluetoothAdapterWin::NotifyGattServiceRemoved(
+ BluetoothDeviceWin* device,
+ BluetoothRemoteGattServiceWin* service) {
+ DCHECK(service);
+ DCHECK(device);
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattServiceRemoved(this, device, service));
+}
+
+void BluetoothAdapterWin::NotifyGattServicesDiscovered(
+ BluetoothDeviceWin* device) {
+ DCHECK(device);
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattServicesDiscovered(this, device));
+}
+
+void BluetoothAdapterWin::NotifyGattDiscoveryCompleteForService(
+ BluetoothRemoteGattServiceWin* service) {
+ DCHECK(service);
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattDiscoveryCompleteForService(this, service));
+}
+
+void BluetoothAdapterWin::NotifyGattServiceChanged(
+ BluetoothRemoteGattServiceWin* service) {
+ DCHECK(service);
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattServiceChanged(this, service));
+}
+
+void BluetoothAdapterWin::NotifyGattCharacteristicAdded(
+ BluetoothRemoteGattCharacteristicWin* characteristic) {
+ DCHECK(characteristic);
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattCharacteristicAdded(this, characteristic));
+}
+
+void BluetoothAdapterWin::NotifyGattCharacteristicRemoved(
+ BluetoothRemoteGattCharacteristicWin* characteristic) {
+ DCHECK(characteristic);
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattCharacteristicRemoved(this, characteristic));
+}
+
+void BluetoothAdapterWin::NotifyGattCharacteristicValueChanged(
+ BluetoothRemoteGattCharacteristicWin* characteristic,
+ const std::vector<uint8_t>& value) {
+ DCHECK(characteristic);
+ FOR_EACH_OBSERVER(
+ BluetoothAdapter::Observer, observers_,
+ GattCharacteristicValueChanged(this, characteristic, value));
+}
+
+void BluetoothAdapterWin::NotifyGattDescriptorAdded(
+ BluetoothRemoteGattDescriptorWin* descriptor) {
+ DCHECK(descriptor);
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattDescriptorAdded(this, descriptor));
+}
+
+void BluetoothAdapterWin::NotifyGattDescriptorRemoved(
+ BluetoothRemoteGattDescriptorWin* descriptor) {
+ DCHECK(descriptor);
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattDescriptorRemoved(this, descriptor));
+}
+
+void BluetoothAdapterWin::NotifyGattDescriptorValueChanged(
+ BluetoothRemoteGattDescriptorWin* descriptor,
+ const std::vector<uint8_t>& value) {
+ DCHECK(descriptor);
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
+ GattDescriptorValueChanged(this, descriptor, value));
+}
+
} // namespace device

Powered by Google App Engine
This is Rietveld 408576698