Method

FwupdPluginDeviceget_contents_bytes

Declaration [src]

GBytes*
fu_device_get_contents_bytes (
  FuDevice* self,
  const gchar* filename,
  gsize count,
  FuProgress* progress,
  GError** error
)

Description [src]

Reads a blob of data from the file, emulating if required.

Available since:2.0.2

Parameters

filename const gchar*
 

Full path to a file.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
count gsize
 

Maximum number of bytes to read.

progress FuProgress
 

Optional FuProgress.

 The argument can be NULL.
 The data is owned by the caller of the function.
error GError **
  The return location for a GError*, or NULL.

Return value

Returns: GBytes
 

A GBytes, or NULL on error.

 The caller of the method takes ownership of the data, and is responsible for freeing it.