1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558
|
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif
#include "device/bluetooth/bluetooth_task_manager_win.h"
#include <winsock2.h>
#include <stddef.h>
#include <memory>
#include <string>
#include <utility>
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
#include "base/no_destructor.h"
#include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/threading/scoped_thread_priority.h"
#include "device/bluetooth/bluetooth_classic_win.h"
#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_init_win.h"
#include "device/bluetooth/bluetooth_service_record_win.h"
#include "device/bluetooth/public/cpp/bluetooth_address.h"
#include "net/base/winsock_init.h"
namespace {
const int kMaxNumDeviceAddressChar = 127;
const int kServiceDiscoveryResultBufferSize = 5000;
// See http://goo.gl/iNTRQe: cTimeoutMultiplier: A value that indicates the time
// out for the inquiry, expressed in increments of 1.28 seconds. For example, an
// inquiry of 12.8 seconds has a cTimeoutMultiplier value of 10. The maximum
// value for this member is 48. When a value greater than 48 is used, the
// calling function immediately fails and returns
const int kMaxDeviceDiscoveryTimeoutMultiplier = 48;
typedef device::BluetoothTaskManagerWin::ServiceRecordState ServiceRecordState;
// Note: The string returned here must have the same format as
// CanonicalizeBluetoothAddress.
std::string BluetoothAddressToCanonicalString(const BLUETOOTH_ADDRESS& btha) {
std::string result = base::StringPrintf("%02X:%02X:%02X:%02X:%02X:%02X",
btha.rgBytes[5],
btha.rgBytes[4],
btha.rgBytes[3],
btha.rgBytes[2],
btha.rgBytes[1],
btha.rgBytes[0]);
DCHECK_EQ(result, device::CanonicalizeBluetoothAddress(result));
return result;
}
// Populates bluetooth adapter state from the currently open adapter.
void GetAdapterState(device::win::BluetoothClassicWrapper* classic_wrapper,
device::BluetoothTaskManagerWin::AdapterState* state) {
std::string name;
std::string address;
bool powered = false;
BLUETOOTH_RADIO_INFO adapter_info = {sizeof(BLUETOOTH_RADIO_INFO)};
if (classic_wrapper->HasHandle() &&
ERROR_SUCCESS == classic_wrapper->GetRadioInfo(&adapter_info)) {
name = base::SysWideToUTF8(adapter_info.szName);
address = BluetoothAddressToCanonicalString(adapter_info.address);
powered = !!classic_wrapper->IsConnectable();
}
state->name = name;
state->address = address;
state->powered = powered;
}
void GetDeviceState(const BLUETOOTH_DEVICE_INFO& device_info,
device::BluetoothTaskManagerWin::DeviceState* state) {
state->name = base::SysWideToUTF8(device_info.szName);
state->address = BluetoothAddressToCanonicalString(device_info.Address);
state->bluetooth_class = device_info.ulClassofDevice;
state->visible = true;
state->connected = !!device_info.fConnected;
state->authenticated = !!device_info.fAuthenticated;
}
} // namespace
namespace device {
// static
const int BluetoothTaskManagerWin::kPollIntervalMs = 500;
BluetoothTaskManagerWin::AdapterState::AdapterState() : powered(false) {
}
BluetoothTaskManagerWin::AdapterState::~AdapterState() {
}
BluetoothTaskManagerWin::ServiceRecordState::ServiceRecordState() {
}
BluetoothTaskManagerWin::ServiceRecordState::~ServiceRecordState() {
}
BluetoothTaskManagerWin::DeviceState::DeviceState()
: visible(false),
connected(false),
authenticated(false),
bluetooth_class(0) {
}
BluetoothTaskManagerWin::DeviceState::~DeviceState() {
}
BluetoothTaskManagerWin::BluetoothTaskManagerWin(
scoped_refptr<base::SequencedTaskRunner> ui_task_runner)
: ui_task_runner_(std::move(ui_task_runner)),
classic_wrapper_(std::make_unique<win::BluetoothClassicWrapper>()) {}
BluetoothTaskManagerWin::BluetoothTaskManagerWin(
std::unique_ptr<win::BluetoothClassicWrapper> classic_wrapper,
scoped_refptr<base::SequencedTaskRunner> ui_task_runner)
: ui_task_runner_(std::move(ui_task_runner)),
classic_wrapper_(std::move(classic_wrapper)) {}
BluetoothTaskManagerWin::~BluetoothTaskManagerWin() = default;
// static
scoped_refptr<BluetoothTaskManagerWin>
BluetoothTaskManagerWin::CreateForTesting(
std::unique_ptr<win::BluetoothClassicWrapper> classic_wrapper,
scoped_refptr<base::SequencedTaskRunner> ui_task_runner) {
return new BluetoothTaskManagerWin(std::move(classic_wrapper),
std::move(ui_task_runner));
}
void BluetoothTaskManagerWin::AddObserver(Observer* observer) {
DCHECK(observer);
DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
observers_.AddObserver(observer);
}
void BluetoothTaskManagerWin::RemoveObserver(Observer* observer) {
DCHECK(observer);
DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
observers_.RemoveObserver(observer);
}
void BluetoothTaskManagerWin::Initialize() {
DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
InitializeWithBluetoothTaskRunner(base::ThreadPool::CreateSequencedTaskRunner(
{base::MayBlock(), base::TaskPriority::BEST_EFFORT,
base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}));
}
void BluetoothTaskManagerWin::InitializeWithBluetoothTaskRunner(
scoped_refptr<base::SequencedTaskRunner> bluetooth_task_runner) {
DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
bluetooth_task_runner_ = bluetooth_task_runner;
bluetooth_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&BluetoothTaskManagerWin::StartPolling, this));
}
void BluetoothTaskManagerWin::StartPolling() {
DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
if (device::bluetooth_init_win::HasBluetoothStack()) {
PollAdapter();
} else {
// IF the bluetooth stack is not available, we still send an empty state
// to BluetoothAdapter so that it is marked initialized, but the adapter
// will not be present.
AdapterState* state = new AdapterState();
ui_task_runner_->PostTask(
FROM_HERE,
base::BindOnce(&BluetoothTaskManagerWin::OnAdapterStateChanged, this,
base::Owned(state)));
}
}
void BluetoothTaskManagerWin::PostSetPoweredBluetoothTask(
bool powered,
base::OnceClosure callback,
BluetoothAdapter::ErrorCallback error_callback) {
DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
bluetooth_task_runner_->PostTask(
FROM_HERE,
base::BindOnce(&BluetoothTaskManagerWin::SetPowered, this, powered,
std::move(callback), std::move(error_callback)));
}
void BluetoothTaskManagerWin::PostStartDiscoveryTask() {
DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
bluetooth_task_runner_->PostTask(
FROM_HERE,
base::BindOnce(&BluetoothTaskManagerWin::StartDiscovery, this));
}
void BluetoothTaskManagerWin::PostStopDiscoveryTask() {
DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
bluetooth_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&BluetoothTaskManagerWin::StopDiscovery, this));
}
void BluetoothTaskManagerWin::LogPollingError(const char* message,
int win32_error) {
const int kLogPeriodInMilliseconds = 60 * 1000;
const int kMaxMessagesPerLogPeriod = 10;
// Check if we need to discard this message
if (!current_logging_batch_ticks_.is_null()) {
if (base::TimeTicks::Now() - current_logging_batch_ticks_ <=
base::Milliseconds(kLogPeriodInMilliseconds)) {
if (current_logging_batch_count_ >= kMaxMessagesPerLogPeriod)
return;
} else {
// The batch expired, reset it to "null".
current_logging_batch_ticks_ = base::TimeTicks();
}
}
// Keep track of this batch of messages
if (current_logging_batch_ticks_.is_null()) {
current_logging_batch_ticks_ = base::TimeTicks::Now();
current_logging_batch_count_ = 0;
}
++current_logging_batch_count_;
// Log the message
if (win32_error == 0)
LOG(WARNING) << message;
else
LOG(WARNING) << message << ": "
<< logging::SystemErrorCodeToString(win32_error);
}
void BluetoothTaskManagerWin::OnAdapterStateChanged(const AdapterState* state) {
DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
for (auto& observer : observers_)
observer.AdapterStateChanged(*state);
}
void BluetoothTaskManagerWin::OnDiscoveryStarted(bool success) {
DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
for (auto& observer : observers_)
observer.DiscoveryStarted(success);
}
void BluetoothTaskManagerWin::OnDiscoveryStopped() {
DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
for (auto& observer : observers_)
observer.DiscoveryStopped();
}
void BluetoothTaskManagerWin::OnDevicesPolled(
std::vector<std::unique_ptr<DeviceState>> devices) {
DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
for (auto& observer : observers_)
observer.DevicesPolled(devices);
}
void BluetoothTaskManagerWin::PollAdapter() {
DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
// Skips updating the adapter info if the adapter is in discovery mode.
if (!discovering_) {
const BLUETOOTH_FIND_RADIO_PARAMS adapter_param =
{ sizeof(BLUETOOTH_FIND_RADIO_PARAMS) };
HBLUETOOTH_RADIO_FIND handle =
classic_wrapper_->FindFirstRadio(&adapter_param);
if (handle) {
GetKnownDevices();
classic_wrapper_->FindRadioClose(handle);
} else {
// If `handle` is null, reset `classic_wrapper_` to avoid stale data
// coming from the opened radio handle in the `classic_wrapper_`.
classic_wrapper_ = std::make_unique<win::BluetoothClassicWrapper>();
}
PostAdapterStateToUi();
}
// Re-poll.
bluetooth_task_runner_->PostDelayedTask(
FROM_HERE, base::BindOnce(&BluetoothTaskManagerWin::PollAdapter, this),
base::Milliseconds(kPollIntervalMs));
}
void BluetoothTaskManagerWin::PostAdapterStateToUi() {
DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
AdapterState* state = new AdapterState();
GetAdapterState(classic_wrapper_.get(), state);
ui_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&BluetoothTaskManagerWin::OnAdapterStateChanged,
this, base::Owned(state)));
}
void BluetoothTaskManagerWin::SetPowered(
bool powered,
base::OnceClosure callback,
BluetoothAdapter::ErrorCallback error_callback) {
DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
bool success = false;
if (classic_wrapper_->HasHandle()) {
if (!powered)
classic_wrapper_->EnableDiscovery(false);
success = !!classic_wrapper_->EnableIncomingConnections(powered);
}
if (success) {
PostAdapterStateToUi();
ui_task_runner_->PostTask(FROM_HERE, std::move(callback));
} else {
ui_task_runner_->PostTask(FROM_HERE, std::move(error_callback));
}
}
void BluetoothTaskManagerWin::StartDiscovery() {
DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
bool adapter_opened = classic_wrapper_->HasHandle();
ui_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&BluetoothTaskManagerWin::OnDiscoveryStarted,
this, adapter_opened));
if (!adapter_opened)
return;
discovering_ = true;
DiscoverDevices(1);
}
void BluetoothTaskManagerWin::StopDiscovery() {
DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
discovering_ = false;
ui_task_runner_->PostTask(
FROM_HERE,
base::BindOnce(&BluetoothTaskManagerWin::OnDiscoveryStopped, this));
}
void BluetoothTaskManagerWin::DiscoverDevices(int timeout_multiplier) {
DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
if (!discovering_ || !classic_wrapper_->HasHandle())
return;
std::vector<std::unique_ptr<DeviceState>> device_list;
if (SearchDevices(timeout_multiplier, false, &device_list)) {
ui_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&BluetoothTaskManagerWin::OnDevicesPolled,
this, std::move(device_list)));
}
if (timeout_multiplier < kMaxDeviceDiscoveryTimeoutMultiplier)
++timeout_multiplier;
bluetooth_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&BluetoothTaskManagerWin::DiscoverDevices, this,
timeout_multiplier));
}
void BluetoothTaskManagerWin::GetKnownDevices() {
std::vector<std::unique_ptr<DeviceState>> device_list;
if (SearchDevices(1, true, &device_list)) {
ui_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&BluetoothTaskManagerWin::OnDevicesPolled,
this, std::move(device_list)));
}
}
bool BluetoothTaskManagerWin::SearchDevices(
int timeout_multiplier,
bool search_cached_devices_only,
std::vector<std::unique_ptr<DeviceState>>* device_list) {
return SearchClassicDevices(timeout_multiplier, search_cached_devices_only,
device_list) &&
DiscoverServices(device_list, search_cached_devices_only);
}
bool BluetoothTaskManagerWin::SearchClassicDevices(
int timeout_multiplier,
bool search_cached_devices_only,
std::vector<std::unique_ptr<DeviceState>>* device_list) {
// Issues a device inquiry and waits for |timeout_multiplier| * 1.28 seconds.
BLUETOOTH_DEVICE_SEARCH_PARAMS device_search_params;
ZeroMemory(&device_search_params, sizeof(device_search_params));
device_search_params.dwSize = sizeof(BLUETOOTH_DEVICE_SEARCH_PARAMS);
device_search_params.fReturnAuthenticated = 1;
device_search_params.fReturnRemembered = 1;
device_search_params.fReturnUnknown = (search_cached_devices_only ? 0 : 1);
device_search_params.fReturnConnected = 1;
device_search_params.fIssueInquiry = (search_cached_devices_only ? 0 : 1);
device_search_params.cTimeoutMultiplier = timeout_multiplier;
BLUETOOTH_DEVICE_INFO device_info;
ZeroMemory(&device_info, sizeof(device_info));
device_info.dwSize = sizeof(BLUETOOTH_DEVICE_INFO);
HBLUETOOTH_DEVICE_FIND handle =
classic_wrapper_->FindFirstDevice(&device_search_params, &device_info);
if (!handle) {
int last_error = classic_wrapper_->LastError();
if (last_error == ERROR_NO_MORE_ITEMS) {
return true; // No devices is not an error.
}
LogPollingError("Error calling BluetoothFindFirstDevice", last_error);
return false;
}
while (true) {
auto device_state = std::make_unique<DeviceState>();
GetDeviceState(device_info, device_state.get());
device_list->push_back(std::move(device_state));
// Reset device info before next call (as a safety precaution).
ZeroMemory(&device_info, sizeof(device_info));
device_info.dwSize = sizeof(BLUETOOTH_DEVICE_INFO);
if (!classic_wrapper_->FindNextDevice(handle, &device_info)) {
int last_error = classic_wrapper_->LastError();
if (last_error == ERROR_NO_MORE_ITEMS) {
break; // No more items is expected error when done enumerating.
}
LogPollingError("Error calling BluetoothFindNextDevice", last_error);
classic_wrapper_->FindDeviceClose(handle);
return false;
}
}
if (!classic_wrapper_->FindDeviceClose(handle)) {
LogPollingError("Error calling BluetoothFindDeviceClose",
classic_wrapper_->LastError());
return false;
}
return true;
}
bool BluetoothTaskManagerWin::DiscoverServices(
std::vector<std::unique_ptr<DeviceState>>* device_list,
bool search_cached_services_only) {
DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
net::EnsureWinsockInit();
for (const auto& device : *device_list) {
std::vector<std::unique_ptr<ServiceRecordState>>* service_record_states =
&device->service_record_states;
if (!DiscoverClassicDeviceServices(device->address, L2CAP_PROTOCOL_UUID,
search_cached_services_only,
service_record_states)) {
return false;
}
}
return true;
}
bool BluetoothTaskManagerWin::DiscoverClassicDeviceServices(
const std::string& device_address,
const GUID& protocol_uuid,
bool search_cached_services_only,
std::vector<std::unique_ptr<ServiceRecordState>>* service_record_states) {
int error_code =
DiscoverClassicDeviceServicesWorker(device_address,
protocol_uuid,
search_cached_services_only,
service_record_states);
// If the device is "offline", no services are returned when specifying
// "LUP_FLUSHCACHE". Try again without flushing the cache so that the list
// of previously known services is returned.
if (!search_cached_services_only &&
(error_code == WSASERVICE_NOT_FOUND || error_code == WSANO_DATA)) {
error_code = DiscoverClassicDeviceServicesWorker(
device_address, protocol_uuid, true, service_record_states);
}
return (error_code == ERROR_SUCCESS);
}
int BluetoothTaskManagerWin::DiscoverClassicDeviceServicesWorker(
const std::string& device_address,
const GUID& protocol_uuid,
bool search_cached_services_only,
std::vector<std::unique_ptr<ServiceRecordState>>* service_record_states) {
// Mitigate the issues caused by loading DLLs on a background thread
// (http://crbug/973868).
SCOPED_MAY_LOAD_LIBRARY_AT_BACKGROUND_PRIORITY();
// Bluetooth and WSAQUERYSET for Service Inquiry. See http://goo.gl/2v9pyt.
WSAQUERYSET sdp_query;
ZeroMemory(&sdp_query, sizeof(sdp_query));
sdp_query.dwSize = sizeof(sdp_query);
GUID protocol = protocol_uuid;
sdp_query.lpServiceClassId = &protocol;
sdp_query.dwNameSpace = NS_BTH;
wchar_t device_address_context[kMaxNumDeviceAddressChar];
std::size_t length = base::SysUTF8ToWide("(" + device_address + ")").copy(
device_address_context, kMaxNumDeviceAddressChar);
device_address_context[length] = NULL;
sdp_query.lpszContext = device_address_context;
DWORD control_flags = LUP_RETURN_ALL;
// See http://goo.gl/t1Hulo: "Applications should generally specify
// LUP_FLUSHCACHE. This flag instructs the system to ignore any cached
// information and establish an over-the-air SDP connection to the specified
// device to perform the SDP search. This non-cached operation may take
// several seconds (whereas a cached search returns quickly)."
// In summary, we need to specify LUP_FLUSHCACHE if we want to obtain the list
// of services for devices which have not been discovered before.
if (!search_cached_services_only)
control_flags |= LUP_FLUSHCACHE;
HANDLE sdp_handle;
if (ERROR_SUCCESS !=
WSALookupServiceBegin(&sdp_query, control_flags, &sdp_handle)) {
int last_error = WSAGetLastError();
// If the device is "offline", no services are returned when specifying
// "LUP_FLUSHCACHE". Don't log error in that case.
if (!search_cached_services_only &&
(last_error == WSASERVICE_NOT_FOUND || last_error == WSANO_DATA)) {
return last_error;
}
LogPollingError("Error calling WSALookupServiceBegin", last_error);
return last_error;
}
char sdp_buffer[kServiceDiscoveryResultBufferSize];
LPWSAQUERYSET sdp_result_data = reinterpret_cast<LPWSAQUERYSET>(sdp_buffer);
while (true) {
DWORD sdp_buffer_size = sizeof(sdp_buffer);
if (ERROR_SUCCESS !=
WSALookupServiceNext(
sdp_handle, control_flags, &sdp_buffer_size, sdp_result_data)) {
int last_error = WSAGetLastError();
if (last_error == WSA_E_NO_MORE || last_error == WSAENOMORE) {
break;
}
LogPollingError("Error calling WSALookupServiceNext", last_error);
WSALookupServiceEnd(sdp_handle);
return last_error;
}
auto service_record_state = std::make_unique<ServiceRecordState>();
service_record_state->name =
base::SysWideToUTF8(sdp_result_data->lpszServiceInstanceName);
for (uint64_t i = 0; i < sdp_result_data->lpBlob->cbSize; i++) {
service_record_state->sdp_bytes.push_back(
sdp_result_data->lpBlob->pBlobData[i]);
}
service_record_states->push_back(std::move(service_record_state));
}
if (ERROR_SUCCESS != WSALookupServiceEnd(sdp_handle)) {
int last_error = WSAGetLastError();
LogPollingError("Error calling WSALookupServiceEnd", last_error);
return last_error;
}
return ERROR_SUCCESS;
}
} // namespace device
|