Skip to content

Commit 86ccbb1

Browse files
authored
Merge pull request #2 from srsng/main
新增接入指南-设备绑定篇(暂无内容)
2 parents ffdd218 + d22c7ff commit 86ccbb1

File tree

26 files changed

+217
-19
lines changed

26 files changed

+217
-19
lines changed

docs/.vitepress/theme/constrants/route.ts

Lines changed: 130 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,25 @@ export enum Chapters {
2020
xrobot = "/xrobot/",
2121
// guide
2222
xrobot_guide = "/xrobot/guide/",
23+
xrobot_guide_quick_start = "/xrobot/guide/quick-start/",
24+
xrobot_guide_xiaozhi_firmware = "/xrobot/guide/xiaozhi-firmware/",
25+
xrobot_guide_xiaozhi_hardware = "/xrobot/guide/xiaozhi-hardware/",
26+
xrobot_guide_platform_mp = "/xrobot/guide/platform-mp/",
2327
// api
2428
xrobot_api = "/xrobot/api/",
2529
xrobot_api_server = "/xrobot/api/server/",
2630
// xrobot_api_client = "/xrobot/api/client/",
2731
xrobot_api_protocol = "/xrobot/api/protocol/",
32+
xrobot_api_mcp = "/xrobot/api/mcp/",
2833
// platform
2934
xrobot_platform = "/xrobot/platform/",
3035
xrobot_platform_esp32 = "/xrobot/platform/esp32/",
3136
xrobot_platform_others = "/xrobot/platform/others/",
3237
xrobot_platform_others_mp = "/xrobot/platform/others/mini-program/",
3338
xrobot_platform_others_console = "/xrobot/platform/others/console/",
3439
xrobot_platform_others_device = "/xrobot/platform/others/device/",
35-
xrobot_platform_others_device_net_config = "/xrobot/platform/others/net-config/",
40+
xrobot_platform_others_device_net_config = "/xrobot/platform/others/device/net-config/",
41+
xrobot_platform_others_device_device_bind = "/xrobot/platform/others/device/device-bind/",
3642
// faq
3743
xrobot_faq = "/xrobot/faq/",
3844
}
@@ -77,7 +83,7 @@ export function apply_prefix(item: ChapterItem, prefix: Chapters) {
7783
return { ...item, link: prefix + item.link };
7884
}
7985

