Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(615)

Side by Side Diff: content/common/bluetooth/bluetooth_device.h

Issue 1941923002: bluetooth: Return int8_t and use -128 for unknown tx power. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Moar fixes Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 CONTENT_COMMON_BLUETOOTH_BLUETOOTH_DEVICE_H_ 5 #ifndef CONTENT_COMMON_BLUETOOTH_BLUETOOTH_DEVICE_H_
6 #define CONTENT_COMMON_BLUETOOTH_BLUETOOTH_DEVICE_H_ 6 #define CONTENT_COMMON_BLUETOOTH_BLUETOOTH_DEVICE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 10 matching lines...) Expand all
21 BluetoothDevice(); 21 BluetoothDevice();
22 BluetoothDevice(const std::string& id, 22 BluetoothDevice(const std::string& id,
23 const base::string16& name, 23 const base::string16& name,
24 int8_t tx_power, 24 int8_t tx_power,
25 int8_t rssi, 25 int8_t rssi,
26 const std::vector<std::string>& uuids); 26 const std::vector<std::string>& uuids);
27 ~BluetoothDevice(); 27 ~BluetoothDevice();
28 28
29 static std::vector<std::string> UUIDsFromBluetoothUUIDs( 29 static std::vector<std::string> UUIDsFromBluetoothUUIDs(
30 const device::BluetoothDevice::UUIDList& uuid_list); 30 const device::BluetoothDevice::UUIDList& uuid_list);
31 // 127 is used as Unknown Power. According to the Bluetooth spec valid powers
32 // are between [-127, 127]. Anything outside this range will be considered
33 // Unknown Power.
34 static int8_t ValidatePower(int16_t power);
35 // TODO(ortuno): RSSI Unknown and Tx Power Unknown should have different
36 // values. Add kUnknownTxPower when implemented: http://crbug.com/551572
37 const static int8_t kUnknownPower = 127;
38 31
39 std::string id; 32 std::string id;
40 base::string16 name; 33 base::string16 name;
41 int8_t tx_power; 34 int8_t tx_power;
42 int8_t rssi; 35 int8_t rssi;
43 std::vector<std::string> uuids; // 128bit UUIDs with dashes. 36 chars. 36 std::vector<std::string> uuids; // 128bit UUIDs with dashes. 36 chars.
44 }; 37 };
45 38
46 } // namespace content 39 } // namespace content
47 40
48 #endif // CONTENT_COMMON_BLUETOOTH_BLUETOOTH_DEVICE_H_ 41 #endif // CONTENT_COMMON_BLUETOOTH_BLUETOOTH_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698