Chromium Code Reviews| Index: components/arc/bluetooth/arc_bluetooth_bridge.h |
| diff --git a/components/arc/bluetooth/arc_bluetooth_bridge.h b/components/arc/bluetooth/arc_bluetooth_bridge.h |
| index cebf74f7253c0ffba1431be1f69f9004ea8b885f..7014779c9ddbd72ff77c9600028f41c359acb9a5 100644 |
| --- a/components/arc/bluetooth/arc_bluetooth_bridge.h |
| +++ b/components/arc/bluetooth/arc_bluetooth_bridge.h |
| @@ -20,6 +20,9 @@ |
| #include "device/bluetooth/bluetooth_adapter_factory.h" |
| #include "device/bluetooth/bluetooth_device.h" |
| #include "device/bluetooth/bluetooth_discovery_session.h" |
| +#include "device/bluetooth/bluetooth_local_gatt_characteristic.h" |
|
rkc
2016/07/01 21:28:27
Forward declare the class and keep the header incl
puthik_chromium
2016/07/14 19:01:32
Done.
|
| +#include "device/bluetooth/bluetooth_local_gatt_descriptor.h" |
| +#include "device/bluetooth/bluetooth_local_gatt_service.h" |
| #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" |
| #include "device/bluetooth/bluetooth_remote_gatt_descriptor.h" |
| #include "device/bluetooth/bluetooth_remote_gatt_service.h" |
| @@ -35,6 +38,7 @@ class ArcBluetoothBridge |
| public ArcBridgeService::Observer, |
| public device::BluetoothAdapter::Observer, |
| public device::BluetoothAdapterFactory::AdapterCallback, |
| + public device::BluetoothLocalGattService::Delegate, |
| public mojom::BluetoothHost { |
| public: |
| explicit ArcBluetoothBridge(ArcBridgeService* bridge_service); |
| @@ -113,6 +117,45 @@ class ArcBluetoothBridge |
| device::BluetoothRemoteGattDescriptor* descriptor, |
| const std::vector<uint8_t>& value) override; |
| + // Overridden from device::BluetoothLocalGattService::Delegate |
| + void OnCharacteristicReadRequest( |
| + const device::BluetoothDevice* device, |
| + const device::BluetoothLocalGattCharacteristic* characteristic, |
| + int offset, |
| + const ValueCallback& callback, |
| + const ErrorCallback& error_callback) override; |
| + |
| + void OnCharacteristicWriteRequest( |
| + const device::BluetoothDevice* device, |
| + const device::BluetoothLocalGattCharacteristic* characteristic, |
| + const std::vector<uint8_t>& value, |
| + int offset, |
| + const base::Closure& callback, |
| + const ErrorCallback& error_callback) override; |
| + |
| + void OnDescriptorReadRequest( |
| + const device::BluetoothDevice* device, |
| + const device::BluetoothLocalGattDescriptor* descriptor, |
| + int offset, |
| + const ValueCallback& callback, |
| + const ErrorCallback& error_callback) override; |
| + |
| + void OnDescriptorWriteRequest( |
| + const device::BluetoothDevice* device, |
| + const device::BluetoothLocalGattDescriptor* descriptor, |
| + const std::vector<uint8_t>& value, |
| + int offset, |
| + const base::Closure& callback, |
| + const ErrorCallback& error_callback) override; |
| + |
| + void OnNotificationsStart( |
| + const device::BluetoothDevice* device, |
| + const device::BluetoothLocalGattCharacteristic* characteristic) override; |
| + |
| + void OnNotificationsStop( |
| + const device::BluetoothDevice* device, |
| + const device::BluetoothLocalGattCharacteristic* characteristic) override; |
| + |
| // Bluetooth Mojo host interface |
| void EnableAdapter(const EnableAdapterCallback& callback) override; |
| void DisableAdapter(const DisableAdapterCallback& callback) override; |
| @@ -190,6 +233,47 @@ class ArcBluetoothBridge |
| void ReadRemoteRssi(mojom::BluetoothAddressPtr remote_addr, |
| const ReadRemoteRssiCallback& callback) override; |
| + // Bluetooth Mojo host interface - Bluetooth Gatt Server functions |
| + // Create a new service. Chrome will create an integer service handle based on |
| + // that BlueZ identifier that will pass back to Android in the callback. |
| + // num_handles: number of handle for characteristic / descriptor that will be |
| + // created in this service |
| + void AddService(mojom::BluetoothGattServiceIDPtr service_id, |
| + int32_t num_handles, |
| + const AddServiceCallback& callback) override; |
| + // Add a characteristic to a service and pass the characteristic handle back. |
| + void AddCharacteristic(int32_t service_handle, |
| + mojom::BluetoothUUIDPtr uuid, |
| + int32_t properties, |
| + int32_t permissions, |
| + const AddCharacteristicCallback& callback) override; |
| + // Add a descriptor to a given service and pass the descriptor handle back. |
| + void AddDescriptor(int32_t service_handle, |
| + mojom::BluetoothUUIDPtr uuid, |
| + int32_t permissions, |
| + const AddDescriptorCallback& callback) override; |
| + // Starts a local service |
| + void StartService(int32_t service_handle, |
| + device::BluetoothTransport device_type, |
|
rkc
2016/07/01 21:28:27
The transport doesn't make sense for starting a se
puthik_chromium
2016/07/14 19:01:31
I agree that it does not make sense. Removed.
|
| + const StartServiceCallback& callback) override; |
| + // Stops a local service |
| + void StopService(int32_t service_handle, |
| + const StopServiceCallback& callback) override; |
| + // Delete a local service |
| + void DeleteService(int32_t service_handle, |
| + const DeleteServiceCallback& callback) override; |
| + // Send value indication to a remote device |
| + void SendIndication(int32_t attribute_handle, |
| + mojom::BluetoothAddressPtr address, |
| + bool confirm, |
| + mojo::Array<uint8_t> value, |
| + const SendIndicationCallback& callback) override; |
| + // Send a response to a read/write operation |
| + void SendResponse(int32_t trans_id, |
| + int32_t status, |
| + mojo::Array<uint8_t> value, |
| + const SendResponseCallback& callback) override; |
| + |
| // Chrome observer callbacks |
| void OnPoweredOn( |
| const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; |