Skip to content

Commit

Permalink
logitech-rallysystem: Use 3 bytes for the system versions
Browse files Browse the repository at this point in the history
  • Loading branch information
vcdmp committed May 15, 2024
1 parent bcaf325 commit 40608ba
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -194,6 +194,17 @@ fu_logitech_rallysystem_audio_device_set_progress(FuDevice *self, FuProgress *pr
static gchar *
fu_logitech_rallysystem_audio_device_convert_version(FuDevice *device, guint64 version_raw)
{
guint8 major = 0;
guint8 minor = 0;
guint8 build = 0;
/*
* device reports system version in 3 bytes: major.minor.build
* convert major.minor.build -> major.minor.0.build
*/
major = (version_raw >> 16) & 0xFF;
minor = (version_raw >> 8) & 0xFF;
build = (version_raw >> 0) & 0xFF;
version_raw = (major << 24) | (minor << 16) | (build << 0);
return fu_version_from_uint32(version_raw, fu_device_get_version_format(device));
}

Expand Down

0 comments on commit 40608ba

Please sign in to comment.