OpenLogi
Features

0x0007 · deviceFriendlyName

Read or write the user-assigned friendly name of a device, and reset it to the factory default.

The user-assigned name for a device — the custom label you can give a mouse or keyboard, distinct from the fixed marketing name in 0x0005 deviceTypeAndName. getFriendlyNameLength reports the current, maximum, and default name lengths; getFriendlyName / getDefaultFriendlyName read the name in 15-byte chunks (or the whole-name convenience wrappers); setFriendlyName writes it and resetFriendlyName restores the factory default.

OpenLogi reads the friendly name during device discovery and surfaces it when it differs from the default.

Spec: Logitech HID++ 2.0 — x0007 deviceFriendlyName. Used by: device identification.

Function reference

The DeviceFriendlyNameFeature wrapper (0x0007) exposes:

Methods

FunctionHID++ fnSignatureReturns
get_friendly_name_length0()DeviceFriendlyNameLength
get_friendly_name1(index: u8)[u8; 15]
get_whole_friendly_name()String
get_default_friendly_name2(index: u8)[u8; 15]
get_whole_default_friendly_name()String
set_friendly_name3(index: u8, chunk: [u8; 15])u8
set_whole_device_name(name: String)u8
reset_friendly_name4()u8

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

The three rows marked are convenience wrappers that compose multiple HID++ calls internally; they have no single function index.

Types

DeviceFriendlyNameLength

Represents the length data returned by get_friendly_name_length.

FieldTypeDescription
name_lengthu8The current length of the friendly device name.
name_max_lengthu8The maximum length of the friendly device name.
default_name_lengthu8The length of the default friendly device name.

Wire format

Short getters carry a 3-byte request payload and return a 16-byte long payload; set_friendly_name uses a 16-byte long request. Byte offsets below are into the feature-level payload (after the HID++ header, feature index, and function/software ID byte).

get_friendly_name_length (fn 0)

Request: [0x00, 0x00, 0x00] (no parameters)

Response (byte → field):

ByteFieldNotes
0name_lengthCurrent UTF-8 byte length of the friendly name
1name_max_lengthMaximum writable length the device accepts
2default_name_lengthByte length of the factory-default name

get_friendly_name (fn 1)

Request: [index, 0x00, 0x00]index is the byte offset into the name to start reading from.

Response (byte → field):

ByteFieldNotes
0(echoed index)Skipped by the wrapper
1–15name chunkUp to 15 UTF-8 bytes; unused trailing bytes are 0x00

get_default_friendly_name (fn 2)

Request: [index, 0x00, 0x00] — same offset semantics as fn 1.

Response (byte → field):

ByteFieldNotes
0(echoed index)Skipped by the wrapper
1–15default name chunkUp to 15 UTF-8 bytes; unused trailing bytes are 0x00

set_friendly_name (fn 3)

Uses a long request (16-byte payload):

Request: [index, chunk[0], chunk[1], …, chunk[14]]

ByteFieldNotes
0indexByte offset at which to begin writing
1–15chunkExactly 15 bytes; pad with 0x00 for the final partial chunk

Response (byte → field):

ByteFieldNotes
0new total name lengthByte count of the name as stored after this write

reset_friendly_name (fn 4)

Request: [0x00, 0x00, 0x00] (no parameters)

Response (byte → field):

ByteFieldNotes
0name length after resetEquals default_name_length from fn 0

Usage (Rust)

use hidpp::{device::Device, feature::device_friendly_name::DeviceFriendlyNameFeature};

// mut device: Device, already created via Device::new(channel, index)
device.enumerate_features().await?;

if let Some(feat) = device.get_feature::<DeviceFriendlyNameFeature>() {
    // Read current name lengths
    let lengths = feat.get_friendly_name_length().await?;
    println!("name length: {}, max: {}", lengths.name_length, lengths.name_max_length);

    // Read the full current friendly name in one call
    let name = feat.get_whole_friendly_name().await?;
    println!("friendly name: {name}");

    // Read the factory-default name
    let default_name = feat.get_whole_default_friendly_name().await?;
    println!("default name: {default_name}");

    // Write a new friendly name (truncated automatically to name_max_length)
    let new_len = feat.set_whole_device_name("My MX Master".to_string()).await?;
    println!("name set, new length: {new_len}");

    // Reset back to the factory default
    let reset_len = feat.reset_friendly_name().await?;
    println!("reset, length now: {reset_len}");
}

On this page