diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-07-17 18:22:36 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-07-17 18:22:36 +0200 |
| commit | 76f13c34f390e7dbbadb2051cda316f0060bdbff (patch) | |
| tree | 3de5c0342318d513de72f41d051b305838bf2976 /src | |
| parent | 8f78b632bf246c6f420735229bad0340f99bb25e (diff) | |
Minor changes
Diffstat (limited to 'src')
| -rw-r--r-- | src/logger.c | 5 | ||||
| -rw-r--r-- | src/subscriber.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/logger.c b/src/logger.c index 852898e..4258090 100644 --- a/src/logger.c +++ b/src/logger.c @@ -117,7 +117,7 @@ int main (int argc, char *argv []) char line[STATIC_LEN]; sprintf(line,"%ld,%ld,%d\n",power_ts.tv_sec,power_ts.tv_nsec,atoi(buffer)); int linelen=strlen(line); - if(queues[queue_id].size+linelen>ZMQ_MSG_SIZE){ + if((queues[queue_id].size+linelen)>ZMQ_MSG_SIZE){ printf("To many measurements to publish. Please increase ZMQ_MSG_SIZE\n"); } else { memcpy(queues[queue_id].msg+queues[queue_id].size,line,linelen); @@ -128,7 +128,7 @@ int main (int argc, char *argv []) #if LOGGERS_DELAY > 0 usleep(LOGGERS_DELAY*1000); #endif - printf("Tick\n"); fflush(stdout); + //printf("Tick\n"); fflush(stdout); } publish(queue_id,publisher); } @@ -144,4 +144,5 @@ int main (int argc, char *argv []) void publish(int queue_id, void* publisher){ printf("Publishing...\n"); zmq_send(publisher,queues[queue_id].msg,queues[queue_id].size,0); + printf("Done\n"); }
\ No newline at end of file diff --git a/src/subscriber.c b/src/subscriber.c index 1024041..eb9a700 100644 --- a/src/subscriber.c +++ b/src/subscriber.c @@ -79,7 +79,7 @@ int main (int argc, char *argv []) // Write all the measurements: if(line>4){ fwrite(token, strlen(token), 1, fptr); - printf("%s\n",token); + //printf("%s\n",token); fwrite("\n",1,1,fptr); } |
