mirror of
https://gitlab.com/manzerbredes/ina260-zmq-publisher.git
synced 2025-04-07 04:16:26 +02:00
Minor changes
This commit is contained in:
parent
05bfba95c7
commit
be6cfef7d2
1 changed files with 13 additions and 1 deletions
14
src/logger.c
14
src/logger.c
|
@ -47,7 +47,7 @@ int main (int argc, char *argv [])
|
||||||
printf("Log interval is too small (min=%ds)\n",MIN_INTERVAL);
|
printf("Log interval is too small (min=%ds)\n",MIN_INTERVAL);
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
if(!FILE_EXISTS(__regpower)){
|
if(FILE_EXISTS(__regpower)){
|
||||||
printf("Logger cannot access to %s\n",__regpower);
|
printf("Logger cannot access to %s\n",__regpower);
|
||||||
exit(3);
|
exit(3);
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,18 @@ int main (int argc, char *argv [])
|
||||||
//----- Start logging
|
//----- Start logging
|
||||||
printf("Logger started [client=%s,interval=%ds]\n",__client,__loginterval);
|
printf("Logger started [client=%s,interval=%ds]\n",__client,__loginterval);
|
||||||
|
|
||||||
|
FILE *regptr,*logptr;
|
||||||
|
char logfilepath[255]="";
|
||||||
|
regptr=fopen("/home/loic/out.txt","r");
|
||||||
|
|
||||||
|
*logfilepath='\0';
|
||||||
|
sprintf(logfilepath,"%s/%ld",__logdir,INTERVAL(TIMESTAMP(),__loginterval));
|
||||||
|
logptr=fopen(logfilepath,"w");
|
||||||
|
fprintf(logptr,"timestamp,power\n");
|
||||||
|
fclose(logptr);
|
||||||
|
|
||||||
|
fclose(regptr);
|
||||||
|
|
||||||
// Extract bus id and ina260 chip address
|
// Extract bus id and ina260 chip address
|
||||||
/*char busid[10];
|
/*char busid[10];
|
||||||
char chipaddr[10];
|
char chipaddr[10];
|
||||||
|
|
Loading…
Add table
Reference in a new issue