Top | ![]() |
![]() |
![]() |
![]() |
FuFirmwareImage * | fu_firmware_image_new () |
gchar * | fu_firmware_image_to_string () |
const gchar * | fu_firmware_image_get_version () |
void | fu_firmware_image_set_version () |
const gchar * | fu_firmware_image_get_filename () |
void | fu_firmware_image_set_filename () |
const gchar * | fu_firmware_image_get_id () |
void | fu_firmware_image_set_id () |
guint64 | fu_firmware_image_get_addr () |
void | fu_firmware_image_set_addr () |
guint64 | fu_firmware_image_get_offset () |
void | fu_firmware_image_set_offset () |
guint64 | fu_firmware_image_get_idx () |
void | fu_firmware_image_set_idx () |
GBytes * | fu_firmware_image_get_bytes () |
void | fu_firmware_image_set_bytes () |
void | fu_firmware_image_add_chunk () |
GPtrArray * | fu_firmware_image_get_chunks () |
gchar * | fu_firmware_image_get_checksum () |
gboolean | fu_firmware_image_parse () |
gboolean | fu_firmware_image_build () |
GBytes * | fu_firmware_image_write () |
GBytes * | fu_firmware_image_write_chunk () |
#define | FU_TYPE_FIRMWARE_IMAGE |
struct | FuFirmwareImageClass |
#define | FU_FIRMWARE_IMAGE_ID_PAYLOAD |
#define | FU_FIRMWARE_IMAGE_ID_SIGNATURE |
#define | FU_FIRMWARE_IMAGE_ID_HEADER |
FuFirmwareImage |
FuFirmwareImage *
fu_firmware_image_new (GBytes *bytes
);
Creates an empty firmware_image object.
Since: 1.3.1
gchar *
fu_firmware_image_to_string (FuFirmwareImage *self
);
This allows us to easily print the object.
Since: 1.3.1
const gchar *
fu_firmware_image_get_version (FuFirmwareImage *self
);
Gets an optional version that represents the firmware image.
Since: 1.3.4
void fu_firmware_image_set_version (FuFirmwareImage *self
,const gchar *version
);
Sets an optional version that represents the firmware image.
Since: 1.3.4
const gchar *
fu_firmware_image_get_filename (FuFirmwareImage *self
);
Gets an optional filename that represents the image source or destination.
Since: 1.5.0
void fu_firmware_image_set_filename (FuFirmwareImage *self
,const gchar *filename
);
Sets an optional filename that represents the image source or destination.
Since: 1.5.0
const gchar *
fu_firmware_image_get_id (FuFirmwareImage *self
);
Gets the image ID, typically set at construction.
Since: 1.3.1
void fu_firmware_image_set_id (FuFirmwareImage *self
,const gchar *id
);
Since: 1.3.1
guint64
fu_firmware_image_get_addr (FuFirmwareImage *self
);
Gets the base address of the image.
Since: 1.3.1
void fu_firmware_image_set_addr (FuFirmwareImage *self
,guint64 addr
);
Sets the base address of the image.
Since: 1.3.1
guint64
fu_firmware_image_get_offset (FuFirmwareImage *self
);
Gets the base offset of the image.
Since: 1.5.0
void fu_firmware_image_set_offset (FuFirmwareImage *self
,guint64 offset
);
Sets the base offset of the image.
Since: 1.5.0
guint64
fu_firmware_image_get_idx (FuFirmwareImage *self
);
Gets the index of the image which is used for ordering.
Since: 1.3.1
void fu_firmware_image_set_idx (FuFirmwareImage *self
,guint64 idx
);
Sets the index of the image which is used for ordering.
Since: 1.3.1
GBytes *
fu_firmware_image_get_bytes (FuFirmwareImage *self
);
Gets the data set using fu_firmware_image_set_bytes()
.
This should only really be used by objects subclassing FuFirmwareImage as
images are normally exported to a file using fu_firmware_image_write()
.
Since: 1.5.0
void fu_firmware_image_set_bytes (FuFirmwareImage *self
,GBytes *bytes
);
Sets the contents of the image if not created with fu_firmware_image_new()
.
Since: 1.3.1
void fu_firmware_image_add_chunk (FuFirmwareImage *self
,FuChunk *chk
);
Adds a chunk to the image.
Since: 1.5.6
GPtrArray * fu_firmware_image_get_chunks (FuFirmwareImage *self
,GError **error
);
Gets the optional image chunks.
Since: 1.5.6
gchar * fu_firmware_image_get_checksum (FuFirmwareImage *self
,GChecksumType csum_kind
,GError **error
);
Returns a checksum of the data.
self |
a FuPlugin |
|
csum_kind |
a GChecksumType, e.g. |
|
error |
A GError, or |
Since: 1.5.5
gboolean fu_firmware_image_parse (FuFirmwareImage *self
,GBytes *fw
,FwupdInstallFlags flags
,GError **error
);
Parses a firmware image, typically checking image CRCs and/or headers.
self |
||
fw |
A GBytes |
|
flags |
some FwupdInstallFlags, e.g. |
|
error |
A GError, or |
Since: 1.5.0
gboolean fu_firmware_image_build (FuFirmwareImage *self
,XbNode *n
,GError **error
);
Builds a firmware image from an XML manifest.
Since: 1.5.0
GBytes * fu_firmware_image_write (FuFirmwareImage *self
,GError **error
);
Writes the image, which will try to call a superclassed ->write()
function.
By default (and in most cases) this just provides the value set by the
fu_firmware_image_set_bytes()
function.
Since: 1.3.3
GBytes * fu_firmware_image_write_chunk (FuFirmwareImage *self
,guint64 address
,guint64 chunk_sz_max
,GError **error
);
Gets a block of data from the image. If the contents of the image is
smaller than the requested chunk size then the GBytes will be smaller
than chunk_sz_max
. Use fu_common_bytes_pad()
if padding is required.
If the address
is larger than the size of the image then an error is returned.
self |
||
address |
an address greater than |
|
chunk_sz_max |
the size of the new chunk |
|
error |
a GError, or |
Since: 1.3.1
struct FuFirmwareImageClass { GObjectClass parent_class; gboolean (*parse) (FuFirmwareImage *self, GBytes *fw, FwupdInstallFlags flags, GError **error); void (*to_string) (FuFirmwareImage *self, guint idt, GString *str); GBytes *(*write) (FuFirmwareImage *self, GError **error); gboolean (*build) (FuFirmwareImage *self, XbNode *n, GError **error); gchar *(*get_checksum)(FuFirmwareImage *self, GChecksumType csum_kind, GError **error); };