跳转至

调试接口 API

所有端点以 /api/v1/devices/{device_id} 为前缀。


GET /api/v1/devices/{device_id}/debug/ports

获取设备可用的串口列表。

响应

{
  "success": true,
  "status": 200,
  "data": {
    "ports": [
      {
        "name": "ttyAMA0",
        "description": "Primary UART"
      }
    ]
  }
}

GET /api/v1/devices/{device_id}/debug/status

获取设备调试系统的状态。

响应

{
  "success": true,
  "status": 200,
  "data": { "调试状态" }
}

GET /api/v1/devices/{device_id}/debug/serial-log

获取设备的串口通信日志。

响应

{
  "success": true,
  "status": 200,
  "data": { "串口日志" }
}

POST /api/v1/devices/{device_id}/debug/send

向下位机发送调试命令。

请求

{
  "command": "M114",
  "params": ""
}

响应

{
  "success": true,
  "status": 200,
  "data": { "命令响应" }
}