Top | ![]() |
![]() |
![]() |
![]() |
#define | FU_TYPE_PLUGIN |
struct | FuPluginClass |
enum | FuPluginVerifyFlags |
enum | FuPluginRule |
typedef | FuPluginData |
FuPlugin |
const gchar *
fu_plugin_get_name (FuPlugin *plugin
);
Gets the plugin name.
Since: 0.8.0
FuPluginData *
fu_plugin_get_data (FuPlugin *plugin
);
Gets the per-plugin allocated private data. This will return NULL
unless
fu_plugin_alloc_data()
has been called by the plugin.
Since: 0.8.0
FuPluginData * fu_plugin_alloc_data (FuPlugin *plugin
,gsize data_sz
);
Allocates the per-plugin allocated private data.
Since: 0.8.0
gboolean
fu_plugin_get_enabled (FuPlugin *plugin
);
Returns if the plugin is enabled. Plugins may self-disable using
fu_plugin_set_enabled()
or can be disabled by the daemon.
Since: 0.8.0
void fu_plugin_set_enabled (FuPlugin *plugin
,gboolean enabled
);
Enables or disables a plugin. Plugins can self-disable at any point.
Since: 0.8.0
GUsbContext *
fu_plugin_get_usb_context (FuPlugin *plugin
);
Gets the shared USB context that all plugins can use.
Since: 0.8.0
GPtrArray *
fu_plugin_get_supported (FuPlugin *plugin
);
Gets all the device GUIDs supported by the daemon.
Since: 1.0.0
void fu_plugin_device_add (FuPlugin *plugin
,FuDevice *device
);
Asks the daemon to add a device to the exported list. If this device ID has already been added by a different plugin then this request will be ignored.
Plugins should use fu_plugin_device_add_delay()
if they are not capable of
actually flashing an image to the hardware so that higher-priority plugins
can add the device themselves.
Since: 0.8.0
void fu_plugin_device_add_delay (FuPlugin *plugin
,FuDevice *device
);
Asks the daemon to add a device to the exported list after a small delay.
Since: 0.8.0
void fu_plugin_device_remove (FuPlugin *plugin
,FuDevice *device
);
Asks the daemon to remove a device from the exported list.
Since: 0.8.0
void fu_plugin_device_register (FuPlugin *plugin
,FuDevice *device
);
Registers the device with other plugins so they can set metadata.
Plugins do not have to call this manually as this is done automatically
when using fu_plugin_device_add()
. They may wish to use this manually
if for intance the coldplug should be ignored based on the metadata
set from other plugins.
Since: 0.9.7
void
fu_plugin_request_recoldplug (FuPlugin *plugin
);
Ask all the plugins to coldplug all devices, which will include the prepare()
and cleanup()
phases. Duplicate devices added will be ignored.
Since: 0.8.0
void fu_plugin_set_coldplug_delay (FuPlugin *plugin
,guint duration
);
Set the minimum time that should be waited inbetween the call to
fu_plugin_coldplug_prepare()
and fu_plugin_coldplug()
. This is usually going
to be the minimum hardware initialisation time from a datasheet.
It is better to use this function rather than using a sleep()
in the plugin
itself as then only one delay is done in the daemon rather than waiting for
each coldplug prepare in a serial way.
Additionally, very long delays should be avoided as the daemon will be blocked from processing requests whilst the coldplug delay is being performed.
Since: 0.8.0
gpointer fu_plugin_cache_lookup (FuPlugin *plugin
,const gchar *id
);
Finds an object in the per-plugin cache.
Since: 0.8.0
void fu_plugin_cache_remove (FuPlugin *plugin
,const gchar *id
);
Removes an object from the per-plugin cache.
Since: 0.8.0
void fu_plugin_cache_add (FuPlugin *plugin
,const gchar *id
,gpointer dev
);
Adds an object to the per-plugin cache.
Since: 0.8.0
gboolean fu_plugin_check_hwid (FuPlugin *plugin
,const gchar *hwid
);
Checks to see if a specific GUID exists. All hardware IDs on a
specific system can be shown using the fwupdmgr hwids
command.
Since: 0.9.1
gboolean fu_plugin_check_supported (FuPlugin *plugin
,const gchar *guid
);
Checks to see if a specific device GUID is supported, i.e. available in the AppStream metadata.
Since: 1.0.0
const gchar * fu_plugin_get_dmi_value (FuPlugin *plugin
,const gchar *dmi_id
);
Gets a hardware DMI value.
Since: 0.9.7
const gchar * fu_plugin_get_smbios_string (FuPlugin *plugin
,guint8 structure_type
,guint8 offset
);
Gets a hardware SMBIOS string.
The type
and offset
can be referenced from the DMTF SMBIOS specification:
https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.1.1.pdf
plugin |
A FuPlugin |
|
structure_type |
A SMBIOS structure type, e.g. |
|
offset |
A SMBIOS offset |
Since: 0.9.8
GBytes * fu_plugin_get_smbios_data (FuPlugin *plugin
,guint8 structure_type
);
Gets a hardware SMBIOS data.
plugin |
A FuPlugin |
|
structure_type |
A SMBIOS structure type, e.g. |
Since: 0.9.8
void fu_plugin_add_rule (FuPlugin *plugin
,FuPluginRule rule
,const gchar *name
);
If the plugin name is found, the rule will be used to sort the plugin list,
for example the plugin specified by name
will be ordered after this plugin
when FU_PLUGIN_RULE_RUN_AFTER
is used.
NOTE: The depsolver is iterative and may not solve overly-complicated rules; If depsolving fails then fwupd will not start.
plugin |
a FuPlugin |
|
rule |
a FuPluginRule, e.g. |
|
name |
a plugin name, e.g. |
FuQuirks *
fu_plugin_get_quirks (FuPlugin *plugin
);
Returns the hardware database object. This can be used to discover device quirks or other device-specific settings.
Since: 1.0.1
const gchar * fu_plugin_lookup_quirk_by_id (FuPlugin *plugin
,const gchar *prefix
,const gchar *id
);
Looks up an entry in the hardware database using a string value.
plugin |
A FuPlugin |
|
prefix |
A string prefix that matches the quirks file basename, e.g. "dfu-quirks" |
|
id |
An ID to match the entry, e.g. "012345" |
Since: 1.0.1
const gchar * fu_plugin_lookup_quirk_by_usb_device (FuPlugin *plugin
,const gchar *prefix
,GUsbDevice *dev
);
Looks up an entry in the hardware database using various keys generated
from dev
.
plugin |
A FuPlugin |
|
prefix |
A string prefix that matches the quirks file basename, e.g. "dfu-quirks" |
|
dev |
A GUsbDevice |
Since: 1.0.1
void fu_plugin_add_report_metadata (FuPlugin *plugin
,const gchar *key
,const gchar *value
);
Sets any additional metadata to be included in the firmware report to aid debugging problems.
Any data included here will be sent to the metadata server after user confirmation.
struct FuPluginClass { GObjectClass parent_class; /* signals */ void (* device_added) (FuPlugin *plugin, FuDevice *device); void (* device_removed) (FuPlugin *plugin, FuDevice *device); void (* status_changed) (FuPlugin *plugin, FwupdStatus status); void (* percentage_changed) (FuPlugin *plugin, guint percentage); void (* recoldplug) (FuPlugin *plugin); void (* set_coldplug_delay) (FuPlugin *plugin, guint duration); void (* device_register) (FuPlugin *plugin, FuDevice *device); };
The rules used for ordering plugins.
Plugins are expected to add rules in fu_plugin_initialize()
.