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 "chrome/browser/chromeos/bluetooth/bluetooth_socket_chromeos.h" | 5 #include "device/bluetooth/bluetooth_socket_chromeos.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include <bluetooth/bluetooth.h> | 9 #include <bluetooth/bluetooth.h> |
10 #include <bluetooth/rfcomm.h> | 10 #include <bluetooth/rfcomm.h> |
11 #include <errno.h> | 11 #include <errno.h> |
12 #include <sys/socket.h> | 12 #include <sys/socket.h> |
13 #include <sys/types.h> | 13 #include <sys/types.h> |
14 #include <string.h> | 14 #include <string.h> |
15 #include <unistd.h> | 15 #include <unistd.h> |
16 | 16 |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "chrome/browser/chromeos/bluetooth/bluetooth_service_record.h" | 18 #include "device/bluetooth/bluetooth_service_record.h" |
19 #include "chrome/browser/chromeos/bluetooth/bluetooth_utils.h" | 19 #include "device/bluetooth/bluetooth_utils.h" |
20 | 20 |
21 namespace chromeos { | 21 namespace device_bluetooth { |
22 | 22 |
23 BluetoothSocketChromeOs::BluetoothSocketChromeOs( | 23 BluetoothSocketChromeOs::BluetoothSocketChromeOs( |
24 const std::string& address, int fd) | 24 const std::string& address, int fd) |
25 : address_(address), | 25 : address_(address), |
26 fd_(fd) { | 26 fd_(fd) { |
27 } | 27 } |
28 | 28 |
29 BluetoothSocketChromeOs::~BluetoothSocketChromeOs() { | 29 BluetoothSocketChromeOs::~BluetoothSocketChromeOs() { |
30 close(fd_); | 30 close(fd_); |
31 } | 31 } |
(...skipping 26 matching lines...) Expand all Loading... |
58 } | 58 } |
59 // TODO(bryeung): add support for L2CAP sockets as well. | 59 // TODO(bryeung): add support for L2CAP sockets as well. |
60 | 60 |
61 return scoped_refptr<BluetoothSocketChromeOs>(bluetooth_socket); | 61 return scoped_refptr<BluetoothSocketChromeOs>(bluetooth_socket); |
62 } | 62 } |
63 | 63 |
64 int BluetoothSocketChromeOs::fd() const { | 64 int BluetoothSocketChromeOs::fd() const { |
65 return fd_; | 65 return fd_; |
66 } | 66 } |
67 | 67 |
68 } // namespace chromeos | 68 } // namespace device_bluetooth |
OLD | NEW |