diff --git a/esp32c3/core/SOC量产及远程升级文件/ESP32C3/sms_to_wifi_1.0.0_LuatOS-SoC_V1007_ESP32C3_USB.ota b/esp32c3/core/SOC量产及远程升级文件/ESP32C3/sms_to_wifi_1.0.0_LuatOS-SoC_V1007_ESP32C3_USB.ota index e074356..3d3f1ab 100644 Binary files a/esp32c3/core/SOC量产及远程升级文件/ESP32C3/sms_to_wifi_1.0.0_LuatOS-SoC_V1007_ESP32C3_USB.ota and b/esp32c3/core/SOC量产及远程升级文件/ESP32C3/sms_to_wifi_1.0.0_LuatOS-SoC_V1007_ESP32C3_USB.ota differ diff --git a/esp32c3/core/SOC量产及远程升级文件/ESP32C3/sms_to_wifi_1.0.0_LuatOS-SoC_V1007_ESP32C3_USB.soc b/esp32c3/core/SOC量产及远程升级文件/ESP32C3/sms_to_wifi_1.0.0_LuatOS-SoC_V1007_ESP32C3_USB.soc index d255608..7426a09 100644 Binary files a/esp32c3/core/SOC量产及远程升级文件/ESP32C3/sms_to_wifi_1.0.0_LuatOS-SoC_V1007_ESP32C3_USB.soc and b/esp32c3/core/SOC量产及远程升级文件/ESP32C3/sms_to_wifi_1.0.0_LuatOS-SoC_V1007_ESP32C3_USB.soc differ diff --git a/esp32c3/script/air780_helper.lua b/esp32c3/script/air780_helper.lua index ed9dd61..1cb1cb2 100644 --- a/esp32c3/script/air780_helper.lua +++ b/esp32c3/script/air780_helper.lua @@ -7,6 +7,7 @@ local sys = require("sys") local utils = require("utils") local config = require("config") local util_notify = require("util_notify") +local led_helper = require("led_helper") local uart_timeout = 100 @@ -77,21 +78,19 @@ sys.subscribe("NEW_MSG", function(data) end local numbers = fskv.kv_get("numbers") -- log.info("air780_helper", "测试numbers", json.encode(numbers),type(numbers)) - local cs_index = air780_helper.cs_index - 1 + local this_cs_index = air780_helper.cs_index - 1 if utils.is_empty(msg.sms) == false then air780_helper.reading = false - msg.index = tostring(cs_index) + msg.cs_index = tostring(this_cs_index) -- 是否屏蔽自检信息 local disable_boot = fskv.kv_get("disable_boot") if disable_boot == 1 and msg.type == "boot" then return end -- 如果没有读到号码就是用设置的号码 - if utils.is_empty(msg.to) then - if fskv.kv_get("numbers") then - if numbers[cs_index] ~= nil then - msg.to = numbers[cs_index] - end + if utils.is_empty(msg.to) and numbers[this_cs_index] ~= nil then + if numbers[this_cs_index] ~= nil then + msg.to = numbers[this_cs_index] end end if fskv.kv_get("hostname") then @@ -104,6 +103,7 @@ sys.subscribe("NEW_MSG", function(data) msg.sms = "收到设备通知:" .. msg.sms msg.index = nil end + log.info("air780_helper", "NEW_MSG", this_cs_index,air780_helper.cs_index) util_notify.add(msg) utils.clear_table(msg) msg = nil diff --git a/esp32c3/script/util_notify.lua b/esp32c3/script/util_notify.lua index 5b08446..b54f37b 100644 --- a/esp32c3/script/util_notify.lua +++ b/esp32c3/script/util_notify.lua @@ -39,8 +39,8 @@ local notify = { if utils.is_empty(msg.hostname) == false then text = text .. "- 设备名称:".. msg.hostname .."\n" end - if utils.is_empty(msg.index) == false then - text = text .. "- 子设备ID:".. msg.index .."\n" + if utils.is_empty(msg.cs_index) == false then + text = text .. "- 子设备ID:".. msg.cs_index .."\n" end if utils.is_empty(msg.from_time) == false then text = text .. "- 接收时间:".. msg.from_time .."\n" @@ -90,8 +90,8 @@ local notify = { if utils.is_empty(msg.hostname) == false then text = text .. "设备名称:".. msg.hostname .."\n" end - if utils.is_empty(msg.index) == false then - text = text .. "设备ID:".. msg.index .."\n" + if utils.is_empty(msg.cs_index) == false then + text = text .. "设备ID:".. msg.cs_index .."\n" end if utils.is_empty(msg.from_time) == false then text = text .. "接收时间:".. msg.from_time .."\n"