> ## 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。

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    glove.ip().set("192.168.1.200")  # 发送到设备并自动持久化到 Flash
    ```
  </Tab>

  <Tab title="C">
    ```c theme={null}
    wuji_glove_set_ip(dev, "192.168.1.100");  // 自动持久化到设备 Flash
    ```
  </Tab>
</Tabs>

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

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

## 重启

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    glove.reboot()  # 重启设备
    ```
  </Tab>

  <Tab title="C">
    ```c theme={null}
    wuji_glove_reboot(dev);  // 重启后需要重新连接
    ```
  </Tab>
</Tabs>

## 标定

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

## 设备日志

读取固件运行日志：

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

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

## 可用参数

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

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

## 设备参数读写

身份与网络参数：

<Tabs>
  <Tab title="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>

  <Tab title="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>
</Tabs>

## 设备控制

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    glove.reboot()
    ```
  </Tab>

  <Tab title="C">
    ```c theme={null}
    wuji_glove_reboot(dev);
    ```
  </Tab>
</Tabs>


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