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

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

Issue 336933002: device/bluetooth: Introduce BluetoothGattConnection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ErrorCallback -> ConnectErrorCallback Created 6 years, 6 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_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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 void BluetoothDeviceWin::ConnectToService( 200 void BluetoothDeviceWin::ConnectToService(
201 const BluetoothUUID& uuid, 201 const BluetoothUUID& uuid,
202 const ConnectToServiceCallback& callback, 202 const ConnectToServiceCallback& callback,
203 const ConnectToServiceErrorCallback& error_callback) { 203 const ConnectToServiceErrorCallback& error_callback) {
204 scoped_refptr<BluetoothSocketWin> socket( 204 scoped_refptr<BluetoothSocketWin> socket(
205 BluetoothSocketWin::CreateBluetoothSocket( 205 BluetoothSocketWin::CreateBluetoothSocket(
206 ui_task_runner_, socket_thread_, NULL, net::NetLog::Source())); 206 ui_task_runner_, socket_thread_, NULL, net::NetLog::Source()));
207 socket->Connect(this, uuid, base::Bind(callback, socket), error_callback); 207 socket->Connect(this, uuid, base::Bind(callback, socket), error_callback);
208 } 208 }
209 209
210 void BluetoothDeviceWin::CreateGattConnection(
211 const GattConnectionCallback& callback,
212 const ConnectErrorCallback& error_callback) {
213 // TODO(armansito): Implement.
214 error_callback.Run(ERROR_UNKNOWN);
215 }
216
210 void BluetoothDeviceWin::StartConnectionMonitor( 217 void BluetoothDeviceWin::StartConnectionMonitor(
211 const base::Closure& callback, 218 const base::Closure& callback,
212 const ErrorCallback& error_callback) { 219 const ErrorCallback& error_callback) {
213 NOTIMPLEMENTED(); 220 NOTIMPLEMENTED();
214 } 221 }
215 222
216 const BluetoothServiceRecordWin* BluetoothDeviceWin::GetServiceRecord( 223 const BluetoothServiceRecordWin* BluetoothDeviceWin::GetServiceRecord(
217 const device::BluetoothUUID& uuid) const { 224 const device::BluetoothUUID& uuid) const {
218 for (ServiceRecordList::const_iterator iter = service_record_list_.begin(); 225 for (ServiceRecordList::const_iterator iter = service_record_list_.begin();
219 iter != service_record_list_.end(); 226 iter != service_record_list_.end();
220 ++iter) { 227 ++iter) {
221 if ((*iter)->uuid() == uuid) 228 if ((*iter)->uuid() == uuid)
222 return *iter; 229 return *iter;
223 } 230 }
224 return NULL; 231 return NULL;
225 } 232 }
226 233
227 } // namespace device 234 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698