OpenLogi

0x8040 · brightnessControl

Device backlight brightness control — read the supported range and step count, get or set the brightness level, and independently toggle illumination on or off.

Controls the display or backlight brightness of a device. getInfo (function 0) returns a BrightnessInfo describing the min/max brightness, the number of discrete steps, and a BrightnessCapabilities bitmask. getBrightness / setBrightness (functions 1–2) read and write the current brightness level as a u16. When the ILLUMINATION capability is set, getIllumination / setIllumination (functions 3–4) independently query and toggle the backlight on or off without changing the stored brightness value.

  • HARDWARE_BRIGHTNESS — hardware can change brightness without a host command.
  • EVENTS — the device emits brightness or illumination change events.
  • ILLUMINATION — illumination can be queried and controlled separately from brightness.
  • HARDWARE_ON_OFF — hardware can toggle illumination on and off directly.
  • TRANSIENT — brightness is not persisted by the device across power cycles.

Spec: Logitech HID++ 2.0 — brightnessControl. Used by: Typed wrapper in openlogi-hidpp.

Function reference

The BrightnessControlFeature wrapper (0x8040) exposes:

Methods

FunctionHID++ fnSignatureReturns
get_info0()BrightnessInfo
get_brightness1()u16
set_brightness2(brightness: u16)()
get_illumination3()bool
set_illumination4(enabled: bool)()

All methods are async and return Result<…, Hidpp20Error>.

Types

BrightnessInfo

Brightness range and capability information.

FieldTypeDescription
min_brightnessu16Minimum accepted brightness.
max_brightnessu16Maximum accepted brightness.
stepsu16Number of brightness steps advertised by the device.
capabilitiesBrightnessCapabilitiesFeature capabilities.

BrightnessCapabilities

Capabilities reported by BrightnessControl.

FlagBit/ValueDescription
HARDWARE_BRIGHTNESS1 << 0Hardware can change brightness directly.
EVENTS1 << 1The device emits brightness or illumination change events.
ILLUMINATION1 << 2Illumination can be queried and controlled separately from brightness.
HARDWARE_ON_OFF1 << 3Hardware can toggle illumination on and off directly.
TRANSIENT1 << 4Brightness is transient and not persisted by the device.

Wire format

Short requests carry a 3-byte payload; getInfo / getBrightness / getIllumination responses are read from the 16-byte extended payload returned by extend_payload().

get_info (fn 0)

Request: [0x00, 0x00, 0x00]

Response (extended 16-byte payload — byte → field):

Byte(s)FieldNotes
0–1max_brightnessBig-endian u16.
2steps (low byte)Combined with byte 6 — see note below.
3capabilitiesBrightnessCapabilities bitmask (see flag table above).
4–5min_brightnessBig-endian u16.
6steps (high byte)steps = u16::from_be_bytes([payload[6], payload[2]]).

The steps field is split across two non-adjacent bytes: high byte at index 6, low byte at index 2.

get_brightness (fn 1)

Request: [0x00, 0x00, 0x00]

Response (extended 16-byte payload — byte → field):

Byte(s)FieldNotes
0–1brightnessBig-endian u16 current brightness value.

set_brightness (fn 2)

Request: [hi, lo, 0x00] where hi and lo are the big-endian bytes of the u16 brightness value.

ByteContent
0(brightness >> 8) as u8
1brightness as u8
20x00 (padding)

No response payload is used.

get_illumination (fn 3)

Request: [0x00, 0x00, 0x00]

Response (extended 16-byte payload — byte → field):

ByteFieldNotes
0illumination enabledBit 0: payload[0] & 1 != 0. true = illumination on.

set_illumination (fn 4)

Request: [enabled, 0x00, 0x00]

ByteContent
00x01 if illumination should be enabled, 0x00 to disable
1–20x00 (padding)

No response payload is used.

Usage (Rust)

use hidpp::{device::Device, feature::brightness_control::BrightnessControlFeature};

// mut device: Device, already created via Device::new(channel, index)?
device.enumerate_features().await?;
if let Some(feat) = device.get_feature::<BrightnessControlFeature>() {
    let info = feat.get_info().await?;
    println!("Brightness range: {}–{} ({} steps)", info.min_brightness, info.max_brightness, info.steps);

    let current = feat.get_brightness().await?;
    println!("Current brightness: {current}");

    // Set brightness to 75 % of the reported maximum
    let target = (info.max_brightness as u32 * 75 / 100) as u16;
    feat.set_brightness(target).await?;

    if info.capabilities.contains(hidpp::feature::brightness_control::BrightnessCapabilities::ILLUMINATION) {
        let on = feat.get_illumination().await?;
        println!("Illumination currently: {on}");
        feat.set_illumination(true).await?;
    }
}

On this page