Richard Hughes | 02c90d8 | 2018-08-09 12:13:03 +0100 | [diff] [blame] | 1 | /* |
Richard Hughes | 9dde04f | 2017-09-13 12:07:15 +0100 | [diff] [blame] | 2 | * Copyright (C) 2017 Richard Hughes <richard@hughsie.com> |
| 3 | * |
Mario Limonciello | 51308e6 | 2018-05-28 20:05:46 -0500 | [diff] [blame] | 4 | * SPDX-License-Identifier: LGPL-2.1+ |
Richard Hughes | 9dde04f | 2017-09-13 12:07:15 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
Richard Hughes | bfd946e | 2019-02-09 08:21:40 +0000 | [diff] [blame] | 7 | #pragma once |
Richard Hughes | 9dde04f | 2017-09-13 12:07:15 +0100 | [diff] [blame] | 8 | |
| 9 | #include <fu-device.h> |
Mario Limonciello | 7a3df4b | 2019-01-31 10:27:22 -0600 | [diff] [blame] | 10 | #include <xmlb.h> |
Richard Hughes | 9dde04f | 2017-09-13 12:07:15 +0100 | [diff] [blame] | 11 | |
Mario Limonciello | 3960265 | 2019-04-29 21:08:58 -0500 | [diff] [blame] | 12 | /** |
| 13 | * FuDeviceInstanceFlags: |
| 14 | * @FU_DEVICE_INSTANCE_FLAG_NONE: No flags set |
| 15 | * @FU_DEVICE_INSTANCE_FLAG_ONLY_QUIRKS: Only use instance ID for quirk matching |
| 16 | * |
| 17 | * The flags to use when interacting with a device instance |
| 18 | **/ |
Richard Hughes | 8ef139f | 2019-04-23 19:33:28 +0100 | [diff] [blame] | 19 | typedef enum { |
| 20 | FU_DEVICE_INSTANCE_FLAG_NONE = 0, |
| 21 | FU_DEVICE_INSTANCE_FLAG_ONLY_QUIRKS = 1 << 0, |
Mario Limonciello | 3960265 | 2019-04-29 21:08:58 -0500 | [diff] [blame] | 22 | /*< private >*/ |
Richard Hughes | 8ef139f | 2019-04-23 19:33:28 +0100 | [diff] [blame] | 23 | FU_DEVICE_INSTANCE_FLAG_LAST |
| 24 | } FuDeviceInstanceFlags; |
| 25 | |
Richard Hughes | 2c0635a | 2018-09-04 14:52:46 +0100 | [diff] [blame] | 26 | GPtrArray *fu_device_get_parent_guids (FuDevice *self); |
| 27 | gboolean fu_device_has_parent_guid (FuDevice *self, |
Richard Hughes | 5e44729 | 2018-04-27 14:25:54 +0100 | [diff] [blame] | 28 | const gchar *guid); |
Richard Hughes | 841c180 | 2018-09-07 15:32:32 +0100 | [diff] [blame] | 29 | void fu_device_set_parent (FuDevice *self, |
| 30 | FuDevice *parent); |
Richard Hughes | 2c0635a | 2018-09-04 14:52:46 +0100 | [diff] [blame] | 31 | guint fu_device_get_order (FuDevice *self); |
| 32 | void fu_device_set_order (FuDevice *self, |
Richard Hughes | 9f86ade | 2018-05-10 21:11:22 +0100 | [diff] [blame] | 33 | guint order); |
Richard Hughes | 2c0635a | 2018-09-04 14:52:46 +0100 | [diff] [blame] | 34 | guint fu_device_get_priority (FuDevice *self); |
| 35 | void fu_device_set_priority (FuDevice *self, |
Richard Hughes | 81c427c | 2018-08-06 15:20:17 +0100 | [diff] [blame] | 36 | guint priority); |
Richard Hughes | 2c0635a | 2018-09-04 14:52:46 +0100 | [diff] [blame] | 37 | void fu_device_set_alternate (FuDevice *self, |
Richard Hughes | e48351e | 2018-06-22 12:32:39 +0100 | [diff] [blame] | 38 | FuDevice *alternate); |
Richard Hughes | d8a8d5e | 2019-10-08 13:05:02 +0100 | [diff] [blame] | 39 | GType fu_device_get_specialized_gtype (FuDevice *self); |
Richard Hughes | c125ec0 | 2018-09-05 19:35:17 +0100 | [diff] [blame] | 40 | gboolean fu_device_ensure_id (FuDevice *self, |
| 41 | GError **error); |
Mario Limonciello | 7a3df4b | 2019-01-31 10:27:22 -0600 | [diff] [blame] | 42 | void fu_device_incorporate_from_component (FuDevice *device, |
| 43 | XbNode *component); |
Richard Hughes | 1bc4323 | 2019-02-05 19:07:42 +0000 | [diff] [blame] | 44 | void fu_device_convert_instance_ids (FuDevice *self); |
Richard Hughes | 8ef139f | 2019-04-23 19:33:28 +0100 | [diff] [blame] | 45 | void fu_device_add_instance_id_full (FuDevice *self, |
| 46 | const gchar *instance_id, |
| 47 | FuDeviceInstanceFlags flags); |
Richard Hughes | d8a8d5e | 2019-10-08 13:05:02 +0100 | [diff] [blame] | 48 | gchar *fu_device_get_guids_as_str (FuDevice *self); |