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
3ed96f9c9a
commit
087253ca04
4 changed files with 7 additions and 5 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -5,4 +5,5 @@
|
||||||
|
|
||||||
# Caches
|
# Caches
|
||||||
/logs
|
/logs
|
||||||
/data
|
/data
|
||||||
|
/pid
|
5
Makefile
5
Makefile
|
@ -15,8 +15,9 @@ logger: src/logger.c src/utils.c
|
||||||
$(CC) $^ -o $@
|
$(CC) $^ -o $@
|
||||||
|
|
||||||
publish: publisher logger
|
publish: publisher logger
|
||||||
./logger $(LOGGERS_DIR) 587 $(LOG_INTERVAL) &
|
rm -f pid
|
||||||
./publisher $(LOGGERS_DIR) $(LOG_INTERVAL) $(SUBSCRIBER_ADDR) $(ZMQ_PORT) $(KEY) &
|
./logger $(LOGGERS_DIR) 587 $(LOG_INTERVAL) &> $(LOGGERS_DIR)/587.log & echo $$! >> pid
|
||||||
|
./publisher $(LOGGERS_DIR) $(LOG_INTERVAL) $(SUBSCRIBER_ADDR) $(ZMQ_PORT) $(KEY)
|
||||||
|
|
||||||
subscribe: subscriber
|
subscribe: subscriber
|
||||||
./subscriber $(ZMQ_PORT) $(SUBSCRIBER_DIR)
|
./subscriber $(ZMQ_PORT) $(SUBSCRIBER_DIR)
|
||||||
|
|
|
@ -70,7 +70,7 @@ int main (int argc, char *argv [])
|
||||||
fprintf(logptr,"%ld,%d\n",TIMESTAMP(),power);
|
fprintf(logptr,"%ld,%d\n",TIMESTAMP(),power);
|
||||||
fseek(regptr,0,SEEK_SET);
|
fseek(regptr,0,SEEK_SET);
|
||||||
sleep(1);
|
sleep(1);
|
||||||
printf("Tick\n");
|
printf("Tick\n"); fflush(stdout);
|
||||||
}
|
}
|
||||||
fclose(logptr);
|
fclose(logptr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ int main (int argc, char *argv [])
|
||||||
// Send current one
|
// Send current one
|
||||||
if(FILE_EXISTS(logfile)){
|
if(FILE_EXISTS(logfile)){
|
||||||
publish(publisher,logfile,client,interval);
|
publish(publisher,logfile,client,interval);
|
||||||
//remove(logfile);
|
remove(logfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue