0x4531 · multiPlatform
为多主机设备的每个主机槽关联操作系统平台——查询功能能力与平台描述符,并读取任意主机槽当前分配的平台及其选择来源。
MultiPlatform 功能让多主机设备能将每个主机槽与特定的操作系统平台关联,使固件能够自动应用针对不同主机的按键映射与行为调整。getFeatureInfos 报告功能特性、可用平台数量、描述符行数、主机槽总数以及当前活跃的主机槽。getPlatformDescriptor 获取单条描述符行,该行编码了所覆盖的操作系统(OsMask)以及适用的 OS 版本范围。getHostPlatform 读取指定主机槽当前分配的平台及其选择来源(PlatformSource)。
MultiPlatformCapabilities——OS_DETECTION(设备可自动检测主机操作系统),SET_HOST_PLATFORM(主机软件可覆盖该选择)。OsMask—— 位域,涵盖 Windows、WindowsEmbedded、Linux、ChromeOS、Android、macOS、iOS、webOS 和 Tizen。PlatformSource——Default(设备默认)、Auto(设备自动检测)、Manual(在设备上手动设置)或Software(由主机软件设置)。
规格: Logitech HID++ 2.0 —— multiPlatform。用于:
openlogi-hidpp中的类型化封装。
Function reference
The MultiPlatformFeature wrapper (0x4531) exposes:
Methods
| Function | HID++ fn | Signature | Returns |
|---|---|---|---|
get_feature_infos | 0 | () | MultiPlatformInfo |
get_platform_descriptor | 1 | (descriptor_index: u8) | PlatformDescriptor |
get_host_platform | 2 | (host: HostIndex) | HostPlatform |
All methods are async and return Result<…, Hidpp20Error>.
Types
MultiPlatformInfo
Static feature information returned by get_feature_infos.
| Field | Type | Description |
|---|---|---|
capabilities | MultiPlatformCapabilities | Feature capabilities. |
platform_count | u8 | Number of platform IDs. |
descriptor_count | u8 | Number of platform descriptor rows. |
host_count | u8 | Number of host slots. |
current_host | HostIndex | Current host slot. |
current_host_platform | Option<u8> | Platform index selected for the current host. |
MultiPlatformCapabilities
Capabilities reported by MultiPlatform.
| Flag | Bit/Value | Description |
|---|---|---|
OS_DETECTION | 1 << 0 | The device can detect the host OS automatically. |
SET_HOST_PLATFORM | 1 << 1 | Software can set the host platform. |
PlatformDescriptor
A platform descriptor row returned by get_platform_descriptor.
| Field | Type | Description |
|---|---|---|
platform_index | u8 | Platform index this descriptor belongs to. |
descriptor_index | u8 | Descriptor row index. |
os_mask | OsMask | Covered operating systems. |
from_version | u8 | First supported OS major version. |
from_revision | u8 | First supported OS revision. |
to_version | u8 | Last supported OS major version. |
to_revision | u8 | Last supported OS revision. |
OsMask
Operating systems covered by a platform descriptor.
| Flag | Bit/Value | Description |
|---|---|---|
WINDOWS | 1 << 0 | Microsoft Windows. |
WINDOWS_EMBEDDED | 1 << 1 | Windows Embedded. |
LINUX | 1 << 2 | Linux. |
CHROME | 1 << 3 | ChromeOS. |
ANDROID | 1 << 4 | Android. |
MACOS | 1 << 5 | macOS. |
IOS | 1 << 6 | iOS. |
WEBOS | 1 << 7 | webOS. |
TIZEN | 1 << 8 | Tizen. |
HostPlatform
Platform selection for a host slot returned by get_host_platform.
| Field | Type | Description |
|---|---|---|
host_index | HostIndex | Host slot index returned by the device. |
status | u8 | Raw host status byte. |
platform_index | Option<u8> | Selected platform, or None when undefined. |
source | PlatformSource | Source of the platform selection. |
auto_platform_index | Option<u8> | Automatically detected platform, if available. |
auto_descriptor_index | Option<u8> | Automatically matched platform descriptor, if available. |
PlatformSource
Source of a host-platform selection.
| Variant | Value | Description |
|---|---|---|
Default | 0 | Device default. |
Auto | 1 | Automatically detected by the device. |
Manual | 2 | Manually selected on the device. |
Software | 3 | Set by host software. |
HostIndex
A host slot selector (defined in hosts_info).
| Variant | Value | Description |
|---|---|---|
Current | 0xff | The host slot currently selected by the device. |
Slot(u8) | 0–0xfe | A 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):
| Byte | Field | Notes |
|---|---|---|
| 0–1 | capabilities | MultiPlatformCapabilities as big-endian u16 |
| 2 | platform_count | Number of platform IDs |
| 3 | descriptor_count | Number of descriptor rows |
| 4 | host_count | Number of host slots |
| 5 | current_host | HostIndex::from(byte) — 0xff → Current |
| 6 | current_host_platform | 0xff → None; otherwise Some(byte) |
get_platform_descriptor (fn 1)
Request: [descriptor_index, 0x00, 0x00]
Response (byte → field):
| Byte | Field | Notes |
|---|---|---|
| 0 | platform_index | Platform index the descriptor belongs to |
| 1 | descriptor_index | Descriptor row index (echoed back) |
| 2–3 | os_mask | OsMask as big-endian u16 |
| 4 | from_version | First supported OS major version |
| 5 | from_revision | First supported OS revision |
| 6 | to_version | Last supported OS major version |
| 7 | to_revision | Last 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):
| Byte | Field | Notes |
|---|---|---|
| 0 | host_index | HostIndex::from(byte) |
| 1 | status | Raw host status byte |
| 2 | platform_index | 0xff → None; otherwise Some(byte) |
| 3 | source | PlatformSource — 0 = Default, 1 = Auto, 2 = Manual, 3 = Software |
| 4 | auto_platform_index | 0xff → None; otherwise Some(byte) |
| 5 | auto_descriptor_index | 0xff → None; 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);
}