Repository navigation
Conversation
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What it does
Adds full management of multiple hardware on-board profile slots (1–5) on supported Razer mice without requiring Razer Synapse:
crates/secbird-core/src/commands.rs,onboard.rs): Implements class05:*commands extracted from Synapse 4'sobmEngine/rzDevice25:05:80— Get Number of Profiles05:81— Get Profiles ID List ([total, id1, id2, ...])05:02— Create New Profile ([slot])05:03— Delete Profile ([slot], refuses to delete the last remaining slot; switches active slot first if deleting the active one)05:04/05:84— Set / Get Active Profile ID ([slot])05:08/05:88— Set / Get Profile Name With Offset (250-byte chunked header: 16-byte GUID, 100-byte UTF-8 name, 128-byte owner, 6-byte hash; 64-byte chunks)05:0B— Reset Profile ([slot])05:0C/05:8C— Set / Get Profile Color ([slot, r, g, b])profile.rs,actions.rs): TracksOnboardSaveper slot (onboard_slots: BTreeMap<u8, OnboardSave>, keeping backward compatibility with the legacyonboardfield) so saving a profile to Slot 2 does not undo Slot 1. Auto-creates a slot if saving to one that does not exist yet.crates/secbird/src/main.rs): Addssecbird slot [list|new <1-5> [name]|use <1-5>|delete <1-5>],--slot Nonbutton save-to-mouseandbutton put-back, and on-board slot count insecbird info.server.rs,editor.html): Adds/api/onboard-slotand optionalslotparameter on/api/save-to-mouse&/api/put-back, and upgrades "Saved on the mouse" (Profile and Buttons sections) with Switch, Save here, Put back, Delete, and "+ Add slot N" controls (with graceful fallback to the single-slot UI on devices that don't report05:81).sim.rs,onboard.rs): Simulates class05:*commands and adds unit tests for header encoding, slot lifecycle, and independent multi-slot button saves.What I tested, on which device
00E8, firmware v1.0, Windows, no Synapse installed):secbird -v slot listreads05:81(05 01 00 00 00 00-> Slot 1) and05:84(01) cleanly, handlingFailedon05:88/05:8Cgracefully.cargo test: 147 (secbird-core) + 8 (secbird-tray) + 1 doc-test — all pass.cargo clippy --all-targets -- -D warnings: pass, zero warnings.node --test crates/secbird-tray/tests/*.test.cjs: 7/7 pass.What I couldn't test
00E7).05:0C/05:8C(the Naga V3 Pro uses fixed indicator colors per slot and returnsFailedon05:8C, which is handled gracefully).Risks / impact on other devices
05:81fall back to the existing single-slot "Saved on the mouse" UI unchanged. Existingprofiles.jsonfiles with the singleonboardfield remain fully compatible.05:02,05:03,05:04,05:08,02:0C) only happen on explicit user action, never automatically on profile switch.Checklist
cargo testandcargo clippy --all-targets -- -D warningspassnode --test crates/secbird-tray/tests/*.test.cjspassesobmEngine/rzDevice25[Unreleased]