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

Implement LED source output device #246

Closed
wants to merge 23 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cd3dbdd
feat(VSCode IDE): add debug button
NeroReflex Dec 28, 2024
57271e6
improv(manager): reorganize code and reduce dependency of UdevDevice:…
NeroReflex Dec 30, 2024
53edb30
feat(VSCode IDE): specify the language as being rust for remote debug…
NeroReflex Dec 30, 2024
005be00
improv(composite_device): better error reporting
NeroReflex Dec 30, 2024
48772bd
fix(udev::Device): bufix for number being u32 and code cleanup
NeroReflex Dec 30, 2024
7135d06
improv(udev::Device): don't use udevadm to inspect devices
NeroReflex Dec 30, 2024
bd6c100
manager: check for devnode() validity for device types that actually …
NeroReflex Dec 30, 2024
3e21daa
feat(config) implement LED configuration
NeroReflex Dec 30, 2024
006df63
feat(LED): LEDs initial implementation
NeroReflex Dec 31, 2024
0fc2c59
feat(LED): implement leds as a source output device
NeroReflex Dec 31, 2024
b6f0803
fix(manager): avoid cycling twice configurations
NeroReflex Dec 31, 2024
27f33ec
improv(CompositeDevice): make the code more readable
NeroReflex Dec 31, 2024
54db7ae
improv(main) do not lose the reference to the ctrl+C signal watcher
NeroReflex Dec 31, 2024
368cf3e
improv(LED): add configuration for the ASUS ROG Ally device
NeroReflex Dec 31, 2024
45d1cdf
improv(LED): increase code readability
NeroReflex Dec 31, 2024
45eb711
improv(code): cargo fmt
NeroReflex Dec 31, 2024
79a2bc6
fix(MultiColorChassis): solve a warning about an unused field
NeroReflex Dec 31, 2024
bbee9b3
improv(code): increase readability by replacing if let() with match
NeroReflex Dec 31, 2024
c65effe
fix(dbus) make dbus path parth of a CompositeDevice at construction
NeroReflex Dec 31, 2024
7d9f0cc
fix(manager): avoid borrowing syntax from typescript
NeroReflex Dec 31, 2024
0b79670
improv(code): cargo fmt
NeroReflex Dec 31, 2024
ac25809
fix(comments): apply suggestions from the PR feedback
NeroReflex Dec 31, 2024
00efbb9
fix(LED): fix inverted b and r components
NeroReflex Dec 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 45 additions & 6 deletions src/input/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ impl Manager {
return Ok(());
}
}
_ => (),
_ => ()
};
log::trace!(
"Device {id} does not match existing device: {:?}",
Expand Down Expand Up @@ -1294,13 +1294,16 @@ impl Manager {
let dev_path = device.devpath();
let sys_name = device.sysname();
if sys_name.is_empty() {
log::warn!(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to be very noisy. Use trace, or at most debug.

"Device discarded for missing sysname: {} at {}",
device.name(),
device.syspath()
);
return Ok(());
}
let sysname = sys_name.clone();
let dev = device.clone();

log::debug!("Device added: {}", device.name());

// Get the device subsystem
let subsystem = device.subsystem();

Expand All @@ -1310,7 +1313,20 @@ impl Manager {
// Create a DBus interface depending on the device subsystem
match subsystem.as_str() {
"input" => {
log::debug!("Event device added");
if device.devnode().is_empty() {
log::warn!(
"Event device discarded for missing devnode: {} at {}",
device.name(),
device.sysname()
);
return Ok(());
}

log::debug!(
"Event device added: {} ({})",
device.name(),
device.sysname()
);

// Create a DBus interface for the event device
let conn = self.dbus.clone();
Expand Down Expand Up @@ -1373,7 +1389,21 @@ impl Manager {
log::debug!("Finished adding {id}");
}
"hidraw" => {
log::debug!("hidraw device added");
if device.devnode().is_empty() {
log::warn!(
"Hidraw device discarded for missing devnode: {} at {}",
device.name(),
device.sysname()
);
return Ok(());
}

log::debug!(
"Hidraw device added: {} ({})",
device.name(),
device.sysname()
);

// Create a DBus interface for the event device
let conn = self.dbus.clone();
let path = hidraw::get_dbus_path(sys_name.clone());
Expand Down Expand Up @@ -1466,7 +1496,16 @@ impl Manager {
}

"iio" => {
log::debug!("iio device added");
if device.devnode().is_empty() {
log::warn!(
"IIO device discarded for missing devnode: {} at {}",
device.name(),
device.sysname()
);
return Ok(());
}

log::debug!("IIO device added: {} ({})", device.name(), device.sysname());

// Create a DBus interface for the event device
let conn = self.dbus.clone();
Expand Down