From f6e6c7743b9727947d733b89606f0d1895bb2790 Mon Sep 17 00:00:00 2001 From: zhangzhen Date: Sun, 14 Jun 2026 11:39:50 +0800 Subject: [PATCH] 2.7.1 --- utils/cmd.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/utils/cmd.js b/utils/cmd.js index e479260..973bcd1 100644 --- a/utils/cmd.js +++ b/utils/cmd.js @@ -193,7 +193,7 @@ const clearQueue = () => { const getQueueSize = () => { return queue.length } -// ========== RS485 优先级消息队列 END ========== +// ========== 统一消息队列 END ========== export default { // 开左门指令 (通过RS485站号03) - 高优先级 @@ -237,32 +237,28 @@ export default { let op = status ? '01' : '00' let cmd = '5AA5EE02' + op store.state.relay.wind = status - let RS232 = getApp().globalData.RS232 - await RS232.sendDataString(cmd); + return enqueue('RS232', cmd, PRIORITY.HIGH) }, // 开灯指令 03 (通过RS232) - 高优先级 Light: async (status) => { let op = status ? '01' : '00' let cmd = '5AA5EE03' + op store.state.relay.light = status - let RS232 = getApp().globalData.RS232 - await RS232.sendDataString(cmd); + return enqueue('RS232', cmd, PRIORITY.HIGH) }, // 开真空指令 04 (通过RS232) - 高优先级 Vacuum: async (status) => { let op = status ? '01' : '00' let cmd = '5AA5EE04' + op store.state.relay.vacuum = status - let RS232 = getApp().globalData.RS232 - await RS232.sendDataString(cmd); + return enqueue('RS232', cmd, PRIORITY.HIGH) }, // 开关消毒指令 05 (通过RS232) - 高优先级 Disinfect: async (status) => { let op = status ? '01' : '00' let cmd = '5AA5EE05' + op store.state.relay.disinfect = status - let RS232 = getApp().globalData.RS232 - await RS232.sendDataString(cmd); + return enqueue('RS232', cmd, PRIORITY.HIGH) }, // 获取温湿度(通过RS485站号02)- 低优先级 getTemp: () => {