Changeset 153 for tools


Ignore:
Timestamp:
01/27/10 15:30:56 (15 years ago)
Author:
daqct3
Message:
Added configuration request for measurement period
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/ListenToArduino/ListenToArduino.cc

    r150 r153  
    3535       
    3636
    37         FILE * openOutfile(char *path);
    38         static int poll_stdin_time(int microsekunden) ;
     37        FILE * openOutfile(char *);
     38        static int poll_stdin_time(int);
    3939
    4040        volatile int STOP=FALSE;
     
    196196        fclose(outfile);
    197197       
    198         if (poll_stdin_time(1500000)==1) {
     198        if (poll_stdin_time(atoi(Srv.GetConfig("Period", "10")))==1) {
    199199                STOP=TRUE;
    200200        }
     
    267267}
    268268
    269 static int poll_stdin_time(int microsekunden) {
     269static int poll_stdin_time(int sekunden) {
    270270        struct timeval timeout;
    271271        fd_set read_fds;
     
    275275        FD_ZERO(&read_fds);
    276276        FD_SET(STDIN_FILENO, &read_fds);
    277         timeout.tv_sec = 0;
    278         timeout.tv_usec =microsekunden;
     277        timeout.tv_sec = sekunden;
     278        timeout.tv_usec = 0;
    279279        stdin_status = select(STDIN_FILENO+1, &read_fds, NULL, NULL, &timeout);
    280280        if (stdin_status == 1 ) {
Note: See TracChangeset for help on using the changeset viewer.