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 "device/bluetooth/bluez/bluetooth_service_record_bluez.h" | 5 #include "device/bluetooth/bluez/bluetooth_service_record_bluez.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 EXPECT_TRUE(service_handle1.value().GetAsInteger(&int_value)); | 123 EXPECT_TRUE(service_handle1.value().GetAsInteger(&int_value)); |
124 EXPECT_EQ(0xffffffff, static_cast<uint32_t>(int_value)); | 124 EXPECT_EQ(0xffffffff, static_cast<uint32_t>(int_value)); |
125 } | 125 } |
126 | 126 |
127 protected: | 127 protected: |
128 BluetoothServiceRecordBlueZ CreateaServiceRecord(const std::string uuid) { | 128 BluetoothServiceRecordBlueZ CreateaServiceRecord(const std::string uuid) { |
129 BluetoothServiceRecordBlueZ record; | 129 BluetoothServiceRecordBlueZ record; |
130 record.AddRecordEntry(kServiceUuidAttributeId, | 130 record.AddRecordEntry(kServiceUuidAttributeId, |
131 BluetoothServiceAttributeValueBlueZ( | 131 BluetoothServiceAttributeValueBlueZ( |
132 BluetoothServiceAttributeValueBlueZ::UUID, 16, | 132 BluetoothServiceAttributeValueBlueZ::UUID, 16, |
133 base::MakeUnique<base::StringValue>(uuid))); | 133 base::MakeUnique<base::Value>(uuid))); |
134 return record; | 134 return record; |
135 } | 135 } |
136 | 136 |
137 BluetoothAdapterBlueZ* adapter_bluez_; | 137 BluetoothAdapterBlueZ* adapter_bluez_; |
138 size_t success_callbacks_; | 138 size_t success_callbacks_; |
139 size_t error_callbacks_; | 139 size_t error_callbacks_; |
140 | 140 |
141 private: | 141 private: |
142 void CreateServiceSuccessCallback(uint32_t handle) { | 142 void CreateServiceSuccessCallback(uint32_t handle) { |
143 last_seen_handle_ = handle; | 143 last_seen_handle_ = handle; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 static_cast<BluetoothDeviceBlueZ*>(adapter_->GetDevice( | 184 static_cast<BluetoothDeviceBlueZ*>(adapter_->GetDevice( |
185 bluez::FakeBluetoothDeviceClient::kPairedDeviceAddress)); | 185 bluez::FakeBluetoothDeviceClient::kPairedDeviceAddress)); |
186 GetServiceRecords(device, false); | 186 GetServiceRecords(device, false); |
187 device->Connect(nullptr, GetCallback(Call::EXPECTED), | 187 device->Connect(nullptr, GetCallback(Call::EXPECTED), |
188 GetConnectErrorCallback(Call::NOT_EXPECTED)); | 188 GetConnectErrorCallback(Call::NOT_EXPECTED)); |
189 GetServiceRecords(device, true); | 189 GetServiceRecords(device, true); |
190 VerifyRecords(); | 190 VerifyRecords(); |
191 } | 191 } |
192 | 192 |
193 } // namespace bluez | 193 } // namespace bluez |
OLD | NEW |