0x8040 · brightnessControl
Display or backlight brightness range, value, and independent illumination control for feature version 1.
Controls display or backlight brightness on devices that advertise BrightnessControl. It reports a brightness range and capability bits. It can also read or set illumination separately when the device advertises that capability.
Spec: Logitech HID++ 2.0 — brightnessControl. Used by: Typed wrapper in
openlogi-hidpp; no v0.8.15 device-layer path.
Function reference
BrightnessControlFeature (0x8040, version 1) exposes the following methods.
Methods
| Function | HID++ fn | Signature | Returns |
|---|---|---|---|
get_info | 0 | () | BrightnessInfo |
get_brightness | 1 | () | u16 |
set_brightness | 2 | (brightness: u16) | () |
get_illumination | 3 | () | bool |
set_illumination | 4 | (enabled: bool) | () |
All methods are async and return Result<…, Hidpp20Error>.
Types
BrightnessInfo
| Field | Type | Description |
|---|---|---|
min_brightness | u16 | Lowest accepted brightness. |
max_brightness | u16 | Highest accepted brightness. |
steps | u16 | Number of advertised brightness steps. |
capabilities | BrightnessCapabilities | Feature capability bits. |
BrightnessCapabilities
Unknown bits are retained when OpenLogi decodes the capability byte.
| Flag | Bit | Description |
|---|---|---|
HARDWARE_BRIGHTNESS | 0 | Hardware can change brightness directly. |
EVENTS | 1 | The device can emit brightness or illumination changes. |
ILLUMINATION | 2 | Illumination can be queried and controlled separately. |
HARDWARE_ON_OFF | 3 | Hardware can toggle illumination directly. |
TRANSIENT | 4 | Brightness does not persist across a power cycle. |
Events
BrightnessControlFeature exposes no event type or listener. The EVENTS capability therefore has no OpenLogi event consumer.
Wire format
Requests have a three-byte short payload. All multi-byte fields are BE. OpenLogi expands short responses to its 16-byte payload before decoding.
get_info (fn 0)
Request: [0x00, 0x00, 0x00]
| Bytes | Field | Notes |
|---|---|---|
| 0–1 | max_brightness | BE u16. |
| 2 | steps low byte | Combined with byte 6. |
| 3 | capabilities | BrightnessCapabilities bitfield. |
| 4–5 | min_brightness | BE u16. |
| 6 | steps high byte | steps is BE from bytes 6 then 2. |
get_brightness (fn 1)
Request: [0x00, 0x00, 0x00]
| Bytes | Field | Notes |
|---|---|---|
| 0–1 | brightness | BE u16. |
set_brightness (fn 2)
Request: [brightness_hi, brightness_lo, 0x00], where brightness is a BE u16.
The response is an acknowledgement. OpenLogi does not inspect a response payload.
get_illumination (fn 3)
Request: [0x00, 0x00, 0x00]
| Byte | Field | Notes |
|---|---|---|
| 0 | illumination state | Bit 0 set means true. |
set_illumination (fn 4)
Request: [enabled, 0x00, 0x00], where enabled is 0x00 or 0x01.
The response is an acknowledgement. OpenLogi does not inspect a response payload.
How OpenLogi uses it
OpenLogi registers BrightnessControlFeature in the HID++ feature registry. In v0.8.15, no openlogi-device, agent, CLI, inventory, or user-facing path opens this feature.
OpenLogi therefore does not read its range, apply a capability gate, read back a write, restore its state, or subscribe to its advertised events. A direct caller should read get_info() and require ILLUMINATION before calling fn 3 or fn 4.
Usage (Rust)
use hidpp::{
device::Device,
feature::brightness_control::{BrightnessCapabilities, BrightnessControlFeature},
};
// `device` is already created for a HID++ channel and device index.
device.enumerate_features().await?;
if let Some(feature) = device.get_feature::<BrightnessControlFeature>() {
let info = feature.get_info().await?;
let current = feature.get_brightness().await?;
println!("brightness: {current} of {}", info.max_brightness);
if info.capabilities.contains(BrightnessCapabilities::ILLUMINATION) {
feature.set_illumination(true).await?;
}
}