summaryrefslogtreecommitdiff
path: root/src/device.h
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 /src/device.h
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 'src/device.h')
-rw-r--r--src/device.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/device.h b/src/device.h
index 06b100499..cb8d884e8 100644
--- a/src/device.h
+++ b/src/device.h
@@ -33,6 +33,7 @@ struct btd_device *device_create_from_storage(struct btd_adapter *adapter,
char *btd_device_get_storage_path(struct btd_device *device,
const char *filename);
+
void btd_device_device_set_name(struct btd_device *device, const char *name);
void device_store_cached_name(struct btd_device *dev, const char *name);
void device_get_name(struct btd_device *device, char *name, size_t len);
@@ -139,6 +140,11 @@ void device_store_svc_chng_ccc(struct btd_device *device, uint8_t bdaddr_type,
uint16_t value);
void device_load_svc_chng_ccc(struct btd_device *device, uint16_t *ccc_le,
uint16_t *ccc_bredr);
+void device_set_wake_support(struct btd_device *device, bool wake_support);
+void device_set_wake_override(struct btd_device *device, bool wake_override);
+void device_set_wake_allowed(struct btd_device *device, bool wake_allowed,
+ guint32 id);
+void device_set_wake_allowed_complete(struct btd_device *device);
typedef void (*disconnect_watch) (struct btd_device *device, gboolean removal,
void *user_data);
@@ -176,5 +182,9 @@ struct btd_service *btd_device_get_service(struct btd_device *dev,
int device_discover_services(struct btd_device *device);
int btd_device_connect_services(struct btd_device *dev, GSList *services);
+uint32_t btd_device_get_current_flags(struct btd_device *dev);
+void btd_device_flags_changed(struct btd_device *dev, uint32_t supported_flags,
+ uint32_t current_flags);
+
void btd_device_init(void);
void btd_device_cleanup(void);