mirror of
https://gitlab.com/manzerbredes/ina260-zmq-publisher.git
synced 2025-07-01 10:37:40 +00:00
Minor changes
This commit is contained in:
parent
af1b88d8fc
commit
1770c5f79e
4 changed files with 23 additions and 7 deletions
|
@ -11,7 +11,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include "../utils.h"
|
||||
|
||||
void start(char *power_path);
|
||||
void start(char *power_path, char *busid, char *chipaddr);
|
||||
|
||||
int main (int argc, char *argv [])
|
||||
{
|
||||
|
@ -26,15 +26,27 @@ int main (int argc, char *argv [])
|
|||
char *base=basename(argv[1]);
|
||||
sscanf(base,"%[^-]-%[^-]",busid,chipaddr);
|
||||
|
||||
start("/home/loic/out.txt");
|
||||
start("/home/loic/out.txt", busid,chipaddr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void start(char *power_path){
|
||||
void start(char *power_path, char *busid, char *chipaddr){
|
||||
if (access(power_path, F_OK) != 0){
|
||||
printf("Could not read %s\n",power_path);
|
||||
exit(2);
|
||||
}
|
||||
char outdir[255];
|
||||
mkdir(STRINGIFY(LOGGER_DIR),0755);
|
||||
sprintf(outdir,"%s/%s-%s/",STRINGIFY(LOGGER_DIR), busid,chipaddr);
|
||||
mkdir(outdir,0755);
|
||||
|
||||
char outfile[255];
|
||||
sprintf(outfile,"%s/%s",outdir,"flk");
|
||||
printf("aa %s\n",outfile);
|
||||
|
||||
FILE *f;
|
||||
f=fopen(outfile, "w");
|
||||
fclose(f);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue