ソースを参照

Merge branch 'master' of http://jiecheng2024.tpddns.cn:3000/liyuezong/SmartPDCode

guohui 1 年間 前
親
コミット
f58765e6e5
共有2 個のファイルを変更した、19 個の追加 と 10 個の削除を含む
  1. 15 6
      ip/src/appweb_handle.c
  2. 4 4
      ip/src/common.c

+ 15 - 6
ip/src/appweb_handle.c

@@ -944,20 +944,27 @@ static void overallStatusMonitoring(void* conn)
             log_e("serach total System total err.");
             log_e("serach total System total err.");
         }
         }
         int nSumChannel=0;
         int nSumChannel=0;
+        int nSumSensor = 0;
         GlobalPowerManger* _globalPowerMangerTemp = NULL ;
         GlobalPowerManger* _globalPowerMangerTemp = NULL ;
         list_for_each_entry(_globalPowerMangerTemp, &__globalDeviceManage._globalPowerManger.list, list)
         list_for_each_entry(_globalPowerMangerTemp, &__globalDeviceManage._globalPowerManger.list, list)
         {
         {
             nSumChannel+=1;
             nSumChannel+=1;
         }
         }
         __system_total_info.channel_total = nSumChannel ;
         __system_total_info.channel_total = nSumChannel ;
-
+        
+        GlobalSensorManger * _g_manerger = NULL;
+        list_for_each_entry(_g_manerger, &__globalDeviceManage._globalSensorManger.list, list)
+        {
+            nSumSensor+=1;
+        }
 
 
         //获取通道总数
         //获取通道总数
         // __GetSystemTotalInfo.channel_total = _globalDeviceManager->useSlaveCount;
         // __GetSystemTotalInfo.channel_total = _globalDeviceManager->useSlaveCount;
         //获取系统总数情况
         //获取系统总数情况
         _over_back_sts_info.system_total.channel_total  = __system_total_info.channel_total;
         _over_back_sts_info.system_total.channel_total  = __system_total_info.channel_total;
 		_over_back_sts_info.system_total.log_total      = __system_total_info.log_total;
 		_over_back_sts_info.system_total.log_total      = __system_total_info.log_total;
-		_over_back_sts_info.system_total.sensor_total   = __system_total_info.sensor_total;
+
+		_over_back_sts_info.system_total.sensor_total   = nSumSensor;
 		_over_back_sts_info.system_total.warn_total     = __system_total_info.warn_total;
 		_over_back_sts_info.system_total.warn_total     = __system_total_info.warn_total;
 
 
         //返回系统总数情况
         //返回系统总数情况
@@ -3701,10 +3708,12 @@ static void serviceManagement(void *conn)
             log_e("time zone not contain GMT/UTC");
             log_e("time zone not contain GMT/UTC");
             return;
             return;
         }
         }
-        char tempstr[10];
-        memcpy(tempstr, &p[strlen(key)], strlen(p) - strlen(key));
-        int value = atoi(tempstr);
-        if (value > 12 || value < -11)
+        p += strlen(key);
+        int value = atoi(p);
+        char tempstr[10] ={0};
+        // memcpy(tempstr, &p[strlen(key)], strlen(p) - strlen(key));
+        // int value = atoi(tempstr);
+        if (value > 12 || value < -12)
         {
         {
             char buf[128];
             char buf[128];
             memset(buf, 0, sizeof(buf));
             memset(buf, 0, sizeof(buf));

+ 4 - 4
ip/src/common.c

@@ -279,7 +279,7 @@ void get_disk_occupy(char ** reused)
 
 
 static int set_rtc(time_t t)
 static int set_rtc(time_t t)
 {
 {
-    /*
+    
     int r=0,fd;
     int r=0,fd;
     struct rtc_time *rtc;
     struct rtc_time *rtc;
 
 
@@ -301,9 +301,9 @@ static int set_rtc(time_t t)
     close(fd);
     close(fd);
     
     
     return r;
     return r;
-    */
-    system("hwclock -w -f /dev/rtc0");
-    return 0;
+    
+    //system("hwclock -w -f /dev/rtc0");
+   // return 0;
     
     
 }
 }