OpenLogi

0x4531 · multiPlatform

Associate each host slot with an OS platform on a multi-host device — query feature capabilities and platform descriptors, and read the platform assigned to any host slot.

The MultiPlatform feature lets a multi-host device associate each of its host slots with a specific OS platform, allowing the firmware to apply per-host key-mapping and behaviour adjustments automatically. getFeatureInfos reports feature capabilities, the number of available platforms and descriptor rows, the host count, and the currently active host slot. getPlatformDescriptor fetches a single descriptor row, which encodes the covered operating systems (OsMask) and the OS-version range the row applies to. getHostPlatform reads the platform currently assigned to a given host slot along with how that selection was made (PlatformSource).

  • MultiPlatformCapabilitiesOS_DETECTION (device can auto-detect the host OS), SET_HOST_PLATFORM (host software may override the selection).
  • OsMask — bitfield covering Windows, WindowsEmbedded, Linux, ChromeOS, Android, macOS, iOS, webOS, and Tizen.
  • PlatformSourceDefault, Auto (device-detected), Manual (set on-device), or Software (set by host software).

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

Function reference

The MultiPlatformFeature wrapper (0x4531) exposes:

Methods

FunctionHID++ fnSignatureReturns
get_feature_infos0()MultiPlatformInfo
get_platform_descriptor1(descriptor_index: u8)PlatformDescriptor
get_host_platform2(host: HostIndex)HostPlatform

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

Types

MultiPlatformInfo

Static feature information returned by get_feature_infos.

FieldTypeDescription
capabilitiesMultiPlatformCapabilitiesFeature capabilities.
platform_countu8Number of platform IDs.
descriptor_countu8Number of platform descriptor rows.
host_countu8Number of host slots.
current_hostHostIndexCurrent host slot.
current_host_platformOption<u8>Platform index selected for the current host.

MultiPlatformCapabilities

Capabilities reported by MultiPlatform.

FlagBit/ValueDescription
OS_DETECTION1 << 0The device can detect the host OS automatically.
SET_HOST_PLATFORM1 << 1Software can set the host platform.

PlatformDescriptor

A platform descriptor row returned by get_platform_descriptor.

FieldTypeDescription
platform_indexu8Platform index this descriptor belongs to.
descriptor_indexu8Descriptor row index.
os_maskOsMaskCovered operating systems.
from_versionu8First supported OS major version.
from_revisionu8First supported OS revision.
to_versionu8Last supported OS major version.
to_revisionu8Last supported OS revision.

OsMask

Operating systems covered by a platform descriptor.

FlagBit/ValueDescription
WINDOWS1 << 0Microsoft Windows.
WINDOWS_EMBEDDED1 << 1Windows Embedded.
LINUX1 << 2Linux.
CHROME1 << 3ChromeOS.
ANDROID1 << 4Android.
MACOS1 << 5macOS.
IOS1 << 6iOS.
WEBOS1 << 7webOS.
TIZEN1 << 8Tizen.

HostPlatform

Platform selection for a host slot returned by get_host_platform.

FieldTypeDescription
host_indexHostIndexHost slot index returned by the device.
statusu8Raw host status byte.
platform_indexOption<u8>Selected platform, or None when undefined.
sourcePlatformSourceSource of the platform selection.
auto_platform_indexOption<u8>Automatically detected platform, if available.
auto_descriptor_indexOption<u8>Automatically matched platform descriptor, if available.

PlatformSource

Source of a host-platform selection.

VariantValueDescription
Default0Device default.
Auto1Automatically detected by the device.
Manual2Manually selected on the device.
Software3Set by host software.

HostIndex

A host slot selector (defined in hosts_info).

VariantValueDescription
Current0xffThe host slot currently selected by the device.
Slot(u8)00xfeA zero-based host slot index.

Wire format

All three functions use a short 3-byte request payload; responses are read from the 16-byte long payload returned by extend_payload().

get_feature_infos (fn 0)

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

Response (byte → field):

ByteFieldNotes
0–1capabilitiesMultiPlatformCapabilities as big-endian u16
2platform_countNumber of platform IDs
3descriptor_countNumber of descriptor rows
4host_countNumber of host slots
5current_hostHostIndex::from(byte)0xffCurrent
6current_host_platform0xffNone; otherwise Some(byte)

get_platform_descriptor (fn 1)

Request: [descriptor_index, 0x00, 0x00]

Response (byte → field):

ByteFieldNotes
0platform_indexPlatform index the descriptor belongs to
1descriptor_indexDescriptor row index (echoed back)
2–3os_maskOsMask as big-endian u16
4from_versionFirst supported OS major version
5from_revisionFirst supported OS revision
6to_versionLast supported OS major version
7to_revisionLast supported OS revision

get_host_platform (fn 2)

Request: [u8::from(host), 0x00, 0x00]HostIndex::Current encodes as 0xff; HostIndex::Slot(n) encodes as n.

Response (byte → field):

ByteFieldNotes
0host_indexHostIndex::from(byte)
1statusRaw host status byte
2platform_index0xffNone; otherwise Some(byte)
3sourcePlatformSource — 0 = Default, 1 = Auto, 2 = Manual, 3 = Software
4auto_platform_index0xffNone; otherwise Some(byte)
5auto_descriptor_index0xffNone; otherwise Some(byte)

Usage (Rust)

use hidpp::{
    device::Device,
    feature::multi_platform::{MultiPlatformFeature, OsMask},
    feature::hosts_info::HostIndex,
};

// mut device: Device, already created via Device::new(channel, index).await?
device.enumerate_features().await?;
if let Some(feat) = device.get_feature::<MultiPlatformFeature>() {
    let info = feat.get_feature_infos().await?;
    println!("hosts={}, platforms={}", info.host_count, info.platform_count);

    // Read the descriptor at index 0
    let desc = feat.get_platform_descriptor(0).await?;
    println!("os_mask={:?}, versions={}.{}–{}.{}", desc.os_mask,
        desc.from_version, desc.from_revision, desc.to_version, desc.to_revision);

    // Read the platform for the current host
    let hp = feat.get_host_platform(HostIndex::Current).await?;
    println!("platform={:?}, source={:?}", hp.platform_index, hp.source);
}

On this page