fix net bug,version 5.2

This commit is contained in:
zhangsheng 2024-12-27 10:09:30 +08:00
parent 4d9207f0ca
commit 2338ffc8b4
4 changed files with 6 additions and 10 deletions

View File

@ -18,7 +18,7 @@ enum enumZigBeeTransmitStatus {
//#define NR5G_MODULE
//#define Q4G_MODULE
#define Q4G_MODULE
//#define WIFI_MODULE
//#define NR5G_MEIGE

View File

@ -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());

View File

@ -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_;
}

View File

@ -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;