Skip to content

Incorrect endianness for array type signals #125

Description

@nuts4coffee

Describe the bug
A clear and concise description of what the bug is.

According to the spec,
The list values for array type signal is MSB order:
image

However, the default transmission order for multi-byte signal values is LSB:
image

The current implementation is based on MSB:
https://github.com/c4deszes/ldfparser/blob/master/tests/test_frame.py#L52

Expected behavior
A clear and concise description of what you expected to happen.

def test_frame_raw_encoding_array():
    signal1 = LinSignal('Signal_1', 16, [0, 0])
    frame = LinUnconditionalFrame(1, 'Frame_1', 2, {0: signal1})
    content = frame.raw({
        'Signal_1': [1, 2]
    })
    assert list(content) == [2, 1]

Stacktrace/Code
If applicable, add stacktrace or code segments to help explain your problem.

Environment:

  • OS: (e.g. Linux)
  • Python version: (e.g. 3.8.5)
  • ldfparser version: (e.g. 0.2.1)
Optionally include the output of 'pipdeptree --warn silence -p ldfparser'

Additional context
Add any other context about the problem here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions