-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix boolean convenience setters for ACF-CAN #67
base: main
Are you sure you want to change the base?
Fix boolean convenience setters for ACF-CAN #67
Conversation
Hi Sebastian, thanks for all the help and effort. This is very much appreciated. But I do have some questions on this PR. Maybe we can discuss this next week when I'm back in office?
|
I tried to set the length so that it can be "expected" to work with any size a user might want to throwe at it, when (as it is very likely for some fields in CAN, see example code in the issue) the values are given by maskig something. I think it is always a bit of an arbitrary choice, a "safe" default would be always 64 bits (which is used in the more generic parts of the code anyway). I chose that for mtv as that is a "non-CAN related" 1722-specific thing, whereas for rtr/eff I assumed no matter the CAN impl (Linux or otherwise) it is highly likely the flags, if they are packed will reside in a 32 bit integer, but unkikely they would be in a (uper half of an) 64bit int. Generally, after thinking /discussing about it, I fell maybe for "bools" (1 bit values) the answer is not discussing int-length in the setters, but rather providing "argument-less" (re)setters for this, like, e.g. void Avtp_Can_EnableEff();
void Avtp_Can_DisableEff(); Then the semantics are clear, and no casting surprises. In the end, of course we should use similar patterns for other "ACF's" as well. |
Signed-off-by: Sebastian Schildt <[email protected]>
…ng CAN fields Signed-off-by: Sebastian Schildt <[email protected]>
80a012d
to
0c63cdb
Compare
Changed all bool CAN fields to Adaptetd acf-can examples please double check bridge/listener/talker still work as intended |
This fixes #66 for ACF-CAN.
Choice of input datatypes:
can_frame
in Linux wich is 32 bitcanfd_frame
struct