| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BLUEZ_BLUETOOTH_ADAPTER_BLUEZ_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_ADAPTER_BLUEZ_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_ADAPTER_BLUEZ_H_ | 6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_ADAPTER_BLUEZ_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 namespace device { | 38 namespace device { |
| 39 class BluetoothSocketThread; | 39 class BluetoothSocketThread; |
| 40 class BluetoothTestBlueZ; | 40 class BluetoothTestBlueZ; |
| 41 } // namespace device | 41 } // namespace device |
| 42 | 42 |
| 43 namespace bluez { | 43 namespace bluez { |
| 44 | 44 |
| 45 class BluetoothBlueZTest; | 45 class BluetoothBlueZTest; |
| 46 class BluetoothAdapterProfileBlueZ; | 46 class BluetoothAdapterProfileBlueZ; |
| 47 class BluetoothDeviceBlueZ; | 47 class BluetoothDeviceBlueZ; |
| 48 class BluetoothLocalGattCharacteristicBlueZ; |
| 48 class BluetoothLocalGattServiceBlueZ; | 49 class BluetoothLocalGattServiceBlueZ; |
| 49 class BluetoothGattApplicationServiceProvider; | 50 class BluetoothGattApplicationServiceProvider; |
| 50 class BluetoothPairingBlueZ; | 51 class BluetoothPairingBlueZ; |
| 51 | 52 |
| 52 // The BluetoothAdapterBlueZ class implements BluetoothAdapter for platforms | 53 // The BluetoothAdapterBlueZ class implements BluetoothAdapter for platforms |
| 53 // that use BlueZ. | 54 // that use BlueZ. |
| 54 // | 55 // |
| 55 // All methods are called from the dbus origin / UI thread and are generally | 56 // All methods are called from the dbus origin / UI thread and are generally |
| 56 // not assumed to be thread-safe. | 57 // not assumed to be thread-safe. |
| 57 // | 58 // |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 172 |
| 172 // Unregister a GATT service. The service must already be registered. | 173 // Unregister a GATT service. The service must already be registered. |
| 173 void UnregisterGattService( | 174 void UnregisterGattService( |
| 174 BluetoothLocalGattServiceBlueZ* service, | 175 BluetoothLocalGattServiceBlueZ* service, |
| 175 const base::Closure& callback, | 176 const base::Closure& callback, |
| 176 const device::BluetoothGattService::ErrorCallback& error_callback); | 177 const device::BluetoothGattService::ErrorCallback& error_callback); |
| 177 | 178 |
| 178 // Returns if a given service is currently registered. | 179 // Returns if a given service is currently registered. |
| 179 bool IsGattServiceRegistered(BluetoothLocalGattServiceBlueZ* service); | 180 bool IsGattServiceRegistered(BluetoothLocalGattServiceBlueZ* service); |
| 180 | 181 |
| 182 // Send a notification for this characteristic that its value has been |
| 183 // updated. If the service that owns that characteristic is not registered, |
| 184 // this method will return false. |
| 185 bool SendValueChanged(BluetoothLocalGattCharacteristicBlueZ* characteristic, |
| 186 const std::vector<uint8_t>& value); |
| 187 |
| 181 // Returns the object path of the adapter. | 188 // Returns the object path of the adapter. |
| 182 dbus::ObjectPath GetApplicationObjectPath() const; | 189 dbus::ObjectPath GetApplicationObjectPath() const; |
| 183 | 190 |
| 184 protected: | 191 protected: |
| 185 // BluetoothAdapter: | 192 // BluetoothAdapter: |
| 186 void RemovePairingDelegateInternal( | 193 void RemovePairingDelegateInternal( |
| 187 device::BluetoothDevice::PairingDelegate* pairing_delegate) override; | 194 device::BluetoothDevice::PairingDelegate* pairing_delegate) override; |
| 188 | 195 |
| 189 private: | 196 private: |
| 190 friend class BluetoothBlueZTest; | 197 friend class BluetoothBlueZTest; |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 // Note: This should remain the last member so it'll be destroyed and | 469 // Note: This should remain the last member so it'll be destroyed and |
| 463 // invalidate its weak pointers before any other members are destroyed. | 470 // invalidate its weak pointers before any other members are destroyed. |
| 464 base::WeakPtrFactory<BluetoothAdapterBlueZ> weak_ptr_factory_; | 471 base::WeakPtrFactory<BluetoothAdapterBlueZ> weak_ptr_factory_; |
| 465 | 472 |
| 466 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterBlueZ); | 473 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterBlueZ); |
| 467 }; | 474 }; |
| 468 | 475 |
| 469 } // namespace bluez | 476 } // namespace bluez |
| 470 | 477 |
| 471 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_ADAPTER_BLUEZ_H_ | 478 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_ADAPTER_BLUEZ_H_ |
| OLD | NEW |