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

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

Issue 1945823003: bluetooth: Remove BluetoothAdvertisementData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Fix test 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>
11 11
12 #include "base/strings/string16.h" 12 #include "base/strings/string16.h"
13 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
14 #include "device/bluetooth/bluetooth_device.h" 14 #include "device/bluetooth/bluetooth_device.h"
15 15
16 namespace content { 16 namespace content {
17 17
18 // Data sent over IPC representing a Bluetooth device, corresponding to 18 // Data sent over IPC representing a Bluetooth device, corresponding to
19 // blink::WebBluetoothDevice. 19 // blink::WebBluetoothDevice.
20 struct CONTENT_EXPORT BluetoothDevice { 20 struct CONTENT_EXPORT BluetoothDevice {
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,
25 int8_t rssi,
26 const std::vector<std::string>& uuids); 24 const std::vector<std::string>& uuids);
27 ~BluetoothDevice(); 25 ~BluetoothDevice();
28 26
29 static std::vector<std::string> UUIDsFromBluetoothUUIDs( 27 static std::vector<std::string> UUIDsFromBluetoothUUIDs(
30 const device::BluetoothDevice::UUIDList& uuid_list); 28 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 29
39 std::string id; 30 std::string id;
40 base::string16 name; 31 base::string16 name;
41 int8_t tx_power;
42 int8_t rssi;
43 std::vector<std::string> uuids; // 128bit UUIDs with dashes. 36 chars. 32 std::vector<std::string> uuids; // 128bit UUIDs with dashes. 36 chars.
44 }; 33 };
45 34
46 } // namespace content 35 } // namespace content
47 36
48 #endif // CONTENT_COMMON_BLUETOOTH_BLUETOOTH_DEVICE_H_ 37 #endif // CONTENT_COMMON_BLUETOOTH_BLUETOOTH_DEVICE_H_
OLDNEW
« no previous file with comments | « content/browser/bluetooth/bluetooth_dispatcher_host.cc ('k') | content/common/bluetooth/bluetooth_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698