Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Side by Side Diff: device/bluetooth/bluetooth_task_manager_win.cc

Issue 13416005: Bluetooth: clean up BluetoothDevice (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make GetServices return a copy of the list Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bluetooth_task_manager_win.h" 5 #include "device/bluetooth/bluetooth_task_manager_win.h"
6 6
7 #include <winsock2.h> 7 #include <winsock2.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 device::BluetoothTaskManagerWin::DeviceState* state) { 59 device::BluetoothTaskManagerWin::DeviceState* state) {
60 state->name = base::SysWideToUTF8(device_info.szName); 60 state->name = base::SysWideToUTF8(device_info.szName);
61 state->address = base::StringPrintf("%02X:%02X:%02X:%02X:%02X:%02X", 61 state->address = base::StringPrintf("%02X:%02X:%02X:%02X:%02X:%02X",
62 device_info.Address.rgBytes[5], 62 device_info.Address.rgBytes[5],
63 device_info.Address.rgBytes[4], 63 device_info.Address.rgBytes[4],
64 device_info.Address.rgBytes[3], 64 device_info.Address.rgBytes[3],
65 device_info.Address.rgBytes[2], 65 device_info.Address.rgBytes[2],
66 device_info.Address.rgBytes[1], 66 device_info.Address.rgBytes[1],
67 device_info.Address.rgBytes[0]); 67 device_info.Address.rgBytes[0]);
68 state->bluetooth_class = device_info.ulClassofDevice; 68 state->bluetooth_class = device_info.ulClassofDevice;
69 state->visible = true;
70 state->connected = !!device_info.fConnected; 69 state->connected = !!device_info.fConnected;
71 state->authenticated = !!device_info.fAuthenticated; 70 state->authenticated = !!device_info.fAuthenticated;
72 } 71 }
73 72
74 } // namespace 73 } // namespace
75 74
76 namespace device { 75 namespace device {
77 76
78 // static 77 // static
79 const int BluetoothTaskManagerWin::kPollIntervalMs = 500; 78 const int BluetoothTaskManagerWin::kPollIntervalMs = 500;
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 service_record_state->sdp_bytes.push_back( 397 service_record_state->sdp_bytes.push_back(
399 sdp_result_data->lpBlob->pBlobData[i]); 398 sdp_result_data->lpBlob->pBlobData[i]);
400 } 399 }
401 service_record_states->push_back(service_record_state); 400 service_record_states->push_back(service_record_state);
402 } 401 }
403 WSALookupServiceEnd(sdp_handle); 402 WSALookupServiceEnd(sdp_handle);
404 } 403 }
405 } 404 }
406 405
407 } // namespace device 406 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698