> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wuji.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# 设备参数与操作

## 参数持久化

设备参数变更（IP 地址、端口）在调用 `.set()` 后自动持久化到设备 Flash，无需额外保存操作——固件检测到变更后会在后台写入 Flash。

> [tab] Python
>
> ```python theme={null}
> glove.ip().set("192.168.1.200")  # 发送到设备并自动持久化到 Flash
> ```

> [tab] C
>
> ```c theme={null}
> wuji_glove_set_ip(dev, "192.168.1.100");  // 自动持久化到设备 Flash
> ```

IP 在同网段内必须唯一，避开其他设备与电脑网卡。

> [!NOTE]
>
> `save_params()` 持久化的是 SDK 本地参数（保存到 `~/.wuji/sdk/params/`），与设备 Flash 持久化是两套独立机制。

## 重启

> [tab] Python
>
> ```python theme={null}
> glove.reboot()  # 重启设备
> ```

> [tab] C
>
> ```c theme={null}
> wuji_glove_reboot(dev);  // 重启后需要重新连接
> ```

## 标定

首次使用、更换穿戴者或需要切换手型时运行手部模型标定，详见 [标定](https://docs.wuji.tech/docs/zh/wuji-glove/latest/sdk-data-reference/calibration.md)。

## 设备日志

读取固件运行日志：

```python theme={null}
# 获取日志存储目录（默认 ~/.wuji/logs/）
log_dir = glove.get_device_log_dir()
print(f"日志目录: {log_dir}")
```

当前 C SDK 没有对应的设备日志目录访问接口。此能力仅提供 Python API。

## 硬件版本

读取手套硬件版本，用于核对硬件适配和记录报障信息。该信息只读，重复查询不会修改设备状态。

### 查询前准备

* 使用最新 Wuji SDK，并确保固件提供硬件版本资源。
* 完成 [设备连接](https://docs.wuji.tech/docs/zh/wuji-sdk/latest/device-connection.md)，获取 Python 手套对象 `glove` 或 C 设备句柄 `dev`。

### 查询硬件版本

> [tab] Python
>
> ```python theme={null}
> glove.hw_version().get()  # 查询硬件版本
> ```

> [tab] C
>
> ```c theme={null}
> wuji_glove_get_hw_version(dev, &version);  // 查询硬件版本
> ```

## 可用参数

通过 SDK 读取和修改设备参数。参数读写 API 见 SDK [设备参数与标定](https://docs.wuji.tech/docs/zh/wuji-sdk/latest/device-params.md)。

| 参数 | API | 读 | 写 | 说明 |
| - | - | - | - | - |
| 序列号 | `glove.sn()` | ✓ | x | 16 字节设备序列号 |
| 固件版本 | `glove.version()` | ✓ | x | 当前固件版本号 |
| 硬件版本 | `glove.hw_version().get()` | ✓ | x | `HwVersion`，全零表示硬件版本未知 |
| IP 地址 | `glove.ip()` | ✓ | ✓ | 设备网络 IP |
| 数据端口 | `glove.port()` | ✓ | ✓ | 数据传输端口 |
| 手别 | `glove.hand_side()` | ✓ | x | 左手或右手 |
| 设备名称 | `glove.device_name` | ✓ | x | 连接时指定的名称 |

## 设备参数读写

身份与网络参数：

> [tab] Python
>
> ```python theme={null}
> print(glove.sn())
> print(glove.version())
> print(glove.ip())
> print(glove.port())
> print(glove.hand_side())
> glove.ip().set("192.168.1.100")
> glove.port().set(50001)
> ```

> [tab] C
>
> ```c theme={null}
> // 字符串 getter 使用两步查询
> size_t needed = 0;
> wuji_glove_get_sn(dev, NULL, 0, &needed);
> char *sn = malloc(needed);
> wuji_glove_get_sn(dev, sn, needed, NULL);
>
> wuji_glove_get_version(dev, NULL, 0, &needed);
> char *fw = malloc(needed);
> wuji_glove_get_version(dev, fw, needed, NULL);
>
> wuji_glove_get_ip(dev, NULL, 0, &needed);
> char *ip = malloc(needed);
> wuji_glove_get_ip(dev, ip, needed, NULL);
>
> wuji_glove_get_hand_side(dev, NULL, 0, &needed);
> char *side = malloc(needed);
> wuji_glove_get_hand_side(dev, side, needed, NULL);
>
> uint16_t port = 0;
> wuji_glove_get_port(dev, &port);
> wuji_glove_set_ip(dev, "192.168.1.100");
> wuji_glove_set_port(dev, 50001);
> free(sn); free(fw); free(ip); free(side);
> ```

## 设备控制

> [tab] Python
>
> ```python theme={null}
> glove.reboot()
> ```

> [tab] C
>
> ```c theme={null}
> wuji_glove_reboot(dev);
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.