OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "device/bluetooth/bluez/bluetooth_adapter_bluez.h" | 5 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 property_name == properties->trusted.name() || | 576 property_name == properties->trusted.name() || |
577 property_name == properties->connected.name() || | 577 property_name == properties->connected.name() || |
578 property_name == properties->uuids.name() || | 578 property_name == properties->uuids.name() || |
579 property_name == properties->rssi.name() || | 579 property_name == properties->rssi.name() || |
580 property_name == properties->tx_power.name()) { | 580 property_name == properties->tx_power.name()) { |
581 NotifyDeviceChanged(device_bluez); | 581 NotifyDeviceChanged(device_bluez); |
582 } | 582 } |
583 | 583 |
584 if (property_name == properties->services_resolved.name() && | 584 if (property_name == properties->services_resolved.name() && |
585 properties->services_resolved.value()) { | 585 properties->services_resolved.value()) { |
| 586 device_bluez->UpdateGattServices(object_path); |
586 NotifyGattServicesDiscovered(device_bluez); | 587 NotifyGattServicesDiscovered(device_bluez); |
587 } | 588 } |
588 | 589 |
589 // When a device becomes paired, mark it as trusted so that the user does | 590 // When a device becomes paired, mark it as trusted so that the user does |
590 // not need to approve every incoming connection | 591 // not need to approve every incoming connection |
591 if (property_name == properties->paired.name()) { | 592 if (property_name == properties->paired.name()) { |
592 if (properties->paired.value() && !properties->trusted.value()) { | 593 if (properties->paired.value() && !properties->trusted.value()) { |
593 device_bluez->SetTrusted(); | 594 device_bluez->SetTrusted(); |
594 } | 595 } |
595 NotifyDevicePairedChanged(device_bluez, properties->paired.value()); | 596 NotifyDevicePairedChanged(device_bluez, properties->paired.value()); |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1684 } else if (error_name == bluetooth_adapter::kErrorAlreadyExists) { | 1685 } else if (error_name == bluetooth_adapter::kErrorAlreadyExists) { |
1685 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_RECORD_ALREADY_EXISTS; | 1686 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_RECORD_ALREADY_EXISTS; |
1686 } else if (error_name == bluetooth_adapter::kErrorNotReady) { | 1687 } else if (error_name == bluetooth_adapter::kErrorNotReady) { |
1687 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_ADAPTER_NOT_READY; | 1688 code = BluetoothServiceRecordBlueZ::ErrorCode::ERROR_ADAPTER_NOT_READY; |
1688 } | 1689 } |
1689 | 1690 |
1690 error_callback.Run(code); | 1691 error_callback.Run(code); |
1691 } | 1692 } |
1692 | 1693 |
1693 } // namespace bluez | 1694 } // namespace bluez |
OLD | NEW |