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

De-duplicate repeated HID packets #1036

Merged
merged 2 commits into from
Jun 14, 2024
Merged

De-duplicate repeated HID packets #1036

merged 2 commits into from
Jun 14, 2024

Conversation

nekomona
Copy link
Contributor

Current implementation of slimenrf-receiver fills empty space with repeated duplication of the last packet to fulfill HID packet length requirement. The duplicated packets would interfere with TPS count and filtering etc.. This PR filters out duplicated packets on the server-side.

Copy link
Member

@ImUrX ImUrX left a comment

Choose a reason for hiding this comment

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

is it possible to not use a reference instead of copying part of an array?

@nekomona
Copy link
Contributor Author

is it possible to not use a reference instead of copying part of an array?

I haven't found a method about creating a reference about a part of an array or doing comparison with subarrays, so I tried the way that keeps sliced results being Array<Byte>. I didn't found a reference about how .slice() with List<Byte> would perform but it doesn't seems to be passing by reference to me. XP

@Eirenliel
Copy link
Member

If you want to access arrays by references, you need to use ByteBuffers.

@ImUrX ImUrX merged commit d23c92d into SlimeVR:main Jun 14, 2024
8 checks passed
@nekomona nekomona deleted the hid-dedup branch June 18, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants