Chromium Code Reviews| 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_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 299 // returns the UUIDs of the device's services. | 299 // returns the UUIDs of the device's services. |
| 300 // * For dual mode devices this may be collected from both. | 300 // * For dual mode devices this may be collected from both. |
| 301 // | 301 // |
| 302 // Note: On ChromeOS and Linux, Bluez persists all services meaning if | 302 // Note: On ChromeOS and Linux, Bluez persists all services meaning if |
| 303 // a device stops advertising a service this function will still return | 303 // a device stops advertising a service this function will still return |
| 304 // its UUID. | 304 // its UUID. |
| 305 virtual UUIDList GetUUIDs() const; | 305 virtual UUIDList GetUUIDs() const; |
| 306 | 306 |
| 307 // The received signal strength, in dBm. This field is avaliable and valid | 307 // The received signal strength, in dBm. This field is avaliable and valid |
| 308 // only during discovery. If not during discovery, or RSSI wasn't reported, | 308 // only during discovery. If not during discovery, or RSSI wasn't reported, |
| 309 // this method will return |kUnknownPower|. | 309 // this method will return |kUnknownPower|. |
|
scheib
2016/08/09 20:39:18
Will no longer return the kUnknownPower, right? Ed
ortuno
2016/08/09 22:10:39
Done.
| |
| 310 virtual int16_t GetInquiryRSSI() const = 0; | 310 virtual base::Optional<int8_t> GetInquiryRSSI() const = 0; |
| 311 | 311 |
| 312 // The transmitted power level. This field is avaliable only for LE devices | 312 // The transmitted power level. This field is avaliable only for LE devices |
| 313 // that include this field in AD. It is avaliable and valid only during | 313 // that include this field in AD. It is avaliable and valid only during |
| 314 // discovery. If not during discovery, or TxPower wasn't reported, this | 314 // discovery. If not during discovery, or TxPower wasn't reported, this |
| 315 // method will return |kUnknownPower|. | 315 // method will return |kUnknownPower|. |
| 316 virtual int16_t GetInquiryTxPower() const = 0; | 316 virtual base::Optional<int8_t> GetInquiryTxPower() const = 0; |
| 317 | 317 |
| 318 // The ErrorCallback is used for methods that can fail in which case it | 318 // The ErrorCallback is used for methods that can fail in which case it |
| 319 // is called, in the success case the callback is simply not called. | 319 // is called, in the success case the callback is simply not called. |
| 320 typedef base::Callback<void()> ErrorCallback; | 320 typedef base::Callback<void()> ErrorCallback; |
| 321 | 321 |
| 322 // The ConnectErrorCallback is used for methods that can fail with an error, | 322 // The ConnectErrorCallback is used for methods that can fail with an error, |
| 323 // passed back as an error code argument to this callback. | 323 // passed back as an error code argument to this callback. |
| 324 // In the success case this callback is not called. | 324 // In the success case this callback is not called. |
| 325 typedef base::Callback<void(enum ConnectErrorCode)> ConnectErrorCallback; | 325 typedef base::Callback<void(enum ConnectErrorCode)> ConnectErrorCallback; |
| 326 | 326 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 594 | 594 |
| 595 private: | 595 private: |
| 596 // Returns a localized string containing the device's bluetooth address and | 596 // Returns a localized string containing the device's bluetooth address and |
| 597 // a device type for display when |name_| is empty. | 597 // a device type for display when |name_| is empty. |
| 598 base::string16 GetAddressWithLocalizedDeviceTypeName() const; | 598 base::string16 GetAddressWithLocalizedDeviceTypeName() const; |
| 599 }; | 599 }; |
| 600 | 600 |
| 601 } // namespace device | 601 } // namespace device |
| 602 | 602 |
| 603 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 603 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| OLD | NEW |