-
Notifications
You must be signed in to change notification settings - Fork 53
feat(Hardware Support): Qualcomm SSC sensors through FastRPC #590
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
Draft
gio3k
wants to merge
11
commits into
ShadowBlip:main
Choose a base branch
from
gio3k:dev/gio/ssc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9ed1414
refactor(config): add Default for MountMatrix
gio3k 3b7d4be
build(Cargo.toml): add libloading dependency
gio3k c849528
feat(Hardware Support): Qualcomm SSC sensors through FastRPC
gio3k dfc0502
docs(bindings): Add FastRPC dbus-xml bindings
gio3k 1b1459d
docs(schema): add FastRPC section in composite device schema
gio3k 90f3429
fix(ssc): cancel sensor init after a few seconds
gio3k 5ffb8b4
refactor(ssc): fix tests, add quark strings to errors
gio3k bf119ac
refactor(imus): thread safety comment NOTE -> SAFETY
gio3k 4fa0c95
refactor(ssc): Add SAFETY comment to g_main_context_iteration call
gio3k fef6485
refactor(ssc): rewrite bindings, use Arc for SscRuntime, safety comments
gio3k 3caa790
refactor(ssc): fix up comment wording in bindings.rs
gio3k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
bindings/dbus-xml/org.shadowblip.Input.Source.FastRPCDevice.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
|
|
||
| <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" | ||
| "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
| <node> | ||
| <interface name="org.freedesktop.DBus.Properties"> | ||
| <method name="Get"> | ||
| <arg name="interface_name" type="s" direction="in"/> | ||
| <arg name="property_name" type="s" direction="in"/> | ||
| <arg type="v" direction="out"/> | ||
| </method> | ||
| <method name="Set"> | ||
| <arg name="interface_name" type="s" direction="in"/> | ||
| <arg name="property_name" type="s" direction="in"/> | ||
| <arg name="value" type="v" direction="in"/> | ||
| </method> | ||
| <method name="GetAll"> | ||
| <arg name="interface_name" type="s" direction="in"/> | ||
| <arg type="a{sv}" direction="out"/> | ||
| </method> | ||
| <signal name="PropertiesChanged"> | ||
| <arg name="interface_name" type="s"/> | ||
| <arg name="changed_properties" type="a{sv}"/> | ||
| <arg name="invalidated_properties" type="as"/> | ||
| </signal> | ||
| </interface> | ||
| <interface name="org.freedesktop.DBus.Introspectable"> | ||
| <method name="Introspect"> | ||
| <arg type="s" direction="out"/> | ||
| </method> | ||
| </interface> | ||
| <interface name="org.freedesktop.DBus.Peer"> | ||
| <method name="Ping"> | ||
| </method> | ||
| <method name="GetMachineId"> | ||
| <arg type="s" direction="out"/> | ||
| </method> | ||
| </interface> | ||
| <interface name="org.shadowblip.Input.Source.FastRPCDevice"> | ||
| <!-- | ||
| Returns the human readable name of the device (e.g. XBox 360 Pad) | ||
| --> | ||
| <property name="Id" type="s" access="read"/> | ||
| </interface> | ||
| </node> | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| use crate::{ | ||
| dbus::{interface::Unregisterable, polkit::check_polkit}, | ||
| udev::device::UdevDevice, | ||
| }; | ||
| use zbus::{fdo, message::Header, Connection}; | ||
| use zbus_macros::interface; | ||
|
|
||
| /// DBusInterface exposing information about a FastRPC device | ||
| pub struct SourceFastRpcInterface { | ||
| device: UdevDevice, | ||
| } | ||
|
|
||
| impl SourceFastRpcInterface { | ||
| pub fn new(device: UdevDevice) -> SourceFastRpcInterface { | ||
| SourceFastRpcInterface { device } | ||
| } | ||
| } | ||
|
|
||
| #[interface(name = "org.shadowblip.Input.Source.FastRPCDevice")] | ||
| impl SourceFastRpcInterface { | ||
| /// Returns the human readable name of the device (e.g. XBox 360 Pad) | ||
| #[zbus(property)] | ||
| async fn id( | ||
| &self, | ||
| #[zbus(connection)] conn: &Connection, | ||
| #[zbus(header)] hdr: Option<Header<'_>>, | ||
| ) -> fdo::Result<String> { | ||
| check_polkit(conn, hdr, "org.shadowblip.Input.Source.FastRPCDevice.Id").await?; | ||
| Ok(self.device.sysname()) | ||
| } | ||
| } | ||
|
|
||
| impl Unregisterable for SourceFastRpcInterface {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| pub mod evdev; | ||
| pub mod fastrpc; | ||
| pub mod hidraw; | ||
| pub mod iio_imu; | ||
| pub mod led; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this new config interface add additional value? I would think that the udev config would be able to find these devices without the need for another protocol specific entry. evdev/hidraw/etc. are all legacy config options we'd ideally like to get away from.