mirror of
https://gitlab.com/manzerbredes/ina260-zmq-publisher.git
synced 2025-07-01 10:37:40 +00:00
Minor changes
This commit is contained in:
parent
a37251135e
commit
b80973cbd0
5 changed files with 15 additions and 8 deletions
|
@ -60,7 +60,7 @@ int main (int argc, char *argv [])
|
|||
int power;
|
||||
time_t interval;
|
||||
|
||||
for(int i=0;i<1;i++){
|
||||
while(1){
|
||||
interval=INTERVAL(__loginterval);
|
||||
*logfilepath='\0';
|
||||
sprintf(logfilepath,"%s/%ld",__logdir,interval);
|
||||
|
|
|
@ -40,11 +40,11 @@ int main (int argc, char *argv [])
|
|||
}
|
||||
|
||||
//----- Start publisher
|
||||
DIR *dr = opendir(__logdir);
|
||||
struct dirent *de; // Pointer for directory entry
|
||||
for(int i=0;i<=0;i++){
|
||||
while(1){
|
||||
int interval=INTERVAL(__loginterval);
|
||||
int interval_next=INTERVAL_NEXT(__loginterval);
|
||||
DIR *dr = opendir(__logdir);
|
||||
while ((de = readdir(dr)) != NULL){
|
||||
if(strcmp(de->d_name,".") && strcmp(de->d_name,"..")){
|
||||
char *client=de->d_name;
|
||||
|
@ -61,12 +61,12 @@ int main (int argc, char *argv [])
|
|||
// Send current one
|
||||
if(FILE_EXISTS(logfile)){
|
||||
publish(logfile,client,interval);
|
||||
remove(logfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir(dr);
|
||||
}
|
||||
closedir(dr);
|
||||
|
||||
|
||||
zmq_close (publisher);
|
||||
zmq_ctx_destroy (context);
|
||||
|
@ -89,5 +89,5 @@ int main (int argc, char *argv [])
|
|||
}
|
||||
|
||||
void publish(char *filepath, char* client, int interval){
|
||||
|
||||
printf("Publish!\n");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue