# device-protocol **Repository Path**: kitfast/device-protocol ## Basic Information - **Project Name**: device-protocol - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-01-24 - **Last Updated**: 2025-02-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 设备协议 ## 设备状态 设备上线 ```json { "cmd": "online", "device": { "id": "设备ID", "name": "设备名称" } } ``` 设备下线 ```json { "cmd": "offline", "device": { "id": "设备ID", "name": "设备名称" } } ``` ## 设备文件 ### 文件同步 设备端接收: ```json { "cmd": "file-sync", "device": { "id": "设备ID", "name": "设备名称" }, "payload": [{ "ack": "target-topic", "path": "D:\\tmp", "files": [{ "id": "file1", "url": "https://example.com/file1.jpg", "name": "", "hashes": [ {"enc": "b64", "alg": "md5", "val": "..."} ] }] }] } ``` 设备端发送: ```json { "cmd": "file-sync-ack", "device": { "id": "设备ID", "name": "设备名称" }, "payload": [{ "path": "D:\\tmp", "error": "", "files": [{ "id": "file1", "hashes": [ {"enc": "b64", "alg": "md5", "val": "..."} ] }] }] } ```