|
|
@@ -1181,7 +1181,7 @@ struct tm* get_curtime(void)
|
|
|
}
|
|
|
static void send_power_data(struct tm *tm, char *dir)
|
|
|
{
|
|
|
- int r,type=0;
|
|
|
+ int r;
|
|
|
char path[200],sub[100];
|
|
|
char tmp1[100],tmp2[100];
|
|
|
GlobalDeviceManager *dm=&__globalDeviceManage;
|
|
|
@@ -1191,15 +1191,12 @@ static void send_power_data(struct tm *tm, char *dir)
|
|
|
get_range(tm, &from, &to, 1);
|
|
|
|
|
|
if(sended_id != from) {
|
|
|
- if(dm->_globalDevInfo.product.pwr_type>=SmartPDU_Tree_AC_Tree) {
|
|
|
- type = 1;
|
|
|
- }
|
|
|
get_time_str2(tmp1,sizeof(tmp1),from);
|
|
|
get_time_str2(tmp2,sizeof(tmp2),to);
|
|
|
|
|
|
sprintf(path, "%s/power_%s_%s.csv", dir, tmp1, tmp2);
|
|
|
if(!file_exist(path)) {
|
|
|
- dev_power_xport(type, from, to, path);
|
|
|
+ dev_power_xport(from, to, path);
|
|
|
}
|
|
|
|
|
|
if(file_exist(path)) {
|
|
|
@@ -1214,7 +1211,7 @@ static void send_power_data(struct tm *tm, char *dir)
|
|
|
}
|
|
|
static void send_log_data(struct tm *tm, char *dir)
|
|
|
{
|
|
|
- int i,r,type=0;
|
|
|
+ int i,r;
|
|
|
char path[200],sub[100];
|
|
|
char tmp1[100],tmp2[100];
|
|
|
GlobalDeviceManager *dm=&__globalDeviceManage;
|
|
|
@@ -1235,7 +1232,7 @@ static void send_log_data(struct tm *tm, char *dir)
|
|
|
|
|
|
sprintf(path, "%s/log_%s_%s_%s.csv", dir, logname[i], tmp1, tmp2);
|
|
|
if(!file_exist(path)) {
|
|
|
- dev_log_xport(type, from, to, path);
|
|
|
+ dev_log_xport(i, from, to, path);
|
|
|
}
|
|
|
|
|
|
if(file_exist(path)) {
|
|
|
@@ -1254,20 +1251,20 @@ static void send_log_data(struct tm *tm, char *dir)
|
|
|
static int tmp_create(void)
|
|
|
{
|
|
|
char cmd[100];
|
|
|
- sprintf(cmd, "mkdir -p %s", TMP_DIR);
|
|
|
+ sprintf(cmd, "mkdir -p %s > /dev/null", TMP_DIR);
|
|
|
return system(cmd);
|
|
|
}
|
|
|
static int tmp_remove(void)
|
|
|
{
|
|
|
char cmd[100];
|
|
|
- sprintf(cmd, "rm -f %s/*.csv", TMP_DIR);
|
|
|
+ sprintf(cmd, "rm -f %s/*.csv > /dev/null", TMP_DIR);
|
|
|
return system(cmd);
|
|
|
}
|
|
|
static void send_check(void)
|
|
|
{
|
|
|
static int file_flag=0;
|
|
|
static uint32_t send_cnt=0;
|
|
|
-
|
|
|
+
|
|
|
send_cnt++;
|
|
|
if(send_cnt%SEND_PERIOD==0) {
|
|
|
struct tm *tm=get_curtime();
|
|
|
@@ -1287,7 +1284,7 @@ static void* polling_thread(void *arg)
|
|
|
{
|
|
|
thread_handle_t *h=(thread_handle_t*)arg;
|
|
|
|
|
|
- //tmp_create();
|
|
|
+ tmp_create();
|
|
|
while(h->quit==0) {
|
|
|
mem_check();
|
|
|
send_check();
|