Files
softbus_daemon/docs/EDGE_LOCAL_SETUP.md
flower_linux 238b814057 edge split
2026-05-13 16:45:31 +08:00

20 lines
1.4 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.
# 边缘上行与核心本地联调
## 前提
- 已编译 `softbus_daemon`(含 `EdgeTcpIngressService`)。
-`~/softbus/config/daemon_config.json` 中启用 **`edgeIngress.enabled`**,并设置 **`port`**(默认 `18765`)。若设置 **`authToken`**,边缘首帧 HELLO 必须携带相同 token。
- 设备树中需存在可被边缘修改的节点:满足 `params.edgeId` 等于边缘 `edgeId`,或节点 `id``edges/<edgeId>` / `edges/<edgeId>/...` 前缀(见 `DeviceTreeModel::applyEdgePropose`)。
## 快速验证
1. 启动核心:`softbus_daemon``CoreRouter` 角色,默认)。
2. 运行单元测试(线格式):`bin/edge_uplink_wire_test`
3. 使用 `edge_agent`(独立仓库)连接核心、发送 HELLO 与可选 `DATA_RAWBUS` / `TREE_PROPOSE`(见该仓库 README
## D-Bus 辅助命令
- `list_edge_sessions`:查看当前边缘 TCP 会话摘要。
- `get_edge_tree_revision`:当前内存设备树 `treeRevision`
- `push_edge_tree`:向指定 `edgeId` 的已连接边缘 TCP 会话发送 **TREE_FULL**(子树 JSON规则同 `DeviceTreeModel::exportSubtreeForEdge`。HELLO 成功后核心也会自动推送一次。**`patch_device_tree_node`** 若修改的节点属于某边缘作用域(`params.edgeId``edges/<edgeId>/...`),响应里会带 **`edgeTreeDownlink`** 并尝试对该 edge 自动下行(无会话时 `ok=false` 等见各元素 `error` 字段)。