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 #include "components/arc/bluetooth/arc_bluetooth_bridge.h" | 5 #include "components/arc/bluetooth/arc_bluetooth_bridge.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <iomanip> | 10 #include <iomanip> |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 properties.push_back(std::move(btp)); | 566 properties.push_back(std::move(btp)); |
567 } | 567 } |
568 if (type == mojom::BluetoothPropertyType::ALL || | 568 if (type == mojom::BluetoothPropertyType::ALL || |
569 type == mojom::BluetoothPropertyType::REMOTE_FRIENDLY_NAME) { | 569 type == mojom::BluetoothPropertyType::REMOTE_FRIENDLY_NAME) { |
570 mojom::BluetoothPropertyPtr btp = mojom::BluetoothProperty::New(); | 570 mojom::BluetoothPropertyPtr btp = mojom::BluetoothProperty::New(); |
571 btp->set_bdname(mojo::String::From(base::UTF16ToUTF8(device->GetName()))); | 571 btp->set_bdname(mojo::String::From(base::UTF16ToUTF8(device->GetName()))); |
572 properties.push_back(std::move(btp)); | 572 properties.push_back(std::move(btp)); |
573 } | 573 } |
574 if (type == mojom::BluetoothPropertyType::ALL || | 574 if (type == mojom::BluetoothPropertyType::ALL || |
575 type == mojom::BluetoothPropertyType::REMOTE_RSSI) { | 575 type == mojom::BluetoothPropertyType::REMOTE_RSSI) { |
576 mojom::BluetoothPropertyPtr btp = mojom::BluetoothProperty::New(); | 576 if (device->GetInquiryRSSI()) { |
577 btp->set_remote_rssi(device->GetInquiryRSSI()); | 577 mojom::BluetoothPropertyPtr btp = mojom::BluetoothProperty::New(); |
578 properties.push_back(std::move(btp)); | 578 btp->set_remote_rssi(device->GetInquiryRSSI().value()); |
| 579 properties.push_back(std::move(btp)); |
| 580 } |
579 } | 581 } |
580 // TODO(smbarber): Add remote version info | 582 // TODO(smbarber): Add remote version info |
581 | 583 |
582 return properties; | 584 return properties; |
583 } | 585 } |
584 | 586 |
585 mojo::Array<mojom::BluetoothPropertyPtr> | 587 mojo::Array<mojom::BluetoothPropertyPtr> |
586 ArcBluetoothBridge::GetAdapterProperties( | 588 ArcBluetoothBridge::GetAdapterProperties( |
587 mojom::BluetoothPropertyType type) const { | 589 mojom::BluetoothPropertyType type) const { |
588 mojo::Array<mojom::BluetoothPropertyPtr> properties; | 590 mojo::Array<mojom::BluetoothPropertyPtr> properties; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 // to | 710 // to |
709 // make sure the bond state machine on Android is ready to take the | 711 // make sure the bond state machine on Android is ready to take the |
710 // pair-done event. Otherwise the pair-done event will be dropped as an | 712 // pair-done event. Otherwise the pair-done event will be dropped as an |
711 // invalid change of paired status. | 713 // invalid change of paired status. |
712 OnPairing(addr->Clone()); | 714 OnPairing(addr->Clone()); |
713 OnPairedDone(std::move(addr)); | 715 OnPairedDone(std::move(addr)); |
714 } | 716 } |
715 } | 717 } |
716 | 718 |
717 } // namespace arc | 719 } // namespace arc |
OLD | NEW |