diff options
author | Richard Hughes <richard@hughsie.com> | 2023-01-23 15:17:27 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2023-01-24 08:01:41 +0000 |
commit | 6ecb11a5845cf5773d7e711c96ab4c2971fda766 (patch) | |
tree | d99b6952ad362fb300fe812fea515fcea9b594a7 /gusb/gusb-device.c | |
parent | d6ad4f72ad897fec83719b744a2265f22e996fe6 (diff) | |
download | gusb-6ecb11a5845cf5773d7e711c96ab4c2971fda766.tar.gz |
Add g_usb_device_is_emulated() for future use
Diffstat (limited to 'gusb/gusb-device.c')
-rw-r--r-- | gusb/gusb-device.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gusb/gusb-device.c b/gusb/gusb-device.c index 3c0a125..90f1539 100644 --- a/gusb/gusb-device.c +++ b/gusb/gusb-device.c @@ -641,6 +641,23 @@ _g_usb_device_get_device(GUsbDevice *self) return priv->device; } +/** + * g_usb_device_is_emulated: + * @self: a #GUsbDevice instance + * + * Gets if the device is emulated. + * + * Return value: %TRUE if the device is emulated and not backed by a physical device. + * + * Since: 0.4.4 + **/ +gboolean +g_usb_device_is_emulated(GUsbDevice *self) +{ + GUsbDevicePrivate *priv = GET_PRIVATE(self); + return priv->device == NULL; +} + static gboolean g_usb_device_libusb_error_to_gerror(GUsbDevice *self, gint rc, GError **error) { |