summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/publisher.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/publisher.c b/src/publisher.c
index 1df2f88..db93e63 100644
--- a/src/publisher.c
+++ b/src/publisher.c
@@ -19,6 +19,9 @@
unsigned char __stop = 0;
unsigned char __stop_zmq_thread = 0;
+/// @brief Path of the break file (if found, publisher will stop publishing)
+char __break_file[STATIC_LEN];
+
/**
* @brief Stop process properly on SIGINT
*
@@ -33,6 +36,10 @@ void sighandler(int signo) {
void *publisher(void *zmq_publisher);
+void askforbreak(){
+
+}
+
typedef struct queue {
int size;
char issending;
@@ -62,6 +69,12 @@ int main(int argc, char *argv[]) {
strcat(regpower, "/");
strcat(regpower, INA260_POWER_OUTPUT);
+ // __break_file
+ strcat(__break_file, "/publisher_");
+ strcat(__break_file, key);
+ strcat(__break_file, "_break");
+ printf("%s\n",__break_file);
+
//----- Sanity checks
signal(SIGINT, sighandler);
if (loginterval < MIN_INTERVAL) {
@@ -175,4 +188,4 @@ void *publisher(void *zmq_publisher) {
queue_id = 0;
}
pthread_exit(EXIT_SUCCESS);
-} \ No newline at end of file
+}