| 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" | |
| 10 #include "base/containers/scoped_ptr_hash_map.h" | 9 #include "base/containers/scoped_ptr_hash_map.h" |
| 11 #include "base/logging.h" | 10 #include "base/logging.h" |
| 12 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
| 13 #include "base/sequenced_task_runner.h" | 12 #include "base/sequenced_task_runner.h" |
| 14 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
| 15 #include "device/bluetooth/bluetooth_adapter_win.h" | 14 #include "device/bluetooth/bluetooth_adapter_win.h" |
| 16 #include "device/bluetooth/bluetooth_service_record_win.h" | 15 #include "device/bluetooth/bluetooth_service_record_win.h" |
| 17 #include "device/bluetooth/bluetooth_socket_thread.h" | 16 #include "device/bluetooth/bluetooth_socket_thread.h" |
| 18 #include "device/bluetooth/bluetooth_socket_win.h" | 17 #include "device/bluetooth/bluetooth_socket_win.h" |
| 19 #include "device/bluetooth/bluetooth_task_manager_win.h" | 18 #include "device/bluetooth/bluetooth_task_manager_win.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 38 ui_task_runner_(ui_task_runner), | 37 ui_task_runner_(ui_task_runner), |
| 39 socket_thread_(socket_thread), | 38 socket_thread_(socket_thread), |
| 40 net_log_(net_log), | 39 net_log_(net_log), |
| 41 net_log_source_(net_log_source) { | 40 net_log_source_(net_log_source) { |
| 42 Update(device_state); | 41 Update(device_state); |
| 43 } | 42 } |
| 44 | 43 |
| 45 BluetoothDeviceWin::~BluetoothDeviceWin() { | 44 BluetoothDeviceWin::~BluetoothDeviceWin() { |
| 46 } | 45 } |
| 47 | 46 |
| 48 uint32 BluetoothDeviceWin::GetBluetoothClass() const { | 47 uint32_t BluetoothDeviceWin::GetBluetoothClass() const { |
| 49 return bluetooth_class_; | 48 return bluetooth_class_; |
| 50 } | 49 } |
| 51 | 50 |
| 52 std::string BluetoothDeviceWin::GetAddress() const { | 51 std::string BluetoothDeviceWin::GetAddress() const { |
| 53 return address_; | 52 return address_; |
| 54 } | 53 } |
| 55 | 54 |
| 56 BluetoothDevice::VendorIDSource | 55 BluetoothDevice::VendorIDSource |
| 57 BluetoothDeviceWin::GetVendorIDSource() const { | 56 BluetoothDeviceWin::GetVendorIDSource() const { |
| 58 return VENDOR_ID_UNKNOWN; | 57 return VENDOR_ID_UNKNOWN; |
| 59 } | 58 } |
| 60 | 59 |
| 61 uint16 BluetoothDeviceWin::GetVendorID() const { | 60 uint16_t BluetoothDeviceWin::GetVendorID() const { |
| 62 return 0; | 61 return 0; |
| 63 } | 62 } |
| 64 | 63 |
| 65 uint16 BluetoothDeviceWin::GetProductID() const { | 64 uint16_t BluetoothDeviceWin::GetProductID() const { |
| 66 return 0; | 65 return 0; |
| 67 } | 66 } |
| 68 | 67 |
| 69 uint16 BluetoothDeviceWin::GetDeviceID() const { | 68 uint16_t BluetoothDeviceWin::GetDeviceID() const { |
| 70 return 0; | 69 return 0; |
| 71 } | 70 } |
| 72 | 71 |
| 73 bool BluetoothDeviceWin::IsPaired() const { | 72 bool BluetoothDeviceWin::IsPaired() const { |
| 74 return paired_; | 73 return paired_; |
| 75 } | 74 } |
| 76 | 75 |
| 77 bool BluetoothDeviceWin::IsConnected() const { | 76 bool BluetoothDeviceWin::IsConnected() const { |
| 78 return connected_; | 77 return connected_; |
| 79 } | 78 } |
| 80 | 79 |
| 81 bool BluetoothDeviceWin::IsGattConnected() const { | 80 bool BluetoothDeviceWin::IsGattConnected() const { |
| 82 NOTIMPLEMENTED(); | 81 NOTIMPLEMENTED(); |
| 83 return false; | 82 return false; |
| 84 } | 83 } |
| 85 | 84 |
| 86 bool BluetoothDeviceWin::IsConnectable() const { | 85 bool BluetoothDeviceWin::IsConnectable() const { |
| 87 return false; | 86 return false; |
| 88 } | 87 } |
| 89 | 88 |
| 90 bool BluetoothDeviceWin::IsConnecting() const { | 89 bool BluetoothDeviceWin::IsConnecting() const { |
| 91 return false; | 90 return false; |
| 92 } | 91 } |
| 93 | 92 |
| 94 BluetoothDevice::UUIDList BluetoothDeviceWin::GetUUIDs() const { | 93 BluetoothDevice::UUIDList BluetoothDeviceWin::GetUUIDs() const { |
| 95 return uuids_; | 94 return uuids_; |
| 96 } | 95 } |
| 97 | 96 |
| 98 int16 BluetoothDeviceWin::GetInquiryRSSI() const { | 97 int16_t BluetoothDeviceWin::GetInquiryRSSI() const { |
| 99 return kUnknownPower; | 98 return kUnknownPower; |
| 100 } | 99 } |
| 101 | 100 |
| 102 int16 BluetoothDeviceWin::GetInquiryTxPower() const { | 101 int16_t BluetoothDeviceWin::GetInquiryTxPower() const { |
| 103 NOTIMPLEMENTED(); | 102 NOTIMPLEMENTED(); |
| 104 return kUnknownPower; | 103 return kUnknownPower; |
| 105 } | 104 } |
| 106 | 105 |
| 107 bool BluetoothDeviceWin::ExpectingPinCode() const { | 106 bool BluetoothDeviceWin::ExpectingPinCode() const { |
| 108 NOTIMPLEMENTED(); | 107 NOTIMPLEMENTED(); |
| 109 return false; | 108 return false; |
| 110 } | 109 } |
| 111 | 110 |
| 112 bool BluetoothDeviceWin::ExpectingPasskey() const { | 111 bool BluetoothDeviceWin::ExpectingPasskey() const { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 129 PairingDelegate* pairing_delegate, | 128 PairingDelegate* pairing_delegate, |
| 130 const base::Closure& callback, | 129 const base::Closure& callback, |
| 131 const ConnectErrorCallback& error_callback) { | 130 const ConnectErrorCallback& error_callback) { |
| 132 NOTIMPLEMENTED(); | 131 NOTIMPLEMENTED(); |
| 133 } | 132 } |
| 134 | 133 |
| 135 void BluetoothDeviceWin::SetPinCode(const std::string& pincode) { | 134 void BluetoothDeviceWin::SetPinCode(const std::string& pincode) { |
| 136 NOTIMPLEMENTED(); | 135 NOTIMPLEMENTED(); |
| 137 } | 136 } |
| 138 | 137 |
| 139 void BluetoothDeviceWin::SetPasskey(uint32 passkey) { | 138 void BluetoothDeviceWin::SetPasskey(uint32_t passkey) { |
| 140 NOTIMPLEMENTED(); | 139 NOTIMPLEMENTED(); |
| 141 } | 140 } |
| 142 | 141 |
| 143 void BluetoothDeviceWin::ConfirmPairing() { | 142 void BluetoothDeviceWin::ConfirmPairing() { |
| 144 NOTIMPLEMENTED(); | 143 NOTIMPLEMENTED(); |
| 145 } | 144 } |
| 146 | 145 |
| 147 void BluetoothDeviceWin::RejectPairing() { | 146 void BluetoothDeviceWin::RejectPairing() { |
| 148 NOTIMPLEMENTED(); | 147 NOTIMPLEMENTED(); |
| 149 } | 148 } |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 iter != device_state.service_record_states.end(); ++iter) { | 296 iter != device_state.service_record_states.end(); ++iter) { |
| 298 BluetoothServiceRecordWin* service_record = | 297 BluetoothServiceRecordWin* service_record = |
| 299 new BluetoothServiceRecordWin(device_state.address, (*iter)->name, | 298 new BluetoothServiceRecordWin(device_state.address, (*iter)->name, |
| 300 (*iter)->sdp_bytes, (*iter)->gatt_uuid); | 299 (*iter)->sdp_bytes, (*iter)->gatt_uuid); |
| 301 service_record_list_.push_back(service_record); | 300 service_record_list_.push_back(service_record); |
| 302 uuids_.push_back(service_record->uuid()); | 301 uuids_.push_back(service_record->uuid()); |
| 303 } | 302 } |
| 304 } | 303 } |
| 305 | 304 |
| 306 } // namespace device | 305 } // namespace device |
| OLD | NEW |