OLD | NEW |
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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_WIN_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_WIN_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_WIN_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_WIN_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/files/file.h" | 11 #include "base/files/file.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/sequenced_task_runner.h" | 13 #include "base/sequenced_task_runner.h" |
14 #include "device/bluetooth/bluetooth_gatt_service.h" | |
15 #include "device/bluetooth/bluetooth_low_energy_defs_win.h" | 14 #include "device/bluetooth/bluetooth_low_energy_defs_win.h" |
| 15 #include "device/bluetooth/bluetooth_remote_gatt_service.h" |
16 | 16 |
17 namespace device { | 17 namespace device { |
18 | 18 |
19 class BluetoothAdapterWin; | 19 class BluetoothAdapterWin; |
20 class BluetoothDeviceWin; | 20 class BluetoothDeviceWin; |
21 class BluetoothRemoteGattCharacteristicWin; | 21 class BluetoothRemoteGattCharacteristicWin; |
22 class BluetoothTaskManagerWin; | 22 class BluetoothTaskManagerWin; |
23 | 23 |
24 // The BluetoothRemoteGattServiceWin class implements BluetoothGattService | 24 // The BluetoothRemoteGattServiceWin class implements BluetoothRemoteGattService |
25 // for remote GATT services on Windows 8 and later. | 25 // for remote GATT services on Windows 8 and later. |
26 class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattServiceWin | 26 class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattServiceWin |
27 : public BluetoothGattService { | 27 : public BluetoothRemoteGattService { |
28 public: | 28 public: |
29 BluetoothRemoteGattServiceWin( | 29 BluetoothRemoteGattServiceWin( |
30 BluetoothDeviceWin* device, | 30 BluetoothDeviceWin* device, |
31 base::FilePath service_path, | 31 base::FilePath service_path, |
32 BluetoothUUID service_uuid, | 32 BluetoothUUID service_uuid, |
33 uint16_t service_attribute_handle, | 33 uint16_t service_attribute_handle, |
34 bool is_primary, | 34 bool is_primary, |
35 BluetoothRemoteGattServiceWin* parent_service, | 35 BluetoothRemoteGattServiceWin* parent_service, |
36 scoped_refptr<base::SequencedTaskRunner>& ui_task_runner); | 36 scoped_refptr<base::SequencedTaskRunner>& ui_task_runner); |
37 ~BluetoothRemoteGattServiceWin() override; | 37 ~BluetoothRemoteGattServiceWin() override; |
38 | 38 |
39 // Override BluetoothGattService interfaces. | 39 // Override BluetoothRemoteGattService interfaces. |
40 std::string GetIdentifier() const override; | 40 std::string GetIdentifier() const override; |
41 BluetoothUUID GetUUID() const override; | 41 BluetoothUUID GetUUID() const override; |
42 bool IsLocal() const override; | 42 bool IsLocal() const override; |
43 bool IsPrimary() const override; | 43 bool IsPrimary() const override; |
44 BluetoothDevice* GetDevice() const override; | 44 BluetoothDevice* GetDevice() const override; |
45 std::vector<BluetoothGattCharacteristic*> GetCharacteristics() const override; | 45 std::vector<BluetoothRemoteGattCharacteristic*> GetCharacteristics() |
46 std::vector<BluetoothGattService*> GetIncludedServices() const override; | 46 const override; |
47 BluetoothGattCharacteristic* GetCharacteristic( | 47 std::vector<BluetoothRemoteGattService*> GetIncludedServices() const override; |
| 48 BluetoothRemoteGattCharacteristic* GetCharacteristic( |
48 const std::string& identifier) const override; | 49 const std::string& identifier) const override; |
49 bool AddCharacteristic(BluetoothGattCharacteristic* characteristic) override; | 50 bool AddCharacteristic( |
50 bool AddIncludedService(BluetoothGattService* service) override; | 51 BluetoothRemoteGattCharacteristic* characteristic) override; |
| 52 bool AddIncludedService(BluetoothRemoteGattService* service) override; |
51 void Register(const base::Closure& callback, | 53 void Register(const base::Closure& callback, |
52 const ErrorCallback& error_callback) override; | 54 const ErrorCallback& error_callback) override; |
53 void Unregister(const base::Closure& callback, | 55 void Unregister(const base::Closure& callback, |
54 const ErrorCallback& error_callback) override; | 56 const ErrorCallback& error_callback) override; |
55 | 57 |
56 // Notify |characteristic| discovery complete, |characteristic| is the | 58 // Notify |characteristic| discovery complete, |characteristic| is the |
57 // included characteritic of this service. | 59 // included characteritic of this service. |
58 void GattCharacteristicDiscoveryComplete( | 60 void GattCharacteristicDiscoveryComplete( |
59 BluetoothRemoteGattCharacteristicWin* characteristic); | 61 BluetoothRemoteGattCharacteristicWin* characteristic); |
60 | 62 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // Flag indicates if asynchronous discovery of included characteristic has | 125 // Flag indicates if asynchronous discovery of included characteristic has |
124 // completed. | 126 // completed. |
125 bool included_characteristics_discovered_; | 127 bool included_characteristics_discovered_; |
126 | 128 |
127 base::WeakPtrFactory<BluetoothRemoteGattServiceWin> weak_ptr_factory_; | 129 base::WeakPtrFactory<BluetoothRemoteGattServiceWin> weak_ptr_factory_; |
128 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattServiceWin); | 130 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattServiceWin); |
129 }; | 131 }; |
130 | 132 |
131 } // namespace device. | 133 } // namespace device. |
132 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_WIN_H_ | 134 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_WIN_H_ |
OLD | NEW |