Files
kuaishai2/docs/下位机交互数据模型.md
Developer d53c41c300 feat(device): 添加USB设备通信支持和程序参数优化
- 在AndroidManifest.xml中添加USB Host权限和设备过滤器配置
- 新增设备控制国际化词条包括速度档位、吹气时间等
- 重构数据库结构将速度相关字段统一为档位数值存储
- 添加通用KV存储方法用于settings表数据读写
- 优化首页导航实现tab间跳转和状态保持功能
- 更新程序详情页面布局和参数表单界面
- 移除模拟运行器相关测试代码
- 添加USB串口通信依赖包usb_serial
2026-06-04 15:13:36 +08:00

179 lines
3.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 默认模块
language_tabs:
- shell: Shell
- http: HTTP
- javascript: JavaScript
- ruby: Ruby
- python: Python
- php: PHP
- java: Java
- go: Go
toc_footers: []
includes: []
search: true
code_clipboard: true
highlight_theme: darkula
headingLevel: 2
generator: "@tarslib/widdershins v4.0.30"
---
# 默认模块
Base URLs:
# Authentication
# 数据模型
<h2 id="tocS_设备基本信息">设备基本信息</h2>
<a id="schema设备基本信息"></a>
<a id="schema_设备基本信息"></a>
<a id="tocS设备基本信息"></a>
<a id="tocs设备基本信息"></a>
```json
{
"message_id": "string",
"type": "string",
"ack": "string",
"need_ack": true,
"data": {
"door_status": "string",
"task_status": "string",
"light_status": "string"
}
}
```
### 属性
|名称|类型|必选|约束|中文名|说明|
|---|---|---|---|---|---|
|message_id|string|true|none||none|
|type|string|true|none|类型|device_info|
|ack|string|true|none||none|
|need_ack|boolean|true|none||none|
|data|object|true|none||none|
|» door_status|string|true|none|门状态|open=开close=关|
|» task_status|string|true|none|任务运行状态|running=运行中pause=暂停idle=空闲|
|» light_status|string|true|none|灯状态|on=开off= 关|
<h2 id="tocS_下发任务">下发任务</h2>
<a id="schema下发任务"></a>
<a id="schema_下发任务"></a>
<a id="tocS下发任务"></a>
<a id="tocs下发任务"></a>
```json
{
"message_id": "string",
"type": "string",
"ack": "string",
"need_ack": true,
"data": {
"steps": [
{
"no": 0,
"slot": 0,
"name": "string",
"mixtime": 0,
"pulltime": 0,
"volume": 0,
"speed": 0
}
],
"temperature": 0,
"airflowtime": 0
}
}
```
### 属性
|名称|类型|必选|约束|中文名|说明|
|---|---|---|---|---|---|
|message_id|string|true|none||由uuid生成唯一识别码|
|type|string|true|none|指令类型|create_task|
|ack|string|true|none||需要响应的消息id|
|need_ack|boolean|true|none|是否需要响应|true|
|data|object|true|none||none|
|» steps|[object]|true|none|步骤列表|none|
|»» no|integer|true|none|步骤号|none|
|»» slot|integer|true|none|槽位号|none|
|»» name|string|true|none|步骤名称|none|
|»» mixtime|integer|true|none|搅拌时间|单位:秒|
|»» pulltime|integer|true|none|吸磁时间|单位:秒|
|»» volume|integer|true|none|容积|范围 0-2000|
|»» speed|integer|true|none|速度等级|范围1-10|
|» temperature|integer|true|none|加热温度|none|
|» airflowtime|integer|true|none|吹气时间|单位:秒|
<h2 id="tocS_灯光控制">灯光控制</h2>
<a id="schema灯光控制"></a>
<a id="schema_灯光控制"></a>
<a id="tocS灯光控制"></a>
<a id="tocs灯光控制"></a>
```json
{
"message_id": "string",
"type": "string",
"ack": " ",
"need_ack": true,
"data": {
"status": "string"
}
}
```
### 属性
|名称|类型|必选|约束|中文名|说明|
|---|---|---|---|---|---|
|message_id|string|true|none||none|
|type|string|true|none|类型|none|
|ack|string|true|none||none|
|need_ack|boolean|true|none||none|
|data|object|true|none||none|
|» status|string|true|none|开光|on / off|
<h2 id="tocS_任务控制">任务控制</h2>
<a id="schema任务控制"></a>
<a id="schema_任务控制"></a>
<a id="tocS任务控制"></a>
<a id="tocs任务控制"></a>
```json
{
"message_id": "string",
"type": "string",
"ack": "string",
"need_ack": true,
"data": {
"status": "string"
}
}
```
### 属性
|名称|类型|必选|约束|中文名|说明|
|---|---|---|---|---|---|
|message_id|string|true|none||none|
|type|string|true|none|类型|control|
|ack|string¦null|true|none||none|
|need_ack|boolean|true|none||none|
|data|object|true|none||none|
|» status|string|true|none|状态|continue=继续stop=停止,暂停=pause|