| OLD | NEW |
| 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_device_win.h" | 5 #include "device/bluetooth/bluetooth_device_win.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 address_ = CanonicalizeAddress(state.address); | 40 address_ = CanonicalizeAddress(state.address); |
| 41 bluetooth_class_ = state.bluetooth_class; | 41 bluetooth_class_ = state.bluetooth_class; |
| 42 visible_ = state.visible; | 42 visible_ = state.visible; |
| 43 connected_ = state.connected; | 43 connected_ = state.connected; |
| 44 paired_ = state.authenticated; | 44 paired_ = state.authenticated; |
| 45 | 45 |
| 46 for (ScopedVector<BluetoothTaskManagerWin::ServiceRecordState>::const_iterator | 46 for (ScopedVector<BluetoothTaskManagerWin::ServiceRecordState>::const_iterator |
| 47 iter = state.service_record_states.begin(); | 47 iter = state.service_record_states.begin(); |
| 48 iter != state.service_record_states.end(); | 48 iter != state.service_record_states.end(); |
| 49 ++iter) { | 49 ++iter) { |
| 50 uint8 sdp_bytes_buffer[kSdpBytesBufferSize]; | |
| 51 std::copy((*iter)->sdp_bytes.begin(), | |
| 52 (*iter)->sdp_bytes.end(), | |
| 53 sdp_bytes_buffer); | |
| 54 BluetoothServiceRecordWin* service_record = new BluetoothServiceRecordWin( | 50 BluetoothServiceRecordWin* service_record = new BluetoothServiceRecordWin( |
| 55 (*iter)->name, | 51 state.address, (*iter)->name, (*iter)->sdp_bytes, (*iter)->gatt_uuid); |
| 56 (*iter)->address, | |
| 57 (*iter)->sdp_bytes.size(), | |
| 58 sdp_bytes_buffer); | |
| 59 service_record_list_.push_back(service_record); | 52 service_record_list_.push_back(service_record); |
| 60 uuids_.push_back(service_record->uuid()); | 53 uuids_.push_back(service_record->uuid()); |
| 61 } | 54 } |
| 62 } | 55 } |
| 63 | 56 |
| 64 BluetoothDeviceWin::~BluetoothDeviceWin() { | 57 BluetoothDeviceWin::~BluetoothDeviceWin() { |
| 65 } | 58 } |
| 66 | 59 |
| 67 void BluetoothDeviceWin::SetVisible(bool visible) { | 60 void BluetoothDeviceWin::SetVisible(bool visible) { |
| 68 visible_ = visible; | 61 visible_ = visible; |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 for (ServiceRecordList::const_iterator iter = service_record_list_.begin(); | 218 for (ServiceRecordList::const_iterator iter = service_record_list_.begin(); |
| 226 iter != service_record_list_.end(); | 219 iter != service_record_list_.end(); |
| 227 ++iter) { | 220 ++iter) { |
| 228 if ((*iter)->uuid() == uuid) | 221 if ((*iter)->uuid() == uuid) |
| 229 return *iter; | 222 return *iter; |
| 230 } | 223 } |
| 231 return NULL; | 224 return NULL; |
| 232 } | 225 } |
| 233 | 226 |
| 234 } // namespace device | 227 } // namespace device |
| OLD | NEW |