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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 void BluetoothDeviceWin::Forget(const ErrorCallback& error_callback) { | 189 void BluetoothDeviceWin::Forget(const ErrorCallback& error_callback) { |
190 NOTIMPLEMENTED(); | 190 NOTIMPLEMENTED(); |
191 } | 191 } |
192 | 192 |
193 void BluetoothDeviceWin::ConnectToService( | 193 void BluetoothDeviceWin::ConnectToService( |
194 const BluetoothUUID& uuid, | 194 const BluetoothUUID& uuid, |
195 const ConnectToServiceCallback& callback, | 195 const ConnectToServiceCallback& callback, |
196 const ConnectToServiceErrorCallback& error_callback) { | 196 const ConnectToServiceErrorCallback& error_callback) { |
197 scoped_refptr<BluetoothSocketWin> socket( | 197 scoped_refptr<BluetoothSocketWin> socket( |
198 BluetoothSocketWin::CreateBluetoothSocket( | 198 BluetoothSocketWin::CreateBluetoothSocket( |
199 ui_task_runner_, socket_thread_, NULL, net::NetLog::Source())); | 199 ui_task_runner_, socket_thread_)); |
200 socket->Connect(this, uuid, base::Bind(callback, socket), error_callback); | 200 socket->Connect(this, uuid, base::Bind(callback, socket), error_callback); |
201 } | 201 } |
202 | 202 |
203 void BluetoothDeviceWin::CreateGattConnection( | 203 void BluetoothDeviceWin::CreateGattConnection( |
204 const GattConnectionCallback& callback, | 204 const GattConnectionCallback& callback, |
205 const ConnectErrorCallback& error_callback) { | 205 const ConnectErrorCallback& error_callback) { |
206 // TODO(armansito): Implement. | 206 // TODO(armansito): Implement. |
207 error_callback.Run(ERROR_UNSUPPORTED_DEVICE); | 207 error_callback.Run(ERROR_UNSUPPORTED_DEVICE); |
208 } | 208 } |
209 | 209 |
210 void BluetoothDeviceWin::StartConnectionMonitor( | 210 void BluetoothDeviceWin::StartConnectionMonitor( |
211 const base::Closure& callback, | 211 const base::Closure& callback, |
212 const ErrorCallback& error_callback) { | 212 const ErrorCallback& error_callback) { |
213 NOTIMPLEMENTED(); | 213 NOTIMPLEMENTED(); |
214 } | 214 } |
215 | 215 |
216 const BluetoothServiceRecordWin* BluetoothDeviceWin::GetServiceRecord( | 216 const BluetoothServiceRecordWin* BluetoothDeviceWin::GetServiceRecord( |
217 const device::BluetoothUUID& uuid) const { | 217 const device::BluetoothUUID& uuid) const { |
218 for (ServiceRecordList::const_iterator iter = service_record_list_.begin(); | 218 for (ServiceRecordList::const_iterator iter = service_record_list_.begin(); |
219 iter != service_record_list_.end(); | 219 iter != service_record_list_.end(); |
220 ++iter) { | 220 ++iter) { |
221 if ((*iter)->uuid() == uuid) | 221 if ((*iter)->uuid() == uuid) |
222 return *iter; | 222 return *iter; |
223 } | 223 } |
224 return NULL; | 224 return NULL; |
225 } | 225 } |
226 | 226 |
227 } // namespace device | 227 } // namespace device |
OLD | NEW |