Project

General

Profile

Statistics
| Revision:

root / branches / simulator / projects / libwireless / logger / main.c @ 880

History | View | Annotate | Download (584 Bytes)

1
#include "stdlib.h"
2
#include "stdio.h"
3

    
4
#include <time.h>
5
#include <string.h>
6

    
7
#include "../lib/wireless.h"
8
#include "wl_token_logger.h"
9

    
10
int main(int argc, char** argv)
11
{
12
        int seconds = 600000;
13
        if (argc >= 2 && !strcmp(argv[1], "-t"))
14
                seconds = atoi(argv[2]);
15

    
16
        wl_set_com_port("/dev/ttyUSB0");
17
        wl_init();
18
        //wl_set_channel(0xF);
19
        wl_token_logger_register(seconds);
20
        printf("Started.\n");
21
        
22
        struct timespec delay;
23
        delay.tv_sec = 0;
24
        delay.tv_nsec = 50000000;
25
        while (1)
26
        {
27
                //wl_error_send_string("s");
28
                wl_do();
29
                nanosleep(&delay, 0);
30
        }
31
        
32
        wl_terminate();
33
        
34
        return 0;
35
}
36