Skip to content
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

Removed 'reversed' from intToLittleEndianArray #10

Merged
merged 2 commits into from
Mar 17, 2024

Conversation

indoorcyclingdev
Copy link
Contributor

Hi, I'm using your library with indoor trainers.

Indoor trainer was not respondingo correctly to setting power, so I found that array values was revesed, and then removed the reversed from your function.

After removing it, Indoor trainer started to wrork correctly.

The indoor trainer I'm using works fine with other apps/programs like Zwift, Rouvy ecc..

I'm sorry for my bad english
Thank you

…ct values to indoor trainer, it was not vorking correctly with the reversed array
Copy link
Owner

@Malte2036 Malte2036 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your investigation 👍 .

Instead of removing the reversed from the Utils.intToLittleEndianArray function, you should add an additionally reversed to the getWriteData function of the machine_control_point.dart file:

List<int> getWriteData() {
    List<int> writeData = [opCode.value];
    if (parameter != null) {
      writeData.addAll(
          Utils.intToLittleEndianArray(parameter!.value, parameter!.size).reversed);
    }
    return writeData;
  }

And it would be nice if you can add an test to machine_control_point_test.dart for your case. Thanks.

@Malte2036 Malte2036 added the bug Something isn't working label Mar 15, 2024
@Malte2036 Malte2036 linked an issue Mar 15, 2024 that may be closed by this pull request
@indoorcyclingdev
Copy link
Contributor Author

Hi, thank you very much.

I fixed the code following your suggestion and wrote the test.

@Malte2036 Malte2036 merged commit b6963fb into Malte2036:main Mar 17, 2024
1 check passed
@Malte2036
Copy link
Owner

Merci. It is released on pub.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MachineControlPoint with custom parameters not working
2 participants