-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leverage 3 bytes for system version #7250
Conversation
@@ -97,6 +100,14 @@ fu_logitech_rallysystem_audio_device_set_version(FuLogitechRallysystemAudioDevic | |||
G_BIG_ENDIAN, | |||
error)) | |||
return FALSE; | |||
/* | |||
* device reports system version in 3 bytes: major.minor.build | |||
* convert major.minor.build -> major.minor.0.build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so is fu_device_set_version_format(FU_DEVICE(self), FWUPD_VERSION_FORMAT_TRIPLET);
still valid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, FWUPD_VERSION_FORMAT_TRIPLET is valid, no other change needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually firmware report version as Byte1=major; Byte2=minor, Byte3&4=build, but this device reports Byte1=major, Byte2=minor, Byte3=build, Byte4=Ignore. Sorry for the confusion, used "." as byte separator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a better way to do this would be to set the fwversion
into version_raw as before, and instead construct the user-visible triplet in fu_logitech_rallysystem_audio_device_convert_version()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense. Updated.
major = (version_raw >> 16) & 0xFF; | ||
minor = (version_raw >> 8) & 0xFF; | ||
build = (version_raw >> 0) & 0xFF; | ||
version_raw = ((major << 24) | (minor << 16) | 0 | (build << 0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think coverity will hate the | 0, can you remove that and the outer brackets please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Type of pull request:
Added filler to convert 3 bytes into guint32. fu_device_set_version_raw() expects 4 bytes