| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/dbus/fake_bluetooth_device_client.h" | 5 #include "device/bluetooth/dbus/fake_bluetooth_device_client.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 base::MakeUnique<BluetoothServiceRecordBlueZ>(); | 107 base::MakeUnique<BluetoothServiceRecordBlueZ>(); |
| 108 // ID 0 = handle. | 108 // ID 0 = handle. |
| 109 record1->AddRecordEntry( | 109 record1->AddRecordEntry( |
| 110 0x0, BluetoothServiceAttributeValueBlueZ( | 110 0x0, BluetoothServiceAttributeValueBlueZ( |
| 111 BluetoothServiceAttributeValueBlueZ::UINT, 4, | 111 BluetoothServiceAttributeValueBlueZ::UINT, 4, |
| 112 base::MakeUnique<base::Value>(static_cast<int32_t>(0x1337)))); | 112 base::MakeUnique<base::Value>(static_cast<int32_t>(0x1337)))); |
| 113 // ID 1 = service class id list. | 113 // ID 1 = service class id list. |
| 114 std::unique_ptr<BluetoothServiceAttributeValueBlueZ::Sequence> class_id_list = | 114 std::unique_ptr<BluetoothServiceAttributeValueBlueZ::Sequence> class_id_list = |
| 115 base::MakeUnique<BluetoothServiceAttributeValueBlueZ::Sequence>(); | 115 base::MakeUnique<BluetoothServiceAttributeValueBlueZ::Sequence>(); |
| 116 class_id_list->emplace_back(BluetoothServiceAttributeValueBlueZ::UUID, 4, | 116 class_id_list->emplace_back(BluetoothServiceAttributeValueBlueZ::UUID, 4, |
| 117 base::MakeUnique<base::StringValue>("1802")); | 117 base::MakeUnique<base::Value>("1802")); |
| 118 record1->AddRecordEntry( | 118 record1->AddRecordEntry( |
| 119 0x1, BluetoothServiceAttributeValueBlueZ(std::move(class_id_list))); | 119 0x1, BluetoothServiceAttributeValueBlueZ(std::move(class_id_list))); |
| 120 records.emplace_back(*record1); | 120 records.emplace_back(*record1); |
| 121 | 121 |
| 122 std::unique_ptr<BluetoothServiceRecordBlueZ> record2 = | 122 std::unique_ptr<BluetoothServiceRecordBlueZ> record2 = |
| 123 base::MakeUnique<BluetoothServiceRecordBlueZ>(); | 123 base::MakeUnique<BluetoothServiceRecordBlueZ>(); |
| 124 // ID 0 = handle. | 124 // ID 0 = handle. |
| 125 record2->AddRecordEntry( | 125 record2->AddRecordEntry( |
| 126 0x0, | 126 0x0, |
| 127 BluetoothServiceAttributeValueBlueZ( | 127 BluetoothServiceAttributeValueBlueZ( |
| (...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1818 } | 1818 } |
| 1819 properties->type.set_valid(true); | 1819 properties->type.set_valid(true); |
| 1820 | 1820 |
| 1821 properties_map_.insert(std::make_pair(device_path, std::move(properties))); | 1821 properties_map_.insert(std::make_pair(device_path, std::move(properties))); |
| 1822 device_list_.push_back(device_path); | 1822 device_list_.push_back(device_path); |
| 1823 for (auto& observer : observers_) | 1823 for (auto& observer : observers_) |
| 1824 observer.DeviceAdded(device_path); | 1824 observer.DeviceAdded(device_path); |
| 1825 } | 1825 } |
| 1826 | 1826 |
| 1827 } // namespace bluez | 1827 } // namespace bluez |
| OLD | NEW |