Commit de6ae639 authored by rpaquay@chromium.org's avatar rpaquay@chromium.org

Expose "visible" and "authenticated" properties.

They are always "true" for now, due to the way BLE devices work under Windows 8.

BUG=388016

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=282286

Review URL: https://codereview.chromium.org/378293007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282634 0039d316-1c4b-4281-b951-d872f2087c98
parent 9c9b3611
......@@ -322,6 +322,11 @@ bool CollectBluetoothLowEnergyDeviceStatus(
}
device_info->connected = !(value->AsUint32() & DN_DEVICE_DISCONNECTED);
// Windows 8 exposes BLE devices only if they are visible and paired. This
// might change in the future if Windows offers a public API for discovering
// and pairing BLE devices.
device_info->visible = true;
device_info->authenticated = true;
return true;
}
......@@ -519,7 +524,7 @@ uint32_t DevicePropertyValue::AsUint32() const {
}
BluetoothLowEnergyDeviceInfo::BluetoothLowEnergyDeviceInfo()
: connected(false) {
: visible(false), authenticated(false), connected(false) {
address.ullLong = BLUETOOTH_NULL_ADDRESS;
}
......
......@@ -113,6 +113,8 @@ struct BluetoothLowEnergyDeviceInfo {
std::string id;
std::string friendly_name;
BLUETOOTH_ADDRESS address;
bool visible;
bool authenticated;
bool connected;
};
......
......@@ -406,7 +406,10 @@ void BluetoothTaskManagerWin::GetKnownDevices() {
DeviceState* device_state = new DeviceState();
device_state->name = device_info->friendly_name;
device_state->address = BluetoothAddressToString(device_info->address);
device_state->visible = device_info->visible;
device_state->authenticated = device_info->authenticated;
device_state->connected = device_info->connected;
device_state->path = device_info->path;
device_list->push_back(device_state);
}
}
......
......@@ -8,6 +8,7 @@
#include <string>
#include <vector>
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_vector.h"
#include "base/observer_list.h"
......@@ -53,13 +54,17 @@ class BluetoothTaskManagerWin
struct DeviceState {
DeviceState();
~DeviceState();
// Properties common to Bluetooth Radio and LE devices.
std::string name;
std::string address;
uint32 bluetooth_class;
bool visible;
bool connected;
bool authenticated;
ScopedVector<ServiceRecordState> service_record_states;
// Properties specific to Bluetooth Radio devices.
uint32 bluetooth_class;
// Properties specific to Bluetooth LE devices.
base::FilePath path;
};
class Observer {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment