| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/proximity_auth/ble/bluetooth_low_energy_connection.h" | 5 #include "components/proximity_auth/ble/bluetooth_low_energy_connection.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 } | 311 } |
| 312 } | 312 } |
| 313 | 313 |
| 314 BluetoothLowEnergyConnection::WriteRequest::WriteRequest( | 314 BluetoothLowEnergyConnection::WriteRequest::WriteRequest( |
| 315 const std::vector<uint8_t>& val, | 315 const std::vector<uint8_t>& val, |
| 316 bool flag) | 316 bool flag) |
| 317 : value(val), | 317 : value(val), |
| 318 is_last_write_for_wire_message(flag), | 318 is_last_write_for_wire_message(flag), |
| 319 number_of_failed_attempts(0) {} | 319 number_of_failed_attempts(0) {} |
| 320 | 320 |
| 321 BluetoothLowEnergyConnection::WriteRequest::WriteRequest( |
| 322 const WriteRequest& other) = default; |
| 323 |
| 321 BluetoothLowEnergyConnection::WriteRequest::~WriteRequest() {} | 324 BluetoothLowEnergyConnection::WriteRequest::~WriteRequest() {} |
| 322 | 325 |
| 323 void BluetoothLowEnergyConnection::CompleteConnection() { | 326 void BluetoothLowEnergyConnection::CompleteConnection() { |
| 324 PA_LOG(INFO) << "Connection completed. Time elapsed: " | 327 PA_LOG(INFO) << "Connection completed. Time elapsed: " |
| 325 << base::TimeTicks::Now() - start_time_; | 328 << base::TimeTicks::Now() - start_time_; |
| 326 SetSubStatus(SubStatus::CONNECTED); | 329 SetSubStatus(SubStatus::CONNECTED); |
| 327 } | 330 } |
| 328 | 331 |
| 329 void BluetoothLowEnergyConnection::OnCreateGattConnectionError( | 332 void BluetoothLowEnergyConnection::OnCreateGattConnectionError( |
| 330 device::BluetoothDevice::ConnectErrorCode error_code) { | 333 device::BluetoothDevice::ConnectErrorCode error_code) { |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 const uint32_t value) { | 609 const uint32_t value) { |
| 607 std::vector<uint8_t> bytes(4, 0); | 610 std::vector<uint8_t> bytes(4, 0); |
| 608 bytes[0] = static_cast<uint8_t>(value); | 611 bytes[0] = static_cast<uint8_t>(value); |
| 609 bytes[1] = static_cast<uint8_t>(value >> 8); | 612 bytes[1] = static_cast<uint8_t>(value >> 8); |
| 610 bytes[2] = static_cast<uint8_t>(value >> 16); | 613 bytes[2] = static_cast<uint8_t>(value >> 16); |
| 611 bytes[3] = static_cast<uint8_t>(value >> 24); | 614 bytes[3] = static_cast<uint8_t>(value >> 24); |
| 612 return bytes; | 615 return bytes; |
| 613 } | 616 } |
| 614 | 617 |
| 615 } // namespace proximity_auth | 618 } // namespace proximity_auth |
| OLD | NEW |