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

drivers: input: sbus: SBUS Channel data isn't parsed correctly. #84199

Open
nikolaptr opened this issue Jan 19, 2025 · 2 comments · May be fixed by #84200
Open

drivers: input: sbus: SBUS Channel data isn't parsed correctly. #84199

nikolaptr opened this issue Jan 19, 2025 · 2 comments · May be fixed by #84200
Labels
bug The issue is a bug, or the PR is fixing a bug

Comments

@nikolaptr
Copy link

Describe the bug
Portion of SBUS Channel 4, 7, 12 and 15 data is discarded, resulting in invalid data for these channels.

To Reproduce
Dummy SBUS packet can be used to test parser

uint8_t dummy_packet[] = {0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00};

Each channel value is set to 2047, but parser returns invalid values for channels 4, 7, 12 and 15:

  • CH4_Value = 1951
  • CH7_Value = 2015
  • CH12_Value = 1951
  • CH15_Value = 2015

Rest of the channels are valid.

Expected behavior
All channel values should be equal to 2047

@nikolaptr nikolaptr added the bug The issue is a bug, or the PR is fixing a bug label Jan 19, 2025
@nikolaptr
Copy link
Author

It seems that when packet is processed in input_sbus_input_report_thread incoming data is stored in intermediate variable value until complete channel data is received. Issue is that value is uint16_t, resulting in discarded data in case more that 16 bit data needs to be stored at the same time.

Copy link

Hi @nikolaptr! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

@nikolaptr nikolaptr linked a pull request Jan 19, 2025 that will close this issue
@nikolaptr nikolaptr changed the title drivers: input: sbus: SBUS Channel 4 isn't parsed correctly. drivers: input: sbus: SBUS Channel data isn't parsed correctly. Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant