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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 // Delete a local service. | 261 // Delete a local service. |
262 void DeleteService(int32_t service_handle, | 262 void DeleteService(int32_t service_handle, |
263 const DeleteServiceCallback& callback) override; | 263 const DeleteServiceCallback& callback) override; |
264 // Send value indication to a remote device. | 264 // Send value indication to a remote device. |
265 void SendIndication(int32_t attribute_handle, | 265 void SendIndication(int32_t attribute_handle, |
266 mojom::BluetoothAddressPtr address, | 266 mojom::BluetoothAddressPtr address, |
267 bool confirm, | 267 bool confirm, |
268 mojo::Array<uint8_t> value, | 268 mojo::Array<uint8_t> value, |
269 const SendIndicationCallback& callback) override; | 269 const SendIndicationCallback& callback) override; |
270 | 270 |
| 271 // Bluetooth Mojo host interface - Bluetooth SDP functions |
| 272 void GetSdpRecords(mojom::BluetoothAddressPtr remote_addr, |
| 273 mojom::BluetoothUUIDPtr target_uuid) override; |
| 274 void CreateSdpRecord(mojom::BluetoothSdpRecordPtr record_mojo, |
| 275 const CreateSdpRecordCallback& callback) override; |
| 276 void RemoveSdpRecord(uint32_t service_handle, |
| 277 const RemoveSdpRecordCallback& callback) override; |
| 278 |
271 // Chrome observer callbacks | 279 // Chrome observer callbacks |
272 void OnPoweredOn( | 280 void OnPoweredOn( |
273 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; | 281 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; |
274 void OnPoweredOff( | 282 void OnPoweredOff( |
275 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; | 283 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; |
276 void OnPoweredError( | 284 void OnPoweredError( |
277 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; | 285 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; |
278 void OnDiscoveryStarted( | 286 void OnDiscoveryStarted( |
279 std::unique_ptr<device::BluetoothDiscoverySession> session); | 287 std::unique_ptr<device::BluetoothDiscoverySession> session); |
280 void OnDiscoveryStopped(); | 288 void OnDiscoveryStopped(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 void OnGattAttributeWriteRequest(const device::BluetoothDevice* device, | 366 void OnGattAttributeWriteRequest(const device::BluetoothDevice* device, |
359 const LocalGattAttribute* attribute, | 367 const LocalGattAttribute* attribute, |
360 const std::vector<uint8_t>& value, | 368 const std::vector<uint8_t>& value, |
361 int offset, | 369 int offset, |
362 const base::Closure& success_callback, | 370 const base::Closure& success_callback, |
363 const ErrorCallback& error_callback); | 371 const ErrorCallback& error_callback); |
364 | 372 |
365 void OnSetDiscoverable(bool discoverable, bool success, uint32_t timeout); | 373 void OnSetDiscoverable(bool discoverable, bool success, uint32_t timeout); |
366 void SetDiscoverable(bool discoverable, uint32_t timeout); | 374 void SetDiscoverable(bool discoverable, uint32_t timeout); |
367 | 375 |
| 376 void OnGetServiceRecordsDone( |
| 377 mojom::BluetoothAddressPtr remote_addr, |
| 378 mojom::BluetoothUUIDPtr target_uuid, |
| 379 const std::vector<bluez::BluetoothServiceRecordBlueZ>& records_bluez); |
| 380 void OnGetServiceRecordsError( |
| 381 mojom::BluetoothAddressPtr remote_addr, |
| 382 mojom::BluetoothUUIDPtr target_uuid, |
| 383 bluez::BluetoothServiceRecordBlueZ::ErrorCode error_code); |
| 384 |
368 bool CalledOnValidThread(); | 385 bool CalledOnValidThread(); |
369 | 386 |
370 mojo::Binding<mojom::BluetoothHost> binding_; | 387 mojo::Binding<mojom::BluetoothHost> binding_; |
371 | 388 |
372 scoped_refptr<bluez::BluetoothAdapterBlueZ> bluetooth_adapter_; | 389 scoped_refptr<bluez::BluetoothAdapterBlueZ> bluetooth_adapter_; |
373 scoped_refptr<device::BluetoothAdvertisement> advertisment_; | 390 scoped_refptr<device::BluetoothAdvertisement> advertisment_; |
374 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_; | 391 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_; |
375 std::unordered_map<std::string, | 392 std::unordered_map<std::string, |
376 std::unique_ptr<device::BluetoothGattNotifySession>> | 393 std::unique_ptr<device::BluetoothGattNotifySession>> |
377 notification_session_; | 394 notification_session_; |
(...skipping 14 matching lines...) Expand all Loading... |
392 | 409 |
393 // WeakPtrFactory to use for callbacks. | 410 // WeakPtrFactory to use for callbacks. |
394 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_; | 411 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_; |
395 | 412 |
396 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge); | 413 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge); |
397 }; | 414 }; |
398 | 415 |
399 } // namespace arc | 416 } // namespace arc |
400 | 417 |
401 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ | 418 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ |
OLD | NEW |