fu-firmware-common

fu-firmware-common

Functions

Description

Functions

fu_firmware_strparse_uint4_safe ()

gboolean
fu_firmware_strparse_uint4_safe (const gchar *data,
                                 gsize datasz,
                                 gsize offset,
                                 guint8 *value,
                                 GError **error);

Parses a base 16 number from a string of 1 character in length. The returned value will range from from 0 to 0xf.

Parameters

data

destination buffer

 

datasz

size of data , typically the same as strlen(data)

 

offset

offset in chars into data to read

 

value

parsed value.

[out][nullable]

error

optional return location for an error.

[nullable]

Returns

TRUE if parsed, FALSE otherwise

Since: 1.5.6


fu_firmware_strparse_uint8_safe ()

gboolean
fu_firmware_strparse_uint8_safe (const gchar *data,
                                 gsize datasz,
                                 gsize offset,
                                 guint8 *value,
                                 GError **error);

Parses a base 16 number from a string of 2 characters in length. The returned value will range from from 0 to 0xff.

Parameters

data

destination buffer

 

datasz

size of data , typically the same as strlen(data)

 

offset

offset in chars into data to read

 

value

parsed value.

[out][nullable]

error

optional return location for an error.

[nullable]

Returns

TRUE if parsed, FALSE otherwise

Since: 1.5.6


fu_firmware_strparse_uint16_safe ()

gboolean
fu_firmware_strparse_uint16_safe (const gchar *data,
                                  gsize datasz,
                                  gsize offset,
                                  guint16 *value,
                                  GError **error);

Parses a base 16 number from a string of 4 characters in length. The returned value will range from from 0 to 0xffff.

Parameters

data

destination buffer

 

datasz

size of data , typically the same as strlen(data)

 

offset

offset in chars into data to read

 

value

parsed value.

[out][nullable]

error

optional return location for an error.

[nullable]

Returns

TRUE if parsed, FALSE otherwise

Since: 1.5.6


fu_firmware_strparse_uint24_safe ()

gboolean
fu_firmware_strparse_uint24_safe (const gchar *data,
                                  gsize datasz,
                                  gsize offset,
                                  guint32 *value,
                                  GError **error);

Parses a base 16 number from a string of 6 characters in length. The returned value will range from from 0 to 0xffffff.

Parameters

data

destination buffer

 

datasz

size of data , typically the same as strlen(data)

 

offset

offset in chars into data to read

 

value

parsed value.

[out][nullable]

error

optional return location for an error.

[nullable]

Returns

TRUE if parsed, FALSE otherwise

Since: 1.5.6


fu_firmware_strparse_uint32_safe ()

gboolean
fu_firmware_strparse_uint32_safe (const gchar *data,
                                  gsize datasz,
                                  gsize offset,
                                  guint32 *value,
                                  GError **error);

Parses a base 16 number from a string of 8 characters in length. The returned value will range from from 0 to 0xffffffff.

Parameters

data

destination buffer

 

datasz

size of data , typically the same as strlen(data)

 

offset

offset in chars into data to read

 

value

parsed value.

[out][nullable]

error

optional return location for an error.

[nullable]

Returns

TRUE if parsed, FALSE otherwise

Since: 1.5.6