| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energ
y_api.h" | 5 #include "chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energ
y_api.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <iterator> | 9 #include <iterator> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1426 return; | 1426 return; |
| 1427 } | 1427 } |
| 1428 std::vector<uint8_t> uint8_vector; | 1428 std::vector<uint8_t> uint8_vector; |
| 1429 uint8_vector.assign(params_->notification.value.begin(), | 1429 uint8_vector.assign(params_->notification.value.begin(), |
| 1430 params_->notification.value.end()); | 1430 params_->notification.value.end()); |
| 1431 | 1431 |
| 1432 bool indicate = params_->notification.should_indicate.get() | 1432 bool indicate = params_->notification.should_indicate.get() |
| 1433 ? *params_->notification.should_indicate | 1433 ? *params_->notification.should_indicate |
| 1434 : false; | 1434 : false; |
| 1435 device::BluetoothLocalGattCharacteristic::NotificationStatus status = | 1435 device::BluetoothLocalGattCharacteristic::NotificationStatus status = |
| 1436 characteristic->NotifyValueChanged(uint8_vector, indicate); | 1436 characteristic->NotifyValueChanged(nullptr, uint8_vector, indicate); |
| 1437 | 1437 |
| 1438 switch (status) { | 1438 switch (status) { |
| 1439 case device::BluetoothLocalGattCharacteristic::NOTIFICATION_SUCCESS: | 1439 case device::BluetoothLocalGattCharacteristic::NOTIFICATION_SUCCESS: |
| 1440 Respond(NoArguments()); | 1440 Respond(NoArguments()); |
| 1441 break; | 1441 break; |
| 1442 case device::BluetoothLocalGattCharacteristic::NOTIFY_PROPERTY_NOT_SET: | 1442 case device::BluetoothLocalGattCharacteristic::NOTIFY_PROPERTY_NOT_SET: |
| 1443 Respond(Error(kErrorNotifyPropertyNotSet)); | 1443 Respond(Error(kErrorNotifyPropertyNotSet)); |
| 1444 break; | 1444 break; |
| 1445 case device::BluetoothLocalGattCharacteristic::INDICATE_PROPERTY_NOT_SET: | 1445 case device::BluetoothLocalGattCharacteristic::INDICATE_PROPERTY_NOT_SET: |
| 1446 Respond(Error(kErrorIndicatePropertyNotSet)); | 1446 Respond(Error(kErrorIndicatePropertyNotSet)); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1482 params_->response.value->end()); | 1482 params_->response.value->end()); |
| 1483 } | 1483 } |
| 1484 event_router_->HandleRequestResponse( | 1484 event_router_->HandleRequestResponse( |
| 1485 extension(), params_->response.request_id, params_->response.is_error, | 1485 extension(), params_->response.request_id, params_->response.is_error, |
| 1486 uint8_vector); | 1486 uint8_vector); |
| 1487 Respond(NoArguments()); | 1487 Respond(NoArguments()); |
| 1488 } | 1488 } |
| 1489 | 1489 |
| 1490 } // namespace api | 1490 } // namespace api |
| 1491 } // namespace extensions | 1491 } // namespace extensions |
| OLD | NEW |