修复路劲规划暂停和继续和停止的tcp指令的数据格式

This commit is contained in:
2026-03-11 17:15:28 +08:00
parent 89de0bc384
commit f3bcba15b1
4 changed files with 106 additions and 15 deletions

View File

@@ -96,9 +96,11 @@ class NetMessageDispatcher {
///取全局的路径规划发送实体 queue
/// 发送下一个指令 移除上一条数据
var queue = _pathPlanningService.getQueue();
//去除第一条数据
//去除上一条数据
queue.removeFirst();
_pathPlanningService.updateQueue(queue as List<DeviceAddPathPointModel>);
/// _pathPlanningService.updateQueue(queue as List<DeviceAddPathPointModel>);
_pathPlanningService.updateQueue(queue.toList());
debugPrint('📡 [Dispatcher] 准备触发下一个路径点发送,队列剩余:${queue.length}');
routePlanningRepository.startRoutePlanning(queue);
return true;
} else {

View File

@@ -277,12 +277,10 @@ class TcpClient {
void sendDeviceStateChange(RoutePlanSendEntity routePlanSendEntity) {
if (_socket == null) return;
final payload = routePlanSendEntity.toBytes();
//_socket!.add(payload);
sendRaw(0x02, payload);
// 🔥 核心修复:直接发送字节数组,不再用 sendRaw 包装
_socket!.add(payload);
var counts = routePlanSendEntity.pointCounts;
var string = routePlanSendEntity.toString();
print("sendDeviceStateChange 底层发送指令完成,数据:$counts");
}