| Index: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
|
| diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
|
| index eeccc823e9f38608a8493cc4810b19ce4e5fca99..301a72c5b158078d3c5eb8c5f120b5a796cb8a5a 100644
|
| --- a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
|
| +++ b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
|
| @@ -343,6 +343,28 @@ bool BluetoothLowEnergyEventRouter::ReadCharacteristicValue(
|
| return true;
|
| }
|
|
|
| +bool BluetoothLowEnergyEventRouter::WriteCharacteristicValue(
|
| + const std::string& instance_id,
|
| + const std::vector<uint8>& value,
|
| + const base::Closure& callback,
|
| + const base::Closure& error_callback) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| + if (!adapter_) {
|
| + VLOG(1) << "BluetoothAdapter not ready.";
|
| + return false;
|
| + }
|
| +
|
| + BluetoothGattCharacteristic* characteristic =
|
| + FindCharacteristicById(instance_id);
|
| + if (!characteristic) {
|
| + VLOG(1) << "Characteristic not found: " << instance_id;
|
| + return false;
|
| + }
|
| +
|
| + characteristic->WriteRemoteCharacteristic(value, callback, error_callback);
|
| + return true;
|
| +}
|
| +
|
| void BluetoothLowEnergyEventRouter::SetAdapterForTesting(
|
| device::BluetoothAdapter* adapter) {
|
| adapter_ = adapter;
|
|
|