| Top |
| DfuFirmware * | dfu_firmware_new () |
| const gchar * | dfu_firmware_format_to_string () |
| DfuImage * | dfu_firmware_get_image () |
| DfuImage * | dfu_firmware_get_image_by_name () |
| DfuImage * | dfu_firmware_get_image_default () |
| GPtrArray * | dfu_firmware_get_images () |
| guint16 | dfu_firmware_get_vid () |
| guint16 | dfu_firmware_get_pid () |
| guint16 | dfu_firmware_get_release () |
| guint16 | dfu_firmware_get_format () |
| guint32 | dfu_firmware_get_size () |
| DfuCipherKind | dfu_firmware_get_cipher_kind () |
| void | dfu_firmware_add_image () |
| void | dfu_firmware_set_vid () |
| void | dfu_firmware_set_pid () |
| void | dfu_firmware_set_release () |
| void | dfu_firmware_set_format () |
| gboolean | dfu_firmware_parse_data () |
| gboolean | dfu_firmware_parse_file () |
| GBytes * | dfu_firmware_write_data () |
| gboolean | dfu_firmware_write_file () |
| gchar * | dfu_firmware_to_string () |
| const gchar * | dfu_firmware_get_metadata () |
| void | dfu_firmware_set_metadata () |
| void | dfu_firmware_remove_metadata () |
| #define | DFU_TYPE_FIRMWARE |
| struct | DfuFirmwareClass |
| enum | DfuFirmwareParseFlags |
| enum | DfuFirmwareFormat |
| DfuFirmware |
This object allows reading and writing firmware files either in raw, DFU or DfuSe formats.
A DfuFirmware can be made up of several DfuImages, although typically there is only one.
See also: DfuImage
DfuFirmware *
dfu_firmware_new (void);
Creates a new DFU firmware object.
Since: 0.5.4
const gchar *
dfu_firmware_format_to_string (DfuFirmwareFormat format);
Returns a string representaiton of the format.
Since: 0.5.4
DfuImage * dfu_firmware_get_image (DfuFirmware *firmware,guint8 alt_setting);
Gets an image from the firmware file.
Since: 0.5.4
DfuImage * dfu_firmware_get_image_by_name (DfuFirmware *firmware,const gchar *name);
Gets an image from the firmware file.
Since: 0.5.4
DfuImage *
dfu_firmware_get_image_default (DfuFirmware *firmware);
Gets the default image from the firmware file.
Since: 0.5.4
GPtrArray *
dfu_firmware_get_images (DfuFirmware *firmware);
Gets all the images contained in this firmware file.
Since: 0.5.4
guint16
dfu_firmware_get_vid (DfuFirmware *firmware);
Gets the vendor ID.
Since: 0.5.4
guint16
dfu_firmware_get_pid (DfuFirmware *firmware);
Gets the product ID.
Since: 0.5.4
guint16
dfu_firmware_get_release (DfuFirmware *firmware);
Gets the device ID.
Since: 0.5.4
guint16
dfu_firmware_get_format (DfuFirmware *firmware);
Gets the DFU version.
Since: 0.5.4
guint32
dfu_firmware_get_size (DfuFirmware *firmware);
Gets the size of all the images in the firmware.
This only returns actual data that would be sent to the device and does not include any padding.
Since: 0.5.4
DfuCipherKind
dfu_firmware_get_cipher_kind (DfuFirmware *firmware);
Returns the kind of cipher used by the firmware file.
NOTE: this value is based on a heuristic, and may not be accurate.
The value DFU_CIPHER_KIND_NONE will be returned when the cipher
is not recognised.
Since: 0.5.4
void dfu_firmware_add_image (DfuFirmware *firmware,DfuImage *image);
Adds an image to the list of images.
Since: 0.5.4
void dfu_firmware_set_vid (DfuFirmware *firmware,guint16 vid);
Sets the vendor ID.
Since: 0.5.4
void dfu_firmware_set_pid (DfuFirmware *firmware,guint16 pid);
Sets the product ID.
Since: 0.5.4
void dfu_firmware_set_release (DfuFirmware *firmware,guint16 release);
Sets the device ID.
Since: 0.5.4
void dfu_firmware_set_format (DfuFirmware *firmware,DfuFirmwareFormat format);
Sets the DFU version in BCD format.
Since: 0.5.4
gboolean dfu_firmware_parse_data (DfuFirmware *firmware,GBytes *bytes,DfuFirmwareParseFlags flags,GError **error);
Parses firmware data which may have an optional DFU suffix.
firmware |
||
bytes |
raw firmware data |
|
flags |
optional flags, e.g. |
|
error |
Since: 0.5.4
gboolean dfu_firmware_parse_file (DfuFirmware *firmware,GFile *file,DfuFirmwareParseFlags flags,GCancellable *cancellable,GError **error);
Parses a DFU firmware, which may contain an optional footer.
firmware |
||
file |
a GFile to load and parse |
|
flags |
optional flags, e.g. |
|
cancellable |
a GCancellable, or |
|
error |
Since: 0.5.4
GBytes * dfu_firmware_write_data (DfuFirmware *firmware,GError **error);
Writes DFU data to a data blob with a DFU-specific footer.
Since: 0.5.4
gboolean dfu_firmware_write_file (DfuFirmware *firmware,GFile *file,GCancellable *cancellable,GError **error);
Writes a DFU firmware with the optional footer.
Since: 0.5.4
gchar *
dfu_firmware_to_string (DfuFirmware *firmware);
Returns a string representaiton of the object.
Since: 0.5.4
const gchar * dfu_firmware_get_metadata (DfuFirmware *firmware,const gchar *key);
Gets metadata from the store with a specific key.
Since: 0.5.4
void dfu_firmware_set_metadata (DfuFirmware *firmware,const gchar *key,const gchar *value);
Sets a metadata value with a specific key.
Since: 0.5.4
void dfu_firmware_remove_metadata (DfuFirmware *firmware,const gchar *key);
Removes a metadata item from the store
Since: 0.5.4