80-
export const items_xrobot_api_server = [
86+
const items_xrobot_api_server = [
8187
{
8288
text: "平台接入API",
8389
collapsed: true,
@@ -91,7 +97,7 @@ export const items_xrobot_api_server = [
9197
},
9298
];
9399

94-
// export const items_xrobot_api_client = [
100+
// const items_xrobot_api_client = [
95101
// {
96102
// text: "设备接入协议",
97103
// collapsed: true,
@@ -100,7 +106,7 @@ export const items_xrobot_api_server = [
100106
// },
101107
// ];
102108

103-
export const items_xrobot_api_protocol = [
109+
const items_xrobot_api_protocol = [
104110
{
105111
text: "设备接入协议",
106112
collapsed: true,
@@ -113,20 +119,29 @@ export const items_xrobot_api_protocol = [
113119
},
114120
];
115121

116-
export const items_xrobot_api = [
122+
const items_xrobot_api_mcp = [
123+
{
124+
text: "MCP接入",
125+
link: Chapters.xrobot_api_mcp,
126+
items: [].map((item) => apply_prefix(item, Chapters.xrobot_api_mcp)),
127+
},
128+
];
129+
130+
const items_xrobot_api = [
117131
{
118132
text: "API参考",
119-
collapsed: false,
133+
// collapsed: false,
120134
link: Chapters.xrobot_api,
121135
items: [
122136
...items_xrobot_api_server,
123137
// ...items_xrobot_api_client,
124138
...items_xrobot_api_protocol,
139+
...items_xrobot_api_mcp,
125140
],
126141
},
127142
];
128143

129-
export const items_xrobot_platform_mp = [
144+
const items_xrobot_platform_mp = [
130145
{
131146
text: "微信小程序",
132147
link: Chapters.xrobot_platform_others_mp,
@@ -154,7 +169,21 @@ const items_xrobot_platform_net_config = [
154169
},
155170
];
156171

157-
export const items_xrobot_platform_device = [
172+
const items_xrobot_platform_device_bind = [
173+
{
174+
text: "绑定设备",
175+
link: Chapters.xrobot_platform_others_device_device_bind,
176+
collapsed: true,
177+
items: [
178+
{ text: "通过微信小程序", link: "mp" },
179+
{ text: "通过浏览器", link: "browser" },
180+
].map((item) =>
181+
apply_prefix(item, Chapters.xrobot_platform_others_device_device_bind)
182+
),
183+
},
184+
];
185+
186+
const items_xrobot_platform_device = [
158187
{
159188
text: "设备配置与使用",
160189
link: Chapters.xrobot_platform_others_device,
@@ -164,6 +193,7 @@ export const items_xrobot_platform_device = [
164193
apply_prefix(item, Chapters.xrobot_platform_others_device)
165194
),
166195
...items_xrobot_platform_net_config,
196+
...items_xrobot_platform_device_bind,
167197
],
168198
},
169199
];
@@ -183,7 +213,72 @@ const items_xrobot_platform_console = [
183213
},
184214
];
185215

186-
export const items_xrobot_guide = [];
216+
const items_xrobot_guide_quick_start = [
217+
{
218+
text: "快速入门",
219+
link: Chapters.xrobot_guide_quick_start,
220+
collapsed: false,
221+
items: [{ text: "创建智能体", link: "create-agent" }].map((item) =>
222+
apply_prefix(item, Chapters.xrobot_guide_quick_start)
223+
),
224+
},
225+
];
226+
227+
const items_xrobot_guide_xiaozhi_firmware = [
228+
{
229+
text: "小智固件接入",
230+
link: Chapters.xrobot_guide_xiaozhi_firmware,
231+
collapsed: true,
232+
items: [
233+
...[
234+
{ text: "编译小智固件", link: "compile" },
235+
{ text: "配网高级选项", link: "advanced-options" },
236+
].map((item) =>
237+
apply_prefix(item, Chapters.xrobot_guide_xiaozhi_firmware)
238+
),
239+
...items_xrobot_guide_quick_start.flatMap((item) => ({
240+
text: item.text,
241+
link: item.link,
242+
})),
243+
],
244+
},
245+
];
246+
247+
const items_xrobot_guide_xiaozhi_hardware = [
248+
{
249+
text: "小智硬件接入",
250+
link: Chapters.xrobot_guide_xiaozhi_hardware,
251+
collapsed: true,
252+
items: [].map((item) =>
253+
apply_prefix(item, Chapters.xrobot_guide_xiaozhi_hardware)
254+
),
255+
},
256+
];
257+
const items_xrobot_guide_platform_mp = [
258+
{
259+
text: "平台小程序接入",
260+
link: Chapters.xrobot_guide_platform_mp,
261+
collapsed: true,
262+
items: [].map((item) =>
263+
apply_prefix(item, Chapters.xrobot_guide_platform_mp)
264+
),
265+
},
266+
];
267+
268+
const items_xrobot_guide = [
269+
{
270+
text: "最佳实践",
271+
link: Chapters.xrobot_guide,
272+
collapsed: false,
273+
items: [
274+
...items_xrobot_guide_quick_start,
275+
...items_xrobot_guide_xiaozhi_firmware,
276+
...items_xrobot_guide_xiaozhi_hardware,
277+
...items_xrobot_guide_platform_mp,
278+
],
279+
// .map((item) => apply_prefix(item, Chapters.xrobot_guide)),
280+
},
281+
];
187282

188283
const items_xrobot_platform_esp32 = [
189284
{
@@ -197,7 +292,6 @@ const items_xrobot_platform_esp32 = [
197292
},
198293
];
199294

200-
// todo: 调整guide内容位置
201295
const items_xrobot_platform_others = [
202296
{
203297
text: "厂商接入指南",
@@ -215,7 +309,7 @@ const items_xrobot_platform = [
215309
{
216310
text: "最佳实践",
217311
link: Chapters.xrobot_platform,
218-
collapsed: false,
312+
// collapsed: false,
219313
items: [...items_xrobot_platform_esp32, ...items_xrobot_platform_others],
220314
},
221315
];
@@ -271,8 +365,28 @@ export const ChapterItems: Record<Chapters, ChapterItem[]> = {
271365
gobackItem(Chapters.xrobot_api),
272366
...items_xrobot_api_protocol,
273367
],
368+
[Chapters.xrobot_api_mcp]: [
369+
gobackItem(Chapters.xrobot_api),
370+
...items_xrobot_api_mcp,
371+
],
274372
// guide
275373
[Chapters.xrobot_guide]: [gobackItem(Chapters.xrobot), ...items_xrobot_guide],
374+
[Chapters.xrobot_guide_quick_start]: [
375+
gobackItem(Chapters.xrobot),
376+
...items_xrobot_guide_quick_start,
377+
],
378+
[Chapters.xrobot_guide_xiaozhi_firmware]: [
379+
gobackItem(Chapters.xrobot),
380+
...items_xrobot_guide_xiaozhi_firmware,
381+
],
382+
[Chapters.xrobot_guide_xiaozhi_hardware]: [
383+
gobackItem(Chapters.xrobot),
384+
...items_xrobot_guide_xiaozhi_hardware,
385+
],
386+
[Chapters.xrobot_guide_platform_mp]: [
387+
gobackItem(Chapters.xrobot),
388+
...items_xrobot_guide_platform_mp,
389+
],
276390
// platform
277391
[Chapters.xrobot_platform]: [
278392
gobackItem(Chapters.xrobot),
@@ -304,6 +418,11 @@ export const ChapterItems: Record<Chapters, ChapterItem[]> = {
304418
gobackItem(Chapters.xrobot_platform_others),
305419
...items_xrobot_platform_net_config,
306420
],
421+
[Chapters.xrobot_platform_others_device_device_bind]: [
422+
gobackItem(Chapters.xrobot_platform_others),
423+
...items_xrobot_platform_device_bind,
424+
],
425+
// platform - others END
307426
// faq
308427
[Chapters.xrobot_faq]: [gobackItem(Chapters.xrobot), ...items_xrobot_faq],
309428
};

docs/xrobot/api/mcp/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script setup>
2+
import { Chapters } from "../../../.vitepress/theme/constrants/route";
3+
4+
const chapter_root = Chapters.xrobot_api_mcp;
5+
</script>
6+
7+
<ChapterContents :chapter=chapter_root />
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: 平台小程序接入
3+
---
4+
5+
<script setup>
6+
import { Chapters } from "../../../.vitepress/theme/constrants/route";
7+
8+
const chapter_root = Chapters.xrobot_guide_platform_mp;
9+
</script>
10+
11+
<ChapterContents :chapter=chapter_root />
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: 创建智能体
3+
---
4+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: 快速入门
3+
---
4+
5+
<script setup>
6+
import { Chapters } from "../../../.vitepress/theme/constrants/route";
7+
8+
const chapter_root = Chapters.xrobot_guide_quick_start;
9+
</script>
10+
11+
<ChapterContents :chapter=chapter_root />
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: 配网高级选项
3+
---
4+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: 编译小智固件
3+
---
4+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: 小智开源固件项目接入
3+
---
4+
5+
<script setup>
6+
import { Chapters } from "../../../.vitepress/theme/constrants/route";
7+
8+
const chapter_root = Chapters.xrobot_guide_xiaozhi_firmware;
9+
</script>
10+
11+
<ChapterContents :chapter=chapter_root />
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: 小智硬件接入
3+
---
4+
5+
<script setup>
6+
import { Chapters } from "../../../.vitepress/theme/constrants/route";
7+
8+
const chapter_root = Chapters.xrobot_guide_xiaozhi_firmware;
9+
</script>
10+
11+
<!-- todo -->
12+
13+
<ChapterContents :chapter=chapter_root />

docs/xrobot/platform/others/console/device-bind.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ title: 设备绑定
1515
<img src="./imgs/device-bind/device-import.png">
1616

1717
不知道设备 mac 地址怎么办?
18+
<!-- todo ↑ -->
1819

1920
## 2. 绑定设备激活码
2021

2122
- 第三步:通过 在“设备管理”中,选择新增,填写 设备激活码
2223
<img src="./imgs/device-bind/3.device-code.png">
2324

24-
怎么获取设备激活码?
25+
## 3. 其他问题
2526

26-
### 2.1 获取设备激活码
27+
### 2.1 怎么获取设备激活码?
2728

2829
通过 OTA 通信协议获取,参考 [OTA 协议](/xrobot/api/protocol/OTA)
2930

0 commit comments

Comments
 (0)