xela144 / CANaconda

CANaconda project: CAN message viewer
GNU General Public License v3.0
10 stars 0 forks source link

Transmission doesn't work when multiple fields are in the same byte #22

Closed Susurrus closed 10 years ago

Susurrus commented 10 years ago

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.

Susurrus commented 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>
Susurrus commented 10 years ago
xela144 commented 10 years ago

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.