summaryrefslogtreecommitdiff
path: root/src/logger
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-07-15 08:38:33 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2023-07-15 08:38:33 +0200
commitf89a58860e4e3c76ef3c2e85d47ff38eeaaabb55 (patch)
treeed5af12adc1654f8a480a1669d6d8b5bde8703e4 /src/logger
parentc84520472c10a5085dc9004ed3b7c8019d01c4f9 (diff)
Minor changes
Diffstat (limited to 'src/logger')
-rw-r--r--src/logger/Makefile13
-rw-r--r--src/logger/main.c55
2 files changed, 0 insertions, 68 deletions
diff --git a/src/logger/Makefile b/src/logger/Makefile
deleted file mode 100644
index fc04b6d..0000000
--- a/src/logger/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-include $(CONF)
-EXEC=logger
-
-DEFINES=\
--DLOGGER_DIR=$(LOGGER_DIR)
-
-all: main.c
- $(CC) $^ -o $(OUT)/$(EXEC) $(CFLAGS) $(DEFINES)
-
-clean:
- rm -f $(OUT)/$(EXEC)
-
-.PHONY: clean
diff --git a/src/logger/main.c b/src/logger/main.c
deleted file mode 100644
index 04781dc..0000000
--- a/src/logger/main.c
+++ /dev/null
@@ -1,55 +0,0 @@
-// Weather update client
-// Connects SUB socket to tcp://localhost:5556
-// Collects weather updates and finds avg temp in zipcode
-#include <zmq.h>
-#include <assert.h>
-#include <time.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libgen.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include "../utils.h"
-#include <time.h>
-
-void start(char *power_path, char *busid, char *chipaddr);
-
-int main (int argc, char *argv [])
-{
- if(argc != 2){
- printf("Usage: %s <sysfs-path>",argv[0]);
- exit(1);
- }
-
- // Extract bus id and ina260 chip address
- char busid[10];
- char chipaddr[10];
- char *base=basename(argv[1]);
- sscanf(base,"%[^-]-%[^-]",busid,chipaddr);
-
- start("/home/loic/out.txt", busid,chipaddr);
-
- return 0;
-}
-
-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];
- time_t timestamp;
- timestamp = time(NULL);
- sprintf(outfile,"%s/%d",outdir,timestamp);
- printf("aa %s\n",outfile);
-
- FILE *f;
- f=fopen(outfile, "w");
- fclose(f);
-
-} \ No newline at end of file