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

Tpm2net incorrect calculation of total packet numbers #1127

Closed
1 task done
mlaurijsse opened this issue Dec 30, 2020 · 1 comment · Fixed by #1128
Closed
1 task done

Tpm2net incorrect calculation of total packet numbers #1127

mlaurijsse opened this issue Dec 30, 2020 · 1 comment · Fixed by #1128
Assignees

Comments

@mlaurijsse
Copy link
Contributor

mlaurijsse commented Dec 30, 2020

  • I confirm that this is an issue rather than a question.

Bug report

When using a tpm2net led device the total number of packets is incorrectly calculated when Max packet is chosen such that all packets are equal size (i.e. the last packet size is equal to the Max packet size).

The root of the error lies in line 26 of LedDeviceTpm2net.cpp. It should round up to the nearest integer instead of rounding down (casting to int) and adding 1.

If needed, I can generate a pull request to fix this bug.

Steps to reproduce

For example: set Hardware LED count to 600 leds, and Max packet 900

What is expected?

600 leds * 3 bytes = 1800 bytes of data
1800 / 900 = 2 packets in total
Two packets being sent, packet header describing a total of 2 packets.

What is actually happening?

Two packets are actually sent, but the packet header is stating a total of 3 packets. This causes the receiver to expect a third packet, which never arrives. Hence the receiver is not processing the data.

System

Hyperion Server:

Hyperion Server OS:

  • Distribution: Raspbian GNU/Linux 10 (buster)
  • Architecture: arm
  • CPU Model: ARMv7 Processor rev 3 (v7l)
  • CPU Type: Raspberry Pi 4 Model B Rev 1.2
  • CPU Revision: c03112
  • CPU Hardware: BCM2711
  • Kernel: linux (5.4.72-v7l+ (WS: 32))
  • Qt Version: 5.7.1
  • Python Version: 3.5.3
  • Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36
@Lord-Grey
Copy link
Collaborator

@mlaurijsse Thanks for reporting.

If you could do a pull request would be very much appreciated.

Thank you!

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

Successfully merging a pull request may close this issue.

3 participants