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 COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ | 5 #ifndef COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ |
6 #define COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ | 6 #define COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // Delete a local service. | 258 // Delete a local service. |
259 void DeleteService(int32_t service_handle, | 259 void DeleteService(int32_t service_handle, |
260 const DeleteServiceCallback& callback) override; | 260 const DeleteServiceCallback& callback) override; |
261 // Send value indication to a remote device. | 261 // Send value indication to a remote device. |
262 void SendIndication(int32_t attribute_handle, | 262 void SendIndication(int32_t attribute_handle, |
263 mojom::BluetoothAddressPtr address, | 263 mojom::BluetoothAddressPtr address, |
264 bool confirm, | 264 bool confirm, |
265 mojo::Array<uint8_t> value, | 265 mojo::Array<uint8_t> value, |
266 const SendIndicationCallback& callback) override; | 266 const SendIndicationCallback& callback) override; |
267 | 267 |
| 268 // Bluetooth Mojo host interface - Bluetooth SDP functions |
| 269 void GetSdpRecords(mojom::BluetoothAddressPtr remote_addr, |
| 270 mojom::BluetoothUUIDPtr target_uuid) override; |
| 271 void CreateSdpRecord(mojom::BluetoothSdpRecordPtr record, |
| 272 const CreateSdpRecordCallback& callback) override; |
| 273 void RemoveSdpRecord(uint32_t service_handle, |
| 274 const RemoveSdpRecordCallback& callback) override; |
| 275 |
268 // Chrome observer callbacks | 276 // Chrome observer callbacks |
269 void OnPoweredOn( | 277 void OnPoweredOn( |
270 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; | 278 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; |
271 void OnPoweredOff( | 279 void OnPoweredOff( |
272 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; | 280 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; |
273 void OnPoweredError( | 281 void OnPoweredError( |
274 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; | 282 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; |
275 void OnDiscoveryStarted( | 283 void OnDiscoveryStarted( |
276 std::unique_ptr<device::BluetoothDiscoverySession> session); | 284 std::unique_ptr<device::BluetoothDiscoverySession> session); |
277 void OnDiscoveryStopped(); | 285 void OnDiscoveryStopped(); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 360 |
353 // Common code for OnCharacteristicWriteRequest and OnDescriptorWriteRequest | 361 // Common code for OnCharacteristicWriteRequest and OnDescriptorWriteRequest |
354 template <class LocalGattAttribute> | 362 template <class LocalGattAttribute> |
355 void OnGattAttributeWriteRequest(const device::BluetoothDevice* device, | 363 void OnGattAttributeWriteRequest(const device::BluetoothDevice* device, |
356 const LocalGattAttribute* attribute, | 364 const LocalGattAttribute* attribute, |
357 const std::vector<uint8_t>& value, | 365 const std::vector<uint8_t>& value, |
358 int offset, | 366 int offset, |
359 const base::Closure& success_callback, | 367 const base::Closure& success_callback, |
360 const ErrorCallback& error_callback); | 368 const ErrorCallback& error_callback); |
361 | 369 |
| 370 void OnGetServiceRecordsDone( |
| 371 mojom::BluetoothAddressPtr remote_addr, |
| 372 mojom::BluetoothUUIDPtr target_uuid, |
| 373 const std::vector<bluez::BluetoothServiceRecordBlueZ>& records); |
| 374 void OnGetServiceRecordsError( |
| 375 mojom::BluetoothAddressPtr remote_addr, |
| 376 mojom::BluetoothUUIDPtr target_uuid, |
| 377 bluez::BluetoothServiceRecordBlueZ::ErrorCode error_code); |
| 378 |
362 bool CalledOnValidThread(); | 379 bool CalledOnValidThread(); |
363 | 380 |
364 mojo::Binding<mojom::BluetoothHost> binding_; | 381 mojo::Binding<mojom::BluetoothHost> binding_; |
365 | 382 |
366 scoped_refptr<bluez::BluetoothAdapterBlueZ> bluetooth_adapter_; | 383 scoped_refptr<bluez::BluetoothAdapterBlueZ> bluetooth_adapter_; |
367 scoped_refptr<device::BluetoothAdvertisement> advertisment_; | 384 scoped_refptr<device::BluetoothAdvertisement> advertisment_; |
368 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_; | 385 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_; |
369 std::unordered_map<std::string, | 386 std::unordered_map<std::string, |
370 std::unique_ptr<device::BluetoothGattNotifySession>> | 387 std::unique_ptr<device::BluetoothGattNotifySession>> |
371 notification_session_; | 388 notification_session_; |
(...skipping 10 matching lines...) Expand all Loading... |
382 | 399 |
383 // WeakPtrFactory to use for callbacks. | 400 // WeakPtrFactory to use for callbacks. |
384 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_; | 401 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_; |
385 | 402 |
386 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge); | 403 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge); |
387 }; | 404 }; |
388 | 405 |
389 } // namespace arc | 406 } // namespace arc |
390 | 407 |
391 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ | 408 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ |
OLD | NEW |