diff --git a/common/global.hpp b/common/global.hpp index ac03d9a..2ff7763 100644 --- a/common/global.hpp +++ b/common/global.hpp @@ -18,7 +18,7 @@ enum enumZigBeeTransmitStatus { //#define NR5G_MODULE -//#define Q4G_MODULE +#define Q4G_MODULE //#define WIFI_MODULE //#define NR5G_MEIGE diff --git a/platform/platform_init.cpp b/platform/platform_init.cpp index 63fc064..b6950bc 100644 --- a/platform/platform_init.cpp +++ b/platform/platform_init.cpp @@ -267,16 +267,12 @@ void PlatformInit::EquipIpInit(std::string eth) { std::string cmd = ""; if (eth == "eth0") { - cmd = "sed -i '5c Address=" + dataWatchIpAddress + "' /etc/systemd/network/static/10-eth0-static.network"; - system(cmd.c_str()); - cmd = "sed -i '6c Netmask=" + subnetMask + "' /etc/systemd/network/static/10-eth0-static.network"; + cmd = "sed -i '5c Address=" + dataWatchIpAddress + "/24" + "' /etc/systemd/network/static/10-eth0-static.network"; system(cmd.c_str()); cmd = "sed -i '7c Gateway=" + gateway + "' /etc/systemd/network/static/10-eth0-static.network"; system(cmd.c_str()); } else if (eth == "eth1") { - cmd = "sed -i '5c Address=" + dataWatchIpAddress + "' /etc/systemd/network/dynamic/20-eth1-dynamic.network"; - system(cmd.c_str()); - cmd = "sed -i '6c Netmask=" + subnetMask + "' /etc/systemd/network/dynamic/20-eth1-dynamic.network"; + cmd = "sed -i '5c Address=" + dataWatchIpAddress + "/24" + "' /etc/systemd/network/dynamic/20-eth1-dynamic.network"; system(cmd.c_str()); cmd = "sed -i '7c Gateway=" + gateway + "' /etc/systemd/network/dynamic/20-eth1-dynamic.network"; system(cmd.c_str()); diff --git a/scheduler/schedule.cpp b/scheduler/schedule.cpp index 0ee94d2..de485be 100644 --- a/scheduler/schedule.cpp +++ b/scheduler/schedule.cpp @@ -207,7 +207,7 @@ int SensorScheduler::GetNextDuration(int short_addr) { long current_ts = GetLocalTs(); long next_ts = CalcNextTimestamp(id, short_addr); int duration = next_ts - current_ts; - if (duration <= 10 || duration > eigen_value_send_interval_) { + if (duration < 0 || duration > eigen_value_send_interval_) { zlog_warn(zct, "[Nxt] exception duration: %d", duration); duration = eigen_value_send_interval_; } diff --git a/uart/uart.cpp b/uart/uart.cpp index 17fee4d..74a3b8a 100644 --- a/uart/uart.cpp +++ b/uart/uart.cpp @@ -393,7 +393,7 @@ int Uart::DealAskTask(uint16_t ushortAdd){ { scheduleTask.cmd = REVIVE_DURATION; scheduleTask.shortAddr = ushortAdd; - scheduleTask.duration = next_duration; + scheduleTask.duration = 6; zlog_info(zct, "next_duration = %d ", next_duration); TaskResp(scheduleTask); }else if (taskID == 13) //6.RSSI @@ -418,7 +418,7 @@ int Uart::DealReviveDuration(uint16_t ushortAdd){ zlog_info(zct, "next_duration = %d ", next_duration); scheduleTask.cmd = REVIVE_DURATION; scheduleTask.shortAddr = ushortAdd; - scheduleTask.duration = next_duration; + scheduleTask.duration = 6; TaskResp(scheduleTask); return 0;