|
|
@@ -256,14 +256,15 @@ static int gettime2(char *buf, char *tok, char *timestr)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int get_sensor2(char* buf,char *tok,char *sensor_type)
|
|
|
+static int get_sensor2(char* buf,char *tok,uint32_t *sensor_type)
|
|
|
{
|
|
|
char *p=strstr(buf, tok);
|
|
|
if(!p) {
|
|
|
return -1;
|
|
|
}
|
|
|
p += strlen(tok);
|
|
|
- memcpy(sensor_type, p, 1);
|
|
|
+ //memcpy(sensor_type, p, 1);
|
|
|
+ *sensor_type = atoi(p);
|
|
|
//sensor_type[1] = 0;
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -335,7 +336,7 @@ static int power_export(char *path, char *start, char *end,uint32_t channel_id)
|
|
|
}
|
|
|
|
|
|
|
|
|
-static int sensor_export(char *path, char *start, char *end,char type)
|
|
|
+static int sensor_export(char *path, char *start, char *end,uint32_t type)
|
|
|
{
|
|
|
int r;
|
|
|
time_t from,to;
|
|
|
@@ -346,9 +347,9 @@ static int sensor_export(char *path, char *start, char *end,char type)
|
|
|
get_time_str2(tmp1,sizeof(tmp1),from);
|
|
|
get_time_str2(tmp2,sizeof(tmp2),to);
|
|
|
sprintf(path, "/tmp/sensor_%s_%s.csv", tmp1, tmp2);
|
|
|
- int sensor_type = atoi(&type);
|
|
|
+ //int sensor_type = atoi(&type);
|
|
|
|
|
|
- return dev_sensor_info_xport(from, to, path,sensor_type);
|
|
|
+ return dev_sensor_info_xport(from, to, path,type);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -526,11 +527,13 @@ static int file_io(void *conn, int ftype, int io, char *buf)
|
|
|
case FILE_SENSOR_INFO:
|
|
|
{
|
|
|
char start[100],end[100];
|
|
|
- char sensor_type;
|
|
|
+ uint32_t sensor_type;
|
|
|
if(io==FILE_EXPORT) {
|
|
|
gettime2(buf, "startTime=", start);
|
|
|
gettime2(buf, "endTime=", end);
|
|
|
get_sensor2(buf,"sensorType=",&sensor_type);
|
|
|
+
|
|
|
+ //printf("sensor_type=%d\n",(uint32_t)sensor_type);
|
|
|
r = sensor_export(path, start, end,sensor_type);
|
|
|
if(r==0) {
|
|
|
download_file(conn, path);
|