summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAbhishek Pandit-Subedi <abhishekpandit@chromium.org>2020-07-06 13:25:15 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2020-07-07 10:46:45 -0700
commiteaeb0d619592c1fa050de597a02db7961f907fe6 (patch)
tree75496b449ec2c948a4966ac74dc184e5514b5963 /lib
parent08d9f2ee6203215a5328c21aa5ec40d8fc674e45 (diff)
downloadbluez-eaeb0d619592c1fa050de597a02db7961f907fe6.tar.gz
device: Support marking a device with wake allowed
If a device is allowed to wake the host system from suspend, it should be marked as wake allowed. We add support for a new property that is sent to the kernel via set device flags mgmt op. We also add the dbus endpoint to allow the wake allowed setting to be controlled. In order for wake allowed to be set, the profile must also support wake. This setting isn't exposed to the user but must be set by profiles that intend to support wake from suspend. If a device is connecting for the first time, it will be marked WakeAllowed if the profile supports it. On subsequent reloads of bluez, the stored setting "WakeAllowed" will be used to override any other setting.
Diffstat (limited to 'lib')
-rw-r--r--lib/mgmt.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/mgmt.h b/lib/mgmt.h
index 525c4dd62..a800bcab4 100644
--- a/lib/mgmt.h
+++ b/lib/mgmt.h
@@ -665,6 +665,8 @@ struct mgmt_rp_get_device_flags {
uint32_t current_flags;
} __packed;
+#define DEVICE_FLAG_REMOTE_WAKEUP (1 << 0)
+
#define MGMT_OP_SET_DEVICE_FLAGS 0x0050
#define MGMT_SET_DEVICE_FLAGS_SIZE 11
struct mgmt_cp_set_device_flags {