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

kdeconnect: choose the first avilable device #1792

Closed
wants to merge 3 commits into from

Conversation

omkar-mohanty
Copy link
Contributor

Fixes #1612

@omkar-mohanty
Copy link
Contributor Author

@MaxVerevkin is this the correct direction to go for? I am a bit unsure if all the cases are handles.

@omkar-mohanty omkar-mohanty marked this pull request as ready for review February 28, 2023 05:06
@MaxVerevkin
Copy link
Collaborator

@MaxVerevkin is this the correct direction to go for? I am a bit unsure if all the cases are handles.

I think a better way to organize things is to do something similar to bluetooth.rs and battery/upower.rs.

@omkar-mohanty omkar-mohanty marked this pull request as draft March 1, 2023 03:43
@omkar-mohanty omkar-mohanty force-pushed the kde branch 2 times, most recently from 3151439 to a59ccac Compare March 4, 2023 07:33
@omkar-mohanty omkar-mohanty marked this pull request as ready for review March 4, 2023 07:38
@omkar-mohanty
Copy link
Contributor Author

@MaxVerevkin I organized kdeconnect.rs like bluetooth.rs, I think it should be ready now.

@MaxVerevkin
Copy link
Collaborator

MaxVerevkin commented Mar 4, 2023

When device is not found, the block should wait until a new device is added, then it can try searching again. Right now there is a tight loop which maxes the CPU usage...


And to be honest, I don't quite understand why I decided to use a tokio task + channels to watch for updates when I was porting this block. It doesn't make sense. Instead a Device can contain three streams which are .next().awaited in wait_for_change.

@omkar-mohanty omkar-mohanty force-pushed the kde branch 2 times, most recently from 3699ccc to a35458d Compare March 6, 2023 06:10
@omkar-mohanty omkar-mohanty force-pushed the kde branch 2 times, most recently from 7322aac to 3e94f91 Compare March 6, 2023 06:57
@omkar-mohanty
Copy link
Contributor Author

@MaxVerevkin for some reason cargo fmt does not seem to work in my local machine

@MaxVerevkin
Copy link
Collaborator

@MaxVerevkin for some reason cargo fmt does not seem to work in my local machine

cargo fmt unfortunately does not format files which are included via macros (in our case the define_blocks! macro in blocks.rs), so if you don't use rust_analyzer, you have to run rustfmt --edition 2021 <file>.

@omkar-mohanty
Copy link
Contributor Author

@MaxVerevkin is the PR close to what you have in mind?

@MaxVerevkin
Copy link
Collaborator

@omkar-mohanty CPU usage is still 100%

Signed-off-by: omkar-mohanty <[email protected]>

kdeconnect: implement display

Signed-off-by: omkar-mohanty <[email protected]>
@MaxVerevkin
Copy link
Collaborator

Now CPU usage is 100% even if the device is available

@MaxVerevkin MaxVerevkin marked this pull request as draft March 18, 2023 16:46
@MaxVerevkin MaxVerevkin mentioned this pull request Apr 12, 2023
@ammgws ammgws closed this in #1860 Jan 9, 2024
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.

kdeconnect: choose first available device
2 participants