| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_DBUS_FAKE_BLUETOOTH_LE_ADVERTISING_MANAGER_CLIENT_H_ | 5 #ifndef DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_LE_ADVERTISING_MANAGER_CLIENT_H_ |
| 6 #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_LE_ADVERTISING_MANAGER_CLIENT_H_ | 6 #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_LE_ADVERTISING_MANAGER_CLIENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 void RegisterAdvertisement(const dbus::ObjectPath& manager_object_path, | 40 void RegisterAdvertisement(const dbus::ObjectPath& manager_object_path, |
| 41 const dbus::ObjectPath& advertisement_object_path, | 41 const dbus::ObjectPath& advertisement_object_path, |
| 42 const base::Closure& callback, | 42 const base::Closure& callback, |
| 43 const ErrorCallback& error_callback) override; | 43 const ErrorCallback& error_callback) override; |
| 44 void UnregisterAdvertisement( | 44 void UnregisterAdvertisement( |
| 45 const dbus::ObjectPath& manager_object_path, | 45 const dbus::ObjectPath& manager_object_path, |
| 46 const dbus::ObjectPath& advertisement_object_path, | 46 const dbus::ObjectPath& advertisement_object_path, |
| 47 const base::Closure& callback, | 47 const base::Closure& callback, |
| 48 const ErrorCallback& error_callback) override; | 48 const ErrorCallback& error_callback) override; |
| 49 | 49 |
| 50 void SetAdvertisingInterval(const dbus::ObjectPath& manager_object_path, |
| 51 uint16_t min_interval_ms, |
| 52 uint16_t max_interval_ms, |
| 53 const base::Closure& callback, |
| 54 const ErrorCallback& error_callback) override; |
| 55 |
| 50 // Register, unregister and retrieve pointers to profile server providers. | 56 // Register, unregister and retrieve pointers to profile server providers. |
| 51 void RegisterAdvertisementServiceProvider( | 57 void RegisterAdvertisementServiceProvider( |
| 52 FakeBluetoothLEAdvertisementServiceProvider* service_provider); | 58 FakeBluetoothLEAdvertisementServiceProvider* service_provider); |
| 53 void UnregisterAdvertisementServiceProvider( | 59 void UnregisterAdvertisementServiceProvider( |
| 54 FakeBluetoothLEAdvertisementServiceProvider* service_provider); | 60 FakeBluetoothLEAdvertisementServiceProvider* service_provider); |
| 55 FakeBluetoothLEAdvertisementServiceProvider* GetAdvertisementServiceProvider( | 61 FakeBluetoothLEAdvertisementServiceProvider* GetAdvertisementServiceProvider( |
| 56 const std::string& uuid); | 62 const std::string& uuid); |
| 57 | 63 |
| 58 // Advertising manager path that we simulate. | |
| 59 static const char kAdvertisingManagerPath[]; | |
| 60 | |
| 61 private: | 64 private: |
| 62 // Map of a D-Bus object path to the FakeBluetoothAdvertisementServiceProvider | 65 // Map of a D-Bus object path to the FakeBluetoothAdvertisementServiceProvider |
| 63 // registered for it; maintained by RegisterAdvertisementServiceProvider() and | 66 // registered for it; maintained by RegisterAdvertisementServiceProvider() and |
| 64 // UnregisterProfileServiceProvicer() called by the constructor and | 67 // UnregisterProfileServiceProvicer() called by the constructor and |
| 65 // destructor of FakeBluetoothAdvertisementServiceProvider. | 68 // destructor of FakeBluetoothAdvertisementServiceProvider. |
| 66 typedef std::map<dbus::ObjectPath, | 69 typedef std::map<dbus::ObjectPath, |
| 67 FakeBluetoothLEAdvertisementServiceProvider*> | 70 FakeBluetoothLEAdvertisementServiceProvider*> |
| 68 ServiceProviderMap; | 71 ServiceProviderMap; |
| 69 ServiceProviderMap service_provider_map_; | 72 ServiceProviderMap service_provider_map_; |
| 70 | 73 |
| 71 // Holds the currently registered advertisement. If there is no advertisement | 74 // Holds the currently registered advertisement. If there is no advertisement |
| 72 // registered, this path is empty. | 75 // registered, this path is empty. |
| 73 dbus::ObjectPath currently_registered_; | 76 dbus::ObjectPath currently_registered_; |
| 74 | 77 |
| 75 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothLEAdvertisingManagerClient); | 78 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothLEAdvertisingManagerClient); |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 } // namespace bluez | 81 } // namespace bluez |
| 79 | 82 |
| 80 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_LE_ADVERTISING_MANAGER_CLIENT_H_ | 83 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_LE_ADVERTISING_MANAGER_CLIENT_H_ |
| OLD | NEW |