-
-
Notifications
You must be signed in to change notification settings - Fork 218
Fix PassThruConnect Flags for 11 bit CAN identifier #288
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
base: master
Are you sure you want to change the base?
Fix PassThruConnect Flags for 11 bit CAN identifier #288
Conversation
Not sure changing the definition of the constant is a proper fix. Should be zeroed at the usage point. Also, does this limitation apply to your use case only or all use case? |
Then why do you change the constant value to 0? |
This constant contains the value that needs to be set to get 11 bit CAN identifier. According to specification bit 8 specifies the CAN identifier length. If the CAN identifier is 29 bit then bit 8 should be set (0x400). Otherwise it should be cleared (0x000). This constant value can be deleted at all but I left it to keep it more readable. |
No. Should be cleared only 8 bit. BUT i think better if const ISO15765_CAN_ID_11 will be deleted. self.txConnectFlags = 0
# Determine mode ID29 or ID11
if txid >> 11:
self.txConnectFlags |= TxStatusFlag.ISO15765_CAN_ID_29.value
self.txFlags = self.txConnectFlags | TxStatusFlag.ISO15765_FRAME_PAD.value |
@kirya-dev : It sure feels like adding the 29 bits flag if required makes more sense. |
I see topic start from another problem - bit 6 should be zerowed. No related with ID len. Related with FRAME_PAD flag. |
27af056
to
df6a583
Compare
Updated according to your comments. |
@kirya-dev : I still find this PR weird. Will follow your call for merge. |
I can approve condition style shown in my message above. |
Issue: #287
Some of the PassThru devices report an error when an invalid bit is set in the flags parameter.
Currently the bit 6 is set but it should be zeroed.