mirror of
https://gitlab.com/manzerbredes/ina260-zmq-publisher.git
synced 2025-04-06 03:46:25 +02:00
Minor changes
This commit is contained in:
parent
af1b88d8fc
commit
1770c5f79e
4 changed files with 23 additions and 7 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,3 +1,7 @@
|
|||
# Binary
|
||||
/client
|
||||
/publisher
|
||||
/publisher
|
||||
/logger
|
||||
|
||||
# Logs
|
||||
/logs
|
6
Makefile
6
Makefile
|
@ -22,8 +22,8 @@ logger:
|
|||
|
||||
|
||||
clean:
|
||||
$(MAKE) clean -C src/publisher/
|
||||
$(MAKE) clean -C src/client/
|
||||
$(MAKE) clean -C src/logger/
|
||||
$(MAKE) clean -C src/publisher/ OUT=$(PWD)
|
||||
$(MAKE) clean -C src/client/ OUT=$(PWD)
|
||||
$(MAKE) clean -C src/logger/ OUT=$(PWD)
|
||||
|
||||
.PHONY: clean publisher client logger
|
||||
|
|
BIN
logger
BIN
logger
Binary file not shown.
|
@ -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
Reference in a new issue