Skip to main content

openlogi_device/
lib.rs

1//! OpenLogi's HID++ device layer: everything that knows Logitech's protocol
2//! and nothing about a host.
3//!
4//! [`backend::HidBackend`] is the seam. Above it sits this crate — enumeration
5//! and probing, the write layer, capture sessions, pairing. Below it sits one
6//! implementation per host HID API: `openlogi-hid` over `async-hid`, a
7//! scripted device tree in tests, WebHID under wasm if that is ever built.
8//!
9//! Nothing here opens a device by itself; everything that needs one is handed
10//! a backend. That is what makes the layer reusable, and it is checked rather
11//! than trusted — CI's `wasm (portable crates)` job builds this crate for a
12//! target with no OS underneath it, so a dependency that assumes one fails
13//! there and nowhere else.
14
15#![deny(missing_docs)]
16#![deny(rustdoc::bare_urls)]
17#![deny(rustdoc::broken_intra_doc_links)]
18
19mod channel;
20
21pub mod backend;
22pub mod backlight;
23pub mod inventory;
24pub mod pairing;
25pub mod reprog_controls;
26pub mod session;
27pub mod thumbwheel;
28pub mod write;
29
30pub use backend::{
31    BackendError, HidBackend, HotplugEvent, HotplugStream, NodeId, NodeInfo, RawWriter,
32};
33pub use backlight::{BacklightMode, BacklightState, BacklightStatus};
34pub use channel::route::{
35    BOLT_PIDS, DIRECT_DEVICE_INDEX, DeviceRoute, LIGHTSPEED_PIDS, LOGITECH_VENDOR_ID,
36    UNIFYING_PIDS, receiver_display_name, speaks_unifying_protocol,
37};
38pub use channel::{ChannelPool, ChannelRegistry, SharedChannel};
39pub use inventory::hotplug::watch_hotplug;
40pub use inventory::standalone::enumerate_standalone;
41pub use inventory::{Enumerator, InventoryError, enumerate};
42pub use openlogi_core::hid::smartshift;
43pub use openlogi_core::hid::smartshift::{
44    SmartShiftAutoDisengage, SmartShiftMode, SmartShiftStatus, SmartShiftThreshold, TunableTorque,
45};
46pub use pairing::{
47    Click, DiscoveredDevice, PairingCommand, PairingError, PairingEvent, PairingReceiver,
48    PasskeyMethod, ReceiverFamily, ReceiverSelector, list_pairing_receivers, run_pairing, unpair,
49};
50pub use session::gesture::{
51    CaptureChannel, CaptureStop, CapturedInput, GestureError, run_capture_session,
52    run_capture_session_with_stop_reason,
53};
54pub use session::host_switch::{
55    HostSwitchError, HostSwitchStopReason, run_host_switch_session, switch_linked_hosts,
56};
57pub use session::keyboard::{
58    KEYBOARD_KEY_CIDS, run_keyboard_capture_session, run_keyboard_capture_session_with_registry,
59};
60pub use write::{
61    Dpi, DpiCapabilities, DpiInfo, FeatureEntry, FirmwareEntity, FirmwareEntityInfo,
62    HapticWaveform, HidppFeatureErrorKind, HidppOperation, LITRA_BEAM_PRODUCT_ID,
63    LITRA_GLOW_PRODUCT_ID, LightCommand, LightingMethod, LitraModel, ReprogControlEntry,
64    ScrollReportingTarget, ScrollResolution, ScrollWheelMode, WriteError, apply_litra,
65    clear_haptic_feature_cache, commands_for_light_settings, dump_features, dump_firmware_entities,
66    dump_reprog_controls, encode_litra_command, ensure_haptics_armed_on, get_backlight, get_dpi,
67    get_dpi_info, get_dpi_info_on, get_scroll_wheel_mode, get_scroll_wheel_mode_on,
68    get_smartshift_status, get_smartshift_status_on, matches_litra, play_haptic, play_haptic_on,
69    read_battery_raw, set_backlight_enabled, set_dpi, set_dpi_on, set_fn_lock, set_fn_lock_on,
70    set_keyboard_color, set_keyboard_color_on, set_keyboard_color_with, set_keyboard_color_with_on,
71    set_scroll_inversion, set_scroll_inversion_on, set_scroll_resolution, set_scroll_resolution_on,
72    set_scroll_wheel_mode, set_scroll_wheel_mode_on, set_smartshift, set_smartshift_on,
73    set_smartshift_sensitivity, toggle_smartshift, toggle_smartshift_on,
74};