Commit f653fee2 authored by Christian Kellner's avatar Christian Kellner
Browse files

device: add domain getter

Add the missing getter for the domain associated with a device, or
NULL if there is none, i.e. the device is offline.
parent 72cc323c
......@@ -1495,6 +1495,14 @@ bolt_device_update_from_udev (BoltDevice *dev,
return status;
BoltDomain *
bolt_device_get_domain (BoltDevice *dev)
g_return_val_if_fail (BOLT_IS_DEVICE (dev), NULL);
return dev->domain;
bolt_device_get_keystate (BoltDevice *dev)
......@@ -66,6 +66,8 @@ void bolt_device_authorize_idle (BoltDevice *dev,
GAsyncReadyCallback callback,
gpointer user_data);
BoltDomain * bolt_device_get_domain (BoltDevice *dev);
BoltKeyState bolt_device_get_keystate (BoltDevice *dev);
const char * bolt_device_get_name (BoltDevice *dev);
......@@ -72,6 +72,7 @@ test_device_basic (TestDevice *tt, gconstpointer user_data)
g_assert_null (store);
g_assert_null (dom);
g_assert_true (dom == bolt_device_get_domain (dev));
g_assert_cmpint (sl, ==, BOLT_SECURITY_UNKNOWN);
g_assert_cmpint (gen, ==, 3);
g_assert_cmpint (gen, ==, bolt_device_get_generation (dev));
Supports Markdown
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