OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROMEOS_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_CHROMEOS_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_CHROMEOS_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_CHROMEOS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 22 matching lines...) Expand all Loading... |
33 class BluetoothRemoteGattDescriptorChromeOS; | 33 class BluetoothRemoteGattDescriptorChromeOS; |
34 | 34 |
35 // The BluetoothRemoteGattServiceChromeOS class implements BluetootGattService | 35 // The BluetoothRemoteGattServiceChromeOS class implements BluetootGattService |
36 // for remote GATT services on the the Chrome OS platform. | 36 // for remote GATT services on the the Chrome OS platform. |
37 class BluetoothRemoteGattServiceChromeOS | 37 class BluetoothRemoteGattServiceChromeOS |
38 : public device::BluetoothGattService, | 38 : public device::BluetoothGattService, |
39 public BluetoothGattServiceClient::Observer, | 39 public BluetoothGattServiceClient::Observer, |
40 public BluetoothGattCharacteristicClient::Observer { | 40 public BluetoothGattCharacteristicClient::Observer { |
41 public: | 41 public: |
42 // device::BluetoothGattService overrides. | 42 // device::BluetoothGattService overrides. |
43 virtual std::string GetIdentifier() const OVERRIDE; | 43 virtual std::string GetIdentifier() const override; |
44 virtual device::BluetoothUUID GetUUID() const OVERRIDE; | 44 virtual device::BluetoothUUID GetUUID() const override; |
45 virtual bool IsLocal() const OVERRIDE; | 45 virtual bool IsLocal() const override; |
46 virtual bool IsPrimary() const OVERRIDE; | 46 virtual bool IsPrimary() const override; |
47 virtual device::BluetoothDevice* GetDevice() const OVERRIDE; | 47 virtual device::BluetoothDevice* GetDevice() const override; |
48 virtual std::vector<device::BluetoothGattCharacteristic*> | 48 virtual std::vector<device::BluetoothGattCharacteristic*> |
49 GetCharacteristics() const OVERRIDE; | 49 GetCharacteristics() const override; |
50 virtual std::vector<device::BluetoothGattService*> | 50 virtual std::vector<device::BluetoothGattService*> |
51 GetIncludedServices() const OVERRIDE; | 51 GetIncludedServices() const override; |
52 virtual device::BluetoothGattCharacteristic* GetCharacteristic( | 52 virtual device::BluetoothGattCharacteristic* GetCharacteristic( |
53 const std::string& identifier) const OVERRIDE; | 53 const std::string& identifier) const override; |
54 virtual bool AddCharacteristic( | 54 virtual bool AddCharacteristic( |
55 device::BluetoothGattCharacteristic* characteristic) OVERRIDE; | 55 device::BluetoothGattCharacteristic* characteristic) override; |
56 virtual bool AddIncludedService( | 56 virtual bool AddIncludedService( |
57 device::BluetoothGattService* service) OVERRIDE; | 57 device::BluetoothGattService* service) override; |
58 virtual void Register(const base::Closure& callback, | 58 virtual void Register(const base::Closure& callback, |
59 const ErrorCallback& error_callback) OVERRIDE; | 59 const ErrorCallback& error_callback) override; |
60 virtual void Unregister(const base::Closure& callback, | 60 virtual void Unregister(const base::Closure& callback, |
61 const ErrorCallback& error_callback) OVERRIDE; | 61 const ErrorCallback& error_callback) override; |
62 | 62 |
63 // Object path of the underlying service. | 63 // Object path of the underlying service. |
64 const dbus::ObjectPath& object_path() const { return object_path_; } | 64 const dbus::ObjectPath& object_path() const { return object_path_; } |
65 | 65 |
66 // Parses a named D-Bus error into a service error code. | 66 // Parses a named D-Bus error into a service error code. |
67 static device::BluetoothGattService::GattErrorCode DBusErrorToServiceError( | 67 static device::BluetoothGattService::GattErrorCode DBusErrorToServiceError( |
68 const std::string error_name); | 68 const std::string error_name); |
69 | 69 |
70 // Returns the adapter associated with this service. | 70 // Returns the adapter associated with this service. |
71 BluetoothAdapterChromeOS* GetAdapter() const; | 71 BluetoothAdapterChromeOS* GetAdapter() const; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 friend class BluetoothDeviceChromeOS; | 106 friend class BluetoothDeviceChromeOS; |
107 | 107 |
108 BluetoothRemoteGattServiceChromeOS(BluetoothAdapterChromeOS* adapter, | 108 BluetoothRemoteGattServiceChromeOS(BluetoothAdapterChromeOS* adapter, |
109 BluetoothDeviceChromeOS* device, | 109 BluetoothDeviceChromeOS* device, |
110 const dbus::ObjectPath& object_path); | 110 const dbus::ObjectPath& object_path); |
111 virtual ~BluetoothRemoteGattServiceChromeOS(); | 111 virtual ~BluetoothRemoteGattServiceChromeOS(); |
112 | 112 |
113 // BluetoothGattServiceClient::Observer override. | 113 // BluetoothGattServiceClient::Observer override. |
114 virtual void GattServicePropertyChanged( | 114 virtual void GattServicePropertyChanged( |
115 const dbus::ObjectPath& object_path, | 115 const dbus::ObjectPath& object_path, |
116 const std::string& property_name) OVERRIDE; | 116 const std::string& property_name) override; |
117 | 117 |
118 // BluetoothGattCharacteristicClient::Observer override. | 118 // BluetoothGattCharacteristicClient::Observer override. |
119 virtual void GattCharacteristicAdded( | 119 virtual void GattCharacteristicAdded( |
120 const dbus::ObjectPath& object_path) OVERRIDE; | 120 const dbus::ObjectPath& object_path) override; |
121 virtual void GattCharacteristicRemoved( | 121 virtual void GattCharacteristicRemoved( |
122 const dbus::ObjectPath& object_path) OVERRIDE; | 122 const dbus::ObjectPath& object_path) override; |
123 virtual void GattCharacteristicPropertyChanged( | 123 virtual void GattCharacteristicPropertyChanged( |
124 const dbus::ObjectPath& object_path, | 124 const dbus::ObjectPath& object_path, |
125 const std::string& property_name) OVERRIDE; | 125 const std::string& property_name) override; |
126 | 126 |
127 // Object path of the GATT service. | 127 // Object path of the GATT service. |
128 dbus::ObjectPath object_path_; | 128 dbus::ObjectPath object_path_; |
129 | 129 |
130 // The adapter associated with this service. It's ok to store a raw pointer | 130 // The adapter associated with this service. It's ok to store a raw pointer |
131 // here since |adapter_| indirectly owns this instance. | 131 // here since |adapter_| indirectly owns this instance. |
132 BluetoothAdapterChromeOS* adapter_; | 132 BluetoothAdapterChromeOS* adapter_; |
133 | 133 |
134 // The device this GATT service belongs to. It's ok to store a raw pointer | 134 // The device this GATT service belongs to. It's ok to store a raw pointer |
135 // here since |device_| owns this instance. | 135 // here since |device_| owns this instance. |
(...skipping 14 matching lines...) Expand all Loading... |
150 // Note: This should remain the last member so it'll be destroyed and | 150 // Note: This should remain the last member so it'll be destroyed and |
151 // invalidate its weak pointers before any other members are destroyed. | 151 // invalidate its weak pointers before any other members are destroyed. |
152 base::WeakPtrFactory<BluetoothRemoteGattServiceChromeOS> weak_ptr_factory_; | 152 base::WeakPtrFactory<BluetoothRemoteGattServiceChromeOS> weak_ptr_factory_; |
153 | 153 |
154 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattServiceChromeOS); | 154 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattServiceChromeOS); |
155 }; | 155 }; |
156 | 156 |
157 } // namespace chromeos | 157 } // namespace chromeos |
158 | 158 |
159 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_CHROMEOS_H_ | 159 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_SERVICE_CHROMEOS_H_ |
OLD | NEW |