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 | |
Richard Hughes | 51a869a | 2019-10-07 11:23:42 +0100 | [diff] [blame^] | 12 | #define fu_device_set_plugin(d,v) fwupd_device_set_plugin(FWUPD_DEVICE(d),v) |
| 13 | |
Mario Limonciello | 3960265 | 2019-04-29 21:08:58 -0500 | [diff] [blame] | 14 | /** |
| 15 | * FuDeviceInstanceFlags: |
| 16 | * @FU_DEVICE_INSTANCE_FLAG_NONE: No flags set |
| 17 | * @FU_DEVICE_INSTANCE_FLAG_ONLY_QUIRKS: Only use instance ID for quirk matching |
| 18 | * |
| 19 | * The flags to use when interacting with a device instance |
| 20 | **/ |
Richard Hughes | 8ef139f | 2019-04-23 19:33:28 +0100 | [diff] [blame] | 21 | typedef enum { |
| 22 | FU_DEVICE_INSTANCE_FLAG_NONE = 0, |
| 23 | FU_DEVICE_INSTANCE_FLAG_ONLY_QUIRKS = 1 << 0, |
Mario Limonciello | 3960265 | 2019-04-29 21:08:58 -0500 | [diff] [blame] | 24 | /*< private >*/ |
Richard Hughes | 8ef139f | 2019-04-23 19:33:28 +0100 | [diff] [blame] | 25 | FU_DEVICE_INSTANCE_FLAG_LAST |
| 26 | } FuDeviceInstanceFlags; |
| 27 | |
Richard Hughes | 2c0635a | 2018-09-04 14:52:46 +0100 | [diff] [blame] | 28 | GPtrArray *fu_device_get_parent_guids (FuDevice *self); |
| 29 | gboolean fu_device_has_parent_guid (FuDevice *self, |
Richard Hughes | 5e44729 | 2018-04-27 14:25:54 +0100 | [diff] [blame] | 30 | const gchar *guid); |
Richard Hughes | 841c180 | 2018-09-07 15:32:32 +0100 | [diff] [blame] | 31 | void fu_device_set_parent (FuDevice *self, |
| 32 | FuDevice *parent); |
Richard Hughes | 2c0635a | 2018-09-04 14:52:46 +0100 | [diff] [blame] | 33 | guint fu_device_get_order (FuDevice *self); |
| 34 | void fu_device_set_order (FuDevice *self, |
Richard Hughes | 9f86ade | 2018-05-10 21:11:22 +0100 | [diff] [blame] | 35 | guint order); |
Richard Hughes | 2c0635a | 2018-09-04 14:52:46 +0100 | [diff] [blame] | 36 | guint fu_device_get_priority (FuDevice *self); |
| 37 | void fu_device_set_priority (FuDevice *self, |
Richard Hughes | 81c427c | 2018-08-06 15:20:17 +0100 | [diff] [blame] | 38 | guint priority); |
Richard Hughes | 2c0635a | 2018-09-04 14:52:46 +0100 | [diff] [blame] | 39 | void fu_device_set_alternate (FuDevice *self, |
Richard Hughes | e48351e | 2018-06-22 12:32:39 +0100 | [diff] [blame] | 40 | FuDevice *alternate); |
Richard Hughes | d8a8d5e | 2019-10-08 13:05:02 +0100 | [diff] [blame] | 41 | GType fu_device_get_specialized_gtype (FuDevice *self); |
Richard Hughes | c125ec0 | 2018-09-05 19:35:17 +0100 | [diff] [blame] | 42 | gboolean fu_device_ensure_id (FuDevice *self, |
| 43 | GError **error); |
Mario Limonciello | 7a3df4b | 2019-01-31 10:27:22 -0600 | [diff] [blame] | 44 | void fu_device_incorporate_from_component (FuDevice *device, |
| 45 | XbNode *component); |
Richard Hughes | 1bc4323 | 2019-02-05 19:07:42 +0000 | [diff] [blame] | 46 | void fu_device_convert_instance_ids (FuDevice *self); |
Richard Hughes | 8ef139f | 2019-04-23 19:33:28 +0100 | [diff] [blame] | 47 | void fu_device_add_instance_id_full (FuDevice *self, |
| 48 | const gchar *instance_id, |
| 49 | FuDeviceInstanceFlags flags); |
Richard Hughes | d8a8d5e | 2019-10-08 13:05:02 +0100 | [diff] [blame] | 50 | gchar *fu_device_get_guids_as_str (FuDevice *self); |
Richard Hughes | 51a869a | 2019-10-07 11:23:42 +0100 | [diff] [blame^] | 51 | GPtrArray *fu_device_get_possible_plugins (FuDevice *self); |