| 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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 ~BluetoothDeviceWin() override; | 34 ~BluetoothDeviceWin() override; |
| 35 | 35 |
| 36 // BluetoothDevice override | 36 // BluetoothDevice override |
| 37 uint32_t GetBluetoothClass() const override; | 37 uint32_t GetBluetoothClass() const override; |
| 38 std::string GetAddress() const override; | 38 std::string GetAddress() const override; |
| 39 VendorIDSource GetVendorIDSource() const override; | 39 VendorIDSource GetVendorIDSource() const override; |
| 40 uint16_t GetVendorID() const override; | 40 uint16_t GetVendorID() const override; |
| 41 uint16_t GetProductID() const override; | 41 uint16_t GetProductID() const override; |
| 42 uint16_t GetDeviceID() const override; | 42 uint16_t GetDeviceID() const override; |
| 43 uint16_t GetAppearance() const override; | 43 uint16_t GetAppearance() const override; |
| 44 base::Optional<std::string> GetName() const override; |
| 44 bool IsPaired() const override; | 45 bool IsPaired() const override; |
| 45 bool IsConnected() const override; | 46 bool IsConnected() const override; |
| 46 bool IsGattConnected() const override; | 47 bool IsGattConnected() const override; |
| 47 bool IsConnectable() const override; | 48 bool IsConnectable() const override; |
| 48 bool IsConnecting() const override; | 49 bool IsConnecting() const override; |
| 49 UUIDList GetUUIDs() const override; | 50 UUIDList GetUUIDs() const override; |
| 50 int16_t GetInquiryRSSI() const override; | 51 int16_t GetInquiryRSSI() const override; |
| 51 int16_t GetInquiryTxPower() const override; | 52 int16_t GetInquiryTxPower() const override; |
| 52 bool ExpectingPinCode() const override; | 53 bool ExpectingPinCode() const override; |
| 53 bool ExpectingPasskey() const override; | 54 bool ExpectingPasskey() const override; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // Returns true if all fields and services of this instance are equal to the | 86 // Returns true if all fields and services of this instance are equal to the |
| 86 // fields and services stored in |device_state|. | 87 // fields and services stored in |device_state|. |
| 87 bool IsEqual(const BluetoothTaskManagerWin::DeviceState& device_state); | 88 bool IsEqual(const BluetoothTaskManagerWin::DeviceState& device_state); |
| 88 | 89 |
| 89 // Updates this instance with all fields and properties stored in | 90 // Updates this instance with all fields and properties stored in |
| 90 // |device_state|. | 91 // |device_state|. |
| 91 void Update(const BluetoothTaskManagerWin::DeviceState& device_state); | 92 void Update(const BluetoothTaskManagerWin::DeviceState& device_state); |
| 92 | 93 |
| 93 protected: | 94 protected: |
| 94 // BluetoothDevice override | 95 // BluetoothDevice override |
| 95 std::string GetDeviceName() const override; | |
| 96 void CreateGattConnectionImpl() override; | 96 void CreateGattConnectionImpl() override; |
| 97 void DisconnectGatt() override; | 97 void DisconnectGatt() override; |
| 98 | 98 |
| 99 private: | 99 private: |
| 100 friend class BluetoothAdapterWin; | 100 friend class BluetoothAdapterWin; |
| 101 | 101 |
| 102 typedef ScopedVector<BluetoothServiceRecordWin> ServiceRecordList; | 102 typedef ScopedVector<BluetoothServiceRecordWin> ServiceRecordList; |
| 103 | 103 |
| 104 // Used by BluetoothAdapterWin to update the visible state during | 104 // Used by BluetoothAdapterWin to update the visible state during |
| 105 // discovery. | 105 // discovery. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 127 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; | 127 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; |
| 128 scoped_refptr<BluetoothSocketThread> socket_thread_; | 128 scoped_refptr<BluetoothSocketThread> socket_thread_; |
| 129 net::NetLog* net_log_; | 129 net::NetLog* net_log_; |
| 130 net::NetLog::Source net_log_source_; | 130 net::NetLog::Source net_log_source_; |
| 131 | 131 |
| 132 // The Bluetooth class of the device, a bitmask that may be decoded using | 132 // The Bluetooth class of the device, a bitmask that may be decoded using |
| 133 // https://www.bluetooth.org/Technical/AssignedNumbers/baseband.htm | 133 // https://www.bluetooth.org/Technical/AssignedNumbers/baseband.htm |
| 134 uint32_t bluetooth_class_; | 134 uint32_t bluetooth_class_; |
| 135 | 135 |
| 136 // The name of the device, as supplied by the remote device. | 136 // The name of the device, as supplied by the remote device. |
| 137 std::string name_; | 137 base::Optional<std::string> name_; |
| 138 | 138 |
| 139 // The Bluetooth address of the device. | 139 // The Bluetooth address of the device. |
| 140 std::string address_; | 140 std::string address_; |
| 141 | 141 |
| 142 // Tracked device state, updated by the adapter managing the lifecycle of | 142 // Tracked device state, updated by the adapter managing the lifecycle of |
| 143 // the device. | 143 // the device. |
| 144 bool paired_; | 144 bool paired_; |
| 145 bool connected_; | 145 bool connected_; |
| 146 | 146 |
| 147 // Used to send change notifications when a device disappears during | 147 // Used to send change notifications when a device disappears during |
| 148 // discovery. | 148 // discovery. |
| 149 bool visible_; | 149 bool visible_; |
| 150 | 150 |
| 151 // The services (identified by UUIDs) that this device provides. | 151 // The services (identified by UUIDs) that this device provides. |
| 152 UUIDList uuids_; | 152 UUIDList uuids_; |
| 153 | 153 |
| 154 // The service records retrieved from SDP. | 154 // The service records retrieved from SDP. |
| 155 ServiceRecordList service_record_list_; | 155 ServiceRecordList service_record_list_; |
| 156 | 156 |
| 157 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceWin); | 157 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceWin); |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 } // namespace device | 160 } // namespace device |
| 161 | 161 |
| 162 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ | 162 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ |
| OLD | NEW |