Closed Susurrus closed 10 years ago
The following message is an example where this fails.
<messageInfo name = "Set rudder status" id = "0x81" format = "standard" size = "1">
<field
name = "Calibrate"
offset = "0"
length = "1"
signed = "no"
type = "int"
/>
<field
name = "Reset"
offset = "1"
length = "1"
signed = "no"
type = "int"
/>
<field
name = "Enable"
offset = "2"
length = "1"
signed = "no"
type = "int"
/>
</messageInfo>
The N2K error is actually from a different bug. See canport.py: https://github.com/xela144/CANaconda/blob/master/canport.py#L427-L429
One way of fixing this is to force the user to include an ID if he wants to broadcast.
For example, my rudder status message has 3 fields, each 1 bit, packed into 1 byte. When it gets encoded into a transmission message, it ends up being 3 bytes. So the only thing that should need to change at this point is the function that generates bytes from the fields and values.