2025-02-11 16:14:44 +08:00
|
|
|
|
登录界面
|
2025-02-08 15:27:48 +08:00
|
|
|
|
(Web → 单片机)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"command": "login",
|
|
|
|
|
"parameters": {
|
|
|
|
|
"username": "string",
|
|
|
|
|
"password": "string"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
(单片机 → Web)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"command": "login_response",
|
|
|
|
|
"parameters": {
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"status": 0, // 0: 成功, 1: 失败
|
|
|
|
|
"message": "Login successful" // 成功或失败的提示信息
|
2025-02-08 15:27:48 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2025-02-11 16:14:44 +08:00
|
|
|
|
修改密码
|
2025-02-08 15:27:48 +08:00
|
|
|
|
(Web → 单片机)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"JSON_id": 2,
|
|
|
|
|
"command": "change_password",
|
|
|
|
|
"parameters": {
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"old_password": "",
|
|
|
|
|
"new_password": ""
|
2025-02-08 15:27:48 +08:00
|
|
|
|
}
|
2025-02-11 16:14:44 +08:00
|
|
|
|
}
|
|
|
|
|
(单片机 → Web)
|
|
|
|
|
json{
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"command": "change_password_response",
|
|
|
|
|
"parameters": {
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"status": 0, // 0: 成功, 1: 失败
|
|
|
|
|
"message": "Password changed successfully"
|
2025-02-08 15:27:48 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2025-02-11 16:14:44 +08:00
|
|
|
|
时间设置
|
2025-02-08 15:27:48 +08:00
|
|
|
|
(Web → 单片机)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"command": "set_time",
|
|
|
|
|
"parameters": {
|
|
|
|
|
"timestamp": "2025-01-13T12:00:00Z"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
(单片机 → Web)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"command": "set_time_response",
|
|
|
|
|
"parameters": {
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"status": 0, // 0: 成功, 1: 失败
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"message": "Time set successfully"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
模式设置
|
2025-02-11 16:14:44 +08:00
|
|
|
|
(Web → 单片机)
|
|
|
|
|
json{
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"command": "set_mode",
|
|
|
|
|
"parameters": {
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"mode": 0, // 智能模式
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"data": {
|
|
|
|
|
"param1": "value1",
|
|
|
|
|
"param2": "value2",
|
|
|
|
|
"param3": "value3"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
(单片机 → Web)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"command": "set_mode_response",
|
|
|
|
|
"parameters": {
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"status": 0, // 0: 成功, 1: 失败
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"message": "Mode set successfully"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
方案设置
|
|
|
|
|
(Web → 单片机)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
|
|
|
|
"command": "add_scheme",
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"parameters": {
|
|
|
|
|
"scheme": [
|
|
|
|
|
{
|
|
|
|
|
"id": 1,
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"en": 1,
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"name": "方案1",
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"selectedMode": 1, // 1:直行,2:左转,3:右转,4:掉头
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"timeRange": {
|
|
|
|
|
"start": "08:00",
|
|
|
|
|
"end": "10:00"
|
|
|
|
|
},
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"lanes": "0100", // 用二进制表示车道状态,这里表示第二车道开启
|
|
|
|
|
"repeatDays": "0000001" // 用二进制表示重复日期,这里表示周日重复
|
2025-02-08 15:27:48 +08:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
(单片机 → Web)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
|
|
|
|
"command": "add_scheme_response",
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"parameters": {
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"status": 0, // 0: 成功, 1: 失败
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"message": "Add Plan successfully"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-11 16:14:44 +08:00
|
|
|
|
|
|
|
|
|
基本信息
|
2025-02-08 15:27:48 +08:00
|
|
|
|
(Web → 单片机)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"command": "get_device_info",
|
|
|
|
|
"parameters": {}
|
|
|
|
|
}
|
|
|
|
|
(单片机 → Web)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"command": "get_device_info_response",
|
|
|
|
|
"parameters": {
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"version": "1.0.3", // 版本号
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"compileTime": "2025-01-14T10:30:00Z"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
获取所有信息
|
|
|
|
|
(Web → 单片机)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"command": "get_all_info",
|
|
|
|
|
"parameters": {}
|
|
|
|
|
}
|
|
|
|
|
(单片机 → Web)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"command": "get_all_info_response",
|
|
|
|
|
"parameters": {
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"set_mode": 0, // 智能模式
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"scheme": [
|
|
|
|
|
{
|
|
|
|
|
"id": 1,
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"en": 1,
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"name": "方案1",
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"selectedMode": 1, // 1:直行,2:左转,3:右转,4:掉头
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"timeRange": {
|
|
|
|
|
"start": "08:00",
|
|
|
|
|
"end": "10:00"
|
|
|
|
|
},
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"lanes": "0100", // 用二进制表示车道状态,这里表示第二车道开启
|
|
|
|
|
"repeatDays": "0000001" // 用二进制表示重复日期,这里表示周日重复
|
2025-02-08 15:27:48 +08:00
|
|
|
|
}
|
|
|
|
|
],
|
2025-02-10 11:15:33 +08:00
|
|
|
|
"laneSetting": {
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"lane1": 0, //0左转直行 1右转直行
|
|
|
|
|
"lane2": 1,
|
|
|
|
|
"lane3": 0,
|
|
|
|
|
"lane4": 1
|
2025-02-10 11:15:33 +08:00
|
|
|
|
},
|
2025-02-08 15:27:48 +08:00
|
|
|
|
"deviceInfo": {
|
|
|
|
|
"version": "1.0.3",
|
|
|
|
|
"compileTime": "2025-01-14 10:30:00"
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-02-10 11:15:33 +08:00
|
|
|
|
}
|
|
|
|
|
默认车道设置
|
|
|
|
|
(Web → 单片机)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
2025-02-10 11:15:33 +08:00
|
|
|
|
"command": "default_lane_setting",
|
|
|
|
|
"parameters": {
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"lane1": 0, //0左转直行 1右转直行
|
|
|
|
|
"lane2": 1,
|
|
|
|
|
"lane3": 0,
|
|
|
|
|
"lane4": 1
|
2025-02-10 11:15:33 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
(单片机 → Web)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
|
|
|
|
"command": "default_lane_setting_response",
|
2025-02-10 11:15:33 +08:00
|
|
|
|
"parameters": {
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"status": 0, // 0: 成功, 1: 失败
|
2025-02-10 11:15:33 +08:00
|
|
|
|
"message": "Set successfully"
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-02-10 15:47:37 +08:00
|
|
|
|
使能部分
|
|
|
|
|
(Web → 单片机)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
2025-02-10 15:47:37 +08:00
|
|
|
|
"JSON_id": 30,
|
2025-02-12 14:23:30 +08:00
|
|
|
|
"command": "modify_scheme_status",
|
2025-02-10 15:47:37 +08:00
|
|
|
|
"parameters": {
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"id": 1,
|
|
|
|
|
"enable": false
|
2025-02-10 15:47:37 +08:00
|
|
|
|
}
|
2025-02-11 16:14:44 +08:00
|
|
|
|
}
|
2025-02-10 15:47:37 +08:00
|
|
|
|
(单片机 → Web)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
2025-02-12 14:23:30 +08:00
|
|
|
|
"command": "modify_scheme_status_response",
|
2025-02-10 15:47:37 +08:00
|
|
|
|
"parameters": {
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"status": 0, // 0: 成功, 1: 失败
|
2025-02-12 14:23:30 +08:00
|
|
|
|
"message": "Modify successfully"
|
2025-02-10 15:47:37 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
删除方案
|
|
|
|
|
(Web → 单片机)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
2025-02-10 15:47:37 +08:00
|
|
|
|
"command": "delete_scheme",
|
|
|
|
|
"parameters": {
|
|
|
|
|
"id": 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
(单片机 → Web)
|
2025-02-11 16:14:44 +08:00
|
|
|
|
json{
|
2025-02-10 15:47:37 +08:00
|
|
|
|
"command": "delete_scheme_response",
|
2025-02-11 16:14:44 +08:00
|
|
|
|
"parameters": {
|
|
|
|
|
"status": 0, // 0: 成功, 1: 失败
|
2025-02-10 15:47:37 +08:00
|
|
|
|
"message": "Delete successfully"
|
|
|
|
|
}
|
2025-02-11 16:14:44 +08:00
|
|
|
|
}
|