diff --git a/AGENTS.md b/AGENTS.md index a587963..92bb4e3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -484,7 +484,11 @@ operation_log(操作日志) 设备登录,验证签名。 ```json +// 请求 {"act":"login","msg_id":1,"dev_id":"123456789012345","sign":"abc12345","timestamp":1719800000,"h_ver":"1.0.0","s_ver":"1.0.0"} + +// 响应 +{"suc":1,"msg_id":1,"cell":6} ``` **字段说明:** @@ -501,7 +505,11 @@ operation_log(操作日志) 获取8位安全码,仅首次连接调用。 ```json +// 请求 {"act":"auth_str","msg_id":2,"dev_id":"123456789012345","ccid":"89860000000000000000"} + +// 响应 +{"suc":1,"msg_id":2,"data":{"auth_str":"abcd1234"}} ``` **字段说明:** @@ -515,7 +523,11 @@ operation_log(操作日志) 定时上报,空闲60秒/充电15秒。 ```json +// 请求 {"act":"status_post","msg_id":10,"dev_id":"123456789012345","rssi":85,"status":{"123456789012345-01":"000100020003000400050006"}} + +// 响应 +{"suc":1,"msg_id":10} ``` **status字段说明:** @@ -529,7 +541,11 @@ operation_log(操作日志) 电源掉电上报。 ```json +// 请求 {"act":"pow_fail","msg_id":15,"dev_id":"123456789012345","info":"0"} + +// 响应 +{"suc":1,"msg_id":15} ``` **字段说明:** @@ -542,7 +558,11 @@ operation_log(操作日志) 接触器合闸,恢复380V充电电源供电。 ```json +// 请求 {"act":"pow_on","msg_id":16,"dev_id":"123456789012345"} + +// 响应 +{"suc":1,"msg_id":16} ``` --- @@ -552,7 +572,11 @@ operation_log(操作日志) 接触器分闸,切断380V充电电源供电。 ```json +// 请求 {"act":"pow_off","msg_id":16,"dev_id":"123456789012345"} + +// 响应 +{"suc":1,"msg_id":16} ``` --- @@ -562,7 +586,11 @@ operation_log(操作日志) 电池插入事件,立即上报。 ```json +// 请求 {"act":"bat_in","msg_id":20,"id":"123456789012345-01-6","bms":{"soc":45,"voltage":52.3}} + +// 响应 +{"suc":1,"msg_id":20} ``` **平台处理:** @@ -577,7 +605,11 @@ operation_log(操作日志) 电池拔出事件,立即上报。 ```json +// 请求 {"act":"bat_out","msg_id":21,"id":"123456789012345-01-6"} + +// 响应 +{"suc":1,"msg_id":21} ``` --- @@ -587,12 +619,17 @@ operation_log(操作日志) **平台→设备:** 开始充电 ```json +// 请求 {"act":"on","msg_id":30,"id":"123456789012345-01-6"} + +// 响应 +{"suc":1,"msg_id":30} ``` **设备→平台:** 充电开始确认(自动充电模式) ```json +// 上报 {"act":"on","msg_id":30,"id":"123456789012345-01-6"} ``` @@ -603,12 +640,17 @@ operation_log(操作日志) **平台→设备:** 手动停止充电 ```json +// 请求 {"act":"off","msg_id":31,"id":"123456789012345-01-6"} + +// 响应 +{"suc":1,"msg_id":31} ``` **设备→平台:** 充满自动停止 ```json +// 上报 {"act":"off","msg_id":31,"id":"123456789012345-01-6"} ``` @@ -619,7 +661,11 @@ operation_log(操作日志) 开门,只需IMEI。 ```json +// 请求 {"act":"open","msg_id":40,"id":"123456789012345"} + +// 响应 +{"suc":1,"msg_id":40} ``` **错误码63 = 门锁故障。** @@ -631,7 +677,11 @@ operation_log(操作日志) 查询仓板状态。 ```json +// 请求 {"act":"status_get","msg_id":50,"id":"123456789012345-01"} + +// 响应 +{"suc":1,"msg_id":50,"data":{"status":"..."}} ``` --- @@ -646,6 +696,9 @@ operation_log(操作日志) // 重启仓控板 {"act":"reset","msg_id":61,"id":"123456789012345-01"} + +// 响应 +{"suc":1,"msg_id":60} ``` ### 充电结束原因(平台判断)