| Top |
| FuFirmware * | fu_firmware_new () |
| FuFirmware * | fu_firmware_new_from_bytes () |
| gchar * | fu_firmware_to_string () |
| const gchar * | fu_firmware_get_version () |
| void | fu_firmware_set_version () |
| gboolean | fu_firmware_tokenize () |
| gboolean | fu_firmware_parse () |
| gboolean | fu_firmware_parse_file () |
| gboolean | fu_firmware_parse_full () |
| GBytes * | fu_firmware_write () |
| gboolean | fu_firmware_write_file () |
| void | fu_firmware_add_image () |
| GPtrArray * | fu_firmware_get_images () |
| FuFirmwareImage * | fu_firmware_get_image_by_id () |
| GBytes * | fu_firmware_get_image_by_id_bytes () |
| FuFirmwareImage * | fu_firmware_get_image_by_idx () |
| GBytes * | fu_firmware_get_image_by_idx_bytes () |
| FuFirmwareImage * | fu_firmware_get_image_default () |
| GBytes * | fu_firmware_get_image_default_bytes () |
An object that represents a firmware file. See also: FuDfuFirmware, FuIhexFirmware, FuSrecFirmware
FuFirmware *
fu_firmware_new (void);
Creates an empty firmware object.
Since: 1.3.1
FuFirmware *
fu_firmware_new_from_bytes (GBytes *fw);
Creates a firmware object with the provided image set as default.
Since: 1.3.1
gchar *
fu_firmware_to_string (FuFirmware *self);
This allows us to easily print the object.
Since: 1.3.1
const gchar *
fu_firmware_get_version (FuFirmware *self);
Gets an optional version that represents the firmware.
Since: 1.3.3
void fu_firmware_set_version (FuFirmware *self,const gchar *version);
Sets an optional version that represents the firmware.
Since: 1.3.3
gboolean fu_firmware_tokenize (FuFirmware *self,GBytes *fw,FwupdInstallFlags flags,GError **error);
Tokenizes a firmware, typically breaking the firmware into records.
Records can be enumerated using subclass-specific functionality, for example
using fu_srec_firmware_get_records().
self |
||
fw |
A GBytes |
|
flags |
some FwupdInstallFlags, e.g. |
|
error |
A GError, or |
Since: 1.3.2
gboolean fu_firmware_parse (FuFirmware *self,GBytes *fw,FwupdInstallFlags flags,GError **error);
Parses a firmware, typically breaking the firmware into images.
self |
||
fw |
A GBytes |
|
flags |
some FwupdInstallFlags, e.g. |
|
error |
A GError, or |
Since: 1.3.1
gboolean fu_firmware_parse_file (FuFirmware *self,GFile *file,FwupdInstallFlags flags,GError **error);
Parses a firmware file, typically breaking the firmware into images.
self |
||
file |
A GFile |
|
flags |
some FwupdInstallFlags, e.g. |
|
error |
A GError, or |
Since: 1.3.3
gboolean fu_firmware_parse_full (FuFirmware *self,GBytes *fw,guint64 addr_start,guint64 addr_end,FwupdInstallFlags flags,GError **error);
Parses a firmware, typically breaking the firmware into images.
self |
||
fw |
A GBytes |
|
addr_start |
Start address, useful for ignoring a bootloader |
|
addr_end |
End address, useful for ignoring config bytes |
|
flags |
some FwupdInstallFlags, e.g. |
|
error |
A GError, or |
Since: 1.3.1
GBytes * fu_firmware_write (FuFirmware *self,GError **error);
Writes a firmware, typically packing the images into a binary blob.
Since: 1.3.1
gboolean fu_firmware_write_file (FuFirmware *self,GFile *file,GError **error);
Writes a firmware, typically packing the images into a binary blob.
Since: 1.3.3
void fu_firmware_add_image (FuFirmware *self,FuFirmwareImage *img);
Adds an image to the firmware.
If an image with the same ID is already present it is replaced.
Since: 1.3.1
GPtrArray *
fu_firmware_get_images (FuFirmware *self);
Returns all the images in the firmware.
Since: 1.3.1
FuFirmwareImage * fu_firmware_get_image_by_id (FuFirmware *self,const gchar *id,GError **error);
Gets the firmware image using the image ID.
Since: 1.3.1
GBytes * fu_firmware_get_image_by_id_bytes (FuFirmware *self,const gchar *id,GError **error);
Gets the firmware image bytes using the image ID.
Since: 1.3.1
FuFirmwareImage * fu_firmware_get_image_by_idx (FuFirmware *self,guint64 idx,GError **error);
Gets the firmware image using the image index.
Since: 1.3.1
GBytes * fu_firmware_get_image_by_idx_bytes (FuFirmware *self,guint64 idx,GError **error);
Gets the firmware image bytes using the image index.
Since: 1.3.1
FuFirmwareImage * fu_firmware_get_image_default (FuFirmware *self,GError **error);
Gets the default firmware image.
NOTE: If the firmware has multiple images included then fu_firmware_get_image_by_id()
or fu_firmware_get_image_by_idx() must be used rather than this function.
Since: 1.3.1
GBytes * fu_firmware_get_image_default_bytes (FuFirmware *self,GError **error);
Gets the default firmware image.
Since: 1.3.1
struct FuFirmwareClass {
GObjectClass parent_class;
gboolean (*parse) (FuFirmware *self,
GBytes *fw,
guint64 addr_start,
guint64 addr_end,
FwupdInstallFlags flags,
GError **error);
GBytes *(*write) (FuFirmware *self,
GError **error);
void (*to_string) (FuFirmware *self,
guint indent,
GString *str);
gboolean (*tokenize) (FuFirmware *self,
GBytes *fw,
FwupdInstallFlags flags,
GError **error);
};