-
Notifications
You must be signed in to change notification settings - Fork 790
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
[provisioning] the DIN fields should be parsed as BCD values #25493
[provisioning] the DIN fields should be parsed as BCD values #25493
Conversation
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.
Added a comment suggestion.
@@ -61,14 +61,18 @@ def to_int(self) -> int: | |||
din |= self.year | |||
return din | |||
|
|||
@staticmethod | |||
def _read_int_as_decimal_str(x: int) -> int: |
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.
def _read_int_as_decimal_str(x: int) -> int: | |
def _read_int_as_decimal_str(x: int) -> int: | |
"""Interpret a number by reading its hexadecimal representation as a decimal number. | |
For example, `70` in hex is `0x46` and should be read as the decimal value 46. | |
This encoding is a manufacturing equipment constraint. | |
""" |
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.
Good code 👍
The DIN fields should each be parsed as decimal values, even though they are reported as a hex string; there are just unused bits of each subfield. Signed-off-by: Tim Trippel <[email protected]>
b7aecdf
to
2f1e578
Compare
The DIN portion of the device ID contains fields that are in BCD format, as was updated in lowRISC#25493. However, the test was not updated accordingly. Moreover, lowRISC#25493 only added parsing BCD formated DINs, but not generating them from the internal DIN object representation. This has also been fixed. Signed-off-by: Tim Trippel <[email protected]>
The DIN portion of the device ID contains fields that are in BCD format, as was updated in lowRISC#25493. However, the test was not updated accordingly. Moreover, lowRISC#25493 only added parsing BCD formated DINs, but not generating them from the internal DIN object representation. This has also been fixed. Signed-off-by: Tim Trippel <[email protected]>
The DIN portion of the device ID contains fields that are in BCD format, as was updated in lowRISC#25493. However, the test was not updated accordingly. Moreover, lowRISC#25493 only added parsing BCD formated DINs, but not generating them from the internal DIN object representation. This has also been fixed. Signed-off-by: Tim Trippel <[email protected]>
The DIN portion of the device ID contains fields that are in BCD format, as was updated in lowRISC#25493. However, the test was not updated accordingly. Moreover, lowRISC#25493 only added parsing BCD formated DINs, but not generating them from the internal DIN object representation. This has also been fixed. Signed-off-by: Tim Trippel <[email protected]>
The DIN portion of the device ID contains fields that are in BCD format, as was updated in lowRISC#25493. However, the test was not updated accordingly. Moreover, lowRISC#25493 only added parsing BCD formated DINs, but not generating them from the internal DIN object representation. This has also been fixed. Signed-off-by: Tim Trippel <[email protected]>
The DIN portion of the device ID contains fields that are in BCD format, as was updated in lowRISC#25493. However, the test was not updated accordingly. Moreover, lowRISC#25493 only added parsing BCD formated DINs, but not generating them from the internal DIN object representation. This has also been fixed. Signed-off-by: Tim Trippel <[email protected]>
The DIN portion of the device ID contains fields that are in BCD format, as was updated in #25493. However, the test was not updated accordingly. Moreover, #25493 only added parsing BCD formated DINs, but not generating them from the internal DIN object representation. This has also been fixed. Signed-off-by: Tim Trippel <[email protected]>
@timothytrippel , it seems to me that this PR breaks
|
Sorry about that, it should be fixed in the latest version of |
The DIN fields should each be parsed as decimal values, even though they are reported as a hex string; there are just unused bits of each subfield.