增加ping指令并获取带版本号的响应

This commit is contained in:
2025-12-01 20:42:21 +08:00
parent d5056af676
commit 2e6a0abac3
17 changed files with 557 additions and 44 deletions

View File

@@ -73,6 +73,18 @@ message LogUploadRequest {
repeated LogEntry entries = 1; // 一批日志条目
}
// 平台向设备发送的Ping指令用于检查存活性。
message Ping {
// 可以留空,指令本身即代表意图
}
// 设备对Ping的响应或设备主动上报的心跳。
// 它包含了设备的关键状态信息。
message Pong {
string firmware_version = 1; // 当前固件版本
// 可以扩展更多状态, e.g., int32 uptime_seconds = 2;
}
// --- 顶层指令包装器 ---
@@ -85,10 +97,12 @@ message Instruction {
BatchCollectCommand batch_collect_command = 2;
OtaUpgradeCommand ota_upgrade_command = 3;
ControlLogUploadCommand control_log_upload_command = 4;
Ping ping = 6;
// --- 上行数据 (设备 -> 平台) ---
CollectResult collect_result = 101;
OtaUpgradeStatus ota_upgrade_status = 102;
LogUploadRequest log_upload_request = 103;
Pong pong = 104;
}
}