Skip to content

Conversation

@IDisposable
Copy link
Contributor

Fixes #128

Summary

  • Revamped the polling and writing of the USB gadget to correct for dropped connections
  • Corrected the initialization order to ensure we run even if the USB is disconnected (and we're getting power from the y-splitter/POE)
  • Ensured that we restart the LED listening polling
  • If we exceed too many consecutive write errors, close and reopen the gadget

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 42 out of 42 changed files in this pull request and generated 17 comments.

Comments suppressed due to low confidence (2)

internal/usbgadget/usbgadget.go:185

  • File handle may be writable as a result of data flow from a call to OpenFile and closing it may result in data loss upon failure, which is not handled explicitly.
		u.absMouseHidFile.Close()

internal/usbgadget/usbgadget.go:189

  • File handle may be writable as a result of data flow from a call to OpenFile and closing it may result in data loss upon failure, which is not handled explicitly.
		u.relMouseHidFile.Close()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@adamshiervani adamshiervani left a comment

Choose a reason for hiding this comment

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

LED state synchronization stops working after 1-2 runs of make test_e2e. The keyboard and mouse movement both work, it's just the LED state that stops updating. A restart fixes the issue.

Also, worth mentioning is that I can also reproduce this issue latest dev without this PR.

@IDisposable
Copy link
Contributor Author

I will look into the LED state issue. When you say it "stops working" do you mean that the client doesn't track the server state, or do you mean the UI doesn't track the RPC pushes?

@adamshiervani
Copy link
Contributor

The remote host receives all keys and mouse events, it's just that the UI doesn't properly reflect the LED State. This makes the make test_e2e fail, as it uses the LED State to determine whether the remote host handles keyboard presses.

@IDisposable
Copy link
Contributor Author

The remote host receives all keys and mouse events, it's just that the UI doesn't properly reflect the LED State. This makes the make test_e2e fail, as it uses the LED State to determine whether the remote host handles keyboard presses.

I'll dig in this weekend... what LED state are we tracking, and what is the test JetKVM physically attached to on the USB port? I notice that MacOS doesn't light the CapsLock LED as I would expect (never really has...) Do you know what kind of machine the Jet is driving?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

USB not detected if not present at startup

2 participants