| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 // * For connected Low Energy Devices for which services have been discovered | 298 // * For connected Low Energy Devices for which services have been discovered |
| 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. |
| 309 // this method will return |kUnknownPower|. | 309 virtual base::Optional<int8_t> GetInquiryRSSI() const = 0; |
| 310 virtual int16_t GetInquiryRSSI() const = 0; | |
| 311 | 310 |
| 312 // The transmitted power level. This field is avaliable only for LE devices | 311 // 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 | 312 // 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 | 313 // discovery. |
| 315 // method will return |kUnknownPower|. | 314 virtual base::Optional<int8_t> GetInquiryTxPower() const = 0; |
| 316 virtual int16_t GetInquiryTxPower() const = 0; | |
| 317 | 315 |
| 318 // The ErrorCallback is used for methods that can fail in which case it | 316 // 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. | 317 // is called, in the success case the callback is simply not called. |
| 320 typedef base::Callback<void()> ErrorCallback; | 318 typedef base::Callback<void()> ErrorCallback; |
| 321 | 319 |
| 322 // The ConnectErrorCallback is used for methods that can fail with an error, | 320 // The ConnectErrorCallback is used for methods that can fail with an error, |
| 323 // passed back as an error code argument to this callback. | 321 // passed back as an error code argument to this callback. |
| 324 // In the success case this callback is not called. | 322 // In the success case this callback is not called. |
| 325 typedef base::Callback<void(enum ConnectErrorCode)> ConnectErrorCallback; | 323 typedef base::Callback<void(enum ConnectErrorCode)> ConnectErrorCallback; |
| 326 | 324 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 | 592 |
| 595 private: | 593 private: |
| 596 // Returns a localized string containing the device's bluetooth address and | 594 // Returns a localized string containing the device's bluetooth address and |
| 597 // a device type for display when |name_| is empty. | 595 // a device type for display when |name_| is empty. |
| 598 base::string16 GetAddressWithLocalizedDeviceTypeName() const; | 596 base::string16 GetAddressWithLocalizedDeviceTypeName() const; |
| 599 }; | 597 }; |
| 600 | 598 |
| 601 } // namespace device | 599 } // namespace device |
| 602 | 600 |
| 603 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 601 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| OLD | NEW |