修改通知

This commit is contained in:
lnk
2026-04-24 16:22:15 +08:00
parent ea176eceaf
commit 54b0d68c24
3 changed files with 10 additions and 6 deletions

Binary file not shown.

View File

@@ -2849,6 +2849,10 @@ static int get_cloud_type_by_state(int type)
case DeviceState::SET_RIGHTTIME_2: return 1113; // 主动对时
case DeviceState::SET_CTRL: return 1114; // 控制/重启
case DeviceState::SET_PREUPGRADE: return 1115; // 升级预校验
case DeviceState::SEND_FILE: return 1116; // 文件上送
case DeviceState::DEL_FILE: return 1117; // 文件删除
case DeviceState::SEND_MENU: return 1118; // 目录创建
case DeviceState::DEL_MENU: return 1119; // 目录删除
default:
return type; // 其他未映射的,保持原值,避免影响现有逻辑

View File

@@ -847,8 +847,8 @@ void process_received_message(string mac, string id,const char* data, size_t len
<< ", Error: " << strerror(errno) << std::endl;
// 文件保存失败,通知云端
/*on_device_response_minimal(static_cast<int>(ResponseCode::BAD_REQUEST),
id, 0, static_cast<int>(DeviceState::READING_EVENTFILE));*/
//on_device_response_minimal(static_cast<int>(ResponseCode::BAD_REQUEST),
// id, 0, static_cast<int>(DeviceState::READING_EVENTFILE));
}
//当前文件下载完毕,调整为空闲处理下一项工作(如果这里后续有新文件等待下载,一般已经存入等待队列等候处理了,调成空闲状态后直接就会开始新文件的下载工作)
@@ -988,7 +988,7 @@ void process_received_message(string mac, string id,const char* data, size_t len
// 当前帧被拒收,文件上送失败
std::cout << "*** send file 0x41 fail ***! " << mac << std::endl;
on_device_response_minimal(static_cast<int>(ResponseCode::REJECTED_BUSY), id, 0, static_cast<int>(DeviceState::SEND_FILE));
on_device_response_minimal(static_cast<int>(ResponseCode::FORBIDDEN), id, 0, static_cast<int>(DeviceState::SEND_FILE));
ClientManager::instance().change_device_state(id, DeviceState::IDLE);
}
@@ -1016,7 +1016,7 @@ void process_received_message(string mac, string id,const char* data, size_t len
// 当前帧被拒收,文件删除失败
std::cout << "*** del file 0x41 fail ***! " << mac << std::endl;
on_device_response_minimal(static_cast<int>(ResponseCode::REJECTED_BUSY), id, 0, static_cast<int>(DeviceState::DEL_FILE));
on_device_response_minimal(static_cast<int>(ResponseCode::FORBIDDEN), id, 0, static_cast<int>(DeviceState::DEL_FILE));
ClientManager::instance().change_device_state(id, DeviceState::IDLE);
}
@@ -1044,7 +1044,7 @@ void process_received_message(string mac, string id,const char* data, size_t len
// 当前帧被拒收,创建目录失败
std::cout << "*** send menu 0x41 fail ***! " << mac << std::endl;
on_device_response_minimal(static_cast<int>(ResponseCode::REJECTED_BUSY), id, 0, static_cast<int>(DeviceState::SEND_MENU));
on_device_response_minimal(static_cast<int>(ResponseCode::FORBIDDEN), id, 0, static_cast<int>(DeviceState::SEND_MENU));
ClientManager::instance().change_device_state(id, DeviceState::IDLE);
}
@@ -1072,7 +1072,7 @@ void process_received_message(string mac, string id,const char* data, size_t len
// 当前帧被拒收,删除目录失败
std::cout << "*** del menu 0x41 fail ***! " << mac << std::endl;
on_device_response_minimal(static_cast<int>(ResponseCode::REJECTED_BUSY), id, 0, static_cast<int>(DeviceState::DEL_MENU));
on_device_response_minimal(static_cast<int>(ResponseCode::FORBIDDEN), id, 0, static_cast<int>(DeviceState::DEL_MENU));
ClientManager::instance().change_device_state(id, DeviceState::IDLE);
}