Files.app: Provide detailed change information on onDirectoryChanged event
[chromium-blink-merge.git] / device / bluetooth / bluetooth_low_energy_win.h
blob6c997e9317442c8539d137e3fd19ddef488c8f38
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_H_
8 #include <windows.h>
9 #include <setupapi.h>
10 // #include <bthledef.h>
11 // TODO(rpaquay):
12 // bthledef.h from Win8 SDK has a couple of issues when used in a Win32 app:
13 // * line 420: usage of "pragma pop" instead of "pragma warning(pop)"
14 // * line 349: no CALLBACK modifier in the definition of
15 // PFNBLUETOOTH_GATT_EVENT_CALLBACK.
17 // So, we duplicate the definitions we need and prevent the build from including
18 // the content of bthledef.h.
19 #ifndef __BTHLEDEF_H__
20 #define __BTHLEDEF_H__
23 // Bluetooth LE device interface GUID
25 // {781aee18-7733-4ce4-adb0-91f41c67b592}
26 DEFINE_GUID(GUID_BLUETOOTHLE_DEVICE_INTERFACE,
27 0x781aee18,
28 0x7733,
29 0x4ce4,
30 0xad,
31 0xd0,
32 0x91,
33 0xf4,
34 0x1c,
35 0x67,
36 0xb5,
37 0x92);
39 #endif // __BTHLEDEF_H__
40 #include <bluetoothapis.h>
42 #include "base/files/file_path.h"
43 #include "base/memory/scoped_vector.h"
44 #include "base/win/scoped_handle.h"
46 namespace device {
47 namespace win {
49 // Returns true only on Windows platforms supporting Bluetooth Low Energy.
50 bool IsBluetoothLowEnergySupported();
52 struct BluetoothLowEnergyDeviceInfo {
53 BluetoothLowEnergyDeviceInfo() { address.ullLong = BLUETOOTH_NULL_ADDRESS; }
55 base::FilePath path;
56 std::string id;
57 std::string friendly_name;
58 BLUETOOTH_ADDRESS address;
61 // Enumerates the list of known (i.e. already paired) Bluetooth LE devices on
62 // this machine. In case of error, returns false and sets |error| with an error
63 // message describing the problem.
64 // Note: This function returns an error if Bluetooth Low Energy is not supported
65 // on this Windows platform.
66 bool EnumerateKnownBluetoothLowEnergyDevices(
67 ScopedVector<BluetoothLowEnergyDeviceInfo>* devices,
68 std::string* error);
70 bool ExtractBluetoothAddressFromDeviceInstanceIdForTesting(
71 const std::string& instance_id,
72 BLUETOOTH_ADDRESS* btha,
73 std::string* error);
75 } // namespace win
76 } // namespace device
78 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_H_