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

USB Portal #210

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

USB Portal #210

wants to merge 4 commits into from

Conversation

hfiguiere
Copy link
Contributor

This is a draft, needs a lot of cleanup. Also the portal hasn't landed yet.

But I'm using this to exercise / test the USB portal.

@hfiguiere hfiguiere force-pushed the usb-portal branch 3 times, most recently from fced97d to ecb8189 Compare May 20, 2024 02:33
@hfiguiere
Copy link
Contributor Author

Currently includes a revert for #208

@hfiguiere hfiguiere force-pushed the usb-portal branch 3 times, most recently from 4d81103 to de86287 Compare May 20, 2024 03:10
@hfiguiere
Copy link
Contributor Author

The build failure is because it needs a flatpak version that isn't available.

src/desktop/usb.rs Outdated Show resolved Hide resolved
src/desktop/usb.rs Outdated Show resolved Hide resolved
src/desktop/usb.rs Outdated Show resolved Hide resolved
src/desktop/usb.rs Outdated Show resolved Hide resolved
}

/// Call on success of acquire_devices.
#[doc(alias = "FinishAcquireDevices")]
Copy link
Owner

Choose a reason for hiding this comment

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

This seems like it can be just called at the end of acquire_device, why it is a separate method?

Copy link
Contributor Author

@hfiguiere hfiguiere Nov 23, 2024

Choose a reason for hiding this comment

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

the problem is that there is a dbus limitation on how many fd it can return, so we need to be able to chunk the finish call. So it has to be called manually.

Copy link
Owner

Choose a reason for hiding this comment

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

We talked about this in the matrix channel, this is a dbus limitation. You should instead call it yourself in AcquireDevices until it stops returning, and return the results or even better make it return a Stream so you can call next on it which would call internally the FinishAcquireDevices.

ashpd-demo/src/portals/desktop/usb.rs Outdated Show resolved Hide resolved
#[strong]
page,
async move {
let usb = UsbProxy::new().await.unwrap();
Copy link
Owner

Choose a reason for hiding this comment

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

Keep the proxy around

ashpd-demo/src/portals/desktop/usb.rs Outdated Show resolved Hide resolved
ashpd-demo/src/portals/desktop/usb.rs Outdated Show resolved Hide resolved

pub(super) async fn stop_session(&self) -> anyhow::Result<()> {
if let Some(session) = self.session.lock().await.take() {
session.close().await?;
Copy link
Owner

Choose a reason for hiding this comment

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

should switch the buttons state

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is done by the non-imp version which is the one called from the UI.

@hfiguiere hfiguiere force-pushed the usb-portal branch 2 times, most recently from d85650e to 3aee673 Compare November 22, 2024 13:24
Signed-off-by: Hubert Figuière <[email protected]>
This allow running the release build.

Signed-off-by: Hubert Figuière <[email protected]>
Signed-off-by: Hubert Figuière <[email protected]>
- Added UI for USB
- Added rusb to the crates.
- Added libusb to the manifest.

Signed-off-by: Hubert Figuière <[email protected]>
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.

2 participants