| 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 CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ | 6 #define CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 void GattCharacteristicValueChanged( | 87 void GattCharacteristicValueChanged( |
| 88 device::BluetoothAdapter* adapter, | 88 device::BluetoothAdapter* adapter, |
| 89 device::BluetoothRemoteGattCharacteristic* characteristic, | 89 device::BluetoothRemoteGattCharacteristic* characteristic, |
| 90 const std::vector<uint8_t>& value) override; | 90 const std::vector<uint8_t>& value) override; |
| 91 | 91 |
| 92 // Notifies the WebBluetoothServiceClient that characteristic | 92 // Notifies the WebBluetoothServiceClient that characteristic |
| 93 // |characteristic_instance_id| changed it's value. We only do this for | 93 // |characteristic_instance_id| changed it's value. We only do this for |
| 94 // characteristics that have been returned to the client in the past. | 94 // characteristics that have been returned to the client in the past. |
| 95 void NotifyCharacteristicValueChanged( | 95 void NotifyCharacteristicValueChanged( |
| 96 const std::string& characteristic_instance_id, | 96 const std::string& characteristic_instance_id, |
| 97 std::vector<uint8_t> value); | 97 const std::vector<uint8_t>& value); |
| 98 | 98 |
| 99 // WebBluetoothService methods: | 99 // WebBluetoothService methods: |
| 100 void SetClient( | 100 void SetClient( |
| 101 blink::mojom::WebBluetoothServiceClientAssociatedPtrInfo client) override; | 101 blink::mojom::WebBluetoothServiceClientAssociatedPtrInfo client) override; |
| 102 void RequestDevice(blink::mojom::WebBluetoothRequestDeviceOptionsPtr options, | 102 void RequestDevice(blink::mojom::WebBluetoothRequestDeviceOptionsPtr options, |
| 103 const RequestDeviceCallback& callback) override; | 103 const RequestDeviceCallback& callback) override; |
| 104 void RemoteServerConnect( | 104 void RemoteServerConnect( |
| 105 const WebBluetoothDeviceId& device_id, | 105 const WebBluetoothDeviceId& device_id, |
| 106 const RemoteServerConnectCallback& callback) override; | 106 const RemoteServerConnectCallback& callback) override; |
| 107 void RemoteServerDisconnect(const WebBluetoothDeviceId& device_id) override; | 107 void RemoteServerDisconnect(const WebBluetoothDeviceId& device_id) override; |
| 108 void RemoteServerGetPrimaryServices( | 108 void RemoteServerGetPrimaryServices( |
| 109 const WebBluetoothDeviceId& device_id, | 109 const WebBluetoothDeviceId& device_id, |
| 110 blink::mojom::WebBluetoothGATTQueryQuantity quantity, | 110 blink::mojom::WebBluetoothGATTQueryQuantity quantity, |
| 111 const base::Optional<device::BluetoothUUID>& service_uuid, | 111 const base::Optional<device::BluetoothUUID>& services_uuid, |
| 112 const RemoteServerGetPrimaryServicesCallback& callback) override; | 112 const RemoteServerGetPrimaryServicesCallback& callback) override; |
| 113 void RemoteServiceGetCharacteristics( | 113 void RemoteServiceGetCharacteristics( |
| 114 const mojo::String& service_instance_id, | 114 const std::string& service_instance_id, |
| 115 blink::mojom::WebBluetoothGATTQueryQuantity quantity, | 115 blink::mojom::WebBluetoothGATTQueryQuantity quantity, |
| 116 const base::Optional<device::BluetoothUUID>& characteristics_uuid, | 116 const base::Optional<device::BluetoothUUID>& characteristics_uuid, |
| 117 const RemoteServiceGetCharacteristicsCallback& callback) override; | 117 const RemoteServiceGetCharacteristicsCallback& callback) override; |
| 118 void RemoteCharacteristicReadValue( | 118 void RemoteCharacteristicReadValue( |
| 119 const mojo::String& characteristic_instance_id, | 119 const std::string& characteristic_instance_id, |
| 120 const RemoteCharacteristicReadValueCallback& callback) override; | 120 const RemoteCharacteristicReadValueCallback& callback) override; |
| 121 void RemoteCharacteristicWriteValue( | 121 void RemoteCharacteristicWriteValue( |
| 122 const mojo::String& characteristic_instance_id, | 122 const std::string& characteristic_instance_id, |
| 123 mojo::Array<uint8_t> value, | 123 const std::vector<uint8_t>& value, |
| 124 const RemoteCharacteristicWriteValueCallback& callback) override; | 124 const RemoteCharacteristicWriteValueCallback& callback) override; |
| 125 void RemoteCharacteristicStartNotifications( | 125 void RemoteCharacteristicStartNotifications( |
| 126 const mojo::String& characteristic_instance_id, | 126 const std::string& characteristic_instance_id, |
| 127 const RemoteCharacteristicStartNotificationsCallback& callback) override; | 127 const RemoteCharacteristicStartNotificationsCallback& callback) override; |
| 128 void RemoteCharacteristicStopNotifications( | 128 void RemoteCharacteristicStopNotifications( |
| 129 const mojo::String& characteristic_instance_id, | 129 const std::string& characteristic_instance_id, |
| 130 const RemoteCharacteristicStopNotificationsCallback& callback) override; | 130 const RemoteCharacteristicStopNotificationsCallback& callback) override; |
| 131 | 131 |
| 132 void RequestDeviceImpl( | 132 void RequestDeviceImpl( |
| 133 blink::mojom::WebBluetoothRequestDeviceOptionsPtr options, | 133 blink::mojom::WebBluetoothRequestDeviceOptionsPtr options, |
| 134 const RequestDeviceCallback& callback, | 134 const RequestDeviceCallback& callback, |
| 135 device::BluetoothAdapter* adapter); | 135 device::BluetoothAdapter* adapter); |
| 136 | 136 |
| 137 // Should only be run after the services have been discovered for | 137 // Should only be run after the services have been discovered for |
| 138 // |device_address|. | 138 // |device_address|. |
| 139 void RemoteServerGetPrimaryServicesImpl( | 139 void RemoteServerGetPrimaryServicesImpl( |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 mojo::Binding<blink::mojom::WebBluetoothService> binding_; | 253 mojo::Binding<blink::mojom::WebBluetoothService> binding_; |
| 254 | 254 |
| 255 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_; | 255 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_; |
| 256 | 256 |
| 257 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl); | 257 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl); |
| 258 }; | 258 }; |
| 259 | 259 |
| 260 } // namespace content | 260 } // namespace content |
| 261 | 261 |
| 262 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ | 262 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ |
| OLD | NEW